ttp-agent-sdk 2.34.9 → 2.34.10

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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see agent-widget.js.LICENSE.txt */
2
- !function(e,A){"object"==typeof exports&&"object"==typeof module?module.exports=A():"function"==typeof define&&define.amd?define([],A):"object"==typeof exports?exports.TTPAgentSDK=A():e.TTPAgentSDK=A()}(window,()=>(()=>{var e={354:function(e){e.exports=function(){"use strict";var e=function(A,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,A){e.__proto__=A}||function(e,A){for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t])},e(A,t)};function A(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=A}e(A,t),A.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var t=function(){return t=Object.assign||function(e){for(var A,t=1,n=arguments.length;t<n;t++)for(var o in A=arguments[t])Object.prototype.hasOwnProperty.call(A,o)&&(e[o]=A[o]);return e},t.apply(this,arguments)};function n(e,A,t,n){return new(t||(t=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 A;e.done?o(e.value):(A=e.value,A instanceof t?A:new t(function(e){e(A)})).then(i,a)}s((n=n.apply(e,A||[])).next())})}function o(e,A){var t,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(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=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=A.call(e,i)}catch(e){r=[6,e],n=0}finally{t=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(e,A,t){if(t||2===arguments.length)for(var n,o=0,r=A.length;o<r;o++)!n&&o in A||(n||(n=Array.prototype.slice.call(A,0,o)),n[o]=A[o]);return e.concat(n||A)}for(var i=function(){function e(e,A,t,n){this.left=e,this.top=A,this.width=t,this.height=n}return e.prototype.add=function(A,t,n,o){return new e(this.left+A,this.top+t,this.width+n,this.height+o)},e.fromClientRect=function(A,t){return new e(t.left+A.windowBounds.left,t.top+A.windowBounds.top,t.width,t.height)},e.fromDOMRectList=function(A,t){var n=Array.from(t).find(function(e){return 0!==e.width});return n?new e(n.left+A.windowBounds.left,n.top+A.windowBounds.top,n.width,n.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,A){return i.fromClientRect(e,A.getBoundingClientRect())},s=function(e){for(var A=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var r=e.charCodeAt(t++);56320==(64512&r)?A.push(((1023&o)<<10)+(1023&r)+65536):(A.push(o),t--)}else A.push(o)}return A},c=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return"";for(var n=[],o=-1,r="";++o<t;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||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+/",g="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h=0;h<64;h++)g[p.charCodeAt(h)]=h;for(var f=function(e,A,t){return e.slice?e.slice(A,t):new Uint16Array(Array.prototype.slice.call(e,A,t))},m=function(){function e(e,A,t,n,o,r){this.initialValue=e,this.errorValue=A,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e<this.highStart)return A=2080+(e>>11),A=this.index[A],A+=e>>5&63,A=((A=this.index[A])<<2)+(31&e),this.data[A];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,L=34,M=35,R=37,_=38,V=39,j=40,N=42,G=[9001,65288],W="×",z="÷",X=function(e){var A,t,n,o=function(e){var A,t,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(A=0;A<a;A+=4)t=g[e.charCodeAt(A)],n=g[e.charCodeAt(A+1)],o=g[e.charCodeAt(A+2)],r=g[e.charCodeAt(A+3)],l[s++]=t<<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 A=e.length,t=[],n=0;n<A;n+=4)t.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return t}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var A=e.length,t=[],n=0;n<A;n+=2)t.push(e[n+1]<<8|e[n]);return t}(o):new Uint16Array(o),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(A=r,t=Math.ceil((24+r[4])/4),A.slice?A.slice(t,n):new Uint32Array(Array.prototype.slice.call(A,t,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,L,M],Ae=[C,b],te=function(e,A,t,n){var o=n[t];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var r=t;r<=n.length;){if((s=n[++r])===A)return!0;if(s!==y)break}if(o===y)for(r=t;r>0;){var i=n[--r];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var a=t;a<=n.length;){var s;if((s=n[++a])===A)return!0;if(s!==y)break}if(i!==y)break}return!1},ne=function(e,A){for(var t=e;t>=0;){var n=A[t];if(n!==y)return n;t--}return 0},oe=function(e,A,t,n,o){if(0===t[n])return W;var r=n-1;if(Array.isArray(o)&&!0===o[r])return W;var i=r-1,a=r+1,s=A[r],c=i>=0?A[i]:0,l=A[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,A))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,A)===k)return W;if(te(23,k,r,A))return W;if(te([x,Q],S,r,A))return W;if(te(12,12,r,A))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!==Ae.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)&&A[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=A[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=A[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(_===s&&-1!==[_,V,L,M].indexOf(l)||-1!==[V,L].indexOf(s)&&-1!==[V,j].indexOf(l)||-1!==[j,M].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=t[r],g=1;p>0&&41===A[--p];)g++;if(g%2!=0)return W}return s===O&&l===K?W:z},re=function(e,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var t=function(e,A){void 0===A&&(A="strict");var t=[],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(A)&&-1!==[8208,8211,12316,12448].indexOf(e))return n.push(r),t.push(16);if(4===i||11===i){if(0===r)return n.push(r),t.push(P);var a=t[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),t.push(a)):(n.push(r),t.push(P))}return n.push(r),31===i?t.push("strict"===A?S:R):i===N||29===i?t.push(P):43===i?e>=131072&&e<=196605||e>=196608&&e<=262141?t.push(R):t.push(P):void t.push(i)}),[n,t,o]}(e,A.lineBreak),n=t[0],o=t[1],r=t[2];"break-all"!==A.wordBreak&&"break-word"!==A.wordBreak||(o=o.map(function(e){return-1!==[I,P,N].indexOf(e)?R:e}));var i="keep-all"===A.wordBreak?r.map(function(A,t){return A&&e[t]>=19968&&e[t]<=40959}):void 0;return[n,o,i]},ie=function(){function e(e,A,t,n){this.codePoints=e,this.required="!"===A,this.start=t,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},ge=function(e){return pe(e)||le(e)||e===ae},he=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},fe=function(e,A){return 92===e&&10!==A},me=function(e,A,t){return e===ae?pe(A)||fe(A,t):!!pe(e)||!(92!==e||!fe(e,A))},ve=function(e,A,t){return e===se||e===ae?!!le(A)||46===A&&le(t):le(46===e?A:e)},Be=function(e){var A=0,t=1;e[A]!==se&&e[A]!==ae||(e[A]===ae&&(t=-1),A++);for(var n=[];le(e[A]);)n.push(e[A++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===e[A]&&A++;for(var r=[];le(e[A]);)r.push(e[A++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==e[A]&&101!==e[A]||A++;var s=1;e[A]!==se&&e[A]!==ae||(e[A]===ae&&(s=-1),A++);for(var l=[];le(e[A]);)l.push(e[A++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return t*(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},Le={type:29},Me={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=[],A=this.consumeToken();A!==Re;)e.push(A),A=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var A=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(ge(A)||fe(t,n)){var o=me(A,t,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 Le;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),g=this.peekCodePoint(1);return p!==se||!ue(g)&&63!==g||(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(),Me):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=[],A=this.consumeCodePoint();ue(A)&&e.length<6;)e.push(A),A=this.consumeCodePoint();for(var t=!1;63===A&&e.length<6;)e.push(A),A=this.consumeCodePoint(),t=!0;if(t)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(),A=this.consumeCodePoint();for(var o=[];ue(A)&&o.length<6;)o.push(A),A=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 A=this.peekCodePoint(0);if(39===A||34===A){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===ce||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.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||he(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 A="";e>0;){var t=Math.min(5e4,e);A+=c.apply(void 0,this._value.splice(0,t)),e-=t}return this._value.shift(),A},e.prototype.consumeStringToken=function(e){for(var A="",t=0;;){var n=this._value[t];if(n===ce||void 0===n||n===e)return{type:0,value:A+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),Te;if(92===n){var o=this._value[t+1];o!==ce&&void 0!==o&&(10===o?(A+=this.consumeStringSlice(t),t=-1,this._value.shift()):fe(n,o)&&(A+=this.consumeStringSlice(t),A+=c(this.consumeEscapedCodePoint()),t=-1))}t++}},e.prototype.consumeNumber=function(){var e=[],A=4,t=this.peekCodePoint(0);for(t!==se&&t!==ae||e.push(this.consumeCodePoint());le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&le(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===t||101===t)&&((n===se||n===ae)&&le(o)||le(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Be(e),A]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),A=e[0],t=e[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);return me(n,o,r)?{type:15,number:A,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:A,flags:t}):{type:17,number:A,flags:t}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(ue(e)){for(var A=c(e);ue(this.peekCodePoint(0))&&A.length<6;)A+=c(this.consumeCodePoint());de(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(A,16);return 0===t||function(e){return e>=55296&&e<=57343}(t)||t>1114111?65533:t}return e===ce?65533:e},e.prototype.consumeName=function(){for(var e="";;){var A=this.consumeCodePoint();if(ge(A))e+=c(A);else{if(!fe(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),Ve=function(){function e(e){this._tokens=e}return e.create=function(A){var t=new _e;return t.write(A),new e(t.read())},e.parseValue=function(A){return e.create(A).parseComponentValue()},e.parseValues=function(A){return e.create(A).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 A=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return A;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var A=this.consumeComponentValue();if(32===A.type)return e;e.push(A),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 A={type:e,values:[]},t=this.consumeToken();;){if(32===t.type||qe(t,e))return A;this.reconsumeToken(t),A.values.push(this.consumeComponentValue()),t=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var A={name:e.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return A;this.reconsumeToken(t),A.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,A){return Ge(e)&&e.value===A},Xe=function(e){return 31!==e.type},Je=function(e){return 31!==e.type&&4!==e.type},Ye=function(e){var A=[],t=[];return e.forEach(function(e){if(4===e.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return A.push(t),void(t=[])}31!==e.type&&t.push(e)}),t.length&&A.push(t),A},qe=function(e,A){return 11===A&&12===e.type||28===A&&29===e.type||2===A&&3===e.type},Ze=function(e){return 17===e.type||15===e.type},$e=function(e){return 16===e.type||Ze(e)},eA=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},AA={type:17,number:0,flags:4},tA={type:16,number:50,flags:4},nA={type:16,number:100,flags:4},oA=function(e,A,t){var n=e[0],o=e[1];return[rA(n,A),rA(void 0!==o?o:n,t)]},rA=function(e,A){if(16===e.type)return e.number/100*A;if(je(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},iA="grad",aA="turn",sA=function(e,A){if(15===A.type)switch(A.unit){case"deg":return Math.PI*A.number/180;case iA:return Math.PI/200*A.number;case"rad":return A.number;case aA:return 2*Math.PI*A.number}throw new Error("Unsupported angle type")},cA=function(e){return 15===e.type&&("deg"===e.unit||e.unit===iA||"rad"===e.unit||e.unit===aA)},lA=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[AA,AA];case"to top":case"bottom":return uA(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[AA,nA];case"to right":case"left":return uA(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[nA,nA];case"to bottom":case"top":return uA(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[nA,AA];case"to left":case"right":return uA(270)}return 0},uA=function(e){return Math.PI*e/180},dA=function(e,A){if(18===A.type){var t=wA[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return t(e,A.values)}if(5===A.type){if(3===A.value.length){var n=A.value.substring(0,1),o=A.value.substring(1,2),r=A.value.substring(2,3);return hA(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===A.value.length){n=A.value.substring(0,1),o=A.value.substring(1,2),r=A.value.substring(2,3);var i=A.value.substring(3,4);return hA(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===A.value.length)return n=A.value.substring(0,2),o=A.value.substring(2,4),r=A.value.substring(4,6),hA(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===A.value.length)return n=A.value.substring(0,2),o=A.value.substring(2,4),r=A.value.substring(4,6),i=A.value.substring(6,8),hA(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===A.type){var a=bA[A.value.toUpperCase()];if(void 0!==a)return a}return bA.TRANSPARENT},pA=function(e){return!(255&e)},gA=function(e){var A=255&e,t=255&e>>8,n=255&e>>16,o=255&e>>24;return A<255?"rgba("+o+","+n+","+t+","+A/255+")":"rgb("+o+","+n+","+t+")"},hA=function(e,A,t,n){return(e<<24|A<<16|t<<8|Math.round(255*n))>>>0},fA=function(e,A){if(17===e.type)return e.number;if(16===e.type){var t=3===A?1:255;return 3===A?e.number/100*t:Math.round(e.number/100*t)}return 0},mA=function(e,A){var t=A.filter(Je);if(3===t.length){var n=t.map(fA),o=n[0],r=n[1],i=n[2];return hA(o,r,i,1)}if(4===t.length){var a=t.map(fA),s=(o=a[0],r=a[1],i=a[2],a[3]);return hA(o,r,i,s)}return 0};function vA(e,A,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(A-e)*t*6+e:t<.5?A:t<2/3?6*(A-e)*(2/3-t)+e:e}var BA=function(e,A){var t=A.filter(Je),n=t[0],o=t[1],r=t[2],i=t[3],a=(17===n.type?uA(n.number):sA(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)?rA(i,1):1;if(0===s)return hA(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,p=vA(d,u,a+1/3),g=vA(d,u,a),h=vA(d,u,a-1/3);return hA(255*p,255*g,255*h,l)},wA={hsl:BA,hsla:BA,rgb:mA,rgba:mA},yA=function(e,A){return dA(e,Ve.create(A).parseComponentValue())},bA={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},CA={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xA={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},QA=function(e,A){var t=dA(e,A[0]),n=A[1];return n&&$e(n)?{color:t,stop:n}:{color:t,stop:null}},FA=function(e,A){var t=e[0],n=e[e.length-1];null===t.stop&&(t.stop=AA),null===n.stop&&(n.stop=nA);for(var o=[],r=0,i=0;i<e.length;i++){var a=e[i].stop;if(null!==a){var s=rA(a,A);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,t){return{color:e.color,stop:Math.max(Math.min(1,o[t]/A),0)}})},UA=function(e,A,t){var n="number"==typeof e?e:function(e,A,t){var n=A/2,o=t/2,r=rA(e[0],A)-n,i=o-rA(e[1],t);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(e,A,t),o=Math.abs(A*Math.sin(n))+Math.abs(t*Math.cos(n)),r=A/2,i=t/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]},SA=function(e,A){return Math.sqrt(e*e+A*A)},kA=function(e,A,t,n,o){return[[0,0],[0,A],[e,0],[e,A]].reduce(function(e,A){var r=A[0],i=A[1],a=SA(t-r,n-i);return(o?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:A,optimumDistance:a}:e},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},EA=function(e,A){var t=uA(180),n=[];return Ye(A).forEach(function(A,o){if(0===o){var r=A[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=lA(A));if(cA(r))return void(t=(sA(e,r)+uA(270))%uA(360))}var i=QA(e,A);n.push(i)}),{angle:t,stops:n,type:1}},IA="closest-side",TA="farthest-side",HA="closest-corner",DA="farthest-corner",PA="circle",OA="ellipse",KA="cover",LA="contain",MA=function(e,A){var t=0,n=3,o=[],r=[];return Ye(A).forEach(function(A,i){var a=!0;if(0===i?a=A.reduce(function(e,A){if(Ge(A))switch(A.value){case"center":return r.push(tA),!1;case"top":case"left":return r.push(AA),!1;case"right":case"bottom":return r.push(nA),!1}else if($e(A)||Ze(A))return r.push(A),!1;return e},a):1===i&&(a=A.reduce(function(e,A){if(Ge(A))switch(A.value){case PA:return t=0,!1;case OA:return t=1,!1;case LA:case IA:return n=0,!1;case TA:return n=1,!1;case HA:return n=2,!1;case KA:case DA:return n=3,!1}else if(Ze(A)||$e(A))return Array.isArray(n)||(n=[]),n.push(A),!1;return e},a)),a){var s=QA(e,A);o.push(s)}}),{size:n,shape:t,stops:o,position:r,type:2}},RA=function(e,A){if(22===A.type){var t={url:A.value,type:0};return e.cache.addImage(A.value),t}if(18===A.type){var n=VA[A.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return n(e,A.values)}throw new Error("Unsupported image type "+A.type)};var _A,VA={"linear-gradient":function(e,A){var t=uA(180),n=[];return Ye(A).forEach(function(A,o){if(0===o){var r=A[0];if(20===r.type&&"to"===r.value)return void(t=lA(A));if(cA(r))return void(t=sA(e,r))}var i=QA(e,A);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":EA,"-ms-linear-gradient":EA,"-o-linear-gradient":EA,"-webkit-linear-gradient":EA,"radial-gradient":function(e,A){var t=0,n=3,o=[],r=[];return Ye(A).forEach(function(A,i){var a=!0;if(0===i){var s=!1;a=A.reduce(function(e,A){if(s)if(Ge(A))switch(A.value){case"center":return r.push(tA),e;case"top":case"left":return r.push(AA),e;case"right":case"bottom":return r.push(nA),e}else($e(A)||Ze(A))&&r.push(A);else if(Ge(A))switch(A.value){case PA:return t=0,!1;case OA:return t=1,!1;case"at":return s=!0,!1;case IA:return n=0,!1;case KA:case TA:return n=1,!1;case LA:case HA:return n=2,!1;case DA:return n=3,!1}else if(Ze(A)||$e(A))return Array.isArray(n)||(n=[]),n.push(A),!1;return e},a)}if(a){var c=QA(e,A);o.push(c)}}),{size:n,shape:t,stops:o,position:r,type:2}},"-moz-radial-gradient":MA,"-ms-radial-gradient":MA,"-o-radial-gradient":MA,"-webkit-radial-gradient":MA,"-webkit-gradient":function(e,A){var t=uA(180),n=[],o=1;return Ye(A).forEach(function(A,t){var r=A[0];if(0===t){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=dA(e,r.values[0]);n.push({stop:AA,color:i})}else if("to"===r.name)i=dA(e,r.values[0]),n.push({stop:nA,color:i});else if("color-stop"===r.name){var a=r.values.filter(Je);if(2===a.length){i=dA(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:(t+uA(180))%uA(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},jA={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A.filter(function(e){return Je(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!VA[e.name])}(e)}).map(function(A){return RA(e,A)})}},NA={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},GA={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,A){return Ye(A).map(function(e){return e.filter($e)}).map(eA)}},WA={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,A){return Ye(A).map(function(e){return e.filter(Ge).map(function(e){return e.value}).join(" ")}).map(zA)}},zA=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"}(_A||(_A={}));var XA,JA={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,A){return Ye(A).map(function(e){return e.filter(YA)})}},YA=function(e){return Ge(e)||$e(e)},qA=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ZA=qA("top"),$A=qA("right"),et=qA("bottom"),At=qA("left"),tt=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,A){return eA(A.filter($e))}}},nt=tt("top-left"),ot=tt("top-right"),rt=tt("bottom-right"),it=tt("bottom-left"),at=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,A){switch(A){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},st=at("top"),ct=at("right"),lt=at("bottom"),ut=at("left"),dt=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,A){return je(A)?A.number:0}}},pt=dt("top"),gt=dt("right"),ht=dt("bottom"),ft=dt("left"),mt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},vt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,A){return"rtl"===A?1:0}},Bt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,A){return A.filter(Ge).reduce(function(e,A){return e|wt(A.value)},0)}},wt=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},yt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},bt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,A){return 20===A.type&&"normal"===A.value?0:17===A.type||15===A.type?A.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(XA||(XA={}));var Ct,xt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"strict"===A?XA.STRICT:XA.NORMAL}},Qt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ft=function(e,A){return Ge(e)&&"normal"===e.value?1.2*A:17===e.type?A*e.number:$e(e)?rA(e,A):A},Ut={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,A){return 20===A.type&&"none"===A.value?null:RA(e,A)}},St={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,A){return"inside"===A?0:1}},kt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){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}}},Et=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},It=Et("top"),Tt=Et("right"),Ht=Et("bottom"),Dt=Et("left"),Pt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,A){return A.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}})}},Ot={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"break-word"===A?"break-word":"normal"}},Kt=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Lt=Kt("top"),Mt=Kt("right"),Rt=Kt("bottom"),_t=Kt("left"),Vt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,A){switch(A){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},jt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Nt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return 1===A.length&&ze(A[0],"none")?[]:Ye(A).map(function(A){for(var t={color:bA.TRANSPARENT,offsetX:AA,offsetY:AA,blur:AA},n=0,o=0;o<A.length;o++){var r=A[o];Ze(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=dA(e,r)}return t})}},Gt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Wt={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,A){if(20===A.type&&"none"===A.value)return null;if(18===A.type){var t=zt[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return t(A.values)}return null}},zt={matrix:function(e){var A=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===A.length?A:null},matrix3d:function(e){var A=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),t=A[0],n=A[1];A[2],A[3];var o=A[4],r=A[5];A[6],A[7],A[8],A[9],A[10],A[11];var i=A[12],a=A[13];return A[14],A[15],16===A.length?[t,n,o,r,i,a]:null}},Xt={type:16,number:50,flags:4},Jt=[Xt,Xt],Yt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,A){var t=A.filter($e);return 2!==t.length?Jt:[t[0],t[1]]}},qt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){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"}(Ct||(Ct={}));for(var Zt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"break-all":return Ct.BREAK_ALL;case"keep-all":return Ct.KEEP_ALL;default:return Ct.NORMAL}}},$t={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,A){if(20===A.type)return{auto:!0,order:0};if(Ne(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},en={name:"time",parse:function(e,A){if(15===A.type)switch(A.unit.toLowerCase()){case"s":return 1e3*A.number;case"ms":return A.number}throw new Error("Unsupported time type")}},An={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,A){return Ne(A)?A.number:1}},tn={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,A){return A.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,A){var t=[],n=[];return A.forEach(function(e){switch(e.type){case 20:case 0:t.push(e.value);break;case 17:t.push(e.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}}),t.length&&n.push(t.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,A){return Ne(A)?A.number:Ge(A)&&"bold"===A.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.filter(Ge).map(function(e){return e.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(e,A){return 0!==(e&A)},un={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A}},dn={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(0===A.length)return null;var t=A[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],o=A.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,A){if(0===A.length)return[];for(var t=[],n=A.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;t.push({counter:r.value,reset:a})}}return t}},gn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,A){return A.filter(je).map(function(A){return en.parse(e,A)})}},hn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(0===A.length)return null;var t=A[0];if(20===t.type&&"none"===t.value)return null;var n=[],o=A.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,A,t){if(!e)return"";var n=e[Math.min(A,e.length-1)];return n?t?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return 1===A.length&&ze(A[0],"none")?[]:Ye(A).map(function(A){for(var t={color:255,offsetX:AA,offsetY:AA,blur:AA,spread:AA,inset:!1},n=0,o=0;o<A.length;o++){var r=A[o];ze(r,"inset")?t.inset=!0:Ze(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=dA(e,r)}return t})}},vn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,A){var t=[];return A.filter(Ge).forEach(function(e){switch(e.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}}),[0,1,2].forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}},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,A){return je(A)?A.number:0}},yn=function(){function e(e,A){var t,n;this.animationDuration=xn(e,gn,A.animationDuration),this.backgroundClip=xn(e,CA,A.backgroundClip),this.backgroundColor=xn(e,xA,A.backgroundColor),this.backgroundImage=xn(e,jA,A.backgroundImage),this.backgroundOrigin=xn(e,NA,A.backgroundOrigin),this.backgroundPosition=xn(e,GA,A.backgroundPosition),this.backgroundRepeat=xn(e,WA,A.backgroundRepeat),this.backgroundSize=xn(e,JA,A.backgroundSize),this.borderTopColor=xn(e,ZA,A.borderTopColor),this.borderRightColor=xn(e,$A,A.borderRightColor),this.borderBottomColor=xn(e,et,A.borderBottomColor),this.borderLeftColor=xn(e,At,A.borderLeftColor),this.borderTopLeftRadius=xn(e,nt,A.borderTopLeftRadius),this.borderTopRightRadius=xn(e,ot,A.borderTopRightRadius),this.borderBottomRightRadius=xn(e,rt,A.borderBottomRightRadius),this.borderBottomLeftRadius=xn(e,it,A.borderBottomLeftRadius),this.borderTopStyle=xn(e,st,A.borderTopStyle),this.borderRightStyle=xn(e,ct,A.borderRightStyle),this.borderBottomStyle=xn(e,lt,A.borderBottomStyle),this.borderLeftStyle=xn(e,ut,A.borderLeftStyle),this.borderTopWidth=xn(e,pt,A.borderTopWidth),this.borderRightWidth=xn(e,gt,A.borderRightWidth),this.borderBottomWidth=xn(e,ht,A.borderBottomWidth),this.borderLeftWidth=xn(e,ft,A.borderLeftWidth),this.boxShadow=xn(e,mn,A.boxShadow),this.color=xn(e,mt,A.color),this.direction=xn(e,vt,A.direction),this.display=xn(e,Bt,A.display),this.float=xn(e,yt,A.cssFloat),this.fontFamily=xn(e,on,A.fontFamily),this.fontSize=xn(e,rn,A.fontSize),this.fontStyle=xn(e,cn,A.fontStyle),this.fontVariant=xn(e,sn,A.fontVariant),this.fontWeight=xn(e,an,A.fontWeight),this.letterSpacing=xn(e,bt,A.letterSpacing),this.lineBreak=xn(e,xt,A.lineBreak),this.lineHeight=xn(e,Qt,A.lineHeight),this.listStyleImage=xn(e,Ut,A.listStyleImage),this.listStylePosition=xn(e,St,A.listStylePosition),this.listStyleType=xn(e,kt,A.listStyleType),this.marginTop=xn(e,It,A.marginTop),this.marginRight=xn(e,Tt,A.marginRight),this.marginBottom=xn(e,Ht,A.marginBottom),this.marginLeft=xn(e,Dt,A.marginLeft),this.opacity=xn(e,An,A.opacity);var o=xn(e,Pt,A.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=xn(e,Ot,A.overflowWrap),this.paddingTop=xn(e,Lt,A.paddingTop),this.paddingRight=xn(e,Mt,A.paddingRight),this.paddingBottom=xn(e,Rt,A.paddingBottom),this.paddingLeft=xn(e,_t,A.paddingLeft),this.paintOrder=xn(e,vn,A.paintOrder),this.position=xn(e,jt,A.position),this.textAlign=xn(e,Vt,A.textAlign),this.textDecorationColor=xn(e,tn,null!==(t=A.textDecorationColor)&&void 0!==t?t:A.color),this.textDecorationLine=xn(e,nn,null!==(n=A.textDecorationLine)&&void 0!==n?n:A.textDecoration),this.textShadow=xn(e,Nt,A.textShadow),this.textTransform=xn(e,Gt,A.textTransform),this.transform=xn(e,Wt,A.transform),this.transformOrigin=xn(e,Yt,A.transformOrigin),this.visibility=xn(e,qt,A.visibility),this.webkitTextStrokeColor=xn(e,Bn,A.webkitTextStrokeColor),this.webkitTextStrokeWidth=xn(e,wn,A.webkitTextStrokeWidth),this.wordBreak=xn(e,Zt,A.wordBreak),this.zIndex=xn(e,$t,A.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return pA(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,A){this.content=xn(e,un,A.content),this.quotes=xn(e,hn,A.quotes)},Cn=function(e,A){this.counterIncrement=xn(e,dn,A.counterIncrement),this.counterReset=xn(e,pn,A.counterReset)},xn=function(e,A,t){var n=new _e,o=null!=t?t.toString():A.initialValue;n.write(o);var r=new Ve(n.read());switch(A.type){case 2:var i=r.parseComponentValue();return A.parse(e,Ge(i)?i.value:A.initialValue);case 0:return A.parse(e,r.parseComponentValue());case 1:return A.parse(e,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(A.format){case"angle":return sA(e,r.parseComponentValue());case"color":return dA(e,r.parseComponentValue());case"image":return RA(e,r.parseComponentValue());case"length":var a=r.parseComponentValue();return Ze(a)?a:AA;case"length-percentage":var s=r.parseComponentValue();return $e(s)?s:AA;case"time":return en.parse(e,r.parseComponentValue())}}},Qn=function(e,A){var t=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===t||A===t},Fn=function(e,A){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Qn(A,3),this.styles=new yn(e,window.getComputedStyle(A,null)),Io(A)&&(this.styles.animationDuration.some(function(e){return e>0})&&(A.style.animationDuration="0s"),null!==this.styles.transform&&(A.style.transform="none")),this.bounds=a(this.context,A),Qn(A,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,A,t){return e.slice?e.slice(A,t):new Uint16Array(Array.prototype.slice.call(e,A,t))},In=function(){function e(e,A,t,n,o,r){this.initialValue=e,this.errorValue=A,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e<this.highStart)return A=2080+(e>>11),A=this.index[A],A+=e>>5&63,A=((A=this.index[A])<<2)+(31&e),this.data[A];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,Ln=11,Mn=12,Rn=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return"";for(var n=[],o=-1,r="";++o<t;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},_n=function(e){var A,t,n,o=function(e){var A,t,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(A=0;A<a;A+=4)t=Sn[e.charCodeAt(A)],n=Sn[e.charCodeAt(A+1)],o=Sn[e.charCodeAt(A+2)],r=Sn[e.charCodeAt(A+3)],l[s++]=t<<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 A=e.length,t=[],n=0;n<A;n+=4)t.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return t}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var A=e.length,t=[],n=0;n<A;n+=2)t.push(e[n+1]<<8|e[n]);return t}(o):new Uint16Array(o),a=En(i,12,r[4]/2),s=2===r[5]?En(i,(24+r[4])/2):(A=r,t=Math.ceil((24+r[4])/4),A.slice?A.slice(t,n):new Uint32Array(Array.prototype.slice.call(A,t,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,A,t){var n=t-2,o=A[n],r=A[t-1],i=A[t];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,Ln,Mn].indexOf(i))return Vn;if(!(r!==Ln&&r!==Kn||i!==Kn&&10!==i))return Vn;if((r===Mn||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=A[--n];if(14===o)return Vn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=A[--n];if(a%2==0)return Vn}return"÷"},Gn=function(e){var A=function(e){for(var A=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var r=e.charCodeAt(t++);56320==(64512&r)?A.push(((1023&o)<<10)+(1023&r)+65536):(A.push(o),t--)}else A.push(o)}return A}(e),t=A.length,n=0,o=0,r=A.map(jn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var e=Vn;n<t&&(e=Nn(0,r,++n))===Vn;);if(e!==Vn||n===t){var i=Rn.apply(null,A.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,A,t,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",A.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",t.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(A,t){var n=new Image;n.onload=function(){return A(n)},n.onerror=t,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 A=e.createRange();if(A.getBoundingClientRect){var t=e.createElement("boundtest");t.style.height="123px",t.style.display="block",e.body.appendChild(t),A.selectNode(t);var n=A.getBoundingClientRect(),o=Math.round(n.height);if(e.body.removeChild(t),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 A=e.createElement("boundtest");A.style.width="50px",A.style.display="block",A.style.fontSize="12px",A.style.letterSpacing="0px",A.style.wordSpacing="0px",e.body.appendChild(A);var t=e.createRange();A.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var n=A.firstChild,o=s(n.data).map(function(e){return c(e)}),r=0,i={},a=o.every(function(e,A){t.setStart(n,r),t.setEnd(n,r+e.length);var o=t.getBoundingClientRect();r+=e.length;var a=o.x>i.x||o.y>i.y;return i=o,0===A||a});return e.body.removeChild(A),a}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var A=new Image,t=e.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;A.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(A,0,0),t.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 A=e.createElement("canvas"),t=100;A.width=t,A.height=t;var n=A.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var o=new Image,r=A.toDataURL();o.src=r;var i=zn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Xn(i).then(function(A){n.drawImage(A,0,0);var o=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var i=e.createElement("div");return i.style.backgroundImage="url("+r+")",i.style.height=t+"px",Wn(o)?Xn(zn(t,t,0,0,i)):Promise.reject(!1)}).then(function(e){return n.drawImage(e,0,0),Wn(n.getImageData(0,0,t,t).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,A){this.text=e,this.bounds=A},qn=function(e,A){var t=A.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(A.cloneNode(!0));var o=A.parentNode;if(o){o.replaceChild(n,A);var r=a(e,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},Zn=function(e,A,t){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(e,A),o.setEnd(e,A+t),o},$n=function(e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(A.segment(e)).map(function(e){return e.segment})}return function(e){for(var A,t=Gn(e),n=[];!(A=t.next()).done;)A.value&&n.push(A.value.slice());return n}(e)},eo=function(e,A){return 0!==A.letterSpacing?$n(e):function(e,A){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return to(e,A)}(e,A)},Ao=[32,160,4961,65792,65793,4153,4241],to=function(e,A){for(var t,n=function(e,A){var t=s(e),n=re(t,A),o=n[0],r=n[1],i=n[2],a=t.length,c=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var e=W;l<a&&(e=oe(t,r,o,++l,i))===W;);if(e!==W||l===a){var A=new ie(t,e,c,l);return c=l,{value:A,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:A.lineBreak,wordBreak:"break-word"===A.overflowWrap?"break-word":A.wordBreak}),o=[],r=function(){if(t.value){var e=t.value.slice(),A=s(e),n="";A.forEach(function(e){-1===Ao.indexOf(e)?n+=c(e):(n.length&&o.push(n),o.push(c(e)),n="")}),n.length&&o.push(n)}};!(t=n.next()).done;)r();return o},no=function(e,A,t){this.text=oo(A.data,t.textTransform),this.textBounds=function(e,A,t,n){var o=eo(A,t),r=[],a=0;return o.forEach(function(A){if(t.textDecorationLine.length||A.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,a,A.length).getClientRects();if(o.length>1){var s=$n(A),c=0;s.forEach(function(A){r.push(new Yn(A,i.fromDOMRectList(e,Zn(n,c+a,A.length).getClientRects()))),c+=A.length})}else r.push(new Yn(A,i.fromDOMRectList(e,o)))}else{var l=n.splitText(A.length);r.push(new Yn(A,qn(e,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(A.length));a+=A.length}),r}(e,this.text,t,A)},oo=function(e,A){switch(A){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,A,t){return e.length>0?A+t.toUpperCase():e},ao=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return A(t,e),t}(Fn),so=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return A(t,e),t}(Fn),co=function(e){function t(A,t){var n=e.call(this,A,t)||this,o=new XMLSerializer,r=a(A,t);return t.setAttribute("width",r.width+"px"),t.setAttribute("height",r.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(o.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return A(t,e),t}(Fn),lo=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.value=t.value,n}return A(t,e),t}(Fn),uo=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return A(t,e),t}(Fn),po=[{type:15,flags:0,unit:"px",number:3}],go=[{type:16,flags:0,number:50}],ho="checkbox",fo="radio",mo="password",vo=707406591,Bo=function(e){function t(A,t){var n,o,r,a=e.call(this,A,t)||this;switch(a.type=t.type.toLowerCase(),a.checked=t.checked,a.value=0===(r=(o=t).type===mo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":r,a.type!==ho&&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 ho: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=go}return a}return A(t,e),t}(Fn),wo=function(e){function t(A,t){var n=e.call(this,A,t)||this,o=t.options[t.selectedIndex||0];return n.value=o&&o.text||"",n}return A(t,e),t}(Fn),yo=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.value=t.value,n}return A(t,e),t}(Fn),bo=function(e){function t(A,t){var n=e.call(this,A,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=Fo(A,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?yA(A,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):bA.TRANSPARENT,r=t.contentWindow.document.body?yA(A,getComputedStyle(t.contentWindow.document.body).backgroundColor):bA.TRANSPARENT;n.backgroundColor=pA(o)?pA(r)?n.styles.backgroundColor:r:o}}catch(e){}return n}return A(t,e),t}(Fn),Co=["OL","UL","MENU"],xo=function(e,A,t,n){for(var o=A.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,ko(o)&&o.data.trim().length>0)t.textNodes.push(new no(e,o,t.styles));else if(Eo(o))if(Go(o)&&o.assignedNodes)o.assignedNodes().forEach(function(A){return xo(e,A,t,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),t.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,A){return Ro(A)?new ao(e,A):Lo(A)?new so(e,A):Oo(A)?new co(e,A):Ho(A)?new lo(e,A):Do(A)?new uo(e,A):Po(A)?new Bo(e,A):No(A)?new wo(e,A):jo(A)?new yo(e,A):_o(A)?new bo(e,A):new Fn(e,A)},Fo=function(e,A){var t=Qo(e,A);return t.flags|=4,xo(e,A,t,t),t},Uo=function(e,A,t){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||Ko(e)&&t.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},Lo=function(e){return"CANVAS"===e.tagName},Mo=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 A=this.counters[e];return A&&A.length?A[A.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var A=this;e.forEach(function(e){return A.counters[e].pop()})},e.prototype.parse=function(e){var A=this,t=e.counterIncrement,n=e.counterReset,o=!0;null!==t&&t.forEach(function(e){var t=A.counters[e.counter];t&&0!==e.increment&&(o=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=e.increment)});var r=[];return o&&n.forEach(function(e){var t=A.counters[e.counter];r.push(e.counter),t||(t=A.counters[e.counter]=[]),t.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,A,t,n,o,r){return e<A||e>t?ar(e,o,r.length>0):n.integers.reduce(function(A,t,o){for(;e>=t;)e-=t,A+=n.values[o];return A},"")+r},$o=function(e,A,t,n){var o="";do{t||e--,o=n(e)+o,e/=A}while(e*A>=A);return o},er=function(e,A,t,n,o){var r=t-A+1;return(e<0?"-":"")+($o(Math.abs(e),r,n,function(e){return c(Math.floor(e%r)+A)})+o)},Ar=function(e,A,t){void 0===t&&(t=". ");var n=A.length;return $o(Math.abs(e),n,!1,function(e){return A[Math.floor(e%n)]})+t},tr=function(e,A,t,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 A[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=A[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=A[c]+(s>0?t[s-1]:"")+a:1===c&&s>0&&(a=t[s-1]+a),i=Math.floor(i/10)}return(e<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(e,A,t){var n=t?". ":"",o=t?"、":"",r=t?", ":"",i=t?" ":"";switch(A){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 Ar(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 Ar(e,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return Ar(e,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return tr(e,"零一二三四五六七八九",nr,"負",o,14);case 47:return tr(e,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return tr(e,"零一二三四五六七八九",nr,"负",o,14);case 41:return tr(e,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return tr(e,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return tr(e,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return tr(e,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return tr(e,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return tr(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 Ar(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ar(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return er(e,3302,3311,!0,n);case 28:return Ar(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return Ar(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,A,t){if(this.context=e,this.options=t,this.scrolledElements=[],this.referenceElement=A,this.counters=new zo,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,A){var t=this,r=ur(e,A);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=gr(r).then(function(){return n(t,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Br),s&&(s.scrollTo(A.left,A.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===A.top&&s.scrollX===A.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-A.left,s.scrollY-A.top,0,0))),e=this.options.onclone,void 0===(t=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,t)}).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),Lo(e))return this.createCanvasClone(e);if(Mo(e))return this.createVideoClone(e);if(Vo(e))return this.createStyleClone(e);var A=e.cloneNode(!1);return Ro(A)&&(Ro(e)&&e.currentSrc&&e.currentSrc!==e.src&&(A.src=e.currentSrc,A.srcset=""),"lazy"===A.loading&&(A.loading="eager")),Wo(A)?this.createCustomElementClone(A):A},e.prototype.createCustomElementClone=function(e){var A=document.createElement("html2canvascustomelement");return fr(e.style,A),A},e.prototype.createStyleClone=function(e){try{var A=e.sheet;if(A&&A.cssRules){var t=[].slice.call(A.cssRules,0).reduce(function(e,A){return A&&"string"==typeof A.cssText?e+A.cssText:e},""),n=e.cloneNode(!1);return n.textContent=t,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 A;if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(A){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!==(A=e.getContext("webgl2"))&&void 0!==A?A: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(A){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return n},e.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var t=A.getContext("2d");try{return t&&(t.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||t.getImageData(0,0,A.width,A.height)),A}catch(A){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,A,t){Eo(A)&&("SCRIPT"===A.tagName||A.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(A))||this.options.copyStyles&&Eo(A)&&Vo(A)||e.appendChild(this.cloneNode(A,t))},e.prototype.cloneChildNodes=function(e,A,t){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(A,e,t)})}else this.appendChildNode(A,o,t)},e.prototype.cloneNode=function(e,A){if(ko(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&Eo(e)&&(Io(e)||To(e))){var n=this.createElementClone(e);n.style.transitionProperty="none";var o=t.getComputedStyle(e),r=t.getComputedStyle(e,":before"),i=t.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)&&(A=!0),Mo(e)||this.cloneChildNodes(e,n,A),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)||A)&&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,A,t,n){var o=this;if(t){var r=t.content,i=A.ownerDocument;if(i&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==t.display){this.counters.parse(new Cn(this.context,t));var a=new bn(this.context,t),s=i.createElement("html2canvaspseudoelement");fr(t,s),a.content.forEach(function(A){if(0===A.type)s.appendChild(i.createTextNode(A.value));else if(22===A.type){var t=i.createElement("img");t.src=A.value,t.style.opacity="1",s.appendChild(t)}else if(18===A.type){if("attr"===A.name){var n=A.values.filter(Ge);n.length&&s.appendChild(i.createTextNode(e.getAttribute(n[0].value)||""))}else if("counter"===A.name){var r=A.values.filter(Je),c=r[0],l=r[1];if(c&&Ge(c)){var u=o.counters.getCounterValue(c.value),d=l&&Ge(l)?kt.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===A.name){var p=A.values.filter(Je),g=(c=p[0],p[1]);if(l=p[2],c&&Ge(c)){var h=o.counters.getCounterValues(c.value),f=l&&Ge(l)?kt.parse(o.context,l.value):3,m=g&&0===g.type?g.value:"",v=h.map(function(e){return ar(e,f,!1)}).join(m);s.appendChild(i.createTextNode(v))}}}else if(20===A.type)switch(A.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(A.value))}}),s.className=wr+" "+yr;var c=n===Pn.BEFORE?" "+wr:" "+yr;return To(A)?A.className.baseValue+=c:A.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,A){var t=e.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=A.width.toString(),t.height=A.height.toString(),t.scrolling="no",t.setAttribute(sr,"true"),e.body.appendChild(t),t},dr=function(e){return new Promise(function(A){e.complete?A():e.src?(e.onload=A,e.onerror=A):A()})},pr=function(e){return Promise.all([].slice.call(e.images,0).map(dr))},gr=function(e){return new Promise(function(A,t){var n=e.contentWindow;if(!n)return t("No window assigned for iframe");var o=n.document;n.onload=e.onload=function(){n.onload=e.onload=null;var t=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(t),A(e))},50)}})},hr=["all","d","content"],fr=function(e,A){for(var t=e.length-1;t>=0;t--){var n=e.item(t);-1===hr.indexOf(n)&&A.style.setProperty(n,e.getPropertyValue(n))}return A},mr=function(e){var A="";return e&&(A+="<!DOCTYPE ",e.name&&(A+=e.name),e.internalSubset&&(A+=e.internalSubset),e.publicId&&(A+='"'+e.publicId+'"'),e.systemId&&(A+='"'+e.systemId+'"'),A+=">"),A},vr=function(e,A,t){e&&e.defaultView&&(A!==e.defaultView.pageXOffset||t!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(A,t)},Br=function(e){var A=e[0],t=e[1],n=e[2];A.scrollLeft=t,A.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,A){var t=e.ownerDocument;if(t){var n=t.createElement("style");n.textContent=A,e.appendChild(n)}},Qr=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),Fr=function(){function e(e,A){this.context=e,this._options=A,this._cache={}}return e.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)?A:Hr(e)||Er(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),A):A},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return A=Qr.isSameOrigin(e),t=!Ir(e)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!A,n=!Ir(e)&&!A&&!Hr(e)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!t,A||!1!==this._options.allowTaint||Ir(e)||Hr(e)||n||t?(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,A){var n=new Image;n.onload=function(){return e(n)},n.onerror=A,(Tr(r)||t)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return e(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return A("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 A=this,t=this._options.proxy;if(!t)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=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+s+"url="+encodeURIComponent(e)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),A._options.imageTimeout){var c=A._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,A){this.type=0,this.x=e,this.y=A}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),Or=function(e,A,t){return new Pr(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},Kr=function(){function e(e,A,t,n){this.type=1,this.start=e,this.startControl=A,this.endControl=t,this.end=n}return e.prototype.subdivide=function(A,t){var n=Or(this.start,this.startControl,A),o=Or(this.startControl,this.endControl,A),r=Or(this.endControl,this.end,A),i=Or(n,o,A),a=Or(o,r,A),s=Or(i,a,A);return t?new e(this.start,n,i,s):new e(s,a,r,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Lr=function(e){return 1===e.type},Mr=function(e){var A=e.styles,t=e.bounds,n=oA(A.borderTopLeftRadius,t.width,t.height),o=n[0],r=n[1],i=oA(A.borderTopRightRadius,t.width,t.height),a=i[0],s=i[1],c=oA(A.borderBottomRightRadius,t.width,t.height),l=c[0],u=c[1],d=oA(A.borderBottomLeftRadius,t.width,t.height),p=d[0],g=d[1],h=[];h.push((o+a)/t.width),h.push((p+l)/t.width),h.push((r+g)/t.height),h.push((s+u)/t.height);var f=Math.max.apply(Math,h);f>1&&(o/=f,r/=f,a/=f,s/=f,l/=f,u/=f,p/=f,g/=f);var m=t.width-a,v=t.height-u,B=t.width-l,w=t.height-g,y=A.borderTopWidth,b=A.borderRightWidth,C=A.borderBottomWidth,x=A.borderLeftWidth,Q=rA(A.paddingTop,e.bounds.width),F=rA(A.paddingRight,e.bounds.width),U=rA(A.paddingBottom,e.bounds.width),S=rA(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Rr(t.left+x/3,t.top+y/3,o-x/3,r-y/3,lr.TOP_LEFT):new Pr(t.left+x/3,t.top+y/3),this.topRightBorderDoubleOuterBox=o>0||r>0?Rr(t.left+m,t.top+y/3,a-b/3,s-y/3,lr.TOP_RIGHT):new Pr(t.left+t.width-b/3,t.top+y/3),this.bottomRightBorderDoubleOuterBox=l>0||u>0?Rr(t.left+B,t.top+v,l-b/3,u-C/3,lr.BOTTOM_RIGHT):new Pr(t.left+t.width-b/3,t.top+t.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||g>0?Rr(t.left+x/3,t.top+w,p-x/3,g-C/3,lr.BOTTOM_LEFT):new Pr(t.left+x/3,t.top+t.height-C/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Rr(t.left+2*x/3,t.top+2*y/3,o-2*x/3,r-2*y/3,lr.TOP_LEFT):new Pr(t.left+2*x/3,t.top+2*y/3),this.topRightBorderDoubleInnerBox=o>0||r>0?Rr(t.left+m,t.top+2*y/3,a-2*b/3,s-2*y/3,lr.TOP_RIGHT):new Pr(t.left+t.width-2*b/3,t.top+2*y/3),this.bottomRightBorderDoubleInnerBox=l>0||u>0?Rr(t.left+B,t.top+v,l-2*b/3,u-2*C/3,lr.BOTTOM_RIGHT):new Pr(t.left+t.width-2*b/3,t.top+t.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=p>0||g>0?Rr(t.left+2*x/3,t.top+w,p-2*x/3,g-2*C/3,lr.BOTTOM_LEFT):new Pr(t.left+2*x/3,t.top+t.height-2*C/3),this.topLeftBorderStroke=o>0||r>0?Rr(t.left+x/2,t.top+y/2,o-x/2,r-y/2,lr.TOP_LEFT):new Pr(t.left+x/2,t.top+y/2),this.topRightBorderStroke=o>0||r>0?Rr(t.left+m,t.top+y/2,a-b/2,s-y/2,lr.TOP_RIGHT):new Pr(t.left+t.width-b/2,t.top+y/2),this.bottomRightBorderStroke=l>0||u>0?Rr(t.left+B,t.top+v,l-b/2,u-C/2,lr.BOTTOM_RIGHT):new Pr(t.left+t.width-b/2,t.top+t.height-C/2),this.bottomLeftBorderStroke=p>0||g>0?Rr(t.left+x/2,t.top+w,p-x/2,g-C/2,lr.BOTTOM_LEFT):new Pr(t.left+x/2,t.top+t.height-C/2),this.topLeftBorderBox=o>0||r>0?Rr(t.left,t.top,o,r,lr.TOP_LEFT):new Pr(t.left,t.top),this.topRightBorderBox=a>0||s>0?Rr(t.left+m,t.top,a,s,lr.TOP_RIGHT):new Pr(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||u>0?Rr(t.left+B,t.top+v,l,u,lr.BOTTOM_RIGHT):new Pr(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=p>0||g>0?Rr(t.left,t.top+w,p,g,lr.BOTTOM_LEFT):new Pr(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||r>0?Rr(t.left+x,t.top+y,Math.max(0,o-x),Math.max(0,r-y),lr.TOP_LEFT):new Pr(t.left+x,t.top+y),this.topRightPaddingBox=a>0||s>0?Rr(t.left+Math.min(m,t.width-b),t.top+y,m>t.width+b?0:Math.max(0,a-b),Math.max(0,s-y),lr.TOP_RIGHT):new Pr(t.left+t.width-b,t.top+y),this.bottomRightPaddingBox=l>0||u>0?Rr(t.left+Math.min(B,t.width-x),t.top+Math.min(v,t.height-C),Math.max(0,l-b),Math.max(0,u-C),lr.BOTTOM_RIGHT):new Pr(t.left+t.width-b,t.top+t.height-C),this.bottomLeftPaddingBox=p>0||g>0?Rr(t.left+x,t.top+Math.min(w,t.height-C),Math.max(0,p-x),Math.max(0,g-C),lr.BOTTOM_LEFT):new Pr(t.left+x,t.top+t.height-C),this.topLeftContentBox=o>0||r>0?Rr(t.left+x+S,t.top+y+Q,Math.max(0,o-(x+S)),Math.max(0,r-(y+Q)),lr.TOP_LEFT):new Pr(t.left+x+S,t.top+y+Q),this.topRightContentBox=a>0||s>0?Rr(t.left+Math.min(m,t.width+x+S),t.top+y+Q,m>t.width+x+S?0:a-x+S,s-(y+Q),lr.TOP_RIGHT):new Pr(t.left+t.width-(b+F),t.top+y+Q),this.bottomRightContentBox=l>0||u>0?Rr(t.left+Math.min(B,t.width-(x+S)),t.top+Math.min(v,t.height+y+Q),Math.max(0,l-(b+F)),u-(C+U),lr.BOTTOM_RIGHT):new Pr(t.left+t.width-(b+F),t.top+t.height-(C+U)),this.bottomLeftContentBox=p>0||g>0?Rr(t.left+x+S,t.top+w,Math.max(0,p-(x+S)),g-(C+U),lr.BOTTOM_LEFT):new Pr(t.left+x+S,t.top+t.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,A,t,n,o){var r=(Math.sqrt(2)-1)/3*4,i=t*r,a=n*r,s=e+t,c=A+n;switch(o){case lr.TOP_LEFT:return new Kr(new Pr(e,c),new Pr(e,c-a),new Pr(s-i,A),new Pr(s,A));case lr.TOP_RIGHT:return new Kr(new Pr(e,A),new Pr(e+i,A),new Pr(s,c-a),new Pr(s,c));case lr.BOTTOM_RIGHT:return new Kr(new Pr(s,A),new Pr(s,A+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,A+a),new Pr(e,A))}},_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,A,t){this.offsetX=e,this.offsetY=A,this.matrix=t,this.type=0,this.target=6},Nr=function(e,A){this.path=e,this.target=A,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,A){return e.length===A.length&&e.some(function(e,t){return e===A[t]})},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,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new Mr(this.container),this.container.styles.opacity<1&&this.effects.push(new Gr(this.container.styles.opacity)),null!==this.container.styles.transform){var t=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(t,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 A=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var o=t.effects.filter(function(e){return!Wr(e)});if(A||0!==t.container.styles.position||!t.parent){if(n.unshift.apply(n,o),A=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var r=_r(t.curves),i=Vr(t.curves);zr(r,i)||n.unshift(new Nr(i,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(A){return ln(A.target,e)})},e}(),Yr=function(e,A,t,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()?t:A,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,A){return u>e.element.container.styles.zIndex.order?(d=A,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var p=0;c.positiveZIndex.some(function(e,A){return u>=e.element.container.styles.zIndex.order?(p=A+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:t,s)}else o.styles.isInlineLevel()?A.inlineLevel.push(a):A.nonInlineLevel.push(a),Yr(a,A,t,s);ln(o.flags,8)&&qr(o,s)})},qr=function(e,A){for(var t=e instanceof uo?e.start:1,n=e instanceof uo&&e.reversed,o=0;o<A.length;o++){var r=A[o];r.container instanceof lo&&"number"==typeof r.container.value&&0!==r.container.value&&(t=r.container.value),r.listValue=ar(t,r.container.styles.listStyleType,!0),t+=n?-1:1}},Zr=function(e,A){switch(A){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,A){var t=[];return Lr(e)?t.push(e.subdivide(.5,!1)):t.push(e),Lr(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},ei=function(e,A,t,n){var o=[];return Lr(e)?o.push(e.subdivide(.5,!1)):o.push(e),Lr(t)?o.push(t.subdivide(.5,!0)):o.push(t),Lr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Lr(A)?o.push(A.subdivide(.5,!1).reverse()):o.push(A),o},Ai=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ti=function(e){var A=e.styles,t=e.bounds,n=rA(A.paddingLeft,t.width),o=rA(A.paddingRight,t.width),r=rA(A.paddingTop,t.width),i=rA(A.paddingBottom,t.width);return t.add(n+A.borderLeftWidth,r+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+n+o),-(A.borderTopWidth+A.borderBottomWidth+r+i))},ni=function(e,A,t){var n=function(e,A){return 0===e?A.bounds:2===e?ti(A):Ai(A)}(ai(e.styles.backgroundOrigin,A),e),o=function(e,A){return 0===e?A.bounds:2===e?ti(A):Ai(A)}(ai(e.styles.backgroundClip,A),e),r=ii(ai(e.styles.backgroundSize,A),t,n),i=r[0],a=r[1],s=oA(ai(e.styles.backgroundPosition,A),n.width-i,n.height-a);return[si(ai(e.styles.backgroundRepeat,A),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===_A.AUTO},ri=function(e){return"number"==typeof e},ii=function(e,A,t){var n=A[0],o=A[1],r=A[2],i=e[0],a=e[1];if(!i)return[0,0];if($e(i)&&a&&$e(a))return[rA(i,t.width),rA(a,t.height)];var s=ri(r);if(Ge(i)&&(i.value===_A.CONTAIN||i.value===_A.COVER))return ri(r)?t.width/t.height<r!=(i.value===_A.COVER)?[t.width,t.width/r]:[t.height*r,t.height]:[t.width,t.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:t.width,l?o:t.height]:[t.width,t.height];if(s){var d=0,p=0;return $e(i)?d=rA(i,t.width):$e(a)&&(p=rA(a,t.height)),oi(i)?d=p*r:a&&!oi(a)||(p=d/r),[d,p]}var g=null,h=null;if($e(i)?g=rA(i,t.width):a&&$e(a)&&(h=rA(a,t.height)),null===g||a&&!oi(a)||(h=c&&l?g/n*o:t.height),null!==h&&oi(i)&&(g=c&&l?h/o*n:t.width),null!==g&&null!==h)return[g,h];throw new Error("Unable to calculate background-size for element")},ai=function(e,A){var t=e[A];return void 0===t?e[0]:t},si=function(e,A,t,n,o){var r=A[0],i=A[1],a=t[0],s=t[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,A){var t=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),r=this._document.body;t.style.visibility="hidden",t.style.fontFamily=e,t.style.fontSize=A,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",r.appendChild(t),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=A,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(ci)),t.appendChild(o),t.appendChild(n);var i=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode(ci)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:i,middle:a}},e.prototype.getMetrics=function(e,A){var t=e+" "+A;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(e,A)),this._data[t]},e}(),ui=function(e,A){this.context=e,this.options=A},di=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new li(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return A(t,e),t.prototype.applyEffects=function(e){for(var A=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return A.applyEffect(e)})},t.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)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(e){return n(this,void 0,void 0,function(){return o(this,function(A){switch(A.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:A.sent(),A.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(e){return n(this,void 0,void 0,function(){return o(this,function(A){switch(A.label){case 0:return ln(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(e)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(e,A,t){var n=this;0===A?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+t):$n(e.text).reduce(function(A,o){return n.ctx.fillText(o,A,e.bounds.top+t),A+n.ctx.measureText(o).width},e.bounds.left)},t.prototype.createFontStyle=function(e){var A=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),t=mi(e.fontFamily).join(", "),n=je(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,A,e.fontWeight,n,t].join(" "),t,n]},t.prototype.renderTextNode=function(e,A){return n(this,void 0,void 0,function(){var t,n,r,i,a,s,c,l,u=this;return o(this,function(o){return t=this.createFontStyle(A),n=t[0],r=t[1],i=t[2],this.ctx.font=n,this.ctx.direction=1===A.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=A.paintOrder,e.textBounds.forEach(function(e){l.forEach(function(t){switch(t){case 0:u.ctx.fillStyle=gA(A.color),u.renderTextWithLetterSpacing(e,A.letterSpacing,s);var n=A.textShadow;n.length&&e.text.trim().length&&(n.slice(0).reverse().forEach(function(t){u.ctx.shadowColor=gA(t.color),u.ctx.shadowOffsetX=t.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=t.offsetY.number*u.options.scale,u.ctx.shadowBlur=t.blur.number,u.renderTextWithLetterSpacing(e,A.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),A.textDecorationLine.length&&(u.ctx.fillStyle=gA(A.textDecorationColor||A.color),A.textDecorationLine.forEach(function(A){switch(A){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:A.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=gA(A.webkitTextStrokeColor),u.ctx.lineWidth=A.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]})})},t.prototype.renderReplacedElement=function(e,A,t){if(t&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var n=ti(e),o=Vr(A);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,e.intrinsicWidth,e.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return n(this,void 0,void 0,function(){var A,n,r,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y;return o(this,function(o){switch(o.label){case 0:this.applyEffects(e.getEffects(4)),A=e.container,n=e.curves,r=A.styles,a=0,s=A.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(!(A instanceof ao))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(A.src)];case 6:return v=o.sent(),this.renderReplacedElement(A,n,v),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+A.src),[3,8];case 8:if(A instanceof so&&this.renderReplacedElement(A,n,A.canvas),!(A instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(A.svg)];case 10:return v=o.sent(),this.renderReplacedElement(A,n,v),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+A.svg.substring(0,255)),[3,12];case 12:return A instanceof bo&&A.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:A.backgroundColor,x:0,y:0,width:A.width,height:A.height}).render(A.tree)]:[3,14];case 13:l=o.sent(),A.width&&A.height&&this.ctx.drawImage(l,0,0,A.width,A.height,A.bounds.left,A.bounds.top,A.bounds.width,A.bounds.height),o.label=14;case 14:if(A instanceof Bo&&(u=Math.min(A.bounds.width,A.bounds.height),A.type===ho?A.checked&&(this.ctx.save(),this.path([new Pr(A.bounds.left+.39363*u,A.bounds.top+.79*u),new Pr(A.bounds.left+.16*u,A.bounds.top+.5549*u),new Pr(A.bounds.left+.27347*u,A.bounds.top+.44071*u),new Pr(A.bounds.left+.39694*u,A.bounds.top+.5649*u),new Pr(A.bounds.left+.72983*u,A.bounds.top+.23*u),new Pr(A.bounds.left+.84*u,A.bounds.top+.34085*u),new Pr(A.bounds.left+.39363*u,A.bounds.top+.79*u)]),this.ctx.fillStyle=gA(vo),this.ctx.fill(),this.ctx.restore()):A.type===fo&&A.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(A.bounds.left+u/2,A.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=gA(vo),this.ctx.fill(),this.ctx.restore())),pi(A)&&A.value.length){switch(d=this.createFontStyle(r),w=d[0],p=d[1],g=this.fontMetrics.getMetrics(w,p).baseline,this.ctx.font=w,this.ctx.fillStyle=gA(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hi(A.styles.textAlign),y=ti(A),h=0,A.styles.textAlign){case 1:h+=y.width/2;break;case 2:h+=y.width}f=y.add(h,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(A.value,f),r.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(A.styles.display,2048))return[3,20];if(null===A.styles.listStyleImage)return[3,19];if(0!==(m=A.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,A.bounds.left-(v.width+10),A.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!==A.styles.listStyleType&&(w=this.createFontStyle(r)[0],this.ctx.font=w,this.ctx.fillStyle=gA(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(A.bounds.left,A.bounds.top+rA(A.styles.paddingTop,A.bounds.width),A.bounds.width,Ft(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(e.listValue,y),r.letterSpacing,Ft(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),o.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i,a,s,c,l,u,d,p,g,h,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(),A=0,t=e.negativeZIndex,o.label=2;case 2:return A<t.length?(f=t[A],[4,this.renderStack(f)]):[3,5];case 3:o.sent(),o.label=4;case 4:return A++,[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:g=0,h=e.positiveZIndex,o.label=27;case 27:return g<h.length?(f=h[g],[4,this.renderStack(f)]):[3,30];case 28:o.sent(),o.label=29;case 29:return g++,[3,27];case 30:return[2]}})})},t.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()},t.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},t.prototype.formatPath=function(e){var A=this;e.forEach(function(e,t){var n=Lr(e)?e.start:e;0===t?A.ctx.moveTo(n.x,n.y):A.ctx.lineTo(n.x,n.y),Lr(e)&&A.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},t.prototype.renderRepeat=function(e,A,t,n){this.path(e),this.ctx.fillStyle=A,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},t.prototype.resizeImage=function(e,A,t){var n;if(e.width===A&&e.height===t)return e;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,A),o.height=Math.max(1,t),o.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,A,t),o},t.prototype.renderBackgroundImage=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i,a;return o(this,function(s){switch(s.label){case 0:A=e.styles.backgroundImage.length-1,t=function(t){var r,i,a,s,c,l,u,d,p,g,h,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!==t.type)return[3,5];r=void 0,i=t.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,A,[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===t.type?(s=ni(e,A,[null,null,null]),w=s[0],F=s[1],U=s[2],C=s[3],x=s[4],c=UA(t.angle,C,x),l=c[0],u=c[1],d=c[2],p=c[3],g=c[4],(h=document.createElement("canvas")).width=C,h.height=x,f=h.getContext("2d"),m=f.createLinearGradient(u,p,d,g),FA(t.stops,l).forEach(function(e){return m.addColorStop(e.stop,gA(e.color))}),f.fillStyle=m,f.fillRect(0,0,C,x),C>0&&x>0&&(v=n.ctx.createPattern(h,"repeat"),n.renderRepeat(w,v,F,U))):function(e){return 2===e.type}(t)&&(B=ni(e,A,[null,null,null]),w=B[0],y=B[1],b=B[2],C=B[3],x=B[4],Q=0===t.position.length?[tA]:t.position,F=rA(Q[0],C),U=rA(Q[Q.length-1],x),S=function(e,A,t,n,o){var r=0,i=0;switch(e.size){case 0:0===e.shape?r=i=Math.min(Math.abs(A),Math.abs(A-n),Math.abs(t),Math.abs(t-o)):1===e.shape&&(r=Math.min(Math.abs(A),Math.abs(A-n)),i=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===e.shape)r=i=Math.min(SA(A,t),SA(A,t-o),SA(A-n,t),SA(A-n,t-o));else if(1===e.shape){var a=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(A),Math.abs(A-n)),s=kA(n,o,A,t,!0),c=s[0],l=s[1];i=a*(r=SA(c-A,(l-t)/a))}break;case 1:0===e.shape?r=i=Math.max(Math.abs(A),Math.abs(A-n),Math.abs(t),Math.abs(t-o)):1===e.shape&&(r=Math.max(Math.abs(A),Math.abs(A-n)),i=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===e.shape)r=i=Math.max(SA(A,t),SA(A,t-o),SA(A-n,t),SA(A-n,t-o));else if(1===e.shape){a=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(A),Math.abs(A-n));var u=kA(n,o,A,t,!1);c=u[0],l=u[1],i=a*(r=SA(c-A,(l-t)/a))}}return Array.isArray(e.size)&&(r=rA(e.size[0],n),i=2===e.size.length?rA(e.size[1],o):r),[r,i]}(t,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),FA(t.stops,2*k).forEach(function(e){return I.addColorStop(e.stop,gA(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 A--,[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,t(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(e,A,t){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zr(t,A)),this.ctx.fillStyle=gA(e),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(e,A,t,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return A<3?[4,this.renderSolidBorder(e,t,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(e,A){switch(A){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,t),this.path(n),this.ctx.fillStyle=gA(e),this.ctx.fill(),i=function(e,A){switch(A){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,t),this.path(i),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i,a,s,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(e.getEffects(2)),A=e.container.styles,t=!pA(A.backgroundColor)||A.backgroundImage.length,n=[{style:A.borderTopStyle,color:A.borderTopColor,width:A.borderTopWidth},{style:A.borderRightStyle,color:A.borderRightColor,width:A.borderRightWidth},{style:A.borderBottomStyle,color:A.borderBottomColor,width:A.borderBottomWidth},{style:A.borderLeftStyle,color:A.borderLeftColor,width:A.borderLeftWidth}],r=gi(ai(A.backgroundClip,0),e.curves),t||A.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),pA(A.backgroundColor)||(this.ctx.fillStyle=gA(A.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),A.boxShadow.slice(0).reverse().forEach(function(A){l.ctx.save();var t,n,o,r,i,a=_r(e.curves),s=A.inset?0:1e4,c=(t=a,n=-s+(A.inset?1:-1)*A.spread.number,o=(A.inset?1:-1)*A.spread.number,r=A.spread.number*(A.inset?-2:2),i=A.spread.number*(A.inset?-2:2),t.map(function(e,A){switch(A){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}));A.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=A.offsetX.number+s,l.ctx.shadowOffsetY=A.offsetY.number,l.ctx.shadowColor=gA(A.color),l.ctx.shadowBlur=A.blur.number,l.ctx.fillStyle=A.inset?gA(A.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&&!pA(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]}})})},t.prototype.renderDashedDottedBorder=function(e,A,t,r,i){return n(this,void 0,void 0,function(){var n,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y;return o(this,function(o){return this.ctx.save(),n=function(e,A){switch(A){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,t),a=Zr(r,t),2===i&&(this.path(a),this.ctx.clip()),Lr(a[0])?(s=a[0].start.x,c=a[0].start.y):(s=a[0].x,c=a[0].y),Lr(a[1])?(l=a[1].end.x,u=a[1].end.y):(l=a[1].x,u=a[1].y),d=0===t||2===t?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),3===i?this.formatPath(n):this.formatPath(a.slice(0,2)),p=A<3?3*A:2*A,g=A<3?2*A:A,3===i&&(p=A,g=A),h=!0,d<=2*p?h=!1:d<=2*p+g?(p*=f=d/(2*p+g),g*=f):(m=Math.floor((d+g)/(p+g)),v=(d-m*p)/(m-1),g=(B=(d-(m+1)*p)/m)<=0||Math.abs(g-v)<Math.abs(g-B)?v:B),h&&(3===i?this.ctx.setLineDash([0,p+g]):this.ctx.setLineDash([p,g])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=A):this.ctx.lineWidth=2*A+1.1,this.ctx.strokeStyle=gA(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Lr(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()),Lr(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]})})},t.prototype.render=function(e){return n(this,void 0,void 0,function(){var A;return o(this,function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=gA(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),A=o,[4,this.renderStack(A)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},t}(ui),pi=function(e){return e instanceof yo||e instanceof wo||e instanceof Bo&&e.type!==fo&&e.type!==ho},gi=function(e,A){switch(e){case 0:return _r(A);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(A);default:return Vr(A)}},hi=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 t(A,t){var n=e.call(this,A,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return A(t,e),t.prototype.render=function(e){return n(this,void 0,void 0,function(){var A,t;return o(this,function(n){switch(n.label){case 0:return A=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Bi(A)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=gA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t}(ui),Bi=function(e){return new Promise(function(A,t){var n=new Image;n.onload=function(){A(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},wi=function(){function e(e){var A=e.id,t=e.enabled;this.id=A,this.enabled=t,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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(A,t){var n;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new wi({id:this.instanceName,enabled:A.logging}),this.cache=null!==(n=A.cache)&&void 0!==n?n:new Fr(this,A)}return e.instanceCount=1,e}();"undefined"!=typeof window&&Qr.setContext(window);var bi=function(e,A){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,L,M,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=A.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=A.imageTimeout)&&void 0!==S?S:15e3,proxy:A.proxy,useCORS:null!==(k=A.useCORS)&&void 0!==k&&k},c=t({logging:null===(E=A.logging)||void 0===E||E,cache:A.cache},s),l={windowWidth:null!==(I=A.windowWidth)&&void 0!==I?I:r.innerWidth,windowHeight:null!==(T=A.windowHeight)&&void 0!==T?T:r.innerHeight,scrollX:null!==(H=A.scrollX)&&void 0!==H?H:r.pageXOffset,scrollY:null!==(D=A.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=A.foreignObjectRendering)&&void 0!==P&&P,g={allowTaint:null!==(O=A.allowTaint)&&void 0!==O&&O,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:p,copyStyles:p},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),h=new cr(d,e,g),(f=h.clonedReferenceElement)?[4,h.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 A=e.body,t=e.documentElement;if(!A||!t)throw new Error("Unable to get document size");var n=Math.max(Math.max(A.scrollWidth,t.scrollWidth),Math.max(A.offsetWidth,t.offsetWidth),Math.max(A.clientWidth,t.clientWidth)),o=Math.max(Math.max(A.scrollHeight,t.scrollHeight),Math.max(A.offsetHeight,t.offsetHeight),Math.max(A.clientHeight,t.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,A.backgroundColor),x={canvas:A.canvas,backgroundColor:C,scale:null!==(L=null!==(K=A.scale)&&void 0!==K?K:r.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(M=A.x)&&void 0!==M?M:0)+y,y:(null!==(R=A.y)&&void 0!==R?R:0)+b,width:null!==(_=A.width)&&void 0!==_?_:Math.ceil(B),height:null!==(V=A.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=bA.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=A.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,A,t){var n=A.ownerDocument,o=n.documentElement?yA(e,getComputedStyle(n.documentElement).backgroundColor):bA.TRANSPARENT,r=n.body?yA(e,getComputedStyle(n.body).backgroundColor):bA.TRANSPARENT,i="string"==typeof t?yA(e,t):null===t?bA.TRANSPARENT:4294967295;return A===n.documentElement?pA(o)?pA(r)?i:r:o:i};return function(e,A){return void 0===A&&(A={}),bi(e,A)}}()},540:(e,A,t)=>{"use strict";e.exports=t(869)},698:(e,A)=>{"use strict";var t=Symbol.for("react.transitional.element");function n(e,A,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==A.key&&(o=""+A.key),"key"in A)for(var r in n={},A)"key"!==r&&(n[r]=A[r]);else n=A;return A=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==A?A:null,props:n}}Symbol.for("react.fragment"),A.jsx=n,A.jsxs=n},848:(e,A,t)=>{"use strict";e.exports=t(698)},869:(e,A)=>{"use strict";Symbol.for("react.transitional.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.consumer"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.activity"),Symbol.iterator;var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,o={};function r(e,A,n){this.props=e,this.context=A,this.refs=o,this.updater=n||t}function i(){}function a(e,A,n){this.props=e,this.context=A,this.refs=o,this.updater=n||t}r.prototype.isReactComponent={},r.prototype.setState=function(e,A){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,A,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},i.prototype=r.prototype;var s=a.prototype=new i;s.constructor=a,n(s,r.prototype),s.isPureReactComponent=!0;Array.isArray;var c={H:null,A:null,T:null,S:null};Object.prototype.hasOwnProperty;"function"==typeof reportError&&reportError;A.useEffect=function(e,A){return c.H.useEffect(e,A)},A.useRef=function(e){return c.H.useRef(e)},A.useState=function(e){return c.H.useState(e)}}},A={};function t(n){var o=A[n];if(void 0!==o)return o.exports;var r=A[n]={exports:{}};return e[n].call(r.exports,r,r.exports,t),r.exports}t.n=e=>{var A=e&&e.__esModule?()=>e.default:()=>e;return t.d(A,{a:A}),A},t.d=(e,A)=>{for(var n in A)t.o(A,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:A[n]})},t.o=(e,A)=>Object.prototype.hasOwnProperty.call(e,A),t.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";t.r(n),t.d(n,{AgentSDK:()=>Hn,AudioPlayer:()=>Zt,AudioRecorder:()=>q,EventEmitter:()=>O,MicPermissionModals:()=>A,MicPermissionUtils:()=>e,TTPChatWidget:()=>or,TextChatSDK:()=>mt,VERSION:()=>rr,VanillaVoiceButton:()=>yn,VoiceButton:()=>un,VoiceSDK_v2:()=>ot,WebSocketManager:()=>_t,default:()=>ir});var e={};t.r(e),t.d(e,{checkPermissionState:()=>Ln,getDeviceInfo:()=>Kn,getPermissionInstructions:()=>Rn,openSettings:()=>_n});var A={};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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=o(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(A)?A:A+""}t.r(A),t.d(A,{showBlockedModal:()=>Jn,showNoMicrophoneModal:()=>Yn,showPrePromptModal:()=>Xn});const a=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},A=[{key:"on",value:function(e,A){return this.events[e]||(this.events[e]=[]),this.events[e].push(A),this}},{key:"off",value:function(e,A){return this.events[e]?(this.events[e]=this.events[e].filter(function(e){return e!==A}),this):this}},{key:"emit",value:function(e){for(var A=arguments.length,t=new Array(A>1?A-1:0),n=1;n<A;n++)t[n-1]=arguments[n];return!!this.events[e]&&(this.events[e].forEach(function(e){e.apply(void 0,t)}),!0)}},{key:"once",value:function(e,A){var t=this,n=function(){A.apply(void 0,arguments),t.off(e,n)};return this.on(e,n)}},{key:"removeAllListeners",value:function(e){return e?delete this.events[e]:this.events={},this}}],A&&r(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=s(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(A)?A:A+""}const u=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCM"},(A=[{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,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g(n.key),n)}}function g(e){var A=function(e){if("object"!=d(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(A)?A:A+""}const h=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMU"},(A=[{key:"decode",value:function(e){for(var A=e instanceof Uint8Array?e:new Uint8Array(e),t=new Int16Array(A.length),n=0;n<A.length;n++)t[n]=this.mulawToLinear(A[n]);return t.buffer}},{key:"encode",value:function(e){for(var A=e instanceof Int16Array?e:new Int16Array(e),t=new Uint8Array(A.length),n=0;n<A.length;n++)t[n]=this.linearToMulaw(A[n]);return t}},{key:"mulawToLinear",value:function(e){var A=1<<3+(e>>4&7);return(128&e?-1:1)*(132+(15&e)*A+(A>>1)-4)}},{key:"linearToMulaw",value:function(e){var A=e>>8&128;A&&(e=-e),e>32635&&(e=32635),e+=132;for(var t=7,n=16384;0===(e&n)&&t>0;t--,n>>=1);return 255&~(A|t<<4|e>>t+3&15)}}])&&p(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=f(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=f(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(A)?A:A+""}const B=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMA"},(A=[{key:"decode",value:function(e){for(var A=e instanceof Uint8Array?e:new Uint8Array(e),t=new Int16Array(A.length),n=0;n<A.length;n++)t[n]=this.alawToLinear(A[n]);return t.buffer}},{key:"encode",value:function(e){for(var A=e instanceof Int16Array?e:new Int16Array(e),t=new Uint8Array(A.length),n=0;n<A.length;n++)t[n]=this.linearToAlaw(A[n]);return t}},{key:"alawToLinear",value:function(e){var A=(e^=85)>>4&7,t=15&e;return(128&e?-1:1)*(0===A?8+(t<<4):264+(t<<4)<<A-1)}},{key:"linearToAlaw",value:function(e){var A,t,n=e>>8&128;if(n&&(e=-e),e>32635&&(e=32635),e<256)A=0,t=e>>4;else{A=7;for(var o=16384;0===(e&o)&&A>0;A--,o>>=1);t=e>>A+3&15}return 85^(n|A<<4|t)}}])&&m(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function b(e){if(null!=e){var A=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(A)return A.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}}throw new TypeError(w(e)+" is not iterable")}function C(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return x(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(x(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}x=function(e,A,t,n){function r(A,t){x(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},x(e,A,t,n)}function Q(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function F(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=w(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=w(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(A)?A:A+""}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,A){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},I(e,A)}const T=function(e){function A(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),e=function(e,A,t){return A=E(A),function(e,A){if(A&&("object"==w(A)||"function"==typeof A))return A;if(void 0!==A)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(A,t||[],E(e).constructor):A.apply(e,t))}(this,A),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 (100ms) + 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=t,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 h,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,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&I(e,A)}(A,e),t=A,n=[{key:"setOutputFormat",value:function(e){var A;this.validateFormat(e)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",e),e=this.getDefaultFormat());var t=null===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate,n=e.sampleRate;this.outputFormat=e,console.log("✅ AudioPlayer v2: Format set:",e),this.audioContext&&t&&t!==n&&(console.warn("⚠️ AudioPlayer: Sample rate changed, recreating AudioContext"),console.warn(" Old: ".concat(t,"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 A,t;if(!e)return!1;var n=null===(A=e.container)||void 0===A?void 0:A.toLowerCase(),o=null===(t=e.encoding)||void 0===t?void 0:t.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 A=this;if(this._isStopped)console.log("🛑 AudioPlayer: Ignoring audio chunk - playback was stopped (barge-in)");else try{var t=this.createAudioBlob(e);this.audioQueue.push(t),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return A.processQueue()},50)}catch(e){console.error("❌ AudioPlayer v2: Playback error:",e),this.emit("playbackError",e)}}},{key:"playChunk",value:(l=F(C().m(function e(A){var t,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:(t=this.prepareChunk(A))?(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(t),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==A?void 0:A.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 A;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 t=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,t=n.buffer}for(var o=new Int16Array(t),r=new Float32Array(o.length),i=1/32768,a=o.length,s=0;s<a;s++)r[s]=o[s]*i;var c=(null===(A=this.outputFormat)||void 0===A?void 0:A.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,g=d;return l!==c&&(g=p/l),{buffer:u,duration:g,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 A,t,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,A=this.preparedBuffer.length,0===(t=Math.min(A,5))&&A>0&&(t=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 A,t,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(A=l.preparedBuffer.shift()){e.n=2;break}return e.a(2,0);case 2:(t=l.audioContext.createBufferSource()).buffer=A.buffer,t.connect(l.gainNode||l.audioContext.destination),l.scheduledSources.add(t),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()),t.start(l.nextStartTime),l.nextStartTime+=A.duration,l.nextStartTime=Math.round(1e6*l.nextStartTime)/1e6,s=l.nextStartTime-A.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(A.duration.toFixed(4),"s (").concat((1e3*A.duration).toFixed(2),"ms), Queued: ").concat(l.preparedBuffer.length,", Scheduled: ").concat(l.scheduledBuffers))),l.scheduledBuffers++,a++,t.onended=function(){if(!l._isStopped&&l.scheduledSources.has(t))if(l.scheduledSources.delete(t),!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<t)){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 A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,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===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate)||this.audioContext.sampleRate,d=this.audioContext.sampleRate,null!==(t=this.outputFormat)&&void 0!==t&&t.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),(g=this.audioContext.createBufferSource()).buffer=p,g.connect(this.gainNode||this.audioContext.destination),h=this.audioContext.currentTime,this.nextStartTime<h&&(this.nextStartTime=h,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",h)),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")))),g.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++,g.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 A=new Uint8Array(e);console.log("🎵 AudioPlayer: Processing ".concat(A.length," bytes")),console.log("🎵 AudioPlayer: Negotiated format:",this.outputFormat);var t=this.outputFormat&&this.outputFormat.container&&"wav"===this.outputFormat.container.toLowerCase(),n=this.outputFormat&&this.outputFormat.container&&"raw"===this.outputFormat.container.toLowerCase(),o=this.isWavFile(A);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(A);if(n&&!o)console.log("🎵 AudioPlayer: Processing as RAW data (as negotiated)");else{if(t&&o)return console.log("✅ AudioPlayer: Processing as WAV file (matches negotiation)"),this.handleWavFile(A);if(t&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(A);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(A);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(A)}},{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 A=this.parseWavHeader(e);if(console.log("🎵 WAV file detected:",{format:A.audioFormat,encoding:this.getEncodingName(A.audioFormat),sampleRate:A.sampleRate,channels:A.channels,bitDepth:A.bitsPerSample}),1===A.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([e],{type:"audio/wav"});var t=this.getCodecForWavFormat(A.audioFormat);if(!t)throw new Error("Unsupported WAV format code: ".concat(A.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=e.slice(44),o=t.decode(n),r=this.createWavHeader(o.byteLength,A.sampleRate,A.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(e){var A,t,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."),A=this.convert24BitTo16Bit(e),t=16):8===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),A=this.convert8BitTo16Bit(e),t=16):(A=e.buffer,t=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else A=o.decode(e),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(A.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([i,A],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(e){for(var A=Math.floor(e.length/3),t=new Int16Array(A),n=0;n<A;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),t[n]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return t.buffer}},{key:"convert8BitTo16Bit",value:function(e){for(var A=e.length,t=new Int16Array(A),n=0;n<A;n++){var o=e[n];t[n]=256*(o-128)}return t.buffer}},{key:"getCodec",value:function(e){var A={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[A]}},{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 A=new DataView(e.buffer,e.byteOffset,e.byteLength);return{audioFormat:A.getUint16(20,!0),channels:A.getUint16(22,!0),sampleRate:A.getUint32(24,!0),byteRate:A.getUint32(28,!0),blockAlign:A.getUint16(32,!0),bitsPerSample:A.getUint16(34,!0)}}},{key:"createWavHeader",value:function(e,A,t,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,t,!0),r.setUint32(24,A,!0),r.setUint32(28,A*t*n/8,!0),r.setUint16(32,t*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 A,t,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===(A=this.audioContext)||void 0===A?void 0:A.state,"currentTime:",null===(t=this.audioContext)||void 0===t?void 0:t.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 A=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),t=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(A),o._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void e();"running"===n.state&&(clearTimeout(A),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),e())};o._waitForReadyStateHandler=t,n.addEventListener("statechange",t),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(A),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,A,t=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||44100;if(48e3!==t&&44100!==t&&(console.log("ℹ️ AudioPlayer: Backend requested ".concat(t,"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-t)>100))return;console.warn("⚠️ AudioPlayer: AudioContext sample rate (".concat(n,"Hz) doesn't match format (").concat(t,"Hz), recreating...")),this.stopImmediate(),this._cleanupAudioContext()}console.log("🎵 AudioPlayer: Creating AudioContext at ".concat(t,"Hz (from outputFormat: ").concat((null===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate)||"not set",")"));try{this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t,latencyHint:"playback"}),console.log("✅ AudioContext created at ".concat(this.audioContext.sampleRate,"Hz (requested: ").concat(t,"Hz)")),Math.abs(this.audioContext.sampleRate-t)>100?(console.error("❌ CRITICAL: Browser sample rate mismatch!"),console.error(" Requested: ".concat(t,"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!==t&&(console.warn("⚠️ Browser adjusted sample rate: ".concat(t,"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 A,t,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 A=this.audioContext.sampleRate,t=this.audioContext.createBuffer(1,.1*A,A),(n=this.audioContext.createBufferSource()).buffer=t,n.connect(this.audioContext.destination),n.start(),e.n=2,new Promise(function(e){return setTimeout(e,100)});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 A,t,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,A=this.audioQueue.shift()){e.n=3;break}return this.isProcessingQueue=!1,e.a(2);case 3:return e.p=3,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),e.n=4,this.waitForAudioContextReady();case 4:return n=this.audioContext,e.n=5,A.arrayBuffer();case 5:return o=e.v,e.n=6,n.decodeAudioData(o);case 6:r=e.v,i=t&&!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 A=0,t=Array.from(this.scheduledSources),n=t.length;this.scheduledSources.clear(),this.scheduledBuffers=0;for(var o=0,r=t;o<r.length;o++){var i=r[o];try{i.stop(),A++}catch(e){console.log(" Source already stopped or not started:",e.message)}}console.log(" Stopped ".concat(A," 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 A=this,t=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(t,", isPlaying: ").concat(n,")")),this._emptySentenceTimeout&&clearTimeout(this._emptySentenceTimeout);var o=e;this._emptySentenceTimeout=setTimeout(function(){A.pendingSentenceText!==o||0!==A.scheduledBuffers||0!==A.preparedBuffer.length||0!==A.pcmChunkQueue.length||A._isStopped||(console.warn('⚠️ AudioPlayer: Empty sentence detected after 5s timeout - no chunks received for: "'.concat(o.substring(0,40),'..."')),A.pendingSentenceText===o&&(A.pendingSentenceText=null),A.isPlaying||0!==A.scheduledSources.size||(console.log("🛑 AudioPlayer: Emitting playbackStopped for empty sentence timeout"),A.emit("playbackStopped"))),A._emptySentenceTimeout=null},5e3)}},{key:"startTranscriptChecker",value:function(){var e=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var A=function(){if(e.isCheckingTranscripts&&e.audioContext){var t,n=e.audioContext.currentTime,o=function(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return y(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(e.sentenceTimings);try{for(o.s();!(t=o.n()).done;){var r=t.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(A):(e.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(A)}}},{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 A;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,A=e.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",A);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(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=H(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=H(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(A)?A:A+""}var O=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},A=[{key:"on",value:function(e,A){this.events[e]||(this.events[e]=[]),this.events[e].push(A)}},{key:"off",value:function(e,A){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==A}))}},{key:"emit",value:function(e){for(var A=arguments.length,t=new Array(A>1?A-1:0),n=1;n<A;n++)t[n-1]=arguments[n];this.events[e]&&this.events[e].forEach(function(A){try{A.apply(void 0,t)}catch(A){console.error("Error in event listener for ".concat(e,":"),A)}})}},{key:"removeAllListeners",value:function(e){e?delete this.events[e]:this.events={}}}],A&&D(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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 L(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function M(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?L(Object(t),!0).forEach(function(A){R(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function R(e,A,t){return(A=z(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function _(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return V(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(V(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}V=function(e,A,t,n){function r(A,t){V(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},V(e,A,t,n)}function j(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function N(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);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,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function W(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=K(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=K(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==K(A)?A:A+""}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,A){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Y(e,A)}var q=function(e){function A(e){var t;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(t=function(e,A,t){return A=J(A),function(e,A){if(A&&("object"==K(A)||"function"==typeof A))return A;if(void 0!==A)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(A,t||[],J(e).constructor):A.apply(e,t))}(this,A)).config=e,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&Y(e,A)}(A,e),t=A,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var e,A=function(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return G(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?G(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(A.s();!(e=A.n()).done;){var t=e.value.src;if(t&&(t.includes("agent-widget.js")||t.includes("ttp-agent-sdk")))try{new URL(t);var n=t.substring(0,t.lastIndexOf("/"));return"".concat(n,"/audio-processor.js")}catch(e){var o=t.substring(0,t.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}}catch(e){A.e(e)}finally{A.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var e=N(_().m(function e(){var A;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 A=e.v,e.a(2,A.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 A,t,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..."),A=this.config.sampleRate||this.config.outputSampleRate||44100,t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=this.config.audioConstraints?M(M({},t),this.config.audioConstraints):t,e.n=3,navigator.mediaDevices.getUserMedia({audio:M({sampleRate:A,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 A,t,n,o,r,i,a,s,c,l,u,d,p,g=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(A=e.v)&&(console.log("📋 AudioRecorder: Current permission state: ".concat(A)),"denied"===A&&console.warn('⚠️ AudioRecorder: Permission state is "denied" - browser may not show prompt. User may need to change in browser settings.')),t=this.config.sampleRate||this.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?M(M({},n),this.config.audioConstraints):n,e.n=2,navigator.mediaDevices.getUserMedia({audio:M({sampleRate:t,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:t}),"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:t,outputSampleRate:this.config.outputSampleRate}}),(c=this.audioContext.createMediaStreamSource(this.mediaStream)).connect(this.audioWorkletNode),this.mediaStreamSource=c,this.audioWorkletNode.port.onmessage=function(e){var A=e.data,t=A.type,n=A.data;"pcm_audio_data"===t&&g.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 A;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,A=e.v,this.emit("error",A),A;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 A,t;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===(A=this.mediaStream.getAudioTracks()).filter(function(e){return"live"===e.readyState}).length&&A.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,t=e.v,console.error("❌ AudioRecorder: Failed to resume AudioContext:",t),this.emit("error",t);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(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Z(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Z(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z(A)?A:A+""}const Ae=function(){function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)}return A=e,t=[{key:"extractPcmFromWav",value:function(e){var A=e instanceof Uint8Array?e:new Uint8Array(e);if(A.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(A[0],A[1],A[2],A[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(A[8],A[9],A[10],A[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var t=A[22]|A[23]<<8,n=A[24]|A[25]<<8|A[26]<<16|A[27]<<24,o=A[34]|A[35]<<8,r=-1,i=12;i<A.length-8;i+=4){if("data"===String.fromCharCode(A[i],A[i+1],A[i+2],A[i+3])){r=i;break}i+=4+(A[i+4]|A[i+5]<<8|A[i+6]<<16|A[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=A[r+4]|A[r+5]<<8|A[r+6]<<16|A[r+7]<<24,s=r+8,c=Math.min(a,A.length-s);return{pcmData:A.slice(s,s+c).buffer,format:{sampleRate:n,channels:t,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,A,t,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,t,!0),r.setUint32(24,A,!0),r.setUint32(28,A*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,e,!0),o}},{key:"wrapPcmInWav",value:function(A,t){var n=e.createWavHeader(A.byteLength,t.sampleRate,t.channels||1,t.bitDepth||16),o=new Uint8Array(n.byteLength+A.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(A),n.byteLength),o.buffer}}],null&&$(A.prototype,null),t&&$(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();function te(e){return te="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},te(e)}function ne(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=te(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=te(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==te(A)?A:A+""}const re=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.codecs={pcm:new u,pcmu:new h,pcma:new B}},(A=[{key:"decodeToPcm",value:function(e,A){var t=null==A?void 0:A.toLowerCase();if(!t||"pcm"===t)return e instanceof ArrayBuffer?e:e instanceof Uint8Array?e.buffer:e;var n=this.codecs[t];if(!n)throw new Error("Unsupported encoding: ".concat(A));var o=e instanceof Uint8Array?e:new Uint8Array(e);return n.decode(o)}},{key:"encodeFromPcm",value:function(e,A){var t=null==A?void 0:A.toLowerCase();if(!t||"pcm"===t)return e;var n=this.codecs[t];if(!n)throw new Error("Unsupported target encoding: ".concat(A));var o=n.encode(e);return o instanceof Uint8Array?o.buffer:o}},{key:"getCodec",value:function(e){var A=null==e?void 0:e.toLowerCase();return this.codecs[A]||null}}])&&ne(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=ie(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ie(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ie(A)?A:A+""}const ce=function(){function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)}return A=e,t=[{key:"convert",value:function(A,t,n){if(t===n)return A;if(8===t)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var o=t/8,r=n/8,i=A.byteLength/o;if(new ArrayBuffer(i*r),16===t&&16===n)return A;if(24===t&&16===n)return e.convert24To16(A);if(16===t&&24===n)return e.convert16To24(A);if(16===t&&8===n)return e.convert16To8(A);if(24===t&&8===n)return e.convert24To8(A);throw new Error("Unsupported bit depth conversion: ".concat(t,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(e){for(var A=new Uint8Array(e),t=Math.floor(A.length/3),n=new Int16Array(t),o=0;o<t;o++){var r=A[3*o],i=A[3*o+1],a=A[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 A=new Int16Array(e),t=new Uint8Array(3*A.length),n=0;n<A.length;n++){var o=256*A[n];t[3*n]=255&o,t[3*n+1]=o>>8&255,t[3*n+2]=o>>16&255}return t.buffer}},{key:"convert16To8",value:function(e){for(var A=new Int16Array(e),t=new Uint8Array(A.length),n=0;n<A.length;n++){var o=A[n];t[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return t.buffer}},{key:"convert24To8",value:function(A){var t=e.convert24To16(A);return e.convert16To8(t)}}],null&&ae(A.prototype,null),t&&ae(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return de(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(de(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}de=function(e,A,t,n){function r(A,t){de(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},de(e,A,t,n)}function pe(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function ge(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,he(n.key),n)}}function he(e){var A=function(e){if("object"!=le(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=le(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==le(A)?A:A+""}const fe=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)},A=[{key:"resample",value:(t=ue().m(function e(A,t,n){var o,r,i,a,s,c,l,u,d,p,g,h,f;return ue().w(function(e){for(;;)switch(e.n){case 0:if(t!==n){e.n=1;break}return e.a(2,A);case 1:for(o=new Int16Array(A),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/t),c=new OfflineAudioContext(1,s,n),(l=c.createBuffer(1,r.length,t)).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),g=new Int16Array(p.length),h=0;h<p.length;h++)f=Math.max(-1,Math.min(1,p[h])),g[h]=Math.round(32767*f);return e.a(2,g.buffer)}},e)}),n=function(){var e=this,A=arguments;return new Promise(function(n,o){var r=t.apply(e,A);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,A,t){return n.apply(this,arguments)})}],A&&ge(e,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=me(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=me(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==me(A)?A:A+""}const we=function(){function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)}return A=e,t=[{key:"convert",value:function(A,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(t===n)return A;if(1===t&&1===n)return A;if(1===t&&2===n)return e.monoToStereo(A,o);if(2===t&&1===n)return e.stereoToMono(A,o);throw new Error("Unsupported channel conversion: ".concat(t," → ").concat(n))}},{key:"monoToStereo",value:function(e,A){for(var t=A/8,n=e.byteLength/t,o=new ArrayBuffer(n*t*2),r=new Uint8Array(e),i=new Uint8Array(o),a=0;a<n;a++)for(var s=a*t,c=a*t*2,l=0;l<t;l++)i[c+l]=r[s+l],i[c+t+l]=r[s+l];return o}},{key:"stereoToMono",value:function(e,A){var t=A/8,n=e.byteLength/(2*t),o=new ArrayBuffer(n*t),r=new Uint8Array(e),i=new Uint8Array(o);if(16===A)for(var a=0;a<n;a++){var s=a*t*2,c=s+t,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*t;i[p]=255&d,i[p+1]=d>>8&255}else for(var g=0;g<n;g++)for(var h=g*t*2,f=g*t,m=0;m<t;m++)i[f+m]=r[h+m];return o}}],null&&ve(A.prototype,null),t&&ve(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ce(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Ce(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ce=function(e,A,t,n){function r(A,t){Ce(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Ce(e,A,t,n)}function xe(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function Qe(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?xe(Object(t),!0).forEach(function(A){Fe(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Fe(e,A,t){return(A=ke(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function Ue(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Se(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=ye(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ye(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ye(A)?A:A+""}const Ee=function(){return e=function e(A,t){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.requestedFormat=A,this.actualFormat=t,this.encodingConverter=new re,this.conversionSteps=[],this._analyzeConversions()},A=[{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:(t=be().m(function e(A){var t,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,A instanceof ArrayBuffer?A:A.buffer);case 1:if(t=A instanceof ArrayBuffer?A:A.buffer,n=Qe({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=Ae.extractPcmFromWav(t),t=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")&&(t=this.encodingConverter.decodeToPcm(t,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)&&(t=ce.convert(t,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(t,n.sampleRate,this.requestedFormat.sampleRate);case 2:t=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")&&(t=we.convert(t,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")&&(t=ce.convert(t,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(t,this.requestedFormat.encoding),t=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")&&(t=Ae.wrapPcmInWav(t,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),e.a(2,t)}},e,this)}),n=function(){var e=this,A=arguments;return new Promise(function(n,o){var r=t.apply(e,A);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)})}],A&&Se(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return He(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(He(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}He=function(e,A,t,n){function r(A,t){He(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},He(e,A,t,n)}function De(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Pe(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Ie(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Ie(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ie(A)?A:A+""}const Ke=function(){return e=function e(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.handlers=new Map,this.sendMessage=A,this.getConversationId=t},A=[{key:"registerHandler",value:function(e,A){if("function"!=typeof A)throw new Error("Handler for tool '".concat(e,"' must be a function"));this.handlers.set(e,A),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:(t=Te().m(function e(A){var t,n,o,r,i,a,s,c,l,u,d,p,g,h;return Te().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=A.toolCallId,n=A.toolName,o=A.parameters,r=Date.now(),i=(new Date).toISOString(),console.log("🔧 ClientTools: [".concat(i,"] Received tool call '").concat(n,"' (id: ").concat(t,")")),console.log(" 📋 Full message received:",JSON.stringify(A,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(t,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(t,n,c,l),e.n=4;break;case 3:e.p=3,h=e.v,p=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),h),g="EXECUTION_ERROR","NotAllowedError"===h.name||null!==(u=h.message)&&void 0!==u&&u.includes("permission")?g="PERMISSION_DENIED":("NotSupportedError"===h.name||null!==(d=h.message)&&void 0!==d&&d.includes("not supported"))&&(g="API_UNAVAILABLE"),this.sendError(t,n,h.message||"Unknown error",g,p);case 4:return e.a(2)}},e,this,[[1,3]])}),n=function(){var e=this,A=arguments;return new Promise(function(n,o){var r=t.apply(e,A);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,A,t,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:e,toolName:A,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] Sending result for tool '").concat(A,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(A)),console.log(" 📋 result:",t),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,A,t,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:A,conversationId:a,error:t,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(A,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(A)),console.log(" 📋 error: ".concat(t,", 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}}],A&&Pe(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();var Le=t(354),Me=t.n(Le);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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ve(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Ve(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ve=function(e,A,t,n){function r(A,t){Ve(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Ve(e,A,t,n)}function je(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function Ne(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?je(Object(t),!0).forEach(function(A){Ge(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Ge(e,A,t){return(A=function(e){var A=function(e){if("object"!=Re(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Re(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Re(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function We(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(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 A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,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(t=(A=U.length>0&&void 0!==U[0]?U[0]:{}).selector,n=void 0===t?null:t,o=A.format,r=void 0===o?"jpeg":o,i=A.quality,a=void 0===i?.85:i,s=A.scale,c=void 0===s?1:s,l=A.maxWidth,u=void 0===l?1280:l,d=A.maxHeight,p=void 0===d?1280:d,g=A.fullPage,h=void 0!==g&&g,console.log("📸 SDK Screenshot: Starting capture with options:",A),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}),h&&!n&&(B.windowHeight=document.documentElement.scrollHeight,B.height=document.documentElement.scrollHeight,B.y=0),e.n=5,Me()(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 A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);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,A,t){var n=e.width,o=e.height,r=1;if(A&&n>A&&(r=Math.min(r,A/n)),t&&o>t&&(r=Math.min(r,t/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,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return Ze(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Ze(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];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 eA(e){if(!e)return!1;var A=(e.type||"").toLowerCase(),t=(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(t," ").concat(n," ").concat(o," ").concat(i," ").concat(a);if($e.types.includes(A))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 g=d.value;if(e.hasAttribute(g))return!0}}catch(e){p.e(e)}finally{p.f()}return"password"===(e.inputMode||"").toLowerCase()}function AA(e){return AA="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},AA(e)}function tA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return nA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(nA(A={},n,function(){return this}),A),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]"}),(tA=function(){return{w:r,m:d}})()}function nA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nA=function(e,A,t,n){function r(A,t){nA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},nA(e,A,t,n)}function oA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function rA(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?oA(Object(t),!0).forEach(function(A){iA(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oA(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function iA(e,A,t){return(A=function(e){var A=function(e){if("object"!=AA(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=AA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AA(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function aA(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function sA(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return cA(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cA(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function cA(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}var lA={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function uA(e){var A,t;if(!e||!e.tagName)return null;if(null!==(A=e.dataset)&&void 0!==A&&A.testid)return'[data-testid="'.concat(e.dataset.testid,'"]');if(null!==(t=e.dataset)&&void 0!==t&&t.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&&!dA(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 A;return(null===(A=e.innerText)||void 0===A?void 0:A.trim())===i}).length)return"".concat(a,':contains("').concat(i.replace(/"/g,'\\"'),'")')}}return function(e){for(var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=[],n=e,o=0;n&&n!==document.body&&o<A;){var r=n.tagName.toLowerCase();if(n.id&&!dA(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var i=pA(n);if(i)t.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;t.unshift("".concat(r,":nth-child(").concat(c,")"))}else t.unshift(r)}n=n.parentElement,o++}return t.join(" > ")}(e)}function dA(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(A){return A.test(e)})}function pA(e){var A=Array.from(e.classList||[]),t=[/^(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 A.filter(function(e){return!t.some(function(A){return A.test(e)})&&e.length>2&&e.length<30})[0]||null}function gA(e){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=e.getBoundingClientRect();return t.bottom>=-A&&t.top<=window.innerHeight+A&&t.right>=0&&t.left<=window.innerWidth}function hA(e){if(!e)return!1;var A=window.getComputedStyle(e);return"none"!==A.display&&"hidden"!==A.visibility&&"0"!==A.opacity&&e.offsetWidth>0&&e.offsetHeight>0}function fA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=sA(document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button'));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(t.length>=A.buttons)break;if(hA(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&t.push({selector:uA(o),text:r.substring(0,A.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:gA(o,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function mA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=sA(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(t.length>=A.links)break;if(hA(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){}t.push({selector:uA(i),text:a.substring(0,A.maxTextLength),href:s,internal:c,inViewport:gA(i,0)})}}}}}catch(e){r.e(e)}finally{r.f()}return t}function vA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=0,o=sA(document.querySelectorAll("form"));try{for(o.s();!(e=o.n()).done;){var r=e.value;if(t.length>=A.forms)break;if(hA(r)){var i,a=[],s=sA(r.querySelectorAll("input, textarea, select"));try{for(s.s();!(i=s.n()).done;){var c,l,u=i.value;if(a.length>=A.fieldsPerForm)break;if("hidden"!==u.type)if(eA(u))n++;else{var d=null;if(u.id){var p,g=document.querySelector('label[for="'.concat(u.id,'"]'));d=null==g||null===(p=g.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:uA(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&&t.push({selector:uA(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:t,sensitiveCount:n}}function BA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=sA(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(t.length>=A.sections)break;if(hA(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,A.maxSummaryLength))||(null===(i=a.innerText)||void 0===i?void 0:i.trim().substring(0,A.maxSummaryLength))||"";t.push({selector:uA(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,A.maxSummaryLength),inViewport:gA(a,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function wA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=sA(document.querySelectorAll("h1, h2, h3"));try{for(n.s();!(e=n.n()).done;){var o,r=e.value;if(t.length>=A.headings)break;if(hA(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&t.push({selector:uA(r),level:r.tagName.toLowerCase(),text:i.substring(0,A.maxTextLength),inViewport:gA(r,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function yA(){return bA.apply(this,arguments)}function bA(){return e=tA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f=arguments;return tA().w(function(e){for(;;)if(0===e.n)return t=f.length>0&&void 0!==f[0]?f[0]:{},n=rA(rA({},lA),t.limits),o=fA(n),r=mA(n),i=vA(n),a=i.forms,s=i.sensitiveCount,c=BA(n),l=wA(n),u=o.length+r.length+a.reduce(function(e,A){return e+A.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===(A=document.querySelector("html"))||void 0===A?void 0:A.getAttribute("lang"))||null,g=navigator.language||navigator.languages&&navigator.languages[0]||null,h=p||g||null,e.a(2,{url:window.location.href,title:document.title,timestamp:Date.now(),language:h,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)}),bA=function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){aA(r,n,o,i,a,"next",e)}function a(e){aA(r,n,o,i,a,"throw",e)}i(void 0)})},bA.apply(this,arguments);var e}function CA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(xA(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xA=function(e,A,t,n){function r(A,t){xA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},xA(e,A,t,n)}function QA(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function FA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){QA(r,n,o,i,a,"next",e)}function a(e){QA(r,n,o,i,a,"throw",e)}i(void 0)})}}function UA(){return SA.apply(this,arguments)}function SA(){return SA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u=arguments;return CA().w(function(e){for(;;)switch(e.n){case 0:if(n=(t=u.length>0&&void 0!==u[0]?u[0]:{}).selector,o=t.color,r=void 0===o?"#6366f1":o,i=t.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,LA(400);case 3:return c=s.getBoundingClientRect(),kA(),(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===(A=s.innerText)||void 0===A?void 0:A.trim().substring(0,100))||null,position:{top:c.top,left:c.left,width:c.width,height:c.height}}})}},e)})),SA.apply(this,arguments)}function kA(){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 EA(){return IA.apply(this,arguments)}function IA(){return IA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return CA().w(function(e){for(;;)switch(e.n){case 0:if(t=(A=B.length>0&&void 0!==B[0]?B[0]:{}).selector,n=A.x,o=A.y,r=A.direction,i=A.amount,a=void 0===i?500:i,s=A.position,c=void 0===s?"center":s,l=A.behavior,u=void 0===l?"smooth":l,!t){e.n=3;break}if(d=document.querySelector(t)){e.n=1;break}return e.a(2,{success:!1,error:"Element not found: ".concat(t)});case 1:return p="top"===c?"start":"bottom"===c?"end":"center",d.scrollIntoView({behavior:u,block:p,inline:"nearest"}),e.n=2,LA("smooth"===u?500:100);case 2:return g=d.getBoundingClientRect(),e.a(2,{success:!0,scrollType:"element",selector:t,elementPosition:{top:g.top,left:g.left}});case 3:if("up"!==r&&"down"!==r){e.n=5;break}return h=a||500,f=window.scrollY,m=document.documentElement.scrollHeight-window.innerHeight,v="up"===r?Math.max(0,f-h):Math.min(m,f+h),window.scrollTo({top:v,left:window.scrollX,behavior:u}),e.n=4,LA("smooth"===u?500:100);case 4:return e.a(2,{success:!0,scrollType:"relative",direction:r,amount:h,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,LA("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)})),IA.apply(this,arguments)}function TA(){return HA.apply(this,arguments)}function HA(){return HA=FA(CA().m(function e(){var A,t,n,o,r=arguments;return CA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=(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,t=new URL(A,window.location.origin),e.n=3;break;case 2:return e.p=2,e.v,e.a(2,{success:!1,error:"Invalid URL: ".concat(A)});case 3:if(["http:","https:"].includes(t.protocol)){e.n=4;break}return e.a(2,{success:!1,error:"Invalid protocol: ".concat(t.protocol)});case 4:if(t.origin===window.location.origin){e.n=7;break}return e.p=5,window.open(t.href,"_blank","noopener,noreferrer"),e.a(2,{success:!0,openedInNewTab:!0,navigatedTo:t.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:t.href});case 7:return n=window.location.href,window.location.href=t.href,e.a(2,{success:!0,navigatedTo:t.href,from:n})}},e,null,[[5,6],[1,2]])})),HA.apply(this,arguments)}function DA(){return PA.apply(this,arguments)}function PA(){return PA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p=arguments;return CA().w(function(e){for(;;)switch(e.n){case 0:if(t=(A=p.length>0&&void 0!==p[0]?p[0]:{}).selector,n=A.value,o=A.triggerEvents,r=void 0===o||o,t){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(t)){e.n=3;break}return e.a(2,{success:!1,error:"Element not found: ".concat(t)});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(!eA(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,LA(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})))),kA(),i.classList.add("ttp-fill-success"),setTimeout(function(){i.classList.remove("ttp-fill-success")},2e3),e.a(2,{success:!0,selector:t,fieldType:i.type||a,fieldName:i.name||null,filled:!0})}},e)})),PA.apply(this,arguments)}function OA(){return KA.apply(this,arguments)}function KA(){return KA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b=arguments;return CA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=(t=b.length>0&&void 0!==b[0]?b[0]:{}).selector,o=t.waitForNavigation,r=void 0!==o&&o,i=t.openInNewTab,a=void 0!==i&&i,s=t.isExternal,c=void 0!==s&&s,l=t.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,LA(300);case 5:return(g=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(g),e.n=6,LA(200);case 6:if(g.remove(),!a&&!c){e.n=9;break}if(!(h=u||d.href||("A"===d.tagName?d.getAttribute("href"):null))||"#"===h||h.startsWith("javascript:")){e.n=9;break}return e.p=7,window.open(h,"_blank","noopener,noreferrer"),e.a(2,{success:!0,selector:n,clicked:!0,openedInNewTab:!0,url:h,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 A=setTimeout(function(){e({navigated:!1})},5e3),t=function(){clearTimeout(A),window.removeEventListener("beforeunload",t),e({navigated:!0})};window.addEventListener("beforeunload",t)}),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===(A=d.innerText)||void 0===A?void 0:A.trim().substring(0,50))||null}})}},e,null,[[7,8]])})),KA.apply(this,arguments)}function LA(e){return new Promise(function(A){return setTimeout(A,e)})}function MA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return RA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(RA(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,RA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,RA(u,"constructor",c),RA(c,"constructor",s),s.displayName="GeneratorFunction",RA(c,o,"GeneratorFunction"),RA(u),RA(u,o,"Generator"),RA(u,n,function(){return this}),RA(u,"toString",function(){return"[object Generator]"}),(MA=function(){return{w:r,m:d}})()}function RA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}RA=function(e,A,t,n){function r(A,t){RA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},RA(e,A,t,n)}function _A(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function VA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){_A(r,n,o,i,a,"next",e)}function a(e){_A(r,n,o,i,a,"throw",e)}i(void 0)})}}function jA(){return(jA=VA(MA().m(function e(){var A;return MA().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,yA();case 1:return A=e.v,e.a(2,{url:A.url,title:A.title,timestamp:A.timestamp,language:A.language,viewport:A.viewport,dom:{buttons:A.buttons,links:A.links,forms:A.forms,sections:A.sections,headings:A.headings,metadata:A.metadata}})}},e)}))).apply(this,arguments)}function NA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return GA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(GA(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,GA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,GA(u,"constructor",c),GA(c,"constructor",s),s.displayName="GeneratorFunction",GA(c,o,"GeneratorFunction"),GA(u),GA(u,o,"Generator"),GA(u,n,function(){return this}),GA(u,"toString",function(){return"[object Generator]"}),(NA=function(){return{w:r,m:d}})()}function GA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}GA=function(e,A,t,n){function r(A,t){GA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},GA(e,A,t,n)}function WA(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function zA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){WA(r,n,o,i,a,"next",e)}function a(e){WA(r,n,o,i,a,"throw",e)}i(void 0)})}}function XA(e){return XA="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},XA(e)}function JA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function YA(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?JA(Object(t),!0).forEach(function(A){At(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):JA(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function qA(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tt(n.key),n)}}function ZA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ZA=function(){return!!e})()}function $A(e){return $A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$A(e)}function et(e,A){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},et(e,A)}function At(e,A,t){return(A=tt(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function tt(e){var A=function(e){if("object"!=XA(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=XA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==XA(A)?A:A+""}var nt=function(e){function A(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(e=function(e,A,t){return A=$A(A),function(e,A){if(A&&("object"==XA(A)||"function"==typeof A))return A;if(void 0!==A)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,ZA()?Reflect.construct(A,t||[],$A(e).constructor):A.apply(e,t))}(this,A)).version="2.0.0",e.config={signedUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:t.agentId,appId:t.appId,sampleRate:t.sampleRate||16e3,channels:t.channels||1,bitDepth:t.bitDepth||16,audioProcessorPath:t.audioProcessorPath,outputContainer:t.outputContainer||e.getDefaultContainer(t),outputEncoding:t.outputEncoding||t.outputCodec||"pcm",outputSampleRate:t.outputSampleRate||16e3,outputChannels:t.outputChannels||1,outputBitDepth:t.outputBitDepth||16,outputFrameDurationMs:t.outputFrameDurationMs||600,outputCodec:t.outputCodec,agentSettingsOverride:t.agentSettingsOverride||null,visualAssistant:t.visualAssistant||null,variables:t.variables||null,autoReconnect:!1!==t.autoReconnect,audioConstraints:t.audioConstraints||null,protocolVersion:t.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=YA(YA({},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(A){return e.sendMessage(A)},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,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&et(e,A)}(A,e),t=A,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:",XA(Xe)),this.clientToolsRegistry.registerHandler("capture_screen",zA(NA().m(function A(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return NA().w(function(A){for(;;)switch(A.p=A.n){case 0:return t=B.length>0&&void 0!==B[0]?B[0]:{},console.log("📸 VoiceSDK: capture_screen tool called with params:",t),n=t.selector,o=void 0===n?null:n,r=t.format,i=void 0===r?"jpeg":r,a=t.quality,s=void 0===a?.85:a,c=t.scale,l=void 0===c?1:c,u=t.fullPage,d=void 0!==u&&u,p=t.maxWidth,g=void 0===p?1280:p,h=t.maxHeight,f=void 0===h?1280:h,A.p=1,A.n=2,Xe({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:g,maxHeight:f});case 2:return m=A.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}),A.a(2,m);case 3:throw A.p=3,v=A.v,console.error("📸 VoiceSDK: Screenshot capture failed:",v),e.emit("screenshotError",{error:v.message}),v;case 4:return A.a(2)}},A,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",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Reading page structure..."),e.n=1,yA(A);case 1:return t=e.v,console.log("[TTP] ✅ Page structure extracted:",{buttons:t.buttons.length,links:t.links.length,forms:t.forms.length,headings:t.headings.length}),e.a(2,t)}},e)}))),e.registerHandler("highlight_element",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] ✨ Highlighting element:",A.selector),e.n=1,UA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",t.error),e.a(2,t)}},e)}))),e.registerHandler("scroll_to_element",VA(MA().m(function e(){var A,t,n,o,r=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return(A=r.length>0&&void 0!==r[0]?r[0]:{}).selector?console.log("[TTP] 📜 Scrolling to element:",A.selector):A.direction?console.log("[TTP] 📜 Scrolling",A.direction,"by",A.amount||500,"px"):void 0!==A.x||void 0!==A.y?console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(t=A.x)&&void 0!==t?t:"current",", ").concat(null!==(n=A.y)&&void 0!==n?n:"current",")")):console.log("[TTP] 📜 Scroll called with params:",A),e.n=1,EA(A);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",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 🔗 Navigating to:",A.url),e.n=1,TA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",t.error),e.a(2,t)}},e)}))),e.registerHandler("fill_field",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📝 Filling field:",A.selector),e.n=1,DA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",t.error),e.a(2,t)}},e)}))),e.registerHandler("click_element",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 👆 Clicking element:",A.selector),e.n=1,OA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",t.error),e.a(2,t)}},e)})));var A=e.getRegisteredTools(),t=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(function(e){return!A.includes(e)});t.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",t):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",A)}(this.clientToolsRegistry);var A=this.clientToolsRegistry.getRegisteredTools(),t=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=A.filter(function(e){return t.includes(e)});if(n.length!==t.length){var o=t.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(A.RESUME_STORAGE_KEY);if(e){var t=JSON.parse(e);if(t&&t.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",t.conversationId),t.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 t={},n=sessionStorage.getItem(A.RESUME_STORAGE_KEY);if(n)try{t=JSON.parse(n)}catch(e){}t.conversationId=e,t.timestamp=Date.now(),t.fromPage=t.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(A.RESUME_STORAGE_KEY,JSON.stringify(t)),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(A.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(A.RESUME_STORAGE_KEY);if(!e)return null;var t=JSON.parse(e),n=Date.now()-t.timestamp;return n>A.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",n,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",t,"age:",n,"ms"),t)}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(A.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 A=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",e.conversationId),console.log("[VoiceSDK] Page change:",e.fromPage,"→",A),{conversationId:e.conversationId,fromPage:e.fromPage,toPage:A}}},{key:"getDefaultContainer",value:function(e){return"wav"===e.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(e){var t;if(!e)return"Input format is required";var n=null===(t=e.encoding)||void 0===t?void 0:t.toLowerCase();return n&&A.SUPPORTED_INPUT_ENCODINGS.includes(n)?e.sampleRate&&A.SUPPORTED_INPUT_SAMPLE_RATES.includes(e.sampleRate)?e.bitDepth&&A.SUPPORTED_INPUT_BIT_DEPTHS.includes(e.bitDepth)?e.channels&&A.SUPPORTED_INPUT_CHANNELS.includes(e.channels)?null:"Unsupported input channels: ".concat(e.channels,". Supported: ").concat(A.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(e.bitDepth,". Supported: ").concat(A.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(e.sampleRate,". Supported: ").concat(A.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(e.encoding,". Supported: ").concat(A.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(e){var t,n;if(!e)return"Output format is required";var o=null===(t=e.encoding)||void 0===t?void 0:t.toLowerCase();if(!o||!A.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(e.encoding,". Supported: ").concat(A.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!e.sampleRate||!A.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(e.sampleRate))return"Unsupported output sample rate: ".concat(e.sampleRate,". Supported: ").concat(A.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!e.bitDepth||!A.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(e.bitDepth))return"Unsupported output bit depth: ".concat(e.bitDepth,". Supported: ").concat(A.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!e.channels||!A.SUPPORTED_OUTPUT_CHANNELS.includes(e.channels))return"Unsupported output channels: ".concat(e.channels,". Supported: ").concat(A.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=e.container)||void 0===n?void 0:n.toLowerCase();return r&&A.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(e.container,". Supported: ").concat(A.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){var e={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},A=this.validateInputFormat(e);if(A)return console.error("❌ VoiceSDK v2: Invalid input format:",A),void this.emit("error",new Error(A));var t={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},n=this.validateOutputFormat(t);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(A){var t=e.currentPlayingSentenceId?e.currentPlayingSentenceId+1:1;e.currentPlayingSentenceId=t;var n={text:A.text,role:"assistant",sentenceId:t,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(A){e.emit("playbackError",A),e.emit("error",A)})}},{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(A){e.isConnected&&e.sendBinary(A)}),this.audioRecorder.on("error",function(A){A.isServerRejection||"ServerRejected"===A.name||(console.error("❌ AudioRecorder error:",A),e.emit("error",A))})}},{key:"buildWebSocketUrl",value:function(){var e=this.config.signedUrl||this.config.websocketUrl,A=new URL(e,"wss://placeholder.com"),t=A.searchParams;this.config.agentId&&!t.has("agentId")&&t.append("agentId",this.config.agentId),this.config.appId&&!t.has("appId")&&t.append("appId",this.config.appId);var n=this.getStoredConversationId();n&&!t.has("conversationId")&&(t.append("conversationId",n),console.log("🔄 VoiceSDK v2: Attempting resume via query param:",n));var o=window.location.pathname+window.location.search;o&&!t.has("currentPage")&&t.append("currentPage",o);var r=t.toString();return r?"".concat(A.origin).concat(A.pathname,"?").concat(r):"".concat(A.origin).concat(A.pathname)}},{key:"connect",value:(p=zA(NA().m(function e(){var A,t,n=this;return NA().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,A=this.buildWebSocketUrl(),e.n=3,new Promise(function(e,t){n.websocket=new WebSocket(A),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 A=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",A);var t=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(function(e){return!A.includes(e)});if(t.length>0){console.warn("⚠️ VoiceSDK v2: Missing tools detected, re-registering:",t),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),t(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 A=new Error("Connection closed - data injection cancelled");A.error="CONNECTION_CLOSED",n.pendingInjections.forEach(function(e,t){clearTimeout(e.timeout),e.reject(A),n.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:t})}),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,t=e.v,console.error("🔌 VoiceSDK v2: Connection failed:",t),this.emit("error",t),e.a(2,!1)}},e,this,[[2,4]])})),function(){return p.apply(this,arguments)})},{key:"detectBrowserLocale",value:function(){var e,A,t=navigator.language||(null===(e=navigator.languages)||void 0===e?void 0:e[0])||"en-US";return{language:(null===(A=t.split("-")[0])||void 0===A?void 0:A.toLowerCase())||"en",fullLocale:t}}},{key:"sendHelloMessage",value:(d=zA(NA().m(function e(){var A,t,n,o,r;return NA().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(A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},t={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},!(n=this.validateInputFormat(A))){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(t))){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:A,requestedOutputFormat:t,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 A,t=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===(A=this.audioPlayer.scheduledSources)||void 0===A?void 0:A.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 jA.apply(this,arguments)}().then(function(e){t.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),t.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){t.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),t.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(A){var a,s,c="string"==typeof e.data?e.data:String(e.data),l=(null===(a=A.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:",A),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),g=c.substring(d,p),h=" ".repeat(u-d)+"^";console.error("VoiceSDK v2: Context around error:"),console.error(g),console.error(h);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=A.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,A,t){var n=t.charCodeAt(0);return A+({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:A,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 A={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},t=[];if(this.requestedOutputFormat.container!==A.container&&t.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(A.container,'"')),this.requestedOutputFormat.encoding!==A.encoding&&t.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(A.encoding,'"')),this.requestedOutputFormat.sampleRate!==A.sampleRate&&t.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(A.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==A.bitDepth&&t.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(A.bitDepth,"-bit")),this.requestedOutputFormat.channels!==A.channels&&t.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(A.channels)),t.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",A),console.warn(" Differences:",t.join(", "));try{if(this.formatConverter=new Ee(this.requestedOutputFormat,A),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!",A),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=zA(NA().m(function e(A){var t,n,o,r,i,a,s,c,l,u=this,d=arguments;return NA().w(function(e){for(;;)switch(e.n){case 0:if(t=d.length>1&&void 0!==d[1]?d[1]:{},n=null==A?void 0:A.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=t.timeout||1e4,c=t.source||"programmatic",l={t:"data_inject",data:n,correlationId:a,source:c,timestamp:Date.now()},t.metadata&&(l.metadata=t.metadata),e.a(2,new Promise(function(e,A){var t=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),A(new Error(e.message))},s);if(u.pendingInjections.set(a,{resolve:function(A){clearTimeout(t),e(A)},reject:function(e){clearTimeout(t),A(e)},timeout:t}),u.sendMessage(l))console.log("📤 VoiceSDK v2: Sent data_inject message:",{correlationId:a,dataLength:n.length,source:c});else{u.pendingInjections.delete(a),clearTimeout(t);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),A(new Error(o.message))}}))}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"handleDataInjectAck",value:function(e){var A=e.correlationId;if(A){var t=this.pendingInjections.get(A);t?(this.pendingInjections.delete(A),t.resolve(e),this.emit("dataInjected",{correlationId:A,data:e.data,metadata:e.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",A)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",A)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}},{key:"handleDataInjectError",value:function(e){var A=e.correlationId;if(A){var t=this.pendingInjections.get(A);if(t){this.pendingInjections.delete(A);var n=new Error(e.message||"Data injection failed");n.error=e.error,n.correlationId=A,t.reject(n),this.emit("dataInjectionError",{error:e.error,message:e.message,correlationId:A}),console.warn("❌ VoiceSDK v2: Data injection error:",A,e.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",A)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}},{key:"handleTranscript",value:function(e){if(e.sentenceId&&e.text){var A=e.sentenceId,t={text:e.text,role:e.role||"assistant",sentenceId:A,final:!1!==e.final,timestamp:e.timestamp||Date.now()};this.transcriptQueue.push(t),console.log("📝 VoiceSDK v2: Received transcript for sentence",A,":",t.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",A),this.emit("transcriptDisplay",t),this.currentPlayingSentenceId=A,this.emit("transcript",t)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",e)}},{key:"handleBinaryMessage",value:(l=zA(NA().m(function e(A){var t,n,o,r,i,a,s,c,l;return NA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(A instanceof Blob)){e.n=2;break}return e.n=1,A.arrayBuffer();case 1:t=e.v,e.n=3;break;case 2:t=A;case 3:if(n=t,!this.formatConverter||!this.formatConverter.needsConversion()){e.n=7;break}return e.p=4,e.n=5,this.formatConverter.convert(t);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=t;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 A=(new Date).toISOString(),t=this.websocket?this.websocket.readyState:"NO_WEBSOCKET",n=this.websocket?{0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"}[t]:"NO_WEBSOCKET";if("client_tool_result"!==e.t&&"client_tool_error"!==e.t||(console.log("📤 VoiceSDK v2: [".concat(A,"] Sending tool ").concat(e.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(t,")")),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(A,"] 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=zA(NA().m(function e(){var A,t,n,o;return NA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isConnected){e.n=1;break}throw A=new Error("Not connected to voice server"),this.emit("error",A),A;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(t=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",t.isServerRejection=!0,t;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=zA(NA().m(function e(){var A;return NA().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,A=e.v,console.error("VoiceSDK v2: Error stopping recording:",A),this.emit("error",A),e.a(2,!1)}},e,this,[[2,4]])})),function(){return s.apply(this,arguments)})},{key:"toggleRecording",value:(a=zA(NA().m(function e(){return NA().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=zA(NA().m(function e(){var A,t=this;return NA().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"),t.wakeLock=null}),e.n=5;break;case 4:e.p=4,A=e.v,console.warn("📱 VoiceSDK v2: Failed to request wake lock:",A.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=zA(NA().m(function e(){var A;return NA().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,A=e.v,console.warn("📱 VoiceSDK v2: Error releasing wake lock:",A.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=zA(NA().m(function e(){return NA().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=YA(YA({},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(),A=Math.random().toString(36).substr(2,9);return"inj_".concat(e,"_").concat(this.injectionCounter,"_").concat(A)}},{key:"registerToolHandler",value:function(e,A){return this.clientToolsRegistry.registerHandler(e,A)}},{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 A=new Error("SDK destroyed - data injection cancelled");A.error="SDK_DESTROYED",this.pendingInjections.forEach(function(e,t){clearTimeout(e.timeout),e.reject(A)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(A){return e.clientToolsRegistry.unregisterHandler(A)}),this.removeAllListeners()}}}],n&&qA(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c,l,u,d,p}(a);At(nt,"RESUME_STORAGE_KEY","voice_resume_state"),At(nt,"RESUME_TTL_MS",1e4),At(nt,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(nt,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(nt,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),At(nt,"SUPPORTED_INPUT_CHANNELS",[1]),At(nt,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(nt,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(nt,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),At(nt,"SUPPORTED_OUTPUT_CHANNELS",[1]),At(nt,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const ot=nt;function rt(e){return rt="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},rt(e)}function it(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return at(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(at(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,at(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,at(u,"constructor",c),at(c,"constructor",s),s.displayName="GeneratorFunction",at(c,o,"GeneratorFunction"),at(u),at(u,o,"Generator"),at(u,n,function(){return this}),at(u,"toString",function(){return"[object Generator]"}),(it=function(){return{w:r,m:d}})()}function at(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}at=function(e,A,t,n){function r(A,t){at(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},at(e,A,t,n)}function st(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function ct(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function lt(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?ct(Object(t),!0).forEach(function(A){ut(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function ut(e,A,t){return(A=pt(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function dt(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pt(n.key),n)}}function pt(e){var A=function(e){if("object"!=rt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=rt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rt(A)?A:A+""}function gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gt=function(){return!!e})()}function ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ht(e)}function ft(e,A){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},ft(e,A)}var mt=function(e){function A(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A);var n=(e=function(e,A,t){return A=ht(A),function(e,A){if(A&&("object"==rt(A)||"function"==typeof A))return A;if(void 0!==A)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,gt()?Reflect.construct(A,t||[],ht(e).constructor):A.apply(e,t))}(this,A)).readScriptTagConfig();return e.config=lt({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:t.appId||n.appId,agentId:t.agentId||n.agentId,conversationId:void 0!==t.conversationId?t.conversationId:e.getPersistedConversationId(),forceConversationId:t.forceConversationId,queue:[],inFlight:!1},t),e.fullResponseBuffer="",e}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&ft(e,A)}(A,e),t=A,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,A=new URLSearchParams;return this.config.appId&&A.append("appId",this.config.appId),this.config.agentId&&A.append("agentId",this.config.agentId),this.config.conversationId&&A.append("conversationId",this.config.conversationId),"".concat(e,"?").concat(A.toString())}},{key:"sendMessage",value:(o=it().m(function e(A){var t=this;return it().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){if(A&&A.trim())if(t.config.appId&&t.config.agentId){var o={text:A,resolve:e,reject:n};t.config.inFlight?t.config.queue.push(o):t.executeTask(o)}else n(new Error("Missing appId or agentId"));else n(new Error("Message is empty"))}))},e)}),r=function(){var e=this,A=arguments;return new Promise(function(t,n){var r=o.apply(e,A);function i(e){st(r,t,n,i,a,"next",e)}function a(e){st(r,t,n,i,a,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"executeTask",value:function(e){var A=this;if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var t=this.getPersistedConversationId();t&&(this.config.conversationId=t,console.log("🔍 TextChatSDK hydrated conversationId from storage:",t))}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(t){if(!s)try{var n={message:e.text},o=A.config.forceConversationId||A.config.conversationId;o&&(n.conversationId=o,A.config.forceConversationId&&!A.config.conversationId&&(A.config.conversationId=o,A.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",A.config.conversationId),t.send(JSON.stringify(n)),s=!0}catch(n){e.reject(n),A.emit("error",n);try{t.close()}catch(e){}}},u=function(e){return function(){A.config.conversationId?l(e):c=setTimeout(function(){return l(e)},200)}},d=function(t){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),A.config.conversationId=o.conversationId,A.persistConversationId(o.conversationId),A.emit&&A.emit("conversationIdChanged",o.conversationId),!s&&t&&1===t.readyState){if(c)try{clearTimeout(c)}catch(e){}l(t)}return}if(!A.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),A.config.conversationId=o.conversationId,A.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)A.fullResponseBuffer+=o.content,A.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!A.fullResponseBuffer&&(A.fullResponseBuffer=r)}catch(e){}!A.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),A.config.conversationId=o.conversationId),A.persistConversationId(A.config.conversationId),A.emit("done",{text:A.fullResponseBuffer}),e.resolve({conversationId:A.config.conversationId,fullText:A.fullResponseBuffer});try{t.close()}catch(e){}}else if("error"===o.type){var i=new Error(o.message||"Server error");A.emit("error",i),e.reject(i);try{t.close()}catch(e){}}}catch(e){}}},p=function(t){if(1008===t.code&&t.reason&&(t.reason.includes("Domain not whitelisted")||t.reason.includes("domain")||t.reason.includes("whitelist"))){var n=new Error("DOMAIN_NOT_WHITELISTED");return n.reason=t.reason,n.code=t.code,A.emit("domainError",n),e.reject(n),A.config.inFlight=!1,void A.drainQueue()}A.config.inFlight=!1,A.drainQueue()},g=new WebSocket(o);g.onopen=u(g),g.onmessage=d(g),g.onerror=(n=g,function(t){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(t){A.emit("error",t),e.reject(t)},void(o.onclose=p)}A.emit("error",t),e.reject(t)}),g.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=lt(lt({},this.config),e)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&dt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(O);function vt(e){return vt="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},vt(e)}function Bt(e,A){return function(e){if(Array.isArray(e))return e}(e)||function(e,A){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(e)).next,0===A){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==A);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,A)||yt(e,A)||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 wt(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=yt(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function yt(e,A){if(e){if("string"==typeof e)return bt(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bt(e,A):void 0}}function bt(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function Ct(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xt(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(xt(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xt=function(e,A,t,n){function r(A,t){xt(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},xt(e,A,t,n)}function Qt(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Ft(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ut(n.key),n)}}function Ut(e){var A=function(e){if("object"!=vt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=vt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vt(A)?A:A+""}function St(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(St=function(){return!!e})()}function kt(e){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kt(e)}function Et(e,A){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Et(e,A)}const It=new(function(e){function A(){var e;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(e=function(e,A,t){return A=kt(A),function(e,A){if(A&&("object"==vt(A)||"function"==typeof A))return A;if(void 0!==A)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,St()?Reflect.construct(A,t||[],kt(e).constructor):A.apply(e,t))}(this,A)).connections=new Map,e.connectionCounts=new Map,e.creatingConnections=new Set,e}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&Et(e,A)}(A,e),t=A,n=[{key:"getConnection",value:(o=Ct().m(function e(A){var t,n,o=this;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(!this.connections.has(A)){e.n=1;break}return t=this.connections.get(A),this.connectionCounts.set(A,(this.connectionCounts.get(A)||0)+1),e.a(2,t);case 1:if(!this.creatingConnections||!this.creatingConnections.has(A)){e.n=2;break}return e.a(2,new Promise(function(e){var t=function(){if(o.connections.has(A)){var n=o.connections.get(A);o.connectionCounts.set(A,(o.connectionCounts.get(A)||0)+1),e(n)}else setTimeout(t,50)};t()}));case 2:return this.creatingConnections.add(A),n=new WebSocket(A),this.connections.set(A,n),this.connectionCounts.set(A,1),n.addEventListener("open",function(e){o.creatingConnections.delete(A),o.emit("open",e,A)}),n.addEventListener("close",function(e){o.creatingConnections.delete(A),o.connections.delete(A),o.connectionCounts.delete(A),o.emit("close",e,A)}),n.addEventListener("error",function(e){o.creatingConnections.delete(A),o.emit("error",e,A)}),n.addEventListener("message",function(e){o.emit("message",e,A)}),e.a(2,n)}},e,this)}),r=function(){var e=this,A=arguments;return new Promise(function(t,n){var r=o.apply(e,A);function i(e){Qt(r,t,n,i,a,"next",e)}function a(e){Qt(r,t,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 A=this.connectionCounts.get(e)||0,t=Math.max(0,A-1);if(this.connectionCounts.set(e,t),0===t){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 A=this.connections.get(e);A&&A.readyState===WebSocket.OPEN&&A.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,A={},t=wt(this.connections.entries());try{for(t.s();!(e=t.n()).done;){var n=Bt(e.value,2),o=n[0],r=n[1];A[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(e){t.e(e)}finally{t.f()}return A}},{key:"clearAll",value:function(){var e,A=wt(this.connections.entries());try{for(A.s();!(e=A.n()).done;){var t=Bt(e.value,2),n=(t[0],t[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(e){A.e(e)}finally{A.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&Ft(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(O));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 Ht(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Dt(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Dt(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Dt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Dt(u,"constructor",c),Dt(c,"constructor",s),s.displayName="GeneratorFunction",Dt(c,o,"GeneratorFunction"),Dt(u),Dt(u,o,"Generator"),Dt(u,n,function(){return this}),Dt(u,"toString",function(){return"[object Generator]"}),(Ht=function(){return{w:r,m:d}})()}function Dt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Dt=function(e,A,t,n){function r(A,t){Dt(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Dt(e,A,t,n)}function Pt(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Ot(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kt(n.key),n)}}function Kt(e){var A=function(e){if("object"!=Tt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Tt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tt(A)?A:A+""}function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lt=function(){return!!e})()}function Mt(e){return Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mt(e)}function Rt(e,A){return Rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Rt(e,A)}var _t=function(e){function A(e){var t;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(t=function(e,A,t){return A=Mt(A),function(e,A){if(A&&("object"==Tt(A)||"function"==typeof A))return A;if(void 0!==A)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,Lt()?Reflect.construct(A,t||[],Mt(e).constructor):A.apply(e,t))}(this,A)).config=e,t.ws=null,t.isConnected=!1,t.connectionId=null,t}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&Rt(e,A)}(A,e),t=A,n=[{key:"connect",value:(r=Ht().m(function e(){var A=this;return Ht().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,t){try{A.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),A.connectResolve=e,A.connectReject=t;var n=A.config.signedUrl||A.config.websocketUrl;It.getConnection(n,A.config).then(function(t){A.ws=t,A.setupEventListeners(),t.readyState===WebSocket.OPEN&&(A.isConnected=!0,A.emit("connected"),e(),A.connectResolve=null,A.connectReject=null)}).catch(function(e){console.error("🔌 WebSocketManager: Connection failed ".concat(A.connectionId),e),t(e),A.connectResolve=null,A.connectReject=null})}catch(e){console.error("🔌 WebSocketManager: Connection error ".concat(A.connectionId),e),t(e),A.connectResolve=null,A.connectReject=null}}))},e)}),i=function(){var e=this,A=arguments;return new Promise(function(t,n){var o=r.apply(e,A);function i(e){Pt(o,t,n,i,a,"next",e)}function a(e){Pt(o,t,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 A=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!0,e.emit("connected"),e.connectResolve&&(e.connectResolve(),e.connectResolve=null,e.connectReject=null))},t=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!1,e.emit("disconnected",A))},n=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&(e.emit("error",A),e.connectReject&&(e.connectReject(A),e.connectResolve=null,e.connectReject=null))},o=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&e.handleMessage(A)};It.on("open",A),It.on("close",t),It.on("error",n),It.on("message",o),this.eventHandlers={open:A,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(It.off("open",this.eventHandlers.open),It.off("close",this.eventHandlers.close),It.off("error",this.eventHandlers.error),It.off("message",this.eventHandlers.message));var e=this.config.signedUrl||this.config.websocketUrl;e&&It.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 A=this;if(e.data instanceof ArrayBuffer)this.emit("binaryAudio",e.data);else if(e.data instanceof Blob)e.data.arrayBuffer().then(function(e){A.emit("binaryAudio",e)}).catch(function(e){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",e)});else try{var t=JSON.parse(e.data);"barge_in_ack"!==t.t&&"stop_sending"!==t.t||this.emit("bargeIn",t),"stop_playing"===t.t&&this.emit("stopPlaying",t),this.emit("message",t)}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 It.getAllConnections()}},{key:"clearAllConnections",value:function(){It.clearAll()}}],n&&Ot(t.prototype,n),o&&Ot(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(O);function Vt(e){return Vt="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},Vt(e)}function jt(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Nt(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Nt(A={},n,function(){return this}),A),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]"}),(jt=function(){return{w:r,m:d}})()}function Nt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Nt=function(e,A,t,n){function r(A,t){Nt(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Nt(e,A,t,n)}function Gt(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Wt(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Gt(r,n,o,i,a,"next",e)}function a(e){Gt(r,n,o,i,a,"throw",e)}i(void 0)})}}function zt(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xt(n.key),n)}}function Xt(e){var A=function(e){if("object"!=Vt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Vt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vt(A)?A:A+""}function Jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jt=function(){return!!e})()}function Yt(e){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yt(e)}function qt(e,A){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},qt(e,A)}var Zt=function(e){function A(e){var t;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(t=function(e,A,t){return A=Yt(A),function(e,A){if(A&&("object"==Vt(A)||"function"==typeof A))return A;if(void 0!==A)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,Jt()?Reflect.construct(A,t||[],Yt(e).constructor):A.apply(e,t))}(this,A)).config=e,t.audioContext=null,t.audioQueue=[],t.isPlaying=!1,t.isProcessingQueue=!1,t.currentSource=null,t.audioContextReady=!1,t.initializeAudioContext().catch(function(){}),t}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&qt(e,A)}(A,e),t=A,n=[{key:"initializeAudioContext",value:(i=Wt(jt().m(function e(){var A,t,n,o,r,i;return jt().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,A=this.config.sampleRate||this.config.outputSampleRate||44100,t={sampleRate:A},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(t),"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 A=this;try{var t=this.createAudioBlob(e);if(this.audioQueue.push(t),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return A.processQueue()},n)}}catch(e){this.emit("playbackError",e)}}},{key:"createAudioBlob",value:function(e){var A=new Uint8Array(e);if(A.length>=4){if(82===A[0]&&73===A[1]&&70===A[2]&&70===A[3])return new Blob([e],{type:"audio/wav"});if(255===A[0]&&!(224&~A[1]))return new Blob([e],{type:"audio/mpeg"});if(79===A[0]&&103===A[1]&&103===A[2]&&83===A[3])return new Blob([e],{type:"audio/ogg"})}return new Blob([e],{type:"audio/wav"})}},{key:"processQueue",value:(r=Wt(jt().m(function e(){var A,t,n,o,r,i,a,s,c=this;return jt().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,A=this.audioQueue.shift()){e.n=2;break}return this.isProcessingQueue=!1,e.a(2);case 2:if(e.p=2,t=!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(!t){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,A.arrayBuffer();case 8:return o=e.v,e.n=9,n.decodeAudioData(o);case 9:r=e.v,i=t&&!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=Wt(jt().m(function e(){var A;return jt().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,A=e.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",A);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&&zt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(O),$t=t(540),en=t(848);function An(e){return An="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},An(e)}function tn(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function nn(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?tn(Object(t),!0).forEach(function(A){on(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function on(e,A,t){return(A=function(e){var A=function(e){if("object"!=An(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=An(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==An(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function rn(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return an(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(an(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,an(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,an(u,"constructor",c),an(c,"constructor",s),s.displayName="GeneratorFunction",an(c,o,"GeneratorFunction"),an(u),an(u,o,"Generator"),an(u,n,function(){return this}),an(u,"toString",function(){return"[object Generator]"}),(rn=function(){return{w:r,m:d}})()}function an(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}an=function(e,A,t,n){function r(A,t){an(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},an(e,A,t,n)}function sn(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function cn(e,A){return function(e){if(Array.isArray(e))return e}(e)||function(e,A){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(e)).next,0===A){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==A);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,A)||function(e,A){if(e){if("string"==typeof e)return ln(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ln(e,A):void 0}}(e,A)||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 ln(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}const un=function(e){var A=e.signedUrl,t=e.websocketUrl,n=e.agentId,o=e.appId,r=e.voice,i=void 0===r?"default":r,a=e.language,s=void 0===a?"en":a,c=e.autoReconnect,l=void 0===c||c,u=e.agentSettingsOverride,d=void 0===u?null:u,p=e.visualAssistant,g=void 0===p?null:p,h=e.onConnected,f=e.onDisconnected,m=e.onRecordingStarted,v=e.onRecordingStopped,B=e.onPlaybackStarted,w=e.onPlaybackStopped,y=e.onError,b=e.onMessage,C=e.onBargeIn,x=e.onStopPlaying,Q=e.onStartConversation,F=e.onEndConversation,U=e.className,S=void 0===U?"":U,k=e.style,E=void 0===k?{}:k,I=e.children,T=cn((0,$t.useState)(!1),2),H=T[0],D=T[1],P=cn((0,$t.useState)(!1),2),O=P[0],K=P[1],L=cn((0,$t.useState)(!1),2),M=(L[0],L[1]),R=cn((0,$t.useState)("Disconnected"),2),_=(R[0],R[1]),V=(0,$t.useRef)(null);(0,$t.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||A)),V.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),V.current.destroy(),V.current=null);var e=new ot({signedUrl:t||A,websocketUrl:t||A,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,visualAssistant:g,onStartConversation:Q,onEndConversation:F});return e.on("connected",function(){D(!0),_("Connected"),null==h||h()}),e.on("disconnected",function(){D(!1),_("Disconnected"),null==f||f()}),e.on("recordingStarted",function(){K(!0),null==m||m()}),e.on("recordingStopped",function(){K(!1),null==v||v()}),e.on("playbackStarted",function(){M(!0),null==B||B()}),e.on("playbackStopped",function(){M(!1),null==w||w()}),e.on("error",function(e){null==y||y(e)}),e.on("message",function(e){null==b||b(e)}),e.on("bargeIn",function(e){null==C||C(e)}),e.on("stopPlaying",function(e){null==x||x(e)}),V.current=e,e.connect(),function(){var e=A||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(e)),V.current&&(V.current.destroy(),V.current=null)}},[A,t,n,o,i,s,d,g]);var j=function(){var e,A=(e=rn().m(function e(){var A;return rn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(V.current){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,V.current.toggleRecording();case 2:e.n=4;break;case 3:e.p=3,A=e.v,console.error("Error toggling recording:",A);case 4:return e.a(2)}},e,null,[[1,3]])}),function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){sn(r,n,o,i,a,"next",e)}function a(e){sn(r,n,o,i,a,"throw",e)}i(void 0)})});return function(){return A.apply(this,arguments)}}(),N=(0,en.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,en.jsx)("div",{style:{fontSize:"20px"},children:O?"🔴":"🎤"}),(0,en.jsx)("div",{children:O?"Stop Listening":"Start Listening"})]});return(0,en.jsx)("button",{className:"voice-button ".concat(O?"recording":""," ").concat(S),style:nn({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:O?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},E),onClick:j,disabled:!H,children:I||N})};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(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return gn(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(gn(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,gn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,gn(u,"constructor",c),gn(c,"constructor",s),s.displayName="GeneratorFunction",gn(c,o,"GeneratorFunction"),gn(u),gn(u,o,"Generator"),gn(u,n,function(){return this}),gn(u,"toString",function(){return"[object Generator]"}),(pn=function(){return{w:r,m:d}})()}function gn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}gn=function(e,A,t,n){function r(A,t){gn(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},gn(e,A,t,n)}function hn(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function fn(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){hn(r,n,o,i,a,"next",e)}function a(e){hn(r,n,o,i,a,"throw",e)}i(void 0)})}}function mn(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function vn(e,A,t){return(A=wn(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function Bn(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wn(n.key),n)}}function wn(e){var A=function(e){if("object"!=dn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=dn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dn(A)?A:A+""}var yn=function(){return e=function e(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=function(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?mn(Object(t),!0).forEach(function(A){vn(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mn(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}({websocketUrl:A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,voice:A.voice||"default",language:A.language||"en",container:A.container||document.body,buttonText:A.buttonText||"Start Listening",buttonClass:A.buttonClass||"voice-button"},A),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1;var t=this.options.websocketUrl||this.options.signedUrl;this.voiceSDK=new ot({signedUrl:t,websocketUrl:t,agentId:this.options.agentId,appId:this.options.appId,voice:this.options.voice,language:this.options.language,visualAssistant:this.options.visualAssistant}),this.setupEventListeners(),this.createButton(),this.connect()},A=[{key:"setupEventListeners",value:function(){var e=this;this.voiceSDK.on("connected",function(){var A,t;e.isConnected=!0,e.updateButton(),null===(A=(t=e.options).onConnected)||void 0===A||A.call(t)}),this.voiceSDK.on("disconnected",function(){var A,t;e.isConnected=!1,e.updateButton(),null===(A=(t=e.options).onDisconnected)||void 0===A||A.call(t)}),this.voiceSDK.on("recordingStarted",function(){var A,t;e.isRecording=!0,e.updateButton(),null===(A=(t=e.options).onRecordingStarted)||void 0===A||A.call(t)}),this.voiceSDK.on("recordingStopped",function(){var A,t;e.isRecording=!1,e.updateButton(),null===(A=(t=e.options).onRecordingStopped)||void 0===A||A.call(t)}),this.voiceSDK.on("playbackStarted",function(){var A,t;e.isPlaying=!0,null===(A=(t=e.options).onPlaybackStarted)||void 0===A||A.call(t)}),this.voiceSDK.on("playbackStopped",function(){var A,t;e.isPlaying=!1,null===(A=(t=e.options).onPlaybackStopped)||void 0===A||A.call(t)}),this.voiceSDK.on("error",function(A){var t,n;null===(t=(n=e.options).onError)||void 0===t||t.call(n,A)}),this.voiceSDK.on("message",function(A){var t,n;null===(t=(n=e.options).onMessage)||void 0===t||t.call(n,A)}),this.voiceSDK.on("bargeIn",function(A){var t,n;null===(t=(n=e.options).onBargeIn)||void 0===t||t.call(n,A)}),this.voiceSDK.on("stopPlaying",function(A){var t,n;null===(t=(n=e.options).onStopPlaying)||void 0===t||t.call(n,A)})}},{key:"createButton",value:function(){var e=this;this.button=document.createElement("button"),this.button.className=this.options.buttonClass,this.button.style.cssText="\n padding: 12px 24px;\n border: none;\n border-radius: 8px;\n background-color: #6c757d;\n color: white;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 8px;\n ",this.button.addEventListener("click",function(){return e.toggleRecording()}),this.options.container.appendChild(this.button),this.updateButton()}},{key:"updateButton",value:function(){if(this.button){var e=this.isRecording?"🔴":"🎤",A=this.isRecording?"Stop Listening":"Start Listening";this.button.innerHTML='\n <span style="font-size: 20px;">'.concat(e,"</span>\n <span>").concat(A,"</span>\n "),this.button.disabled=!this.isConnected,this.button.style.backgroundColor=this.isRecording?"#dc3545":this.isConnected?"#007bff":"#6c757d"}}},{key:"connect",value:(n=fn(pn().m(function e(){var A;return pn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.voiceSDK.connect();case 1:e.n=3;break;case 2:e.p=2,A=e.v,console.error("Failed to connect:",A);case 3:return e.a(2)}},e,this,[[0,2]])})),function(){return n.apply(this,arguments)})},{key:"toggleRecording",value:(t=fn(pn().m(function e(){var A;return pn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.voiceSDK){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,this.voiceSDK.toggleRecording();case 2:e.n=4;break;case 3:e.p=3,A=e.v,console.error("Error toggling recording:",A);case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"getStatus",value:function(){return{isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying}}},{key:"updateConfig",value:function(e){this.voiceSDK.updateConfig(e)}},{key:"destroy",value:function(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}],A&&Bn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function bn(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Cn(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Cn(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Cn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Cn(u,"constructor",c),Cn(c,"constructor",s),s.displayName="GeneratorFunction",Cn(c,o,"GeneratorFunction"),Cn(u),Cn(u,o,"Generator"),Cn(u,n,function(){return this}),Cn(u,"toString",function(){return"[object Generator]"}),(bn=function(){return{w:r,m:d}})()}function Cn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Cn=function(e,A,t,n){function r(A,t){Cn(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Cn(e,A,t,n)}function xn(e,A){return function(e){if(Array.isArray(e))return e}(e)||function(e,A){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(e)).next,0===A){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==A);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,A)||Fn(e,A)||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 Qn(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Fn(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Fn(e,A){if(e){if("string"==typeof e)return Un(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Un(e,A):void 0}}function Un(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}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 kn(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function En(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){kn(r,n,o,i,a,"next",e)}function a(e){kn(r,n,o,i,a,"throw",e)}i(void 0)})}}function In(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Sn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Sn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sn(A)?A:A+""}var Hn=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("🚀 AgentSDK v2.1.8 initialized with config:",A),this.config=A,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=A.onConversationStart||function(){},this.onConversationEnd=A.onConversationEnd||function(){},this.onBargeIn=A.onBargeIn||function(){},this.onAudioStartPlaying=A.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=A.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=A.onSubtitleDisplay||function(){}},A=[{key:"checkResumeBeforeConnect",value:function(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var e,A=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant),t=new ot({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:A,protocolVersion:2}).checkAndResume();return this._resumeChecked=!0,t?(console.log("🔄 [AGENT SDK] Found resume state before connect:",t),this._resumeInfo=t,t):(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=En(bn().m(function e(A){var t,n,o,r,i,a,s,c,l=this;return bn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,A){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===(t=this.config.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant),this.voiceSDK=new ot({signedUrl:A,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 A=new Error("DOMAIN_NOT_WHITELISTED");A.reason=e.reason,A.code=e.code,l.onError(A)}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()}),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!",Sn(l.onTranscript))),l.onSubtitleDisplay(e)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=Qn(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=xn(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:(t=En(bn().m(function e(){var A;return bn().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,!(A=e.v).isServerRejection&&"ServerRejected"!==A.name){e.n=4;break}throw A;case 4:throw console.error("❌ AgentSDK: Failed to start recording:",A),A;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 t.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,A){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(e,A);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(e,A),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 A;return this.voiceSDK?this.voiceSDK.hasToolHandler(e):(null===(A=this._pendingToolHandlers)||void 0===A?void 0:A.has(e))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],A&&In(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function Dn(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Pn(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Pn(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Pn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Pn(u,"constructor",c),Pn(c,"constructor",s),s.displayName="GeneratorFunction",Pn(c,o,"GeneratorFunction"),Pn(u),Pn(u,o,"Generator"),Pn(u,n,function(){return this}),Pn(u,"toString",function(){return"[object Generator]"}),(Dn=function(){return{w:r,m:d}})()}function Pn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Pn=function(e,A,t,n){function r(A,t){Pn(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Pn(e,A,t,n)}function On(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Kn(){var e=navigator.userAgent,A=/iPad|iPhone|iPod/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,t=/Android/.test(e),n=/Mac/.test(e)&&!A,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";A?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return A?u="ios":t?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:A,isAndroid:t,isMac:n,isWindows:o,isMobile:A||t,isDesktop:!A&&!t}}function Ln(){return Mn.apply(this,arguments)}function Mn(){var e;return e=Dn().m(function e(){var A;return Dn().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 A=e.v,e.a(2,A.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]])}),Mn=function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){On(r,n,o,i,a,"next",e)}function a(e){On(r,n,o,i,a,"throw",e)}i(void 0)})},Mn.apply(this,arguments)}function Rn(e){var A=e.platform,t=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"===A?n.ios:"android"===A?n["android_".concat(t)]||n.android_chrome:n["desktop_".concat(t)]||n.desktop_chrome}function _n(e){var A=e.isIOS,t=e.isAndroid,n=e.browser;if(A)try{return window.location.href="app-settings:",!0}catch(e){return console.warn("Could not open iOS settings:",e),!1}if(t&&"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 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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Vn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Vn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vn(A)?A:A+""}function Gn(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return Wn(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Wn(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Wn(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}var zn=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.overlay=null,this.modal=null},(A=[{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)}}])&&jn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Xn(e,A){var t=new zn,n=t.createOverlay(),o=Kn(),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),t.overlay=n,t.modal=r,r.querySelector('[data-action="accept"]').addEventListener("click",function(){t.close(),e()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){t.close(),A()}),n.addEventListener("click",function(e){e.target===n&&(t.close(),A())}),t.show(),t}function Jn(e,A){var t,n,o,r=new zn,i=r.createOverlay(),a=Kn(),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 A,t=e.platform,n=e.browser,o=document.getElementsByTagName("script"),r="",i=Gn(o);try{for(i.s();!(A=i.n()).done;){var a=A.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"===t?"ios-settings.svg":"android"===t?"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=Gn(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 g=window.location.pathname.split("/");g.pop(),(r=window.location.origin+g.join("/"))&&r!==window.location.origin||(r=window.location.origin)}}r=r.replace(/\/$/,"");var h="".concat(r,"/shared/mic-permission-assets/").concat(c);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",h,"Base path:",r,"Platform:",t,"Browser:",n),h}(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===(t=c.querySelector('[data-action="close"]'))||void 0===t||t.addEventListener("click",function(){r.close(),e()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){_n(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(),Kn();var A,t=document.getElementsByTagName("script"),n="",o=Gn(t);try{for(o.s();!(A=o.n()).done;){var r=A.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=Gn(t);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 g=document.createElement("div");g.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 h=document.createElement("div");h.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(){h.style.display="none"},h.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),g.appendChild(h),g.appendChild(m),g.appendChild(B),p.appendChild(g),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 g=p.nextElementSibling;g&&(g.style.display="none",p.addEventListener("click",function(){"none"===g.style.display?(g.style.display="block",p.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(g.style.display="none",p.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(A){A.target===i&&(r.close(),e())}),r.show(),r}function Yn(e){var A=new zn,t=A.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 ',t.appendChild(n),A.overlay=t,A.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){A.close(),e()}),t.addEventListener("click",function(n){n.target===t&&(A.close(),e())}),A.show(),A}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 Zn(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$n(n.key),n)}}function $n(e){var A=function(e){if("object"!=qn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=qn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qn(A)?A:A+""}var eo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config},(A=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"getText",value:function(e,A){return this.voiceInterface.getText(e,A)}},{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,A){return'<div class="mobile-waveform-bar" data-index="'.concat(A,'"></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>')}}])&&Zn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Ao(e){return Ao="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},Ao(e)}function to(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,no(n.key),n)}}function no(e){var A=function(e){if("object"!=Ao(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Ao(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ao(A)?A:A+""}var oo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config},(A=[{key:"generateCSS",value:function(){var e,A=this.config.avatarBackgroundColor||"#667eea",t=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",g=this.config.controlButtonSecondaryColor||"#64748b",h=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(A," 0%, ").concat(t," 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(g).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;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 5px 10px;\n background: rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 11px;\n color: #64748b;\n margin: 0 auto;\n }\n \n .desktop-timer .timer-dot {\n width: 5px;\n height: 5px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\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(A," 0%, ").concat(t,' 100%) !important;\n }\n \n .desktop-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: 36px;\n width: 100%;\n }\n \n .desktop-waveform-bar {\n width: 4px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 2px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .desktop-waveform-bar[data-index="0"] { height: 14px; animation-delay: 0s; }\n .desktop-waveform-bar[data-index="1"] { height: 26px; animation-delay: 0.1s; }\n .desktop-waveform-bar[data-index="2"] { height: 36px; animation-delay: 0.2s; }\n .desktop-waveform-bar[data-index="3"] { height: 22px; animation-delay: 0.3s; }\n .desktop-waveform-bar[data-index="4"] { height: 16px; animation-delay: 0.4s; }\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;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n width: 100%;\n max-width: 200px;\n margin: 0 auto;\n padding: 0 20px;\n }\n\n .desktop-main-waveform .waveform-bar {\n width: 3px;\n background: #a855f7;\n border-radius: 2px;\n height: 8px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n\n .desktop-main-waveform .waveform-bar:nth-child(1) { height: 12px; animation-delay: 0s; }\n .desktop-main-waveform .waveform-bar:nth-child(2) { height: 20px; animation-delay: 0.05s; }\n .desktop-main-waveform .waveform-bar:nth-child(3) { height: 28px; animation-delay: 0.1s; }\n .desktop-main-waveform .waveform-bar:nth-child(4) { height: 36px; animation-delay: 0.15s; }\n .desktop-main-waveform .waveform-bar:nth-child(5) { height: 44px; animation-delay: 0.2s; }\n .desktop-main-waveform .waveform-bar:nth-child(6) { height: 50px; animation-delay: 0.25s; }\n .desktop-main-waveform .waveform-bar:nth-child(7) { height: 54px; animation-delay: 0.3s; }\n .desktop-main-waveform .waveform-bar:nth-child(8) { height: 56px; animation-delay: 0.35s; }\n .desktop-main-waveform .waveform-bar:nth-child(9) { height: 54px; animation-delay: 0.4s; }\n .desktop-main-waveform .waveform-bar:nth-child(10) { height: 50px; animation-delay: 0.45s; }\n .desktop-main-waveform .waveform-bar:nth-child(11) { height: 44px; animation-delay: 0.5s; }\n .desktop-main-waveform .waveform-bar:nth-child(12) { height: 36px; animation-delay: 0.55s; }\n .desktop-main-waveform .waveform-bar:nth-child(13) { height: 28px; animation-delay: 0.6s; }\n .desktop-main-waveform .waveform-bar:nth-child(14) { height: 20px; animation-delay: 0.65s; }\n .desktop-main-waveform .waveform-bar:nth-child(15) { height: 12px; animation-delay: 0.7s; }\n\n .desktop-status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n font-size: 12px;\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;\n height: 5px;\n background: ").concat(r,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\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(A,", ").concat(t,");\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;\n align-items: center;\n justify-content: center;\n gap: 2px;\n height: 100%;\n width: 100%;\n padding: 4px;\n transform: scale(0.75);\n transform-origin: center;\n }\n \n /* Ensure waveform bars are visible and animated in compact mode */\n .compact-avatar .desktop-main-waveform .waveform-bar {\n width: 2px;\n min-width: 2px;\n background: #a855f7;\n border-radius: 1px;\n flex-shrink: 0;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(1) { height: 6px; animation-delay: 0s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(2) { height: 10px; animation-delay: 0.05s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(3) { height: 14px; animation-delay: 0.1s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(4) { height: 18px; animation-delay: 0.15s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(5) { height: 22px; animation-delay: 0.2s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(6) { height: 26px; animation-delay: 0.25s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(7) { height: 28px; animation-delay: 0.3s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(8) { height: 30px; animation-delay: 0.35s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(9) { height: 28px; animation-delay: 0.4s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(10) { height: 26px; animation-delay: 0.45s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(11) { height: 22px; animation-delay: 0.5s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(12) { height: 18px; animation-delay: 0.55s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(13) { height: 14px; animation-delay: 0.6s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(14) { height: 10px; animation-delay: 0.65s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(15) { height: 6px; animation-delay: 0.7s; }\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;\n height: 6px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\n }\n \n .compact-status {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: ").concat(n,";\n }\n \n .compact-status .status-dot {\n width: 5px;\n height: 5px;\n background: ").concat(r,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\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(h).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(h).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(A," !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 ")}},{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 ")}}])&&to(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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 io(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function ao(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,so(n.key),n)}}function so(e){var A=function(e){if("object"!=ro(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ro(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ro(A)?A:A+""}var co=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.conversationMessages=[],this.currentLiveMessage=null},(A=[{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 A=document.getElementById("mobileTranscriptText");A&&(A.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 t=document.getElementById("mobileMessagesContainer");if(t){var n=t.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"),A=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),t=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"),A&&A.classList.add("expanded"),t&&(t.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"),A&&A.classList.remove("expanded"),t&&(t.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,A){if(!this.voiceInterface.isMobile&&A&&A.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==e)return this.currentLiveMessage={role:e,content:A},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:e,content:A}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}},{key:"updateLiveMessageRow",value:function(){var e=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),A=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),t=null==e?void 0:e.querySelector(".message-avatar");if(e&&A)if(this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()){t&&("user"===this.currentLiveMessage.role?(t.textContent="U",t.className="message-avatar user"):(t.innerHTML='<div class="orb"></div>',t.className="message-avatar assistant")),A.textContent=this.currentLiveMessage.content,e.style.display="flex";var n=A.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",A.querySelector(".typing-cursor")||A.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,A=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(A){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(A.innerHTML="");var t=function(e){return function(e){if(Array.isArray(e))return io(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,A){if(e){if("string"==typeof e)return io(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?io(e,A):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&&t.length>0){var n=t[t.length-1];n.role===this.currentLiveMessage.role&&n.content===this.currentLiveMessage.content&&(t=t.slice(0,-1))}console.log("📝 [TRANSCRIPT] Rendering",t.length,"messages (live message excluded)"),A.innerHTML=t.map(function(A){var t="user"===A.role;return'\n <div class="message-row '.concat(A.role,'">\n <div class="message-avatar ').concat(A.role,'">\n ').concat(t?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(e.escapeHtml(A.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")}}])&&ao(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function lo(e){return lo="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},lo(e)}function uo(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,po(n.key),n)}}function po(e){var A=function(e){if("object"!=lo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=lo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lo(A)?A:A+""}var go=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null},A=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"setupTextInjectAckHandler",value:function(){var e,A=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){A.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 A,t;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!==(A=n.value)&&void 0!==A&&A.trim()));var r=document.getElementById("mobileTextInput"),i=document.getElementById("mobileSendBtn");if(r&&(r.disabled=!1),i&&(i.disabled=!(null!=r&&null!==(t=r.value)&&void 0!==t&&t.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"),A=this.shadowRoot.getElementById("voiceSendBtn");if(e&&A){var t=e.value.trim();t&&this._sendTextMessage(t,e,A,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}},{key:"sendMobileTextMessage",value:function(){var e=document.getElementById("mobileTextInput"),A=document.getElementById("mobileSendBtn");e&&A?this._sendTextMessage(e.value,e,A,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}},{key:"_sendTextMessage",value:function(e,A,t,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){A.value="",t&&(t.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,A.disabled=!1,t&&(t.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 A.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(e){console.error("Error sending text message:",e),A.disabled=!1,t&&(t.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,A,t){"mobile"===e?this.showMobileTextInputStatus(A,t):this.showDesktopTextInputStatus(A,t)}},{key:"showDesktopTextInputStatus",value:function(e,A){var t=this.shadowRoot.querySelector(".voice-input-hint");t&&(this._originalHintText||(this._originalHintText=t.textContent),t.classList.remove("voice-input-hint--sending","voice-input-hint--success","voice-input-hint--queued","voice-input-hint--error"),"sending"===e?(t.classList.add("voice-input-hint--sending"),t.textContent=A||"Sending..."):"success"===e?(t.classList.add("voice-input-hint--success"),t.textContent=A||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===e?(t.classList.add("voice-input-hint--queued"),t.textContent=A||"Queued"):"error"===e?(t.classList.add("voice-input-hint--error"),t.textContent=A||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===e&&(t.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}},{key:"showMobileTextInputStatus",value:function(e,A){var t=document.querySelector(".mobile-input-hint");t&&(this._originalMobileHintText||(this._originalMobileHintText=t.textContent),t.classList.remove("mobile-input-hint--sending","mobile-input-hint--success","mobile-input-hint--queued","mobile-input-hint--error"),"sending"===e?(t.classList.add("mobile-input-hint--sending"),t.textContent=A||"Sending..."):"success"===e?(t.classList.add("mobile-input-hint--success"),t.textContent=A||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===e?(t.classList.add("mobile-input-hint--queued"),t.textContent=A||"Queued"):"error"===e?(t.classList.add("mobile-input-hint--error"),t.textContent=A||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===e&&(t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}},{key:"clearTextInputStatusAfterDelay",value:function(){var e=this,A=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},A)}},{key:"clearMobileTextInputStatusAfterDelay",value:function(){var e=this,A=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},A)}}],A&&uo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function ho(e){return ho="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},ho(e)}function fo(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=ho(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ho(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ho(A)?A:A+""}var vo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot},A=[{key:"setupEventHandlers",value:function(e){var A=this,t=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(t&&(t.onclick=function(){return A.voiceInterface.startVoiceCall()}),n&&(n.onclick=function(){return A.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){return A.voiceInterface.toggleMute()}),r&&(r.onclick=function(){return A.voiceInterface.toggleSpeaker()}),i&&(i.onclick=function(){return A.voiceInterface.endVoiceCall()}),a&&(a.onclick=function(){return A.voiceInterface.toggleMute()}),s&&(s.onclick=function(){return A.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(){A.voiceInterface.sendDesktopTextMessage()});var u=this.shadowRoot.getElementById("conversationHeader");u&&u.addEventListener("click",function(){A.voiceInterface.transcript.toggleConversationPanel()})}}},{key:"setupMobileEventHandlers",value:function(){var e=this;if(this.voiceInterface.isMobile){var A=document.getElementById("mobileMuteBtn"),t=document.getElementById("mobileSpeakerBtn"),n=document.getElementById("mobileEndCallBtn"),o=document.getElementById("mobileTranscriptRow"),r=document.getElementById("mobileCloseTranscriptBtn"),i=document.getElementById("mobileTextInput"),a=document.getElementById("mobileSendBtn");A&&(A.onclick=function(){return e.voiceInterface.toggleMute()}),t&&(t.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()})}}}],A&&fo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Bo(e){return Bo="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},Bo(e)}function wo(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yo(n.key),n)}}function yo(e){var A=function(e){if("object"!=Bo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Bo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bo(A)?A:A+""}var bo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._liveWaveformInterval=null},(A=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"adjustSizesForContainer",value:function(){var e=this.shadowRoot.getElementById("voiceInterface");if(e){var A,t,n,o,r,i,a=e.clientHeight||e.offsetHeight||400,s=e.clientWidth||e.offsetWidth||400;a<=350?(A=80,t=80,n=48,o=54,r=6,i=12):a<=450?(A=100,t=100,n=56,o=62,r=8,i=14):a<=550?(A=120,t=120,n=64,o=70,r=10,i=16):a<=700?(A=140,t=140,n=72,o=78,r=12,i=18):(A=160,t=160,n=80,o=86,r=14,i=20);var c=this.shadowRoot.querySelector(".voice-avatar, .voice-avatar-active");c&&(c.style.width="".concat(A,"px"),c.style.height="".concat(A,"px"),c.style.fontSize="".concat(.5*A,"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(t,"px"),d.style.maxHeight="".concat(t,"px"),d.style.height="".concat(t,"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 g=this.shadowRoot.querySelector(".transcript-text");g&&(g.style.fontSize="".concat(Math.max(10,i-2),"px"));var h=this.shadowRoot.querySelector(".voice-text-input-area");if(h){var f=h.querySelector(".voice-input-wrapper"),m=h.querySelector(".voice-text-input"),v=h.querySelector(".voice-send-btn"),B=h.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 A=e.querySelector("svg");if(A){var t=.65*n;A.style.setProperty("width","".concat(t,"px"),"important"),A.style.setProperty("height","".concat(t,"px"),"important"),A.style.setProperty("min-width","".concat(t,"px"),"important"),A.style.setProperty("min-height","".concat(t,"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 A;A=this.config.statusText||(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected")),e.textContent=A;var t=this.shadowRoot.getElementById("desktopStatusText");t&&t!==e&&(t.textContent=A)}}}},{key:"updateLiveWaveform",value:function(e){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopLiveWaveform");A&&A.querySelectorAll(".desktop-live-bar").forEach(function(A,t){if(e){var n=40*Math.random()+8;A.style.height="".concat(n,"px")}else A.style.height="8px"})}}},{key:"showError",value:function(e){var A=this.shadowRoot.getElementById("transcriptText");A&&(A.textContent="".concat(this.t("error"),": ").concat(e),A.classList.remove("empty"))}},{key:"showDomainError",value:function(){var e=this;console.log("🚫 Showing domain error in widget UI...");var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.querySelector("#startCallBtn"),r=this.t("domainNotValidated"),i=this.t("domainErrorMessage");console.log("🚫 Domain error title:",r),console.log("🚫 Domain error message:",i),t?(t.textContent=r,t.style.color="#991B1B",t.style.fontSize="20px",t.style.fontWeight="600",t.style.marginLeft="20px",t.style.marginRight="20px",t.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=A.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=A.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(a,s.nextSibling):n&&n.parentNode?n.parentNode.insertBefore(a,n.nextSibling):A.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")}A.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"),A=this.shadowRoot.getElementById("liveTextCollapsed");if(e){var t=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=t,t&&""!==t.trim()||e.classList.add("empty"))},5e3)}else if(A){var o=A.textContent;A.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(){A&&(A.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()}}])&&wo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Co(e){return Co="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},Co(e)}function xo(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qo(n.key),n)}}function Qo(e){var A=function(e){if("object"!=Co(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Co(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Co(A)?A:A+""}var Fo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])},(A=[{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 A=document.createElement("style");A.id="mobile-voice-call-bar-styles",A.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(A)}var t=document.createElement("div");t.id="mobile-voice-call-bar-container",t.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,A){return'<div class="mobile-waveform-bar" data-index="'.concat(A,'"></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(t);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 A=document.getElementById("mobileTextInput");A&&setTimeout(function(){return A.focus()},100);var t=document.getElementById("mobileMessagesContainer");t&&setTimeout(function(){t.scrollTop=t.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 A=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(A||t){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"),A&&(A.textContent=r),t&&(t.textContent=r),n&&(n.style.backgroundColor=i,n.style.boxShadow="paused"===e?"none":"0 0 8px ".concat(i))}}},{key:"addMobileMessage",value:function(e,A){this.voiceInterface.messages.push({type:e,text:A});var t=document.getElementById("mobileMessagesContainer");if(t){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(e),n.textContent=A,t.appendChild(n),t.scrollTop=t.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,A){var t=60*Math.random()+10;e.style.height="".concat(t,"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=[]}}])&&xo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Uo(e){return Uo="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},Uo(e)}function So(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return ko(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(ko(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ko(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,ko(u,"constructor",c),ko(c,"constructor",s),s.displayName="GeneratorFunction",ko(c,o,"GeneratorFunction"),ko(u),ko(u,o,"Generator"),ko(u,n,function(){return this}),ko(u,"toString",function(){return"[object Generator]"}),(So=function(){return{w:r,m:d}})()}function ko(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ko=function(e,A,t,n){function r(A,t){ko(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},ko(e,A,t,n)}function Eo(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Io(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Eo(r,n,o,i,a,"next",e)}function a(e){Eo(r,n,o,i,a,"throw",e)}i(void 0)})}}function To(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ho(n.key),n)}}function Ho(e){var A=function(e){if("object"!=Uo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Uo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uo(A)?A:A+""}var Do=function(){return e=function e(A){var t;!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=A,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=A.shadowRoot||document,this.textSDK=A.textSDK||null,this.deviceInfo=Kn(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=A.visualAssistant||(null===(t=A.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);this.sdk=new Hn({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,visualAssistant:n,variables:A.variables||{},language:A.language||"en",outputContainer:A.outputContainer,outputEncoding:A.outputEncoding,outputSampleRate:A.outputSampleRate,outputChannels:A.outputChannels,outputBitDepth:A.outputBitDepth,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay}),this.templates=new eo(this),this.styles=new oo(this),this.transcript=new co(this),this.textHandlers=new go(this),this.handlers=new vo(this),this.desktop=new bo(this),this.mobile=new Fo(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()},A=[{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(A){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",A),e.updateTranscript(A)},this.sdk.onAgentSpeaking=function(A){var t=e.shadowRoot.getElementById("voiceAvatarActive");t&&(A?(t.classList.add("speaking"),e.isMobile?(e.updateMobileStatus("speaking"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())):(t.classList.remove("speaking"),e.isMobile?(e.updateMobileStatus("listening"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var A=Io(So().m(function A(t){return So().w(function(A){for(;;)switch(A.n){case 0:if(console.log("🔌 WebSocket disconnected, hanging up call..."),!t||!(1008===t.code&&t.reason&&(t.reason.includes("Domain not whitelisted")||t.reason.includes("domain")||t.reason.includes("whitelist"))||1008===t.code&&t.reason&&t.reason.includes("localhost"))){A.n=2;break}return console.error("❌ Domain not whitelisted - WebSocket closed:",t.code,t.reason),A.n=1,e.endCallOnServerRejection();case 1:A.n=3;break;case 2:e.isActive&&(e.isActive=!1,e.endVoiceCall());case 3:return A.a(2)}},A)}));return function(e){return A.apply(this,arguments)}}(),this.sdk.onError=function(){var A=Io(So().m(function A(t){return So().w(function(A){for(;;)switch(A.n){case 0:if(!t||!("DOMAIN_NOT_WHITELISTED"===t.message||t.message&&t.message.includes("Domain not whitelisted"))){A.n=2;break}return console.error("❌ Voice SDK Error: Domain not whitelisted:",t),A.n=1,e.endCallOnServerRejection();case 1:return A.a(2);case 2:if(!t.isServerRejection&&"ServerRejected"!==t.name){A.n=3;break}return A.a(2);case 3:console.error("❌ Voice SDK Error:",t),e.showError(t.message||t);case 4:return A.a(2)}},A)}));return function(e){return A.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 A,t,n=this.config.language||"en";return((null===(A=this.config.translations)||void 0===A?void 0:A[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[e]||e}},{key:"getText",value:function(e,A){return void 0!==this.config[e]&&null!==this.config[e]?this.config[e]:this.t(A)}},{key:"getTooltip",value:function(e){var A,t=null===(A=this.config.tooltips)||void 0===A?void 0:A[e];return null!=t?t:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[e]||""}},{key:"_updateTimerElements",value:function(e,A){var t=this.shadowRoot.getElementById("voiceTimer");t&&(t.textContent=e);var n=this.shadowRoot.getElementById("desktopTimerText"),o=this.shadowRoot.getElementById("compactTimerText");if(n&&(n.textContent=e),o&&(o.textContent=e),!o&&!n&&A<2e3){console.warn("⚠️ Timer elements not found - compactTimerText:",!!o,"desktopTimerText:",!!n,"elapsed:",A);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){return 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=Io(So().m(function e(){var A,t=this;return So().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,Ln();case 2:if(A=e.v,console.log("📋 Current permission state: ".concat(A)),"denied"!==A){e.n=3;break}throw console.log("🚫 Permission is denied, showing blocked modal..."),this.resetConnectingState(),Kn(),Jn(function(){console.log("Blocked modal closed")}),new Error("Microphone permission denied");case 3:if("prompt"!==A&&"unknown"!==A){e.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),e.a(2,new Promise(function(e,A){Xn(Io(So().m(function n(){var o;return So().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,t.proceedWithVoiceCall();case 2:e(),n.n=4;break;case 3:n.p=3,o=n.v,A(o);case 4:return n.a(2)}},n,null,[[1,3]])})),function(){console.log("❌ Pre-prompt cancelled"),t.resetConnectingState(),A(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=Io(So().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,L,M,R,_,V,j,N,G,W=this;return So().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,A=this.shadowRoot.getElementById("desktopConversationPanel"),t=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"),A&&(A.classList.remove("expanded"),A.classList.add("collapsed")),t&&t.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="":(g=document.getElementById("text-chat-button"))&&(g.style.display=""),(h=this.shadowRoot.getElementById("voiceIdleState"))&&(h.style.display="flex"),(f=this.shadowRoot.getElementById("text-chat-panel"))?f.style.display="":(m=document.getElementById("text-chat-panel"))&&(m.style.display=""),Kn(),Jn(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 this.isMobile&&this.updateMobileStatus("listening"),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..."),this.isMobile&&this.updateMobileStatus("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.updateMobileStatus("listening")):(this.startDesktopWaveformAnimation(),this.updateDesktopStatus(),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,A=Math.floor(e/6e4),t=Math.floor(e%6e4/1e3),n="".concat(A.toString().padStart(2,"0"),":").concat(t.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.updateMobileStatus("listening")):(this.startDesktopWaveformAnimation(),this.updateDesktopStatus(),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=""),(L=this.shadowRoot.getElementById("text-chat-button"))?L.style.display="":(M=document.getElementById("text-chat-button"))&&(M.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,A=Math.floor(e/6e4),t=Math.floor(e%6e4/1e3),n="".concat(A.toString().padStart(2,"0"),":").concat(t.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}Kn(),Jn(function(){W.resetUIState()}),e.n=44;break;case 40:if("NotFoundError"!==G.name&&"DevicesNotFoundError"!==G.name){e.n=41;break}Yn(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 A=document.getElementById("text-chat-panel");A&&(A.style.display="")}}var t=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState");t&&(t.style.display="flex"),n&&(n.style.display="none")}},{key:"endCallOnServerRejection",value:(t=Io(So().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m;return So().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"),A=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("landingScreen"),A&&(A.classList.add("active"),console.log("✅ Made voice interface visible")),t&&(t.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,g=e.v,console.warn("Error calling stopRecording:",g);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,h=e.v,console.warn("Error calling stopListening:",h);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 t.apply(this,arguments)})},{key:"endVoiceCall",value:function(){var e,A=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 t=this.shadowRoot.getElementById("text-chat-panel");if(t)t.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 A.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(){var e=this.shadowRoot.getElementById("voiceIdleState"),A=this.shadowRoot.getElementById("voiceActiveState");if(e){var t=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(t&&(t.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"}A&&(A.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 A=e.querySelector("#domainErrorBackBtn");A&&A.parentNode&&A.parentNode.removeChild(A);var t=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(t&&(t.textContent=this.getText("startCallTitle","clickToStartCall"),t.style.color="",t.style.fontSize="",t.style.fontWeight="",t.style.marginLeft="",t.style.marginRight="",t.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,A){return this.transcript.addConversationMessage(e,A)}},{key:"renderConversationMessages",value:function(){return this.transcript.renderConversationMessages()}},{key:"escapeHtml",value:function(e){var A=document.createElement("div");return A.textContent=e,A.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 A=this.shadowRoot.getElementById("desktopMuteBtn"),t=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),A){var n=A.querySelector(".desktop-mic-icon"),o=A.querySelector(".desktop-mic-off-icon");n&&o&&(e.enabled?(A.classList.remove("muted"),n.style.display="block",o.style.display="none"):(A.classList.add("muted"),n.style.display="none",o.style.display="block"))}if(t){var r=t.querySelector(".desktop-mic-icon"),i=t.querySelector(".desktop-mic-off-icon");r&&i&&(e.enabled?(t.classList.remove("muted"),r.style.display="block",i.style.display="none"):(t.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"),A=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(e){var t=e.querySelector(".desktop-speaker-icon"),n=e.querySelector(".desktop-speaker-off-icon");t&&n&&(this.isSpeakerMuted?(e.classList.add("muted"),t.style.display="none",n.style.display="block"):(e.classList.remove("muted"),t.style.display="block",n.style.display="none"))}if(A){var o=A.querySelector(".desktop-speaker-icon"),r=A.querySelector(".desktop-speaker-off-icon");o&&r&&(this.isSpeakerMuted?(A.classList.add("muted"),o.style.display="none",r.style.display="block"):(A.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,A){return this.mobile.addMobileMessage(e,A)}},{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)}}],A&&To(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n,o}();function Po(e){return Po="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},Po(e)}function Oo(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ko(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Ko(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ko(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ko(u,"constructor",c),Ko(c,"constructor",s),s.displayName="GeneratorFunction",Ko(c,o,"GeneratorFunction"),Ko(u),Ko(u,o,"Generator"),Ko(u,n,function(){return this}),Ko(u,"toString",function(){return"[object Generator]"}),(Oo=function(){return{w:r,m:d}})()}function Ko(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ko=function(e,A,t,n){function r(A,t){Ko(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Ko(e,A,t,n)}function Lo(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Mo(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Lo(r,n,o,i,a,"next",e)}function a(e){Lo(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ro(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_o(n.key),n)}}function _o(e){var A=function(e){if("object"!=Po(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Po(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Po(A)?A:A+""}var Vo=function(){return e=function e(A,t){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=A,this.sdk=t,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=A.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},A=[{key:"t",value:function(e){var A,t,n=this.config.language||"en";return((null===(A=this.config.translations)||void 0===A?void 0:A[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[e]||e}},{key:"generateHTML",value:function(){var e,A,t,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!==(A=this.config.sendButtonHint)&&void 0!==A&&A.text||null!==(t=this.config.panel)&&void 0!==t&&null!==(t=t.sendButtonHint)&&void 0!==t&&t.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,A,t,n,o,r,i,a,s,c,l,u,d,p=this.config.messages,g=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonColor)||"#7C3AED"),h=this.config.sendButtonHoverColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonHoverColor)||"#6D28D9",f=this.config.sendButtonTextColor||(null===(t=this.config.panel)||void 0===t?void 0:t.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(g,";\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(h,";\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,A=this.shadowRoot.getElementById("sendButton"),t=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(A&&(A.onclick=function(){return e.sendMessage()}),n&&(n.onclick=function(){return e.startNewChat()}),this.updateInputAttributes(),t){t.style.height="32px",t.style.overflow="hidden";var o=function(){t.style.height="auto";var e=Math.min(t.scrollHeight,120);t.style.height=e+"px",t.style.overflowY=e>=120?"auto":"hidden",e>=120&&setTimeout(function(){t.scrollTop=t.scrollHeight},0)};t.addEventListener("input",o),t.addEventListener("keydown",function(A){"Enter"!==A.key||A.shiftKey?"Enter"===A.key&&A.shiftKey&&setTimeout(o,0):(A.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 A=this.shadowRoot.getElementById("messageInput");A&&A.focus()}},{key:"updateInputAttributes",value:function(){var e=this.shadowRoot.getElementById("messageInput");if(e){var A,t=this.config.inputPlaceholder||(null===(A=this.config.panel)||void 0===A?void 0:A.inputPlaceholder)||this.t("typeMessage")||"Type your message...";e.placeholder=t,e.dir=this.config.direction||"ltr",e.style.textAlign="rtl"===this.config.direction?"right":"left"}}},{key:"show",value:function(){var e=this,A=this.shadowRoot.getElementById("textInterface");A&&A.classList.add("active"),setTimeout(function(){var A=e.shadowRoot.getElementById("messageInput");A&&A.focus()},50)}},{key:"hide",value:function(){var e=this.shadowRoot.getElementById("textInterface");e&&e.classList.remove("active")}},{key:"startChat",value:(n=Mo(Oo().m(function e(){return Oo().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:(t=Mo(Oo().m(function e(){var A,t,n;return Oo().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=this.shadowRoot.getElementById("messageInput"),t=A.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",t),A.value="",A.style.height="32px",A.style.overflow="hidden",e.p=3,this.beginStreaming(),e.n=4,this.sdk.sendMessage(t);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 t.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var e=this.shadowRoot.getElementById("sendButton");e&&(e.disabled=!this.isActive)}},{key:"addMessage",value:function(e,A){var t,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===(t=this.config.messages)||void 0===t?void 0:t.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=A,i.appendChild(s),i.appendChild(l),o.appendChild(i),o.scrollTop=o.scrollHeight}}},{key:"beginStreaming",value:function(){var e,A=this.shadowRoot.getElementById("messagesContainer");if(A){this.stopStreamingState();var t=document.createElement("div"),n="rtl"===this.config.direction?"edge-right":"edge-left";t.className="message agent ".concat(n),t.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>',t.appendChild(o),t.appendChild(r),A.appendChild(t),this.streamingEl=r,this.hasStartedStreaming=!1,A.scrollTop=A.scrollHeight}}},{key:"appendStreamingChunk",value:function(e){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=e;var A=this.shadowRoot.getElementById("messagesContainer");A&&(A.scrollTop=A.scrollHeight)}}},{key:"finalizeStreaming",value:function(e){if(this.streamingEl){this.streamingEl.textContent=e||this.streamingEl.textContent;var A=this.shadowRoot.getElementById("agent-streaming");A&&(A.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 A=this.shadowRoot.getElementById("messagesContainer");if(A){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 t,n=document.createElement("div");n.className="error-message",n.style.cssText="padding: 16px; margin: 12px; border-radius: 8px; background: "+((null===(t=this.config.messages)||void 0===t?void 0:t.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),A.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,A.appendChild(i)}A.scrollTop=A.scrollHeight}}},{key:"setActive",value:function(e){this.isActive=e,this.updateSendButtonState()}}],A&&Ro(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function jo(e){return jo="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},jo(e)}function No(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Go(n.key),n)}}function Go(e){var A=function(e){if("object"!=jo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=jo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jo(A)?A:A+""}var Wo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=A,this.translations=A.translations||{},this.shadowRoot=A.shadowRoot},A=[{key:"t",value:function(e){var A=this.config.language||"en";return(this.translations[A]||this.translations.en||{})[e]||e}},{key:"generateHTML",value:function(){var e,A=this.config.landing||{};return e="image"===A.logoType&&A.logoImageUrl?'<img src="'.concat(A.logoImageUrl,'" alt="Logo" style="max-width: 44px; max-height: 44px; object-fit: contain; border: none; outline: none;">'):'<span class="landing-avatar-emoji">'.concat(A.logoIcon||A.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(A.title||this.t("landingTitle"),'</h2>\n <p class="landing-subtitle">').concat(A.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(A.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(A.textCardTitle||this.t("textChat"),"</span>\n </button>\n </div>\n </div>\n ")}},{key:"generateCSS",value:function(){var e=this.config.landing||{},A=(this.config.animation,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(A,"; \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(A,"; \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 A=e.logoBackgroundColor||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;")}return"background: transparent; box-shadow: none; border: none; outline: none;"}var t=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;")}(),"\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,A=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");A&&A.classList.add("active")}},{key:"hide",value:function(){var e,A=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");A&&A.classList.remove("active")}},{key:"setupEventHandlers",value:function(){var e,A,t=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===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("mode-card-text");n&&t.onSelectVoice&&(n.onclick=t.onSelectVoice),o&&t.onSelectText&&(o.onclick=t.onSelectText)}}],A&&No(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();const zo={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 Xo(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Jo(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Jo(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Jo(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Jo(u,"constructor",c),Jo(c,"constructor",s),s.displayName="GeneratorFunction",Jo(c,o,"GeneratorFunction"),Jo(u),Jo(u,o,"Generator"),Jo(u,n,function(){return this}),Jo(u,"toString",function(){return"[object Generator]"}),(Xo=function(){return{w:r,m:d}})()}function Jo(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Jo=function(e,A,t,n){function r(A,t){Jo(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Jo(e,A,t,n)}function Yo(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function qo(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Yo(r,n,o,i,a,"next",e)}function a(e){Yo(r,n,o,i,a,"throw",e)}i(void 0)})}}function Zo(e){return Zo="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},Zo(e)}function $o(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function er(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?$o(Object(t),!0).forEach(function(A){Ar(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$o(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Ar(e,A,t){return(A=nr(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function tr(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Zo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Zo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zo(A)?A:A+""}var or=function(){return e=function e(){var A,t,n,o,r,i,a,s,c,l=this,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=this.mergeWithDefaults(u),this.sdk=new mt(this.config),this.isOpen=!1,this.isActive=!1,this.translations=zo,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=er(er(er({},this.config),this.config.voice),{},{inputPlaceholder:(null===(A=this.config.text)||void 0===A?void 0:A.inputPlaceholder)||this.config.inputPlaceholder||"Type your message...",sendButtonColor:(null===(t=this.config.text)||void 0===t?void 0:t.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,A,t=null===(e=l.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(t&&"none"!==t.style.display){var n=t.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===(A=l.config.behavior)||void 0===A?void 0:A.mode)||"unified")&&l.showLanding()},onShowVoice:function(){l.showVoice()},onShowLanding:function(){l.showLanding()},onErrorToast:function(e,A){l.showErrorToast(e,A)}});this.voiceInterface=new Do(d);var p=er(er(er({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Vo(p,this.sdk),"unified"===((null===(c=this.config.behavior)||void 0===c?void 0:c.mode)||"unified")){var g=er(er({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new Wo(g)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var h,f=null===(h=this.shadowRoot)||void 0===h?void 0:h.getElementById("text-chat-panel");f&&(this.isOpen=!0,f.classList.add("open"))}this.checkAndHandleResume()},A=[{key:"checkAndHandleResume",value:function(){var e=this,A=this.voiceInterface.checkAndHandleResume();A&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(function(){e.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(A){var t;console.error("❌ [WIDGET] Failed to auto-resume call:",A),"unified"===((null===(t=e.config.behavior)||void 0===t?void 0:t.mode)||"unified")&&e.showLanding()})},100))}},{key:"open",value:function(){var e;if(!this.isOpen){var A=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("text-chat-panel");A&&(this.isOpen=!0,A.classList.add("open"))}}},{key:"mergeWithDefaults",value:function(e){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,L,M,R,_,V,j,N,G,W,z,X,J,Y,q,Z,$,ee,Ae,te,ne,oe,re,ie,ae,se,ce,le,ue,de,pe,ge,he,fe,me,ve,Be,we,ye,be,Ce,xe,Qe,Fe,Ue,Se,ke,Ee,Ie,Te,He,De,Pe,Oe,Ke,Le,Me,Re,_e,Ve,je,Ne,Ge,We,ze,Xe,Je,Ye,qe,Ze,$e,eA,AA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,pA,gA,hA,fA,mA,vA,BA,wA,yA,bA,CA,xA,QA,FA,UA,SA,kA,EA,IA,TA=e.position||"bottom-right";if("string"==typeof TA){var HA=TA.split("-");TA={vertical:HA[0]||"bottom",horizontal:HA[1]||"right",offset:e.positionOffset||{x:20,y:20}}}var DA,PA,OA=e.primaryColor||(null===(A=e.button)||void 0===A?void 0:A.primaryColor)||(null===(t=e.button)||void 0===t?void 0:t.backgroundColor)||"#FFFFFF";return er({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:er({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:er({vertical:TA.vertical||"bottom",horizontal:TA.horizontal||"right",offset:TA.offset||{x:20,y:20}},"object"===Zo(e.position)?e.position:{}),button:er({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===(g=e.button)||void 0===g?void 0:g.shadow),shadowColor:(null===(h=e.button)||void 0===h?void 0:h.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:er({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:er({micButtonColor:(null===(x=e.voice)||void 0===x?void 0:x.micButtonColor)||(null===(Q=e.panel)||void 0===Q?void 0:Q.micButtonColor)||OA,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:er(er({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===(L=e.voice)||void 0===L?void 0:L.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(M=e.voice)||void 0===M?void 0:M.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:er({sendButtonColor:(null===(ee=e.text)||void 0===ee?void 0:ee.sendButtonColor)||(null===(Ae=e.panel)||void 0===Ae?void 0:Ae.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(te=e.text)||void 0===te?void 0:te.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:er(er({text:(null===(ge=e.text)||void 0===ge||null===(ge=ge.sendButtonHint)||void 0===ge?void 0:ge.text)||(null===(he=e.panel)||void 0===he||null===(he=he.sendButtonHint)||void 0===he?void 0:he.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:(PA={},e.landing&&Object.keys(e.landing).forEach(function(A){var t=e.landing[A];(null!=t&&""!==t||!1===t)&&(PA[A]=t)}),er({backgroundColor:PA.backgroundColor||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:PA.logo||"🤖",title:PA.title||null,titleColor:PA.titleColor||"#1e293b",modeCardBackgroundColor:PA.modeCardBackgroundColor||"#FFFFFF",modeCardBorderColor:PA.modeCardBorderColor||"#E2E8F0",modeCardHoverBorderColor:PA.modeCardHoverBorderColor||"#7C3AED",modeCardIconBackgroundColor:PA.modeCardIconBackgroundColor||"#7C3AED",modeCardTitleColor:PA.modeCardTitleColor||"#111827",voiceCardIcon:PA.voiceCardIcon||"🎤",textCardIcon:PA.textCardIcon||"💬",voiceCardTitle:PA.voiceCardTitle||null,textCardTitle:PA.textCardTitle||null},PA)),header:(DA={},e.header&&Object.keys(e.header).forEach(function(A){var t=e.header[A];A.startsWith("onlineIndicator")?null!=t&&(DA[A]=t):null!=t&&""!==t&&(DA[A]=t)}),er({title:DA.title||"Chat Assistant",showTitle:!1!==DA.showTitle,backgroundColor:DA.backgroundColor||"#7C3AED",textColor:DA.textColor||"#FFFFFF",showCloseButton:!1!==DA.showCloseButton},DA)),footer:er({show:!1!==(null===(Le=e.footer)||void 0===Le?void 0:Le.show),backgroundColor:(null===(Me=e.footer)||void 0===Me?void 0:Me.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:er({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:er({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===(eA=e.messages)||void 0===eA?void 0:eA.textColor)||"#1F2937",agentTextColor:(null===(AA=e.messages)||void 0===AA?void 0:AA.agentTextColor)||(null===(tA=e.messages)||void 0===tA?void 0:tA.textColor)||"#1F2937",userAvatarIcon:(null===(nA=e.messages)||void 0===nA?void 0:nA.userAvatarIcon)||"👤",agentAvatarIcon:(null===(oA=e.messages)||void 0===oA?void 0:oA.agentAvatarIcon)||"🤖",fontSize:(null===(rA=e.messages)||void 0===rA?void 0:rA.fontSize)||"14px",borderRadius:(null===(iA=e.messages)||void 0===iA?void 0:iA.borderRadius)||16},e.messages),animation:er({enableHover:!1!==(null===(aA=e.animation)||void 0===aA?void 0:aA.enableHover),enablePulse:!1!==(null===(sA=e.animation)||void 0===sA?void 0:sA.enablePulse),enableSlide:!1!==(null===(cA=e.animation)||void 0===cA?void 0:cA.enableSlide),duration:(null===(lA=e.animation)||void 0===lA?void 0:lA.duration)||.3},e.animation),promptAnimation:er({enabled:!0===(null===(uA=e.promptAnimation)||void 0===uA?void 0:uA.enabled),text:(null===(dA=e.promptAnimation)||void 0===dA?void 0:dA.text)||"Try me!",backgroundColor:(null===(pA=e.promptAnimation)||void 0===pA?void 0:pA.backgroundColor)||"linear-gradient(135deg, #7c3aed, #4f46e5)",textColor:(null===(gA=e.promptAnimation)||void 0===gA?void 0:gA.textColor)||"#ffffff",animationType:(null===(hA=e.promptAnimation)||void 0===hA?void 0:hA.animationType)||"bounce",showShimmer:!1!==(null===(fA=e.promptAnimation)||void 0===fA?void 0:fA.showShimmer),showPulseRings:!1!==(null===(mA=e.promptAnimation)||void 0===mA?void 0:mA.showPulseRings),hideAfterClick:!1!==(null===(vA=e.promptAnimation)||void 0===vA?void 0:vA.hideAfterClick),hideAfterSeconds:void 0!==(null===(BA=e.promptAnimation)||void 0===BA?void 0:BA.hideAfterSeconds)?e.promptAnimation.hideAfterSeconds:null,position:(null===(wA=e.promptAnimation)||void 0===wA?void 0:wA.position)||"top"},e.promptAnimation),behavior:er({autoOpen:(null===(yA=e.behavior)||void 0===yA?void 0:yA.autoOpen)||!1,startOpen:(null===(bA=e.behavior)||void 0===bA?void 0:bA.startOpen)||!1,hidden:(null===(CA=e.behavior)||void 0===CA?void 0:CA.hidden)||!1,autoConnect:(null===(xA=e.behavior)||void 0===xA?void 0:xA.autoConnect)||!1,showWelcomeMessage:!1!==(null===(QA=e.behavior)||void 0===QA?void 0:QA.showWelcomeMessage),welcomeMessage:(null===(FA=e.behavior)||void 0===FA?void 0:FA.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(UA=e.behavior)||void 0===UA?void 0:UA.enableVoiceMode)||e.behavior.enableVoiceMode,mode:(null===(SA=e.behavior)||void 0===SA?void 0:SA.mode)||"unified"},e.behavior),accessibility:er({ariaLabel:(null===(kA=e.accessibility)||void 0===kA?void 0:kA.ariaLabel)||"Chat Assistant",ariaDescription:(null===(EA=e.accessibility)||void 0===EA?void 0:EA.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(IA=e.accessibility)||void 0===IA?void 0:IA.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:OA},"string"==typeof e.position?{positionString:e.position}:{})}},{key:"setupEventHandlers",value:function(){var e=this;this.sdk.on("domainError",function(A){e.textInterface.showError(A),e.textInterface.stopStreamingState()}),this.sdk.on("error",function(A){A&&("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))||(e.textInterface.showError(A.message||A),e.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(A){e.textInterface.appendStreamingChunk(A)}),this.sdk.on("done",function(A){var t=A.text;e.textInterface.finalizeStreaming(t)})}},{key:"createShadowHost",value:function(){var e=document.getElementById("ttp-widget-shadow-host");e&&e.remove();var A=document.createElement("div");A.id="ttp-widget-shadow-host",A.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=A.attachShadow({mode:"open"}),document.body.appendChild(A)}},{key:"createRegularContainer",value:function(){var e=document.getElementById("ttp-widget-container");e&&e.remove();var A=document.createElement("div");A.id="ttp-widget-container",A.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(A),this.regularContainer=A}},{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 A;A=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 t=this.generateWidgetHTML();if(this.config.useShadowDOM){var n="\n <style>".concat(A,"</style>\n ").concat(t,"\n ");this.shadowRoot.innerHTML=n}else this.injectStylesIntoHead(A),this.container.innerHTML=t;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 A,t,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(A=this.config.button)||void 0===A?void 0:A.size]||60,r={small:20,medium:28,large:36,xl:44}[null===(t=this.config.icon)||void 0===t?void 0:t.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,A=this,t=(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}[t.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 t=A.config.language||"en";return(A.translations[t]||A.translations.en)[e]||e},g=function(e){var t,n=null===(t=A.config.tooltips)||void 0===t?void 0:t[e];return null!=n?n:{newChat:p("newChat"),back:p("back"),close:p("close"),mute:p("mute"),speaker:p("speaker"),endCall:p("endCall")}[e]||""},h=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(h,"\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(g("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(g("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="'+g("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"),A="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(A,'" 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,A=e.offset||{x:20,y:20},t="";return"top"===e.vertical?t+="top: ".concat(A.y,"px;"):"bottom"===e.vertical?t+="bottom: ".concat(A.y,"px;"):"center"===e.vertical&&(t+="top: 50%; transform: translateY(-50%);"),"left"===e.horizontal?t+="left: ".concat(A.x,"px;"):"right"===e.horizontal?t+="right: ".concat(A.x,"px;"):"center"===e.horizontal&&(t+="left: 50%; transform: translateX(-50%);"),t}},{key:"generateIconHTML",value:function(e){var A=this.config.icon;switch(A.type){case"custom":return'<img src="'.concat(A.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(A.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*e),'px; font-weight: bold; color: white;">').concat(A.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,A){var t="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var n=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);n&&(t=n[0])}else t=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(t,';">\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 A="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var t=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);t&&(A=t[0])}else A=e.backgroundColor;return'\n <div class="prompt-pulse-rings" id="prompt-pulse-rings">\n <div class="prompt-pulse-ring" style="background-color: '.concat(A,'33;"></div>\n <div class="prompt-pulse-ring" style="background-color: ').concat(A,'1a;"></div>\n </div>\n ')}},{key:"generateCSS",value:function(e,A,t){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",g="unified"===p,h="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(A,"px;\n height: ").concat(A,"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(A,"px;\n height: ").concat(A,"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(A,"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(A,"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(g&&this.landingScreen?this.landingScreen.generateCSS():"","\n\n ").concat(h?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,A=this;if(this.shadowRoot){this.setupPromptAnimation();var t=this.shadowRoot.getElementById("text-chat-button");t&&(t.onclick=function(){A.config.promptAnimation.hideAfterClick&&A.hidePrompt(),A.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=function(){A._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,t,n;if(null!==(e=A.voiceInterface)&&void 0!==e&&e.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),A.voiceInterface.isShowingDomainError=!1,null!==(n=A.voiceInterface)&&void 0!==n&&n.resetConnectingState&&A.voiceInterface.resetConnectingState(),void A.showLanding();null!==(t=A.voiceInterface)&&void 0!==t&&t.isActive?A.showBackButtonWarning():A.showLanding()}),i&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=qo(Xo().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x;return Xo().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!A.isStartingCall){e.n=1;break}return console.log("⚠️ Call already starting, ignoring duplicate click"),e.a(2);case 1:if("function"==typeof A.config.onVoiceCallButtonClick)try{A.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"start"})}catch(e){console.error("Error in onVoiceCallButtonClick callback:",e)}if(A.isStartingCall=!0,e.p=2,A.showVoice(),null!==(t=A.voiceInterface)&&void 0!==t&&t.showConnectingState&&A.voiceInterface.showConnectingState(),null===(n=A.voiceInterface)||void 0===n||!n.isMobile||null===(o=A.voiceInterface)||void 0===o||!o.createMobileMinimizedBar){e.n=3;break}return(a=(null===(i=A.shadowRoot)||void 0===i?void 0:i.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(a.style.display="none"),A.voiceInterface.createMobileMinimizedBar(),A.voiceInterface.updateMobileStatus("connecting"),e.n=3,new Promise(function(e){return requestAnimationFrame(function(){return requestAnimationFrame(e)})});case 3:return e.n=4,A.startVoiceCall();case 4:if(null===(r=A.voiceInterface)||void 0===r||!r.isActive){e.n=5;break}console.log("✅ Voice call started successfully"),e.n=7;break;case 5:if(console.warn("⚠️ startVoiceCall() returned but call is not active"),u=null===(s=A.voiceInterface)||void 0===s||null===(s=s.shadowRoot)||void 0===s?void 0:s.getElementById("voiceIdleState"),d=!1,u&&"none"!==u.style.display&&(p=u.querySelector(".voice-status-title"))&&(h=p.textContent.trim(),f=null===(g=A.voiceInterface)||void 0===g?void 0:g.t("domainNotValidated"),console.log("🔍 Checking for domain error - titleText:",h,"domainErrorTitle:",f),(h===f||h.includes("Domain not")||h.includes("not whitelisted"))&&(d=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))),!d){e.n=6;break}return A.currentView="voice",A.showVoice(),console.log("✅ Staying on voice interface with domain error displayed"),e.a(2);case 6:console.log("⚠️ Not a domain error - returning to landing screen"),null!==(c=A.voiceInterface)&&void 0!==c&&c.resetConnectingState&&A.voiceInterface.resetConnectingState(),"unified"===((null===(l=A.config.behavior)||void 0===l?void 0:l.mode)||"unified")&&A.showLanding();case 7:e.n=10;break;case 8:if(e.p=8,!(x=e.v).isServerRejection&&"ServerRejected"!==x.name){e.n=9;break}return null!==(w=A.voiceInterface)&&void 0!==w&&w.resetConnectingState&&A.voiceInterface.resetConnectingState(),e.a(2);case 9:console.error("❌ Failed to start voice call:",x),null!==(m=A.voiceInterface)&&void 0!==m&&m.resetConnectingState&&A.voiceInterface.resetConnectingState(),null!==(v=A.voiceInterface)&&void 0!==v&&v.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&null!==(y=A.voiceInterface)&&void 0!==y&&y.removeMobileMinimizedBar&&A.voiceInterface.removeMobileMinimizedBar(),(C=(null===(b=A.shadowRoot)||void 0===b?void 0:b.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(C.style.display="")),"Call cancelled by user"!==x.message&&A.showErrorToast(x.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(B=A.config.behavior)||void 0===B?void 0:B.mode)||"unified")&&A.showLanding();case 10:return e.p=10,A.isStartingCall=!1,e.f(10);case 11:return e.a(2)}},e,null,[[2,8,10,11]])})),function(){return o.apply(this,arguments)}),onSelectText:function(){return A.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 A.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 A=null===(e=this.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(A&&"none"!==A.style.display){var t=A.querySelector(".voice-status-title");if(t){var n,o=t.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"),A=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),A&&A.classList.remove("active"),this.textInterface.show();var o=this.config.behavior.mode||"unified";t&&"unified"===o&&t.classList.add("visible"),n&&(n.style.display="")}}},{key:"showVoice",value:function(){if(this.shadowRoot){this.currentView="voice";var e=this.shadowRoot.getElementById("landingScreen"),A=this.shadowRoot.getElementById("textInterface"),t=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),A&&A.classList.remove("active"),t&&t.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(A){"Escape"===A.key&&e.isOpen&&e.togglePanel()})}},{key:"setupPromptAnimation",value:function(){var e=this;if(this.shadowRoot){var A=this.config.promptAnimation||{},t=!0===A.enabled;if(console.log("🎨 setupPromptAnimation called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:A,enabled:A.enabled,isPromptEnabled:t,isOpen:this.isOpen}),!t)return console.log("❌ Prompt disabled, hiding"),void this.hidePrompt();if(this.isOpen?this.hidePrompt():this.showPrompt(),!this.isOpen&&null!==A.hideAfterSeconds&&A.hideAfterSeconds>0&&(this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*A.hideAfterSeconds)),this.voiceInterface&&this.voiceInterface.sdk){var n=this.config.onConversationStart;this.config.onConversationStart=function(){var A=e.shadowRoot.getElementById("prompt-pulse-rings");A&&(A.style.display="none"),n&&n.apply(void 0,arguments)},this.voiceInterface.sdk.voiceSDK&&this.voiceInterface.sdk.voiceSDK.on("recordingStarted",function(){var A=e.shadowRoot.getElementById("prompt-pulse-rings");A&&(A.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 A=this.shadowRoot.getElementById("prompt-pulse-rings");A||this.shadowRoot===document||(A=document.getElementById("prompt-pulse-rings")),A&&(A.style.display="none",A.style.visibility="hidden")}}},{key:"showPrompt",value:function(){var e=this;if(this.shadowRoot){var A=this.config.promptAnimation||{},t=!1!==A.enabled;if(console.log("👁️ showPrompt called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:A,enabled:A.enabled,isPromptEnabled:t,shadowRoot:!!this.shadowRoot}),t){var n=function(){var t=e.shadowRoot.getElementById("prompt-bubble");if(t||e.shadowRoot===document||(t=document.getElementById("prompt-bubble")),t?(t.style.display="block",t.style.visibility="visible",t.style.opacity="1",console.log("✅ Prompt bubble shown:",t)):console.warn("⚠️ Prompt bubble not found in shadowRoot or document"),!1!==A.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!==A.showPulseRings?this.shadowRoot.getElementById("prompt-pulse-rings"):null;o&&(!1===A.showPulseRings||r)||(setTimeout(function(){n()},100),setTimeout(function(){n()},500)),null!==A.hideAfterSeconds&&A.hideAfterSeconds>0&&(this.promptAutoHideTimer&&clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*A.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 A=this.shadowRoot.getElementById("text-chat-panel");A&&A.classList.toggle("open"),this.isOpen?(this.hidePrompt(),setTimeout(function(){var A=e.shadowRoot.getElementById("messageInput");A&&A.focus()},100)):(this.showPrompt(),setTimeout(function(){var A,t=e.shadowRoot.getElementById("prompt-bubble");t&&"none"===t.style.display&&(t.style.display="block");var n=e.shadowRoot.getElementById("prompt-pulse-rings");n&&!1!==(null===(A=e.config.promptAnimation)||void 0===A?void 0:A.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 A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",t=document.createElement("div");t.className="widget-toast widget-toast-".concat(A),t.textContent=e;var n="error"===A?"#ef4444":"warning"===A?"#f59e0b":"#3b82f6";if(Object.assign(t.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(t),setTimeout(function(){t.style.animation="slideDown 0.3s ease-out",setTimeout(function(){t.parentNode&&t.parentNode.removeChild(t)},300)},4e3)}},{key:"showConfirmModal",value:function(e){var A=e.title,t=void 0===A?"Confirm":A,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 g=document.createElement("div");g.className="widget-confirm-modal",g.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 h="danger"===l?"widget-modal-btn--danger":"widget-modal-btn--primary";g.innerHTML='\n <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #1e293b;">'.concat(t,'</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(h,'" 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(g),(this.shadowRoot||document.body).appendChild(p),g.querySelector('[data-action="confirm"]').onclick=function(){p.remove(),null==u||u()},g.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=qo(Xo().m(function e(){return Xo().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=qo(Xo().m(function e(){return Xo().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,A;null!==(e=this.voiceInterface)&&void 0!==e&&e.isActive&&null!==(A=this.voiceInterface.desktop)&&void 0!==A&&A.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}},{key:"getSignedUrl",value:(o=qo(Xo().m(function e(){var A,t,n;return Xo().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 A=this.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",(t=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&t.append("appId",this.config.appId),!1!==this.config.demo&&t.append("demo","true"),n="".concat(A,"?").concat(t.toString()),e.a(2,n)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"addMessage",value:function(e,A){this.textInterface.addMessage(e,A)}},{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 A,t,n,o,r,i,a,s,c,l,u=er({},this.config);e.panel&&(u.panel=er(er({},this.config.panel),e.panel)),e.voice&&(u.voice=er(er({},this.config.voice),e.voice),e.voice.micButtonHint&&(u.voice.micButtonHint=er(er({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),e.voice.micButtonHint))),e.text&&(u.text=er(er({},this.config.text),e.text),e.text.sendButtonHint&&(u.text.sendButtonHint=er(er({},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=er(er({},this.config.button),e.button)),e.header&&(u.header=er(er({},this.config.header),e.header)),e.icon&&(u.icon=er(er({},this.config.icon),e.icon)),e.messages&&(u.messages=er(er({},this.config.messages),e.messages)),e.animation&&(u.animation=er(er({},this.config.animation),e.animation)),e.behavior&&(u.behavior=er(er({},this.config.behavior),e.behavior)),e.accessibility&&(u.accessibility=er(er({},this.config.accessibility),e.accessibility)),e.tooltips&&(u.tooltips=er(er({},this.config.tooltips),e.tooltips)),e.landing&&(u.landing=er(er({},this.config.landing),e.landing)),e.footer&&(u.footer=er(er({},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(A){["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(A)||(u[A]=e[A])}),null===(A=this.config)||void 0===A||A.language;var d=!1!==(null===(t=this.config)||void 0===t?void 0:t.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 g=document.getElementById("ttp-widget-container");if(g&&this.config.useShadowDOM&&g.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var h=document.getElementById("ttp-widget-shadow-host");h?(this.shadowRoot=h.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=er(er(er({},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 Do(y);var b=er(er(er({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Vo(b,this.sdk),"unified"===((null===(s=this.config.behavior)||void 0===s?void 0:s.mode)||"unified")){var C=er(er({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new Wo(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 A=document.getElementById("ttp-widget-container");A&&A.remove();var t=document.getElementById("ttp-widget-styles");t&&t.remove(),this.sdk&&this.sdk.destroy(),this.voiceInterface&&this.voiceInterface.destroy()}},{key:"startVoiceCall",value:(n=qo(Xo().m(function e(){return Xo().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:(t=qo(Xo().m(function e(A){var t,n,o,r,i=arguments;return Xo().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},A&&A.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===(t=this.voiceInterface)||void 0===t?void 0:t.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(A,er(er({},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 t.apply(this,arguments)})},{key:"registerToolHandler",value:function(e,A){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.registerToolHandler(e,A):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:e,handler:A}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}},{key:"unregisterToolHandler",value:function(e){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.unregisterToolHandler(e):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(function(A){return A.name!==e})),this)}},{key:"hasToolHandler",value:function(e){var A;return!(null===(A=this.voiceInterface)||void 0===A||!A.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,A=this;this._pendingClientTools&&null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk&&(this._pendingClientTools.forEach(function(e){var t=e.name,n=e.handler;A.voiceInterface.sdk.registerToolHandler(t,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(e,A){return this.registerToolHandler(e,A)}},{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()}}],A&&tr(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n,o,r,i}();console.log("[TTP SDK] ✅ Sandbox Deployment Test - v2.33.9-SANDBOX (with NEW conversation panel: collapsed/expanded states & compact design)");var rr="2.18.0";const ir={VoiceSDK_v2:ot,TextChatSDK:mt,WebSocketManager:_t,AudioRecorder:q,AudioPlayer:Zt,EventEmitter:O,VoiceButton:un,VanillaVoiceButton:yn,AgentSDK:Hn,TTPChatWidget:or,VERSION:rr}})(),n})());
2
+ !function(e,A){"object"==typeof exports&&"object"==typeof module?module.exports=A():"function"==typeof define&&define.amd?define([],A):"object"==typeof exports?exports.TTPAgentSDK=A():e.TTPAgentSDK=A()}(window,()=>(()=>{var e={354:function(e){e.exports=function(){"use strict";var e=function(A,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,A){e.__proto__=A}||function(e,A){for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t])},e(A,t)};function A(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=A}e(A,t),A.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var t=function(){return t=Object.assign||function(e){for(var A,t=1,n=arguments.length;t<n;t++)for(var o in A=arguments[t])Object.prototype.hasOwnProperty.call(A,o)&&(e[o]=A[o]);return e},t.apply(this,arguments)};function n(e,A,t,n){return new(t||(t=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 A;e.done?o(e.value):(A=e.value,A instanceof t?A:new t(function(e){e(A)})).then(i,a)}s((n=n.apply(e,A||[])).next())})}function o(e,A){var t,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(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=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=A.call(e,i)}catch(e){r=[6,e],n=0}finally{t=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(e,A,t){if(t||2===arguments.length)for(var n,o=0,r=A.length;o<r;o++)!n&&o in A||(n||(n=Array.prototype.slice.call(A,0,o)),n[o]=A[o]);return e.concat(n||A)}for(var i=function(){function e(e,A,t,n){this.left=e,this.top=A,this.width=t,this.height=n}return e.prototype.add=function(A,t,n,o){return new e(this.left+A,this.top+t,this.width+n,this.height+o)},e.fromClientRect=function(A,t){return new e(t.left+A.windowBounds.left,t.top+A.windowBounds.top,t.width,t.height)},e.fromDOMRectList=function(A,t){var n=Array.from(t).find(function(e){return 0!==e.width});return n?new e(n.left+A.windowBounds.left,n.top+A.windowBounds.top,n.width,n.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,A){return i.fromClientRect(e,A.getBoundingClientRect())},s=function(e){for(var A=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var r=e.charCodeAt(t++);56320==(64512&r)?A.push(((1023&o)<<10)+(1023&r)+65536):(A.push(o),t--)}else A.push(o)}return A},c=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return"";for(var n=[],o=-1,r="";++o<t;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||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+/",g="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h=0;h<64;h++)g[p.charCodeAt(h)]=h;for(var f=function(e,A,t){return e.slice?e.slice(A,t):new Uint16Array(Array.prototype.slice.call(e,A,t))},m=function(){function e(e,A,t,n,o,r){this.initialValue=e,this.errorValue=A,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e<this.highStart)return A=2080+(e>>11),A=this.index[A],A+=e>>5&63,A=((A=this.index[A])<<2)+(31&e),this.data[A];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,L=34,M=35,R=37,_=38,V=39,j=40,N=42,G=[9001,65288],W="×",z="÷",X=function(e){var A,t,n,o=function(e){var A,t,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(A=0;A<a;A+=4)t=g[e.charCodeAt(A)],n=g[e.charCodeAt(A+1)],o=g[e.charCodeAt(A+2)],r=g[e.charCodeAt(A+3)],l[s++]=t<<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 A=e.length,t=[],n=0;n<A;n+=4)t.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return t}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var A=e.length,t=[],n=0;n<A;n+=2)t.push(e[n+1]<<8|e[n]);return t}(o):new Uint16Array(o),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(A=r,t=Math.ceil((24+r[4])/4),A.slice?A.slice(t,n):new Uint32Array(Array.prototype.slice.call(A,t,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,L,M],Ae=[C,b],te=function(e,A,t,n){var o=n[t];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var r=t;r<=n.length;){if((s=n[++r])===A)return!0;if(s!==y)break}if(o===y)for(r=t;r>0;){var i=n[--r];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var a=t;a<=n.length;){var s;if((s=n[++a])===A)return!0;if(s!==y)break}if(i!==y)break}return!1},ne=function(e,A){for(var t=e;t>=0;){var n=A[t];if(n!==y)return n;t--}return 0},oe=function(e,A,t,n,o){if(0===t[n])return W;var r=n-1;if(Array.isArray(o)&&!0===o[r])return W;var i=r-1,a=r+1,s=A[r],c=i>=0?A[i]:0,l=A[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,A))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,A)===k)return W;if(te(23,k,r,A))return W;if(te([x,Q],S,r,A))return W;if(te(12,12,r,A))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!==Ae.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)&&A[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=A[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=A[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(_===s&&-1!==[_,V,L,M].indexOf(l)||-1!==[V,L].indexOf(s)&&-1!==[V,j].indexOf(l)||-1!==[j,M].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=t[r],g=1;p>0&&41===A[--p];)g++;if(g%2!=0)return W}return s===O&&l===K?W:z},re=function(e,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var t=function(e,A){void 0===A&&(A="strict");var t=[],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(A)&&-1!==[8208,8211,12316,12448].indexOf(e))return n.push(r),t.push(16);if(4===i||11===i){if(0===r)return n.push(r),t.push(P);var a=t[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),t.push(a)):(n.push(r),t.push(P))}return n.push(r),31===i?t.push("strict"===A?S:R):i===N||29===i?t.push(P):43===i?e>=131072&&e<=196605||e>=196608&&e<=262141?t.push(R):t.push(P):void t.push(i)}),[n,t,o]}(e,A.lineBreak),n=t[0],o=t[1],r=t[2];"break-all"!==A.wordBreak&&"break-word"!==A.wordBreak||(o=o.map(function(e){return-1!==[I,P,N].indexOf(e)?R:e}));var i="keep-all"===A.wordBreak?r.map(function(A,t){return A&&e[t]>=19968&&e[t]<=40959}):void 0;return[n,o,i]},ie=function(){function e(e,A,t,n){this.codePoints=e,this.required="!"===A,this.start=t,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},ge=function(e){return pe(e)||le(e)||e===ae},he=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},fe=function(e,A){return 92===e&&10!==A},me=function(e,A,t){return e===ae?pe(A)||fe(A,t):!!pe(e)||!(92!==e||!fe(e,A))},ve=function(e,A,t){return e===se||e===ae?!!le(A)||46===A&&le(t):le(46===e?A:e)},Be=function(e){var A=0,t=1;e[A]!==se&&e[A]!==ae||(e[A]===ae&&(t=-1),A++);for(var n=[];le(e[A]);)n.push(e[A++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===e[A]&&A++;for(var r=[];le(e[A]);)r.push(e[A++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==e[A]&&101!==e[A]||A++;var s=1;e[A]!==se&&e[A]!==ae||(e[A]===ae&&(s=-1),A++);for(var l=[];le(e[A]);)l.push(e[A++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return t*(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},Le={type:29},Me={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=[],A=this.consumeToken();A!==Re;)e.push(A),A=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var A=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(ge(A)||fe(t,n)){var o=me(A,t,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 Le;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),g=this.peekCodePoint(1);return p!==se||!ue(g)&&63!==g||(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(),Me):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=[],A=this.consumeCodePoint();ue(A)&&e.length<6;)e.push(A),A=this.consumeCodePoint();for(var t=!1;63===A&&e.length<6;)e.push(A),A=this.consumeCodePoint(),t=!0;if(t)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(),A=this.consumeCodePoint();for(var o=[];ue(A)&&o.length<6;)o.push(A),A=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 A=this.peekCodePoint(0);if(39===A||34===A){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===ce||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.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||he(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 A="";e>0;){var t=Math.min(5e4,e);A+=c.apply(void 0,this._value.splice(0,t)),e-=t}return this._value.shift(),A},e.prototype.consumeStringToken=function(e){for(var A="",t=0;;){var n=this._value[t];if(n===ce||void 0===n||n===e)return{type:0,value:A+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),Te;if(92===n){var o=this._value[t+1];o!==ce&&void 0!==o&&(10===o?(A+=this.consumeStringSlice(t),t=-1,this._value.shift()):fe(n,o)&&(A+=this.consumeStringSlice(t),A+=c(this.consumeEscapedCodePoint()),t=-1))}t++}},e.prototype.consumeNumber=function(){var e=[],A=4,t=this.peekCodePoint(0);for(t!==se&&t!==ae||e.push(this.consumeCodePoint());le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&le(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===t||101===t)&&((n===se||n===ae)&&le(o)||le(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Be(e),A]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),A=e[0],t=e[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);return me(n,o,r)?{type:15,number:A,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:A,flags:t}):{type:17,number:A,flags:t}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(ue(e)){for(var A=c(e);ue(this.peekCodePoint(0))&&A.length<6;)A+=c(this.consumeCodePoint());de(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(A,16);return 0===t||function(e){return e>=55296&&e<=57343}(t)||t>1114111?65533:t}return e===ce?65533:e},e.prototype.consumeName=function(){for(var e="";;){var A=this.consumeCodePoint();if(ge(A))e+=c(A);else{if(!fe(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),Ve=function(){function e(e){this._tokens=e}return e.create=function(A){var t=new _e;return t.write(A),new e(t.read())},e.parseValue=function(A){return e.create(A).parseComponentValue()},e.parseValues=function(A){return e.create(A).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 A=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return A;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var A=this.consumeComponentValue();if(32===A.type)return e;e.push(A),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 A={type:e,values:[]},t=this.consumeToken();;){if(32===t.type||qe(t,e))return A;this.reconsumeToken(t),A.values.push(this.consumeComponentValue()),t=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var A={name:e.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return A;this.reconsumeToken(t),A.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,A){return Ge(e)&&e.value===A},Xe=function(e){return 31!==e.type},Je=function(e){return 31!==e.type&&4!==e.type},Ye=function(e){var A=[],t=[];return e.forEach(function(e){if(4===e.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return A.push(t),void(t=[])}31!==e.type&&t.push(e)}),t.length&&A.push(t),A},qe=function(e,A){return 11===A&&12===e.type||28===A&&29===e.type||2===A&&3===e.type},Ze=function(e){return 17===e.type||15===e.type},$e=function(e){return 16===e.type||Ze(e)},eA=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},AA={type:17,number:0,flags:4},tA={type:16,number:50,flags:4},nA={type:16,number:100,flags:4},oA=function(e,A,t){var n=e[0],o=e[1];return[rA(n,A),rA(void 0!==o?o:n,t)]},rA=function(e,A){if(16===e.type)return e.number/100*A;if(je(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},iA="grad",aA="turn",sA=function(e,A){if(15===A.type)switch(A.unit){case"deg":return Math.PI*A.number/180;case iA:return Math.PI/200*A.number;case"rad":return A.number;case aA:return 2*Math.PI*A.number}throw new Error("Unsupported angle type")},cA=function(e){return 15===e.type&&("deg"===e.unit||e.unit===iA||"rad"===e.unit||e.unit===aA)},lA=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[AA,AA];case"to top":case"bottom":return uA(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[AA,nA];case"to right":case"left":return uA(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[nA,nA];case"to bottom":case"top":return uA(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[nA,AA];case"to left":case"right":return uA(270)}return 0},uA=function(e){return Math.PI*e/180},dA=function(e,A){if(18===A.type){var t=wA[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return t(e,A.values)}if(5===A.type){if(3===A.value.length){var n=A.value.substring(0,1),o=A.value.substring(1,2),r=A.value.substring(2,3);return hA(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===A.value.length){n=A.value.substring(0,1),o=A.value.substring(1,2),r=A.value.substring(2,3);var i=A.value.substring(3,4);return hA(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===A.value.length)return n=A.value.substring(0,2),o=A.value.substring(2,4),r=A.value.substring(4,6),hA(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===A.value.length)return n=A.value.substring(0,2),o=A.value.substring(2,4),r=A.value.substring(4,6),i=A.value.substring(6,8),hA(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===A.type){var a=bA[A.value.toUpperCase()];if(void 0!==a)return a}return bA.TRANSPARENT},pA=function(e){return!(255&e)},gA=function(e){var A=255&e,t=255&e>>8,n=255&e>>16,o=255&e>>24;return A<255?"rgba("+o+","+n+","+t+","+A/255+")":"rgb("+o+","+n+","+t+")"},hA=function(e,A,t,n){return(e<<24|A<<16|t<<8|Math.round(255*n))>>>0},fA=function(e,A){if(17===e.type)return e.number;if(16===e.type){var t=3===A?1:255;return 3===A?e.number/100*t:Math.round(e.number/100*t)}return 0},mA=function(e,A){var t=A.filter(Je);if(3===t.length){var n=t.map(fA),o=n[0],r=n[1],i=n[2];return hA(o,r,i,1)}if(4===t.length){var a=t.map(fA),s=(o=a[0],r=a[1],i=a[2],a[3]);return hA(o,r,i,s)}return 0};function vA(e,A,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(A-e)*t*6+e:t<.5?A:t<2/3?6*(A-e)*(2/3-t)+e:e}var BA=function(e,A){var t=A.filter(Je),n=t[0],o=t[1],r=t[2],i=t[3],a=(17===n.type?uA(n.number):sA(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)?rA(i,1):1;if(0===s)return hA(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,p=vA(d,u,a+1/3),g=vA(d,u,a),h=vA(d,u,a-1/3);return hA(255*p,255*g,255*h,l)},wA={hsl:BA,hsla:BA,rgb:mA,rgba:mA},yA=function(e,A){return dA(e,Ve.create(A).parseComponentValue())},bA={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},CA={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xA={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},QA=function(e,A){var t=dA(e,A[0]),n=A[1];return n&&$e(n)?{color:t,stop:n}:{color:t,stop:null}},FA=function(e,A){var t=e[0],n=e[e.length-1];null===t.stop&&(t.stop=AA),null===n.stop&&(n.stop=nA);for(var o=[],r=0,i=0;i<e.length;i++){var a=e[i].stop;if(null!==a){var s=rA(a,A);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,t){return{color:e.color,stop:Math.max(Math.min(1,o[t]/A),0)}})},UA=function(e,A,t){var n="number"==typeof e?e:function(e,A,t){var n=A/2,o=t/2,r=rA(e[0],A)-n,i=o-rA(e[1],t);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(e,A,t),o=Math.abs(A*Math.sin(n))+Math.abs(t*Math.cos(n)),r=A/2,i=t/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]},SA=function(e,A){return Math.sqrt(e*e+A*A)},kA=function(e,A,t,n,o){return[[0,0],[0,A],[e,0],[e,A]].reduce(function(e,A){var r=A[0],i=A[1],a=SA(t-r,n-i);return(o?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:A,optimumDistance:a}:e},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},EA=function(e,A){var t=uA(180),n=[];return Ye(A).forEach(function(A,o){if(0===o){var r=A[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=lA(A));if(cA(r))return void(t=(sA(e,r)+uA(270))%uA(360))}var i=QA(e,A);n.push(i)}),{angle:t,stops:n,type:1}},IA="closest-side",TA="farthest-side",HA="closest-corner",DA="farthest-corner",PA="circle",OA="ellipse",KA="cover",LA="contain",MA=function(e,A){var t=0,n=3,o=[],r=[];return Ye(A).forEach(function(A,i){var a=!0;if(0===i?a=A.reduce(function(e,A){if(Ge(A))switch(A.value){case"center":return r.push(tA),!1;case"top":case"left":return r.push(AA),!1;case"right":case"bottom":return r.push(nA),!1}else if($e(A)||Ze(A))return r.push(A),!1;return e},a):1===i&&(a=A.reduce(function(e,A){if(Ge(A))switch(A.value){case PA:return t=0,!1;case OA:return t=1,!1;case LA:case IA:return n=0,!1;case TA:return n=1,!1;case HA:return n=2,!1;case KA:case DA:return n=3,!1}else if(Ze(A)||$e(A))return Array.isArray(n)||(n=[]),n.push(A),!1;return e},a)),a){var s=QA(e,A);o.push(s)}}),{size:n,shape:t,stops:o,position:r,type:2}},RA=function(e,A){if(22===A.type){var t={url:A.value,type:0};return e.cache.addImage(A.value),t}if(18===A.type){var n=VA[A.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return n(e,A.values)}throw new Error("Unsupported image type "+A.type)};var _A,VA={"linear-gradient":function(e,A){var t=uA(180),n=[];return Ye(A).forEach(function(A,o){if(0===o){var r=A[0];if(20===r.type&&"to"===r.value)return void(t=lA(A));if(cA(r))return void(t=sA(e,r))}var i=QA(e,A);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":EA,"-ms-linear-gradient":EA,"-o-linear-gradient":EA,"-webkit-linear-gradient":EA,"radial-gradient":function(e,A){var t=0,n=3,o=[],r=[];return Ye(A).forEach(function(A,i){var a=!0;if(0===i){var s=!1;a=A.reduce(function(e,A){if(s)if(Ge(A))switch(A.value){case"center":return r.push(tA),e;case"top":case"left":return r.push(AA),e;case"right":case"bottom":return r.push(nA),e}else($e(A)||Ze(A))&&r.push(A);else if(Ge(A))switch(A.value){case PA:return t=0,!1;case OA:return t=1,!1;case"at":return s=!0,!1;case IA:return n=0,!1;case KA:case TA:return n=1,!1;case LA:case HA:return n=2,!1;case DA:return n=3,!1}else if(Ze(A)||$e(A))return Array.isArray(n)||(n=[]),n.push(A),!1;return e},a)}if(a){var c=QA(e,A);o.push(c)}}),{size:n,shape:t,stops:o,position:r,type:2}},"-moz-radial-gradient":MA,"-ms-radial-gradient":MA,"-o-radial-gradient":MA,"-webkit-radial-gradient":MA,"-webkit-gradient":function(e,A){var t=uA(180),n=[],o=1;return Ye(A).forEach(function(A,t){var r=A[0];if(0===t){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=dA(e,r.values[0]);n.push({stop:AA,color:i})}else if("to"===r.name)i=dA(e,r.values[0]),n.push({stop:nA,color:i});else if("color-stop"===r.name){var a=r.values.filter(Je);if(2===a.length){i=dA(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:(t+uA(180))%uA(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},jA={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A.filter(function(e){return Je(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!VA[e.name])}(e)}).map(function(A){return RA(e,A)})}},NA={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},GA={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,A){return Ye(A).map(function(e){return e.filter($e)}).map(eA)}},WA={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,A){return Ye(A).map(function(e){return e.filter(Ge).map(function(e){return e.value}).join(" ")}).map(zA)}},zA=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"}(_A||(_A={}));var XA,JA={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,A){return Ye(A).map(function(e){return e.filter(YA)})}},YA=function(e){return Ge(e)||$e(e)},qA=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ZA=qA("top"),$A=qA("right"),et=qA("bottom"),At=qA("left"),tt=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,A){return eA(A.filter($e))}}},nt=tt("top-left"),ot=tt("top-right"),rt=tt("bottom-right"),it=tt("bottom-left"),at=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,A){switch(A){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},st=at("top"),ct=at("right"),lt=at("bottom"),ut=at("left"),dt=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,A){return je(A)?A.number:0}}},pt=dt("top"),gt=dt("right"),ht=dt("bottom"),ft=dt("left"),mt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},vt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,A){return"rtl"===A?1:0}},Bt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,A){return A.filter(Ge).reduce(function(e,A){return e|wt(A.value)},0)}},wt=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},yt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},bt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,A){return 20===A.type&&"normal"===A.value?0:17===A.type||15===A.type?A.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(XA||(XA={}));var Ct,xt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"strict"===A?XA.STRICT:XA.NORMAL}},Qt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ft=function(e,A){return Ge(e)&&"normal"===e.value?1.2*A:17===e.type?A*e.number:$e(e)?rA(e,A):A},Ut={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,A){return 20===A.type&&"none"===A.value?null:RA(e,A)}},St={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,A){return"inside"===A?0:1}},kt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){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}}},Et=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},It=Et("top"),Tt=Et("right"),Ht=Et("bottom"),Dt=Et("left"),Pt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,A){return A.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}})}},Ot={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){return"break-word"===A?"break-word":"normal"}},Kt=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Lt=Kt("top"),Mt=Kt("right"),Rt=Kt("bottom"),_t=Kt("left"),Vt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,A){switch(A){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},jt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Nt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return 1===A.length&&ze(A[0],"none")?[]:Ye(A).map(function(A){for(var t={color:bA.TRANSPARENT,offsetX:AA,offsetY:AA,blur:AA},n=0,o=0;o<A.length;o++){var r=A[o];Ze(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=dA(e,r)}return t})}},Gt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Wt={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,A){if(20===A.type&&"none"===A.value)return null;if(18===A.type){var t=zt[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return t(A.values)}return null}},zt={matrix:function(e){var A=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===A.length?A:null},matrix3d:function(e){var A=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),t=A[0],n=A[1];A[2],A[3];var o=A[4],r=A[5];A[6],A[7],A[8],A[9],A[10],A[11];var i=A[12],a=A[13];return A[14],A[15],16===A.length?[t,n,o,r,i,a]:null}},Xt={type:16,number:50,flags:4},Jt=[Xt,Xt],Yt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,A){var t=A.filter($e);return 2!==t.length?Jt:[t[0],t[1]]}},qt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){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"}(Ct||(Ct={}));for(var Zt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"break-all":return Ct.BREAK_ALL;case"keep-all":return Ct.KEEP_ALL;default:return Ct.NORMAL}}},$t={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,A){if(20===A.type)return{auto:!0,order:0};if(Ne(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},en={name:"time",parse:function(e,A){if(15===A.type)switch(A.unit.toLowerCase()){case"s":return 1e3*A.number;case"ms":return A.number}throw new Error("Unsupported time type")}},An={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,A){return Ne(A)?A.number:1}},tn={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,A){return A.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,A){var t=[],n=[];return A.forEach(function(e){switch(e.type){case 20:case 0:t.push(e.value);break;case 17:t.push(e.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}}),t.length&&n.push(t.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,A){return Ne(A)?A.number:Ge(A)&&"bold"===A.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.filter(Ge).map(function(e){return e.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(e,A){return 0!==(e&A)},un={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(0===A.length)return[];var t=A[0];return 20===t.type&&"none"===t.value?[]:A}},dn={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(0===A.length)return null;var t=A[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],o=A.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,A){if(0===A.length)return[];for(var t=[],n=A.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;t.push({counter:r.value,reset:a})}}return t}},gn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,A){return A.filter(je).map(function(A){return en.parse(e,A)})}},hn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(0===A.length)return null;var t=A[0];if(20===t.type&&"none"===t.value)return null;var n=[],o=A.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,A,t){if(!e)return"";var n=e[Math.min(A,e.length-1)];return n?t?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return 1===A.length&&ze(A[0],"none")?[]:Ye(A).map(function(A){for(var t={color:255,offsetX:AA,offsetY:AA,blur:AA,spread:AA,inset:!1},n=0,o=0;o<A.length;o++){var r=A[o];ze(r,"inset")?t.inset=!0:Ze(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=dA(e,r)}return t})}},vn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,A){var t=[];return A.filter(Ge).forEach(function(e){switch(e.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}}),[0,1,2].forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}},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,A){return je(A)?A.number:0}},yn=function(){function e(e,A){var t,n;this.animationDuration=xn(e,gn,A.animationDuration),this.backgroundClip=xn(e,CA,A.backgroundClip),this.backgroundColor=xn(e,xA,A.backgroundColor),this.backgroundImage=xn(e,jA,A.backgroundImage),this.backgroundOrigin=xn(e,NA,A.backgroundOrigin),this.backgroundPosition=xn(e,GA,A.backgroundPosition),this.backgroundRepeat=xn(e,WA,A.backgroundRepeat),this.backgroundSize=xn(e,JA,A.backgroundSize),this.borderTopColor=xn(e,ZA,A.borderTopColor),this.borderRightColor=xn(e,$A,A.borderRightColor),this.borderBottomColor=xn(e,et,A.borderBottomColor),this.borderLeftColor=xn(e,At,A.borderLeftColor),this.borderTopLeftRadius=xn(e,nt,A.borderTopLeftRadius),this.borderTopRightRadius=xn(e,ot,A.borderTopRightRadius),this.borderBottomRightRadius=xn(e,rt,A.borderBottomRightRadius),this.borderBottomLeftRadius=xn(e,it,A.borderBottomLeftRadius),this.borderTopStyle=xn(e,st,A.borderTopStyle),this.borderRightStyle=xn(e,ct,A.borderRightStyle),this.borderBottomStyle=xn(e,lt,A.borderBottomStyle),this.borderLeftStyle=xn(e,ut,A.borderLeftStyle),this.borderTopWidth=xn(e,pt,A.borderTopWidth),this.borderRightWidth=xn(e,gt,A.borderRightWidth),this.borderBottomWidth=xn(e,ht,A.borderBottomWidth),this.borderLeftWidth=xn(e,ft,A.borderLeftWidth),this.boxShadow=xn(e,mn,A.boxShadow),this.color=xn(e,mt,A.color),this.direction=xn(e,vt,A.direction),this.display=xn(e,Bt,A.display),this.float=xn(e,yt,A.cssFloat),this.fontFamily=xn(e,on,A.fontFamily),this.fontSize=xn(e,rn,A.fontSize),this.fontStyle=xn(e,cn,A.fontStyle),this.fontVariant=xn(e,sn,A.fontVariant),this.fontWeight=xn(e,an,A.fontWeight),this.letterSpacing=xn(e,bt,A.letterSpacing),this.lineBreak=xn(e,xt,A.lineBreak),this.lineHeight=xn(e,Qt,A.lineHeight),this.listStyleImage=xn(e,Ut,A.listStyleImage),this.listStylePosition=xn(e,St,A.listStylePosition),this.listStyleType=xn(e,kt,A.listStyleType),this.marginTop=xn(e,It,A.marginTop),this.marginRight=xn(e,Tt,A.marginRight),this.marginBottom=xn(e,Ht,A.marginBottom),this.marginLeft=xn(e,Dt,A.marginLeft),this.opacity=xn(e,An,A.opacity);var o=xn(e,Pt,A.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=xn(e,Ot,A.overflowWrap),this.paddingTop=xn(e,Lt,A.paddingTop),this.paddingRight=xn(e,Mt,A.paddingRight),this.paddingBottom=xn(e,Rt,A.paddingBottom),this.paddingLeft=xn(e,_t,A.paddingLeft),this.paintOrder=xn(e,vn,A.paintOrder),this.position=xn(e,jt,A.position),this.textAlign=xn(e,Vt,A.textAlign),this.textDecorationColor=xn(e,tn,null!==(t=A.textDecorationColor)&&void 0!==t?t:A.color),this.textDecorationLine=xn(e,nn,null!==(n=A.textDecorationLine)&&void 0!==n?n:A.textDecoration),this.textShadow=xn(e,Nt,A.textShadow),this.textTransform=xn(e,Gt,A.textTransform),this.transform=xn(e,Wt,A.transform),this.transformOrigin=xn(e,Yt,A.transformOrigin),this.visibility=xn(e,qt,A.visibility),this.webkitTextStrokeColor=xn(e,Bn,A.webkitTextStrokeColor),this.webkitTextStrokeWidth=xn(e,wn,A.webkitTextStrokeWidth),this.wordBreak=xn(e,Zt,A.wordBreak),this.zIndex=xn(e,$t,A.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return pA(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,A){this.content=xn(e,un,A.content),this.quotes=xn(e,hn,A.quotes)},Cn=function(e,A){this.counterIncrement=xn(e,dn,A.counterIncrement),this.counterReset=xn(e,pn,A.counterReset)},xn=function(e,A,t){var n=new _e,o=null!=t?t.toString():A.initialValue;n.write(o);var r=new Ve(n.read());switch(A.type){case 2:var i=r.parseComponentValue();return A.parse(e,Ge(i)?i.value:A.initialValue);case 0:return A.parse(e,r.parseComponentValue());case 1:return A.parse(e,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(A.format){case"angle":return sA(e,r.parseComponentValue());case"color":return dA(e,r.parseComponentValue());case"image":return RA(e,r.parseComponentValue());case"length":var a=r.parseComponentValue();return Ze(a)?a:AA;case"length-percentage":var s=r.parseComponentValue();return $e(s)?s:AA;case"time":return en.parse(e,r.parseComponentValue())}}},Qn=function(e,A){var t=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===t||A===t},Fn=function(e,A){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Qn(A,3),this.styles=new yn(e,window.getComputedStyle(A,null)),Io(A)&&(this.styles.animationDuration.some(function(e){return e>0})&&(A.style.animationDuration="0s"),null!==this.styles.transform&&(A.style.transform="none")),this.bounds=a(this.context,A),Qn(A,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,A,t){return e.slice?e.slice(A,t):new Uint16Array(Array.prototype.slice.call(e,A,t))},In=function(){function e(e,A,t,n,o,r){this.initialValue=e,this.errorValue=A,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)return A=((A=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[A];if(e<this.highStart)return A=2080+(e>>11),A=this.index[A],A+=e>>5&63,A=((A=this.index[A])<<2)+(31&e),this.data[A];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,Ln=11,Mn=12,Rn=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return"";for(var n=[],o=-1,r="";++o<t;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},_n=function(e){var A,t,n,o=function(e){var A,t,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(A=0;A<a;A+=4)t=Sn[e.charCodeAt(A)],n=Sn[e.charCodeAt(A+1)],o=Sn[e.charCodeAt(A+2)],r=Sn[e.charCodeAt(A+3)],l[s++]=t<<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 A=e.length,t=[],n=0;n<A;n+=4)t.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return t}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var A=e.length,t=[],n=0;n<A;n+=2)t.push(e[n+1]<<8|e[n]);return t}(o):new Uint16Array(o),a=En(i,12,r[4]/2),s=2===r[5]?En(i,(24+r[4])/2):(A=r,t=Math.ceil((24+r[4])/4),A.slice?A.slice(t,n):new Uint32Array(Array.prototype.slice.call(A,t,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,A,t){var n=t-2,o=A[n],r=A[t-1],i=A[t];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,Ln,Mn].indexOf(i))return Vn;if(!(r!==Ln&&r!==Kn||i!==Kn&&10!==i))return Vn;if((r===Mn||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=A[--n];if(14===o)return Vn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=A[--n];if(a%2==0)return Vn}return"÷"},Gn=function(e){var A=function(e){for(var A=[],t=0,n=e.length;t<n;){var o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var r=e.charCodeAt(t++);56320==(64512&r)?A.push(((1023&o)<<10)+(1023&r)+65536):(A.push(o),t--)}else A.push(o)}return A}(e),t=A.length,n=0,o=0,r=A.map(jn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var e=Vn;n<t&&(e=Nn(0,r,++n))===Vn;);if(e!==Vn||n===t){var i=Rn.apply(null,A.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,A,t,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",A.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",t.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(A,t){var n=new Image;n.onload=function(){return A(n)},n.onerror=t,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 A=e.createRange();if(A.getBoundingClientRect){var t=e.createElement("boundtest");t.style.height="123px",t.style.display="block",e.body.appendChild(t),A.selectNode(t);var n=A.getBoundingClientRect(),o=Math.round(n.height);if(e.body.removeChild(t),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 A=e.createElement("boundtest");A.style.width="50px",A.style.display="block",A.style.fontSize="12px",A.style.letterSpacing="0px",A.style.wordSpacing="0px",e.body.appendChild(A);var t=e.createRange();A.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var n=A.firstChild,o=s(n.data).map(function(e){return c(e)}),r=0,i={},a=o.every(function(e,A){t.setStart(n,r),t.setEnd(n,r+e.length);var o=t.getBoundingClientRect();r+=e.length;var a=o.x>i.x||o.y>i.y;return i=o,0===A||a});return e.body.removeChild(A),a}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var A=new Image,t=e.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;A.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(A,0,0),t.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 A=e.createElement("canvas"),t=100;A.width=t,A.height=t;var n=A.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var o=new Image,r=A.toDataURL();o.src=r;var i=zn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Xn(i).then(function(A){n.drawImage(A,0,0);var o=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var i=e.createElement("div");return i.style.backgroundImage="url("+r+")",i.style.height=t+"px",Wn(o)?Xn(zn(t,t,0,0,i)):Promise.reject(!1)}).then(function(e){return n.drawImage(e,0,0),Wn(n.getImageData(0,0,t,t).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,A){this.text=e,this.bounds=A},qn=function(e,A){var t=A.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(A.cloneNode(!0));var o=A.parentNode;if(o){o.replaceChild(n,A);var r=a(e,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},Zn=function(e,A,t){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(e,A),o.setEnd(e,A+t),o},$n=function(e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(A.segment(e)).map(function(e){return e.segment})}return function(e){for(var A,t=Gn(e),n=[];!(A=t.next()).done;)A.value&&n.push(A.value.slice());return n}(e)},eo=function(e,A){return 0!==A.letterSpacing?$n(e):function(e,A){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return to(e,A)}(e,A)},Ao=[32,160,4961,65792,65793,4153,4241],to=function(e,A){for(var t,n=function(e,A){var t=s(e),n=re(t,A),o=n[0],r=n[1],i=n[2],a=t.length,c=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var e=W;l<a&&(e=oe(t,r,o,++l,i))===W;);if(e!==W||l===a){var A=new ie(t,e,c,l);return c=l,{value:A,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:A.lineBreak,wordBreak:"break-word"===A.overflowWrap?"break-word":A.wordBreak}),o=[],r=function(){if(t.value){var e=t.value.slice(),A=s(e),n="";A.forEach(function(e){-1===Ao.indexOf(e)?n+=c(e):(n.length&&o.push(n),o.push(c(e)),n="")}),n.length&&o.push(n)}};!(t=n.next()).done;)r();return o},no=function(e,A,t){this.text=oo(A.data,t.textTransform),this.textBounds=function(e,A,t,n){var o=eo(A,t),r=[],a=0;return o.forEach(function(A){if(t.textDecorationLine.length||A.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,a,A.length).getClientRects();if(o.length>1){var s=$n(A),c=0;s.forEach(function(A){r.push(new Yn(A,i.fromDOMRectList(e,Zn(n,c+a,A.length).getClientRects()))),c+=A.length})}else r.push(new Yn(A,i.fromDOMRectList(e,o)))}else{var l=n.splitText(A.length);r.push(new Yn(A,qn(e,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(A.length));a+=A.length}),r}(e,this.text,t,A)},oo=function(e,A){switch(A){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,A,t){return e.length>0?A+t.toUpperCase():e},ao=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return A(t,e),t}(Fn),so=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return A(t,e),t}(Fn),co=function(e){function t(A,t){var n=e.call(this,A,t)||this,o=new XMLSerializer,r=a(A,t);return t.setAttribute("width",r.width+"px"),t.setAttribute("height",r.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(o.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return A(t,e),t}(Fn),lo=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.value=t.value,n}return A(t,e),t}(Fn),uo=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return A(t,e),t}(Fn),po=[{type:15,flags:0,unit:"px",number:3}],go=[{type:16,flags:0,number:50}],ho="checkbox",fo="radio",mo="password",vo=707406591,Bo=function(e){function t(A,t){var n,o,r,a=e.call(this,A,t)||this;switch(a.type=t.type.toLowerCase(),a.checked=t.checked,a.value=0===(r=(o=t).type===mo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":r,a.type!==ho&&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 ho: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=go}return a}return A(t,e),t}(Fn),wo=function(e){function t(A,t){var n=e.call(this,A,t)||this,o=t.options[t.selectedIndex||0];return n.value=o&&o.text||"",n}return A(t,e),t}(Fn),yo=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n.value=t.value,n}return A(t,e),t}(Fn),bo=function(e){function t(A,t){var n=e.call(this,A,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=Fo(A,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?yA(A,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):bA.TRANSPARENT,r=t.contentWindow.document.body?yA(A,getComputedStyle(t.contentWindow.document.body).backgroundColor):bA.TRANSPARENT;n.backgroundColor=pA(o)?pA(r)?n.styles.backgroundColor:r:o}}catch(e){}return n}return A(t,e),t}(Fn),Co=["OL","UL","MENU"],xo=function(e,A,t,n){for(var o=A.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,ko(o)&&o.data.trim().length>0)t.textNodes.push(new no(e,o,t.styles));else if(Eo(o))if(Go(o)&&o.assignedNodes)o.assignedNodes().forEach(function(A){return xo(e,A,t,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),t.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,A){return Ro(A)?new ao(e,A):Lo(A)?new so(e,A):Oo(A)?new co(e,A):Ho(A)?new lo(e,A):Do(A)?new uo(e,A):Po(A)?new Bo(e,A):No(A)?new wo(e,A):jo(A)?new yo(e,A):_o(A)?new bo(e,A):new Fn(e,A)},Fo=function(e,A){var t=Qo(e,A);return t.flags|=4,xo(e,A,t,t),t},Uo=function(e,A,t){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||Ko(e)&&t.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},Lo=function(e){return"CANVAS"===e.tagName},Mo=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 A=this.counters[e];return A&&A.length?A[A.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var A=this;e.forEach(function(e){return A.counters[e].pop()})},e.prototype.parse=function(e){var A=this,t=e.counterIncrement,n=e.counterReset,o=!0;null!==t&&t.forEach(function(e){var t=A.counters[e.counter];t&&0!==e.increment&&(o=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=e.increment)});var r=[];return o&&n.forEach(function(e){var t=A.counters[e.counter];r.push(e.counter),t||(t=A.counters[e.counter]=[]),t.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,A,t,n,o,r){return e<A||e>t?ar(e,o,r.length>0):n.integers.reduce(function(A,t,o){for(;e>=t;)e-=t,A+=n.values[o];return A},"")+r},$o=function(e,A,t,n){var o="";do{t||e--,o=n(e)+o,e/=A}while(e*A>=A);return o},er=function(e,A,t,n,o){var r=t-A+1;return(e<0?"-":"")+($o(Math.abs(e),r,n,function(e){return c(Math.floor(e%r)+A)})+o)},Ar=function(e,A,t){void 0===t&&(t=". ");var n=A.length;return $o(Math.abs(e),n,!1,function(e){return A[Math.floor(e%n)]})+t},tr=function(e,A,t,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 A[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=A[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=A[c]+(s>0?t[s-1]:"")+a:1===c&&s>0&&(a=t[s-1]+a),i=Math.floor(i/10)}return(e<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(e,A,t){var n=t?". ":"",o=t?"、":"",r=t?", ":"",i=t?" ":"";switch(A){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 Ar(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 Ar(e,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return Ar(e,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return tr(e,"零一二三四五六七八九",nr,"負",o,14);case 47:return tr(e,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return tr(e,"零一二三四五六七八九",nr,"负",o,14);case 41:return tr(e,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return tr(e,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return tr(e,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return tr(e,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return tr(e,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return tr(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 Ar(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ar(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return er(e,3302,3311,!0,n);case 28:return Ar(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return Ar(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,A,t){if(this.context=e,this.options=t,this.scrolledElements=[],this.referenceElement=A,this.counters=new zo,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,A){var t=this,r=ur(e,A);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=gr(r).then(function(){return n(t,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Br),s&&(s.scrollTo(A.left,A.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===A.top&&s.scrollX===A.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-A.left,s.scrollY-A.top,0,0))),e=this.options.onclone,void 0===(t=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,t)}).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),Lo(e))return this.createCanvasClone(e);if(Mo(e))return this.createVideoClone(e);if(Vo(e))return this.createStyleClone(e);var A=e.cloneNode(!1);return Ro(A)&&(Ro(e)&&e.currentSrc&&e.currentSrc!==e.src&&(A.src=e.currentSrc,A.srcset=""),"lazy"===A.loading&&(A.loading="eager")),Wo(A)?this.createCustomElementClone(A):A},e.prototype.createCustomElementClone=function(e){var A=document.createElement("html2canvascustomelement");return fr(e.style,A),A},e.prototype.createStyleClone=function(e){try{var A=e.sheet;if(A&&A.cssRules){var t=[].slice.call(A.cssRules,0).reduce(function(e,A){return A&&"string"==typeof A.cssText?e+A.cssText:e},""),n=e.cloneNode(!1);return n.textContent=t,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 A;if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(A){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!==(A=e.getContext("webgl2"))&&void 0!==A?A: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(A){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return n},e.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var t=A.getContext("2d");try{return t&&(t.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||t.getImageData(0,0,A.width,A.height)),A}catch(A){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,A,t){Eo(A)&&("SCRIPT"===A.tagName||A.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(A))||this.options.copyStyles&&Eo(A)&&Vo(A)||e.appendChild(this.cloneNode(A,t))},e.prototype.cloneChildNodes=function(e,A,t){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(A,e,t)})}else this.appendChildNode(A,o,t)},e.prototype.cloneNode=function(e,A){if(ko(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&Eo(e)&&(Io(e)||To(e))){var n=this.createElementClone(e);n.style.transitionProperty="none";var o=t.getComputedStyle(e),r=t.getComputedStyle(e,":before"),i=t.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)&&(A=!0),Mo(e)||this.cloneChildNodes(e,n,A),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)||A)&&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,A,t,n){var o=this;if(t){var r=t.content,i=A.ownerDocument;if(i&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==t.display){this.counters.parse(new Cn(this.context,t));var a=new bn(this.context,t),s=i.createElement("html2canvaspseudoelement");fr(t,s),a.content.forEach(function(A){if(0===A.type)s.appendChild(i.createTextNode(A.value));else if(22===A.type){var t=i.createElement("img");t.src=A.value,t.style.opacity="1",s.appendChild(t)}else if(18===A.type){if("attr"===A.name){var n=A.values.filter(Ge);n.length&&s.appendChild(i.createTextNode(e.getAttribute(n[0].value)||""))}else if("counter"===A.name){var r=A.values.filter(Je),c=r[0],l=r[1];if(c&&Ge(c)){var u=o.counters.getCounterValue(c.value),d=l&&Ge(l)?kt.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===A.name){var p=A.values.filter(Je),g=(c=p[0],p[1]);if(l=p[2],c&&Ge(c)){var h=o.counters.getCounterValues(c.value),f=l&&Ge(l)?kt.parse(o.context,l.value):3,m=g&&0===g.type?g.value:"",v=h.map(function(e){return ar(e,f,!1)}).join(m);s.appendChild(i.createTextNode(v))}}}else if(20===A.type)switch(A.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(A.value))}}),s.className=wr+" "+yr;var c=n===Pn.BEFORE?" "+wr:" "+yr;return To(A)?A.className.baseValue+=c:A.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,A){var t=e.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=A.width.toString(),t.height=A.height.toString(),t.scrolling="no",t.setAttribute(sr,"true"),e.body.appendChild(t),t},dr=function(e){return new Promise(function(A){e.complete?A():e.src?(e.onload=A,e.onerror=A):A()})},pr=function(e){return Promise.all([].slice.call(e.images,0).map(dr))},gr=function(e){return new Promise(function(A,t){var n=e.contentWindow;if(!n)return t("No window assigned for iframe");var o=n.document;n.onload=e.onload=function(){n.onload=e.onload=null;var t=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(t),A(e))},50)}})},hr=["all","d","content"],fr=function(e,A){for(var t=e.length-1;t>=0;t--){var n=e.item(t);-1===hr.indexOf(n)&&A.style.setProperty(n,e.getPropertyValue(n))}return A},mr=function(e){var A="";return e&&(A+="<!DOCTYPE ",e.name&&(A+=e.name),e.internalSubset&&(A+=e.internalSubset),e.publicId&&(A+='"'+e.publicId+'"'),e.systemId&&(A+='"'+e.systemId+'"'),A+=">"),A},vr=function(e,A,t){e&&e.defaultView&&(A!==e.defaultView.pageXOffset||t!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(A,t)},Br=function(e){var A=e[0],t=e[1],n=e[2];A.scrollLeft=t,A.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,A){var t=e.ownerDocument;if(t){var n=t.createElement("style");n.textContent=A,e.appendChild(n)}},Qr=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),Fr=function(){function e(e,A){this.context=e,this._options=A,this._cache={}}return e.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)?A:Hr(e)||Er(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),A):A},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return A=Qr.isSameOrigin(e),t=!Ir(e)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!A,n=!Ir(e)&&!A&&!Hr(e)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!t,A||!1!==this._options.allowTaint||Ir(e)||Hr(e)||n||t?(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,A){var n=new Image;n.onload=function(){return e(n)},n.onerror=A,(Tr(r)||t)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return e(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return A("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 A=this,t=this._options.proxy;if(!t)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=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+s+"url="+encodeURIComponent(e)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),A._options.imageTimeout){var c=A._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,A){this.type=0,this.x=e,this.y=A}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),Or=function(e,A,t){return new Pr(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},Kr=function(){function e(e,A,t,n){this.type=1,this.start=e,this.startControl=A,this.endControl=t,this.end=n}return e.prototype.subdivide=function(A,t){var n=Or(this.start,this.startControl,A),o=Or(this.startControl,this.endControl,A),r=Or(this.endControl,this.end,A),i=Or(n,o,A),a=Or(o,r,A),s=Or(i,a,A);return t?new e(this.start,n,i,s):new e(s,a,r,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Lr=function(e){return 1===e.type},Mr=function(e){var A=e.styles,t=e.bounds,n=oA(A.borderTopLeftRadius,t.width,t.height),o=n[0],r=n[1],i=oA(A.borderTopRightRadius,t.width,t.height),a=i[0],s=i[1],c=oA(A.borderBottomRightRadius,t.width,t.height),l=c[0],u=c[1],d=oA(A.borderBottomLeftRadius,t.width,t.height),p=d[0],g=d[1],h=[];h.push((o+a)/t.width),h.push((p+l)/t.width),h.push((r+g)/t.height),h.push((s+u)/t.height);var f=Math.max.apply(Math,h);f>1&&(o/=f,r/=f,a/=f,s/=f,l/=f,u/=f,p/=f,g/=f);var m=t.width-a,v=t.height-u,B=t.width-l,w=t.height-g,y=A.borderTopWidth,b=A.borderRightWidth,C=A.borderBottomWidth,x=A.borderLeftWidth,Q=rA(A.paddingTop,e.bounds.width),F=rA(A.paddingRight,e.bounds.width),U=rA(A.paddingBottom,e.bounds.width),S=rA(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Rr(t.left+x/3,t.top+y/3,o-x/3,r-y/3,lr.TOP_LEFT):new Pr(t.left+x/3,t.top+y/3),this.topRightBorderDoubleOuterBox=o>0||r>0?Rr(t.left+m,t.top+y/3,a-b/3,s-y/3,lr.TOP_RIGHT):new Pr(t.left+t.width-b/3,t.top+y/3),this.bottomRightBorderDoubleOuterBox=l>0||u>0?Rr(t.left+B,t.top+v,l-b/3,u-C/3,lr.BOTTOM_RIGHT):new Pr(t.left+t.width-b/3,t.top+t.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||g>0?Rr(t.left+x/3,t.top+w,p-x/3,g-C/3,lr.BOTTOM_LEFT):new Pr(t.left+x/3,t.top+t.height-C/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Rr(t.left+2*x/3,t.top+2*y/3,o-2*x/3,r-2*y/3,lr.TOP_LEFT):new Pr(t.left+2*x/3,t.top+2*y/3),this.topRightBorderDoubleInnerBox=o>0||r>0?Rr(t.left+m,t.top+2*y/3,a-2*b/3,s-2*y/3,lr.TOP_RIGHT):new Pr(t.left+t.width-2*b/3,t.top+2*y/3),this.bottomRightBorderDoubleInnerBox=l>0||u>0?Rr(t.left+B,t.top+v,l-2*b/3,u-2*C/3,lr.BOTTOM_RIGHT):new Pr(t.left+t.width-2*b/3,t.top+t.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=p>0||g>0?Rr(t.left+2*x/3,t.top+w,p-2*x/3,g-2*C/3,lr.BOTTOM_LEFT):new Pr(t.left+2*x/3,t.top+t.height-2*C/3),this.topLeftBorderStroke=o>0||r>0?Rr(t.left+x/2,t.top+y/2,o-x/2,r-y/2,lr.TOP_LEFT):new Pr(t.left+x/2,t.top+y/2),this.topRightBorderStroke=o>0||r>0?Rr(t.left+m,t.top+y/2,a-b/2,s-y/2,lr.TOP_RIGHT):new Pr(t.left+t.width-b/2,t.top+y/2),this.bottomRightBorderStroke=l>0||u>0?Rr(t.left+B,t.top+v,l-b/2,u-C/2,lr.BOTTOM_RIGHT):new Pr(t.left+t.width-b/2,t.top+t.height-C/2),this.bottomLeftBorderStroke=p>0||g>0?Rr(t.left+x/2,t.top+w,p-x/2,g-C/2,lr.BOTTOM_LEFT):new Pr(t.left+x/2,t.top+t.height-C/2),this.topLeftBorderBox=o>0||r>0?Rr(t.left,t.top,o,r,lr.TOP_LEFT):new Pr(t.left,t.top),this.topRightBorderBox=a>0||s>0?Rr(t.left+m,t.top,a,s,lr.TOP_RIGHT):new Pr(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||u>0?Rr(t.left+B,t.top+v,l,u,lr.BOTTOM_RIGHT):new Pr(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=p>0||g>0?Rr(t.left,t.top+w,p,g,lr.BOTTOM_LEFT):new Pr(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||r>0?Rr(t.left+x,t.top+y,Math.max(0,o-x),Math.max(0,r-y),lr.TOP_LEFT):new Pr(t.left+x,t.top+y),this.topRightPaddingBox=a>0||s>0?Rr(t.left+Math.min(m,t.width-b),t.top+y,m>t.width+b?0:Math.max(0,a-b),Math.max(0,s-y),lr.TOP_RIGHT):new Pr(t.left+t.width-b,t.top+y),this.bottomRightPaddingBox=l>0||u>0?Rr(t.left+Math.min(B,t.width-x),t.top+Math.min(v,t.height-C),Math.max(0,l-b),Math.max(0,u-C),lr.BOTTOM_RIGHT):new Pr(t.left+t.width-b,t.top+t.height-C),this.bottomLeftPaddingBox=p>0||g>0?Rr(t.left+x,t.top+Math.min(w,t.height-C),Math.max(0,p-x),Math.max(0,g-C),lr.BOTTOM_LEFT):new Pr(t.left+x,t.top+t.height-C),this.topLeftContentBox=o>0||r>0?Rr(t.left+x+S,t.top+y+Q,Math.max(0,o-(x+S)),Math.max(0,r-(y+Q)),lr.TOP_LEFT):new Pr(t.left+x+S,t.top+y+Q),this.topRightContentBox=a>0||s>0?Rr(t.left+Math.min(m,t.width+x+S),t.top+y+Q,m>t.width+x+S?0:a-x+S,s-(y+Q),lr.TOP_RIGHT):new Pr(t.left+t.width-(b+F),t.top+y+Q),this.bottomRightContentBox=l>0||u>0?Rr(t.left+Math.min(B,t.width-(x+S)),t.top+Math.min(v,t.height+y+Q),Math.max(0,l-(b+F)),u-(C+U),lr.BOTTOM_RIGHT):new Pr(t.left+t.width-(b+F),t.top+t.height-(C+U)),this.bottomLeftContentBox=p>0||g>0?Rr(t.left+x+S,t.top+w,Math.max(0,p-(x+S)),g-(C+U),lr.BOTTOM_LEFT):new Pr(t.left+x+S,t.top+t.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,A,t,n,o){var r=(Math.sqrt(2)-1)/3*4,i=t*r,a=n*r,s=e+t,c=A+n;switch(o){case lr.TOP_LEFT:return new Kr(new Pr(e,c),new Pr(e,c-a),new Pr(s-i,A),new Pr(s,A));case lr.TOP_RIGHT:return new Kr(new Pr(e,A),new Pr(e+i,A),new Pr(s,c-a),new Pr(s,c));case lr.BOTTOM_RIGHT:return new Kr(new Pr(s,A),new Pr(s,A+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,A+a),new Pr(e,A))}},_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,A,t){this.offsetX=e,this.offsetY=A,this.matrix=t,this.type=0,this.target=6},Nr=function(e,A){this.path=e,this.target=A,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,A){return e.length===A.length&&e.some(function(e,t){return e===A[t]})},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,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new Mr(this.container),this.container.styles.opacity<1&&this.effects.push(new Gr(this.container.styles.opacity)),null!==this.container.styles.transform){var t=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(t,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 A=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var o=t.effects.filter(function(e){return!Wr(e)});if(A||0!==t.container.styles.position||!t.parent){if(n.unshift.apply(n,o),A=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var r=_r(t.curves),i=Vr(t.curves);zr(r,i)||n.unshift(new Nr(i,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(A){return ln(A.target,e)})},e}(),Yr=function(e,A,t,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()?t:A,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,A){return u>e.element.container.styles.zIndex.order?(d=A,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var p=0;c.positiveZIndex.some(function(e,A){return u>=e.element.container.styles.zIndex.order?(p=A+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:t,s)}else o.styles.isInlineLevel()?A.inlineLevel.push(a):A.nonInlineLevel.push(a),Yr(a,A,t,s);ln(o.flags,8)&&qr(o,s)})},qr=function(e,A){for(var t=e instanceof uo?e.start:1,n=e instanceof uo&&e.reversed,o=0;o<A.length;o++){var r=A[o];r.container instanceof lo&&"number"==typeof r.container.value&&0!==r.container.value&&(t=r.container.value),r.listValue=ar(t,r.container.styles.listStyleType,!0),t+=n?-1:1}},Zr=function(e,A){switch(A){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,A){var t=[];return Lr(e)?t.push(e.subdivide(.5,!1)):t.push(e),Lr(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},ei=function(e,A,t,n){var o=[];return Lr(e)?o.push(e.subdivide(.5,!1)):o.push(e),Lr(t)?o.push(t.subdivide(.5,!0)):o.push(t),Lr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Lr(A)?o.push(A.subdivide(.5,!1).reverse()):o.push(A),o},Ai=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ti=function(e){var A=e.styles,t=e.bounds,n=rA(A.paddingLeft,t.width),o=rA(A.paddingRight,t.width),r=rA(A.paddingTop,t.width),i=rA(A.paddingBottom,t.width);return t.add(n+A.borderLeftWidth,r+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+n+o),-(A.borderTopWidth+A.borderBottomWidth+r+i))},ni=function(e,A,t){var n=function(e,A){return 0===e?A.bounds:2===e?ti(A):Ai(A)}(ai(e.styles.backgroundOrigin,A),e),o=function(e,A){return 0===e?A.bounds:2===e?ti(A):Ai(A)}(ai(e.styles.backgroundClip,A),e),r=ii(ai(e.styles.backgroundSize,A),t,n),i=r[0],a=r[1],s=oA(ai(e.styles.backgroundPosition,A),n.width-i,n.height-a);return[si(ai(e.styles.backgroundRepeat,A),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===_A.AUTO},ri=function(e){return"number"==typeof e},ii=function(e,A,t){var n=A[0],o=A[1],r=A[2],i=e[0],a=e[1];if(!i)return[0,0];if($e(i)&&a&&$e(a))return[rA(i,t.width),rA(a,t.height)];var s=ri(r);if(Ge(i)&&(i.value===_A.CONTAIN||i.value===_A.COVER))return ri(r)?t.width/t.height<r!=(i.value===_A.COVER)?[t.width,t.width/r]:[t.height*r,t.height]:[t.width,t.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:t.width,l?o:t.height]:[t.width,t.height];if(s){var d=0,p=0;return $e(i)?d=rA(i,t.width):$e(a)&&(p=rA(a,t.height)),oi(i)?d=p*r:a&&!oi(a)||(p=d/r),[d,p]}var g=null,h=null;if($e(i)?g=rA(i,t.width):a&&$e(a)&&(h=rA(a,t.height)),null===g||a&&!oi(a)||(h=c&&l?g/n*o:t.height),null!==h&&oi(i)&&(g=c&&l?h/o*n:t.width),null!==g&&null!==h)return[g,h];throw new Error("Unable to calculate background-size for element")},ai=function(e,A){var t=e[A];return void 0===t?e[0]:t},si=function(e,A,t,n,o){var r=A[0],i=A[1],a=t[0],s=t[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,A){var t=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),r=this._document.body;t.style.visibility="hidden",t.style.fontFamily=e,t.style.fontSize=A,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",r.appendChild(t),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=A,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(ci)),t.appendChild(o),t.appendChild(n);var i=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode(ci)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:i,middle:a}},e.prototype.getMetrics=function(e,A){var t=e+" "+A;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(e,A)),this._data[t]},e}(),ui=function(e,A){this.context=e,this.options=A},di=function(e){function t(A,t){var n=e.call(this,A,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new li(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return A(t,e),t.prototype.applyEffects=function(e){for(var A=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return A.applyEffect(e)})},t.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)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(e){return n(this,void 0,void 0,function(){return o(this,function(A){switch(A.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:A.sent(),A.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(e){return n(this,void 0,void 0,function(){return o(this,function(A){switch(A.label){case 0:return ln(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(e)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(e,A,t){var n=this;0===A?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+t):$n(e.text).reduce(function(A,o){return n.ctx.fillText(o,A,e.bounds.top+t),A+n.ctx.measureText(o).width},e.bounds.left)},t.prototype.createFontStyle=function(e){var A=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),t=mi(e.fontFamily).join(", "),n=je(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,A,e.fontWeight,n,t].join(" "),t,n]},t.prototype.renderTextNode=function(e,A){return n(this,void 0,void 0,function(){var t,n,r,i,a,s,c,l,u=this;return o(this,function(o){return t=this.createFontStyle(A),n=t[0],r=t[1],i=t[2],this.ctx.font=n,this.ctx.direction=1===A.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=A.paintOrder,e.textBounds.forEach(function(e){l.forEach(function(t){switch(t){case 0:u.ctx.fillStyle=gA(A.color),u.renderTextWithLetterSpacing(e,A.letterSpacing,s);var n=A.textShadow;n.length&&e.text.trim().length&&(n.slice(0).reverse().forEach(function(t){u.ctx.shadowColor=gA(t.color),u.ctx.shadowOffsetX=t.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=t.offsetY.number*u.options.scale,u.ctx.shadowBlur=t.blur.number,u.renderTextWithLetterSpacing(e,A.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),A.textDecorationLine.length&&(u.ctx.fillStyle=gA(A.textDecorationColor||A.color),A.textDecorationLine.forEach(function(A){switch(A){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:A.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=gA(A.webkitTextStrokeColor),u.ctx.lineWidth=A.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]})})},t.prototype.renderReplacedElement=function(e,A,t){if(t&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var n=ti(e),o=Vr(A);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,e.intrinsicWidth,e.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return n(this,void 0,void 0,function(){var A,n,r,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y;return o(this,function(o){switch(o.label){case 0:this.applyEffects(e.getEffects(4)),A=e.container,n=e.curves,r=A.styles,a=0,s=A.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(!(A instanceof ao))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(A.src)];case 6:return v=o.sent(),this.renderReplacedElement(A,n,v),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+A.src),[3,8];case 8:if(A instanceof so&&this.renderReplacedElement(A,n,A.canvas),!(A instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(A.svg)];case 10:return v=o.sent(),this.renderReplacedElement(A,n,v),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+A.svg.substring(0,255)),[3,12];case 12:return A instanceof bo&&A.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:A.backgroundColor,x:0,y:0,width:A.width,height:A.height}).render(A.tree)]:[3,14];case 13:l=o.sent(),A.width&&A.height&&this.ctx.drawImage(l,0,0,A.width,A.height,A.bounds.left,A.bounds.top,A.bounds.width,A.bounds.height),o.label=14;case 14:if(A instanceof Bo&&(u=Math.min(A.bounds.width,A.bounds.height),A.type===ho?A.checked&&(this.ctx.save(),this.path([new Pr(A.bounds.left+.39363*u,A.bounds.top+.79*u),new Pr(A.bounds.left+.16*u,A.bounds.top+.5549*u),new Pr(A.bounds.left+.27347*u,A.bounds.top+.44071*u),new Pr(A.bounds.left+.39694*u,A.bounds.top+.5649*u),new Pr(A.bounds.left+.72983*u,A.bounds.top+.23*u),new Pr(A.bounds.left+.84*u,A.bounds.top+.34085*u),new Pr(A.bounds.left+.39363*u,A.bounds.top+.79*u)]),this.ctx.fillStyle=gA(vo),this.ctx.fill(),this.ctx.restore()):A.type===fo&&A.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(A.bounds.left+u/2,A.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=gA(vo),this.ctx.fill(),this.ctx.restore())),pi(A)&&A.value.length){switch(d=this.createFontStyle(r),w=d[0],p=d[1],g=this.fontMetrics.getMetrics(w,p).baseline,this.ctx.font=w,this.ctx.fillStyle=gA(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hi(A.styles.textAlign),y=ti(A),h=0,A.styles.textAlign){case 1:h+=y.width/2;break;case 2:h+=y.width}f=y.add(h,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(A.value,f),r.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(A.styles.display,2048))return[3,20];if(null===A.styles.listStyleImage)return[3,19];if(0!==(m=A.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,A.bounds.left-(v.width+10),A.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!==A.styles.listStyleType&&(w=this.createFontStyle(r)[0],this.ctx.font=w,this.ctx.fillStyle=gA(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(A.bounds.left,A.bounds.top+rA(A.styles.paddingTop,A.bounds.width),A.bounds.width,Ft(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(e.listValue,y),r.letterSpacing,Ft(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),o.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i,a,s,c,l,u,d,p,g,h,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(),A=0,t=e.negativeZIndex,o.label=2;case 2:return A<t.length?(f=t[A],[4,this.renderStack(f)]):[3,5];case 3:o.sent(),o.label=4;case 4:return A++,[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:g=0,h=e.positiveZIndex,o.label=27;case 27:return g<h.length?(f=h[g],[4,this.renderStack(f)]):[3,30];case 28:o.sent(),o.label=29;case 29:return g++,[3,27];case 30:return[2]}})})},t.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()},t.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},t.prototype.formatPath=function(e){var A=this;e.forEach(function(e,t){var n=Lr(e)?e.start:e;0===t?A.ctx.moveTo(n.x,n.y):A.ctx.lineTo(n.x,n.y),Lr(e)&&A.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},t.prototype.renderRepeat=function(e,A,t,n){this.path(e),this.ctx.fillStyle=A,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},t.prototype.resizeImage=function(e,A,t){var n;if(e.width===A&&e.height===t)return e;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,A),o.height=Math.max(1,t),o.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,A,t),o},t.prototype.renderBackgroundImage=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i,a;return o(this,function(s){switch(s.label){case 0:A=e.styles.backgroundImage.length-1,t=function(t){var r,i,a,s,c,l,u,d,p,g,h,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!==t.type)return[3,5];r=void 0,i=t.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,A,[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===t.type?(s=ni(e,A,[null,null,null]),w=s[0],F=s[1],U=s[2],C=s[3],x=s[4],c=UA(t.angle,C,x),l=c[0],u=c[1],d=c[2],p=c[3],g=c[4],(h=document.createElement("canvas")).width=C,h.height=x,f=h.getContext("2d"),m=f.createLinearGradient(u,p,d,g),FA(t.stops,l).forEach(function(e){return m.addColorStop(e.stop,gA(e.color))}),f.fillStyle=m,f.fillRect(0,0,C,x),C>0&&x>0&&(v=n.ctx.createPattern(h,"repeat"),n.renderRepeat(w,v,F,U))):function(e){return 2===e.type}(t)&&(B=ni(e,A,[null,null,null]),w=B[0],y=B[1],b=B[2],C=B[3],x=B[4],Q=0===t.position.length?[tA]:t.position,F=rA(Q[0],C),U=rA(Q[Q.length-1],x),S=function(e,A,t,n,o){var r=0,i=0;switch(e.size){case 0:0===e.shape?r=i=Math.min(Math.abs(A),Math.abs(A-n),Math.abs(t),Math.abs(t-o)):1===e.shape&&(r=Math.min(Math.abs(A),Math.abs(A-n)),i=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===e.shape)r=i=Math.min(SA(A,t),SA(A,t-o),SA(A-n,t),SA(A-n,t-o));else if(1===e.shape){var a=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(A),Math.abs(A-n)),s=kA(n,o,A,t,!0),c=s[0],l=s[1];i=a*(r=SA(c-A,(l-t)/a))}break;case 1:0===e.shape?r=i=Math.max(Math.abs(A),Math.abs(A-n),Math.abs(t),Math.abs(t-o)):1===e.shape&&(r=Math.max(Math.abs(A),Math.abs(A-n)),i=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===e.shape)r=i=Math.max(SA(A,t),SA(A,t-o),SA(A-n,t),SA(A-n,t-o));else if(1===e.shape){a=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(A),Math.abs(A-n));var u=kA(n,o,A,t,!1);c=u[0],l=u[1],i=a*(r=SA(c-A,(l-t)/a))}}return Array.isArray(e.size)&&(r=rA(e.size[0],n),i=2===e.size.length?rA(e.size[1],o):r),[r,i]}(t,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),FA(t.stops,2*k).forEach(function(e){return I.addColorStop(e.stop,gA(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 A--,[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,t(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(e,A,t){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zr(t,A)),this.ctx.fillStyle=gA(e),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(e,A,t,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return A<3?[4,this.renderSolidBorder(e,t,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(e,A){switch(A){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,t),this.path(n),this.ctx.fillStyle=gA(e),this.ctx.fill(),i=function(e,A){switch(A){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,t),this.path(i),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(e){return n(this,void 0,void 0,function(){var A,t,n,r,i,a,s,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(e.getEffects(2)),A=e.container.styles,t=!pA(A.backgroundColor)||A.backgroundImage.length,n=[{style:A.borderTopStyle,color:A.borderTopColor,width:A.borderTopWidth},{style:A.borderRightStyle,color:A.borderRightColor,width:A.borderRightWidth},{style:A.borderBottomStyle,color:A.borderBottomColor,width:A.borderBottomWidth},{style:A.borderLeftStyle,color:A.borderLeftColor,width:A.borderLeftWidth}],r=gi(ai(A.backgroundClip,0),e.curves),t||A.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),pA(A.backgroundColor)||(this.ctx.fillStyle=gA(A.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),A.boxShadow.slice(0).reverse().forEach(function(A){l.ctx.save();var t,n,o,r,i,a=_r(e.curves),s=A.inset?0:1e4,c=(t=a,n=-s+(A.inset?1:-1)*A.spread.number,o=(A.inset?1:-1)*A.spread.number,r=A.spread.number*(A.inset?-2:2),i=A.spread.number*(A.inset?-2:2),t.map(function(e,A){switch(A){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}));A.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=A.offsetX.number+s,l.ctx.shadowOffsetY=A.offsetY.number,l.ctx.shadowColor=gA(A.color),l.ctx.shadowBlur=A.blur.number,l.ctx.fillStyle=A.inset?gA(A.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&&!pA(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]}})})},t.prototype.renderDashedDottedBorder=function(e,A,t,r,i){return n(this,void 0,void 0,function(){var n,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y;return o(this,function(o){return this.ctx.save(),n=function(e,A){switch(A){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,t),a=Zr(r,t),2===i&&(this.path(a),this.ctx.clip()),Lr(a[0])?(s=a[0].start.x,c=a[0].start.y):(s=a[0].x,c=a[0].y),Lr(a[1])?(l=a[1].end.x,u=a[1].end.y):(l=a[1].x,u=a[1].y),d=0===t||2===t?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),3===i?this.formatPath(n):this.formatPath(a.slice(0,2)),p=A<3?3*A:2*A,g=A<3?2*A:A,3===i&&(p=A,g=A),h=!0,d<=2*p?h=!1:d<=2*p+g?(p*=f=d/(2*p+g),g*=f):(m=Math.floor((d+g)/(p+g)),v=(d-m*p)/(m-1),g=(B=(d-(m+1)*p)/m)<=0||Math.abs(g-v)<Math.abs(g-B)?v:B),h&&(3===i?this.ctx.setLineDash([0,p+g]):this.ctx.setLineDash([p,g])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=A):this.ctx.lineWidth=2*A+1.1,this.ctx.strokeStyle=gA(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Lr(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()),Lr(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]})})},t.prototype.render=function(e){return n(this,void 0,void 0,function(){var A;return o(this,function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=gA(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),A=o,[4,this.renderStack(A)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},t}(ui),pi=function(e){return e instanceof yo||e instanceof wo||e instanceof Bo&&e.type!==fo&&e.type!==ho},gi=function(e,A){switch(e){case 0:return _r(A);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(A);default:return Vr(A)}},hi=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 t(A,t){var n=e.call(this,A,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return A(t,e),t.prototype.render=function(e){return n(this,void 0,void 0,function(){var A,t;return o(this,function(n){switch(n.label){case 0:return A=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Bi(A)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=gA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t}(ui),Bi=function(e){return new Promise(function(A,t){var n=new Image;n.onload=function(){A(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},wi=function(){function e(e){var A=e.id,t=e.enabled;this.id=A,this.enabled=t,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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=[],A=0;A<arguments.length;A++)e[A]=arguments[A];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(A,t){var n;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new wi({id:this.instanceName,enabled:A.logging}),this.cache=null!==(n=A.cache)&&void 0!==n?n:new Fr(this,A)}return e.instanceCount=1,e}();"undefined"!=typeof window&&Qr.setContext(window);var bi=function(e,A){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,L,M,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=A.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=A.imageTimeout)&&void 0!==S?S:15e3,proxy:A.proxy,useCORS:null!==(k=A.useCORS)&&void 0!==k&&k},c=t({logging:null===(E=A.logging)||void 0===E||E,cache:A.cache},s),l={windowWidth:null!==(I=A.windowWidth)&&void 0!==I?I:r.innerWidth,windowHeight:null!==(T=A.windowHeight)&&void 0!==T?T:r.innerHeight,scrollX:null!==(H=A.scrollX)&&void 0!==H?H:r.pageXOffset,scrollY:null!==(D=A.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=A.foreignObjectRendering)&&void 0!==P&&P,g={allowTaint:null!==(O=A.allowTaint)&&void 0!==O&&O,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:p,copyStyles:p},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),h=new cr(d,e,g),(f=h.clonedReferenceElement)?[4,h.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 A=e.body,t=e.documentElement;if(!A||!t)throw new Error("Unable to get document size");var n=Math.max(Math.max(A.scrollWidth,t.scrollWidth),Math.max(A.offsetWidth,t.offsetWidth),Math.max(A.clientWidth,t.clientWidth)),o=Math.max(Math.max(A.scrollHeight,t.scrollHeight),Math.max(A.offsetHeight,t.offsetHeight),Math.max(A.clientHeight,t.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,A.backgroundColor),x={canvas:A.canvas,backgroundColor:C,scale:null!==(L=null!==(K=A.scale)&&void 0!==K?K:r.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(M=A.x)&&void 0!==M?M:0)+y,y:(null!==(R=A.y)&&void 0!==R?R:0)+b,width:null!==(_=A.width)&&void 0!==_?_:Math.ceil(B),height:null!==(V=A.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=bA.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=A.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,A,t){var n=A.ownerDocument,o=n.documentElement?yA(e,getComputedStyle(n.documentElement).backgroundColor):bA.TRANSPARENT,r=n.body?yA(e,getComputedStyle(n.body).backgroundColor):bA.TRANSPARENT,i="string"==typeof t?yA(e,t):null===t?bA.TRANSPARENT:4294967295;return A===n.documentElement?pA(o)?pA(r)?i:r:o:i};return function(e,A){return void 0===A&&(A={}),bi(e,A)}}()},540:(e,A,t)=>{"use strict";e.exports=t(869)},698:(e,A)=>{"use strict";var t=Symbol.for("react.transitional.element");function n(e,A,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==A.key&&(o=""+A.key),"key"in A)for(var r in n={},A)"key"!==r&&(n[r]=A[r]);else n=A;return A=n.ref,{$$typeof:t,type:e,key:o,ref:void 0!==A?A:null,props:n}}Symbol.for("react.fragment"),A.jsx=n,A.jsxs=n},848:(e,A,t)=>{"use strict";e.exports=t(698)},869:(e,A)=>{"use strict";Symbol.for("react.transitional.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.consumer"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.activity"),Symbol.iterator;var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,o={};function r(e,A,n){this.props=e,this.context=A,this.refs=o,this.updater=n||t}function i(){}function a(e,A,n){this.props=e,this.context=A,this.refs=o,this.updater=n||t}r.prototype.isReactComponent={},r.prototype.setState=function(e,A){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,A,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},i.prototype=r.prototype;var s=a.prototype=new i;s.constructor=a,n(s,r.prototype),s.isPureReactComponent=!0;Array.isArray;var c={H:null,A:null,T:null,S:null};Object.prototype.hasOwnProperty;"function"==typeof reportError&&reportError;A.useEffect=function(e,A){return c.H.useEffect(e,A)},A.useRef=function(e){return c.H.useRef(e)},A.useState=function(e){return c.H.useState(e)}}},A={};function t(n){var o=A[n];if(void 0!==o)return o.exports;var r=A[n]={exports:{}};return e[n].call(r.exports,r,r.exports,t),r.exports}t.n=e=>{var A=e&&e.__esModule?()=>e.default:()=>e;return t.d(A,{a:A}),A},t.d=(e,A)=>{for(var n in A)t.o(A,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:A[n]})},t.o=(e,A)=>Object.prototype.hasOwnProperty.call(e,A),t.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";t.r(n),t.d(n,{AgentSDK:()=>Hn,AudioPlayer:()=>Zt,AudioRecorder:()=>q,EventEmitter:()=>O,MicPermissionModals:()=>A,MicPermissionUtils:()=>e,TTPChatWidget:()=>or,TextChatSDK:()=>mt,VERSION:()=>rr,VanillaVoiceButton:()=>yn,VoiceButton:()=>un,VoiceSDK_v2:()=>ot,WebSocketManager:()=>_t,default:()=>ir});var e={};t.r(e),t.d(e,{checkPermissionState:()=>Ln,getDeviceInfo:()=>Kn,getPermissionInstructions:()=>Rn,openSettings:()=>_n});var A={};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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=o(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(A)?A:A+""}t.r(A),t.d(A,{showBlockedModal:()=>Jn,showNoMicrophoneModal:()=>Yn,showPrePromptModal:()=>Xn});const a=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},A=[{key:"on",value:function(e,A){return this.events[e]||(this.events[e]=[]),this.events[e].push(A),this}},{key:"off",value:function(e,A){return this.events[e]?(this.events[e]=this.events[e].filter(function(e){return e!==A}),this):this}},{key:"emit",value:function(e){for(var A=arguments.length,t=new Array(A>1?A-1:0),n=1;n<A;n++)t[n-1]=arguments[n];return!!this.events[e]&&(this.events[e].forEach(function(e){e.apply(void 0,t)}),!0)}},{key:"once",value:function(e,A){var t=this,n=function(){A.apply(void 0,arguments),t.off(e,n)};return this.on(e,n)}},{key:"removeAllListeners",value:function(e){return e?delete this.events[e]:this.events={},this}}],A&&r(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=s(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(A)?A:A+""}const u=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCM"},(A=[{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,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g(n.key),n)}}function g(e){var A=function(e){if("object"!=d(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(A)?A:A+""}const h=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMU"},(A=[{key:"decode",value:function(e){for(var A=e instanceof Uint8Array?e:new Uint8Array(e),t=new Int16Array(A.length),n=0;n<A.length;n++)t[n]=this.mulawToLinear(A[n]);return t.buffer}},{key:"encode",value:function(e){for(var A=e instanceof Int16Array?e:new Int16Array(e),t=new Uint8Array(A.length),n=0;n<A.length;n++)t[n]=this.linearToMulaw(A[n]);return t}},{key:"mulawToLinear",value:function(e){var A=1<<3+(e>>4&7);return(128&e?-1:1)*(132+(15&e)*A+(A>>1)-4)}},{key:"linearToMulaw",value:function(e){var A=e>>8&128;A&&(e=-e),e>32635&&(e=32635),e+=132;for(var t=7,n=16384;0===(e&n)&&t>0;t--,n>>=1);return 255&~(A|t<<4|e>>t+3&15)}}])&&p(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=f(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=f(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(A)?A:A+""}const B=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMA"},(A=[{key:"decode",value:function(e){for(var A=e instanceof Uint8Array?e:new Uint8Array(e),t=new Int16Array(A.length),n=0;n<A.length;n++)t[n]=this.alawToLinear(A[n]);return t.buffer}},{key:"encode",value:function(e){for(var A=e instanceof Int16Array?e:new Int16Array(e),t=new Uint8Array(A.length),n=0;n<A.length;n++)t[n]=this.linearToAlaw(A[n]);return t}},{key:"alawToLinear",value:function(e){var A=(e^=85)>>4&7,t=15&e;return(128&e?-1:1)*(0===A?8+(t<<4):264+(t<<4)<<A-1)}},{key:"linearToAlaw",value:function(e){var A,t,n=e>>8&128;if(n&&(e=-e),e>32635&&(e=32635),e<256)A=0,t=e>>4;else{A=7;for(var o=16384;0===(e&o)&&A>0;A--,o>>=1);t=e>>A+3&15}return 85^(n|A<<4|t)}}])&&m(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function b(e){if(null!=e){var A=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(A)return A.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}}throw new TypeError(w(e)+" is not iterable")}function C(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return x(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(x(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}x=function(e,A,t,n){function r(A,t){x(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},x(e,A,t,n)}function Q(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function F(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=w(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=w(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(A)?A:A+""}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,A){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},I(e,A)}const T=function(e){function A(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),e=function(e,A,t){return A=E(A),function(e,A){if(A&&("object"==w(A)||"function"==typeof A))return A;if(void 0!==A)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(A,t||[],E(e).constructor):A.apply(e,t))}(this,A),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 (100ms) + 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=t,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 h,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,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&I(e,A)}(A,e),t=A,n=[{key:"setOutputFormat",value:function(e){var A;this.validateFormat(e)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",e),e=this.getDefaultFormat());var t=null===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate,n=e.sampleRate;this.outputFormat=e,console.log("✅ AudioPlayer v2: Format set:",e),this.audioContext&&t&&t!==n&&(console.warn("⚠️ AudioPlayer: Sample rate changed, recreating AudioContext"),console.warn(" Old: ".concat(t,"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 A,t;if(!e)return!1;var n=null===(A=e.container)||void 0===A?void 0:A.toLowerCase(),o=null===(t=e.encoding)||void 0===t?void 0:t.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 A=this;if(this._isStopped)console.log("🛑 AudioPlayer: Ignoring audio chunk - playback was stopped (barge-in)");else try{var t=this.createAudioBlob(e);this.audioQueue.push(t),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return A.processQueue()},50)}catch(e){console.error("❌ AudioPlayer v2: Playback error:",e),this.emit("playbackError",e)}}},{key:"playChunk",value:(l=F(C().m(function e(A){var t,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:(t=this.prepareChunk(A))?(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(t),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==A?void 0:A.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 A;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 t=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,t=n.buffer}for(var o=new Int16Array(t),r=new Float32Array(o.length),i=1/32768,a=o.length,s=0;s<a;s++)r[s]=o[s]*i;var c=(null===(A=this.outputFormat)||void 0===A?void 0:A.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,g=d;return l!==c&&(g=p/l),{buffer:u,duration:g,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 A,t,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,A=this.preparedBuffer.length,0===(t=Math.min(A,5))&&A>0&&(t=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 A,t,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(A=l.preparedBuffer.shift()){e.n=2;break}return e.a(2,0);case 2:(t=l.audioContext.createBufferSource()).buffer=A.buffer,t.connect(l.gainNode||l.audioContext.destination),l.scheduledSources.add(t),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()),t.start(l.nextStartTime),l.nextStartTime+=A.duration,l.nextStartTime=Math.round(1e6*l.nextStartTime)/1e6,s=l.nextStartTime-A.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(A.duration.toFixed(4),"s (").concat((1e3*A.duration).toFixed(2),"ms), Queued: ").concat(l.preparedBuffer.length,", Scheduled: ").concat(l.scheduledBuffers))),l.scheduledBuffers++,a++,t.onended=function(){if(!l._isStopped&&l.scheduledSources.has(t))if(l.scheduledSources.delete(t),!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<t)){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 A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,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===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate)||this.audioContext.sampleRate,d=this.audioContext.sampleRate,null!==(t=this.outputFormat)&&void 0!==t&&t.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),(g=this.audioContext.createBufferSource()).buffer=p,g.connect(this.gainNode||this.audioContext.destination),h=this.audioContext.currentTime,this.nextStartTime<h&&(this.nextStartTime=h,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",h)),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")))),g.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++,g.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 A=new Uint8Array(e);console.log("🎵 AudioPlayer: Processing ".concat(A.length," bytes")),console.log("🎵 AudioPlayer: Negotiated format:",this.outputFormat);var t=this.outputFormat&&this.outputFormat.container&&"wav"===this.outputFormat.container.toLowerCase(),n=this.outputFormat&&this.outputFormat.container&&"raw"===this.outputFormat.container.toLowerCase(),o=this.isWavFile(A);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(A);if(n&&!o)console.log("🎵 AudioPlayer: Processing as RAW data (as negotiated)");else{if(t&&o)return console.log("✅ AudioPlayer: Processing as WAV file (matches negotiation)"),this.handleWavFile(A);if(t&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(A);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(A);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(A)}},{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 A=this.parseWavHeader(e);if(console.log("🎵 WAV file detected:",{format:A.audioFormat,encoding:this.getEncodingName(A.audioFormat),sampleRate:A.sampleRate,channels:A.channels,bitDepth:A.bitsPerSample}),1===A.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([e],{type:"audio/wav"});var t=this.getCodecForWavFormat(A.audioFormat);if(!t)throw new Error("Unsupported WAV format code: ".concat(A.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=e.slice(44),o=t.decode(n),r=this.createWavHeader(o.byteLength,A.sampleRate,A.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(e){var A,t,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."),A=this.convert24BitTo16Bit(e),t=16):8===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),A=this.convert8BitTo16Bit(e),t=16):(A=e.buffer,t=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else A=o.decode(e),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(A.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([i,A],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(e){for(var A=Math.floor(e.length/3),t=new Int16Array(A),n=0;n<A;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),t[n]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return t.buffer}},{key:"convert8BitTo16Bit",value:function(e){for(var A=e.length,t=new Int16Array(A),n=0;n<A;n++){var o=e[n];t[n]=256*(o-128)}return t.buffer}},{key:"getCodec",value:function(e){var A={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[A]}},{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 A=new DataView(e.buffer,e.byteOffset,e.byteLength);return{audioFormat:A.getUint16(20,!0),channels:A.getUint16(22,!0),sampleRate:A.getUint32(24,!0),byteRate:A.getUint32(28,!0),blockAlign:A.getUint16(32,!0),bitsPerSample:A.getUint16(34,!0)}}},{key:"createWavHeader",value:function(e,A,t,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,t,!0),r.setUint32(24,A,!0),r.setUint32(28,A*t*n/8,!0),r.setUint16(32,t*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 A,t,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===(A=this.audioContext)||void 0===A?void 0:A.state,"currentTime:",null===(t=this.audioContext)||void 0===t?void 0:t.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 A=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),t=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(A),o._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void e();"running"===n.state&&(clearTimeout(A),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),e())};o._waitForReadyStateHandler=t,n.addEventListener("statechange",t),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(A),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,A,t=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||44100;if(48e3!==t&&44100!==t&&(console.log("ℹ️ AudioPlayer: Backend requested ".concat(t,"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-t)>100))return;console.warn("⚠️ AudioPlayer: AudioContext sample rate (".concat(n,"Hz) doesn't match format (").concat(t,"Hz), recreating...")),this.stopImmediate(),this._cleanupAudioContext()}console.log("🎵 AudioPlayer: Creating AudioContext at ".concat(t,"Hz (from outputFormat: ").concat((null===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate)||"not set",")"));try{this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t,latencyHint:"playback"}),console.log("✅ AudioContext created at ".concat(this.audioContext.sampleRate,"Hz (requested: ").concat(t,"Hz)")),Math.abs(this.audioContext.sampleRate-t)>100?(console.error("❌ CRITICAL: Browser sample rate mismatch!"),console.error(" Requested: ".concat(t,"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!==t&&(console.warn("⚠️ Browser adjusted sample rate: ".concat(t,"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 A,t,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 A=this.audioContext.sampleRate,t=this.audioContext.createBuffer(1,.1*A,A),(n=this.audioContext.createBufferSource()).buffer=t,n.connect(this.audioContext.destination),n.start(),e.n=2,new Promise(function(e){return setTimeout(e,100)});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 A,t,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,A=this.audioQueue.shift()){e.n=3;break}return this.isProcessingQueue=!1,e.a(2);case 3:return e.p=3,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),e.n=4,this.waitForAudioContextReady();case 4:return n=this.audioContext,e.n=5,A.arrayBuffer();case 5:return o=e.v,e.n=6,n.decodeAudioData(o);case 6:r=e.v,i=t&&!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 A=0,t=Array.from(this.scheduledSources),n=t.length;this.scheduledSources.clear(),this.scheduledBuffers=0;for(var o=0,r=t;o<r.length;o++){var i=r[o];try{i.stop(),A++}catch(e){console.log(" Source already stopped or not started:",e.message)}}console.log(" Stopped ".concat(A," 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 A=this,t=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(t,", isPlaying: ").concat(n,")")),this._emptySentenceTimeout&&clearTimeout(this._emptySentenceTimeout);var o=e;this._emptySentenceTimeout=setTimeout(function(){A.pendingSentenceText!==o||0!==A.scheduledBuffers||0!==A.preparedBuffer.length||0!==A.pcmChunkQueue.length||A._isStopped||(console.warn('⚠️ AudioPlayer: Empty sentence detected after 5s timeout - no chunks received for: "'.concat(o.substring(0,40),'..."')),A.pendingSentenceText===o&&(A.pendingSentenceText=null),A.isPlaying||0!==A.scheduledSources.size||(console.log("🛑 AudioPlayer: Emitting playbackStopped for empty sentence timeout"),A.emit("playbackStopped"))),A._emptySentenceTimeout=null},5e3)}},{key:"startTranscriptChecker",value:function(){var e=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var A=function(){if(e.isCheckingTranscripts&&e.audioContext){var t,n=e.audioContext.currentTime,o=function(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return y(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(e.sentenceTimings);try{for(o.s();!(t=o.n()).done;){var r=t.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(A):(e.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(A)}}},{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 A;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,A=e.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",A);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(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=H(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=H(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(A)?A:A+""}var O=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},A=[{key:"on",value:function(e,A){this.events[e]||(this.events[e]=[]),this.events[e].push(A)}},{key:"off",value:function(e,A){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==A}))}},{key:"emit",value:function(e){for(var A=arguments.length,t=new Array(A>1?A-1:0),n=1;n<A;n++)t[n-1]=arguments[n];this.events[e]&&this.events[e].forEach(function(A){try{A.apply(void 0,t)}catch(A){console.error("Error in event listener for ".concat(e,":"),A)}})}},{key:"removeAllListeners",value:function(e){e?delete this.events[e]:this.events={}}}],A&&D(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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 L(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function M(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?L(Object(t),!0).forEach(function(A){R(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function R(e,A,t){return(A=z(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function _(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return V(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(V(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}V=function(e,A,t,n){function r(A,t){V(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},V(e,A,t,n)}function j(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function N(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);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,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function W(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=K(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=K(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==K(A)?A:A+""}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,A){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Y(e,A)}var q=function(e){function A(e){var t;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(t=function(e,A,t){return A=J(A),function(e,A){if(A&&("object"==K(A)||"function"==typeof A))return A;if(void 0!==A)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(A,t||[],J(e).constructor):A.apply(e,t))}(this,A)).config=e,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&Y(e,A)}(A,e),t=A,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var e,A=function(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return G(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?G(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(A.s();!(e=A.n()).done;){var t=e.value.src;if(t&&(t.includes("agent-widget.js")||t.includes("ttp-agent-sdk")))try{new URL(t);var n=t.substring(0,t.lastIndexOf("/"));return"".concat(n,"/audio-processor.js")}catch(e){var o=t.substring(0,t.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}}catch(e){A.e(e)}finally{A.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var e=N(_().m(function e(){var A;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 A=e.v,e.a(2,A.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 A,t,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..."),A=this.config.sampleRate||this.config.outputSampleRate||44100,t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=this.config.audioConstraints?M(M({},t),this.config.audioConstraints):t,e.n=3,navigator.mediaDevices.getUserMedia({audio:M({sampleRate:A,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 A,t,n,o,r,i,a,s,c,l,u,d,p,g=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(A=e.v)&&(console.log("📋 AudioRecorder: Current permission state: ".concat(A)),"denied"===A&&console.warn('⚠️ AudioRecorder: Permission state is "denied" - browser may not show prompt. User may need to change in browser settings.')),t=this.config.sampleRate||this.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?M(M({},n),this.config.audioConstraints):n,e.n=2,navigator.mediaDevices.getUserMedia({audio:M({sampleRate:t,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:t}),"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:t,outputSampleRate:this.config.outputSampleRate}}),(c=this.audioContext.createMediaStreamSource(this.mediaStream)).connect(this.audioWorkletNode),this.mediaStreamSource=c,this.audioWorkletNode.port.onmessage=function(e){var A=e.data,t=A.type,n=A.data;"pcm_audio_data"===t&&g.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 A;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,A=e.v,this.emit("error",A),A;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 A,t;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===(A=this.mediaStream.getAudioTracks()).filter(function(e){return"live"===e.readyState}).length&&A.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,t=e.v,console.error("❌ AudioRecorder: Failed to resume AudioContext:",t),this.emit("error",t);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(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Z(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Z(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z(A)?A:A+""}const Ae=function(){function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)}return A=e,t=[{key:"extractPcmFromWav",value:function(e){var A=e instanceof Uint8Array?e:new Uint8Array(e);if(A.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(A[0],A[1],A[2],A[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(A[8],A[9],A[10],A[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var t=A[22]|A[23]<<8,n=A[24]|A[25]<<8|A[26]<<16|A[27]<<24,o=A[34]|A[35]<<8,r=-1,i=12;i<A.length-8;i+=4){if("data"===String.fromCharCode(A[i],A[i+1],A[i+2],A[i+3])){r=i;break}i+=4+(A[i+4]|A[i+5]<<8|A[i+6]<<16|A[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=A[r+4]|A[r+5]<<8|A[r+6]<<16|A[r+7]<<24,s=r+8,c=Math.min(a,A.length-s);return{pcmData:A.slice(s,s+c).buffer,format:{sampleRate:n,channels:t,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,A,t,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,t,!0),r.setUint32(24,A,!0),r.setUint32(28,A*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,e,!0),o}},{key:"wrapPcmInWav",value:function(A,t){var n=e.createWavHeader(A.byteLength,t.sampleRate,t.channels||1,t.bitDepth||16),o=new Uint8Array(n.byteLength+A.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(A),n.byteLength),o.buffer}}],null&&$(A.prototype,null),t&&$(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();function te(e){return te="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},te(e)}function ne(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=te(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=te(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==te(A)?A:A+""}const re=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.codecs={pcm:new u,pcmu:new h,pcma:new B}},(A=[{key:"decodeToPcm",value:function(e,A){var t=null==A?void 0:A.toLowerCase();if(!t||"pcm"===t)return e instanceof ArrayBuffer?e:e instanceof Uint8Array?e.buffer:e;var n=this.codecs[t];if(!n)throw new Error("Unsupported encoding: ".concat(A));var o=e instanceof Uint8Array?e:new Uint8Array(e);return n.decode(o)}},{key:"encodeFromPcm",value:function(e,A){var t=null==A?void 0:A.toLowerCase();if(!t||"pcm"===t)return e;var n=this.codecs[t];if(!n)throw new Error("Unsupported target encoding: ".concat(A));var o=n.encode(e);return o instanceof Uint8Array?o.buffer:o}},{key:"getCodec",value:function(e){var A=null==e?void 0:e.toLowerCase();return this.codecs[A]||null}}])&&ne(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=ie(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ie(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ie(A)?A:A+""}const ce=function(){function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)}return A=e,t=[{key:"convert",value:function(A,t,n){if(t===n)return A;if(8===t)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var o=t/8,r=n/8,i=A.byteLength/o;if(new ArrayBuffer(i*r),16===t&&16===n)return A;if(24===t&&16===n)return e.convert24To16(A);if(16===t&&24===n)return e.convert16To24(A);if(16===t&&8===n)return e.convert16To8(A);if(24===t&&8===n)return e.convert24To8(A);throw new Error("Unsupported bit depth conversion: ".concat(t,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(e){for(var A=new Uint8Array(e),t=Math.floor(A.length/3),n=new Int16Array(t),o=0;o<t;o++){var r=A[3*o],i=A[3*o+1],a=A[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 A=new Int16Array(e),t=new Uint8Array(3*A.length),n=0;n<A.length;n++){var o=256*A[n];t[3*n]=255&o,t[3*n+1]=o>>8&255,t[3*n+2]=o>>16&255}return t.buffer}},{key:"convert16To8",value:function(e){for(var A=new Int16Array(e),t=new Uint8Array(A.length),n=0;n<A.length;n++){var o=A[n];t[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return t.buffer}},{key:"convert24To8",value:function(A){var t=e.convert24To16(A);return e.convert16To8(t)}}],null&&ae(A.prototype,null),t&&ae(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return de(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(de(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}de=function(e,A,t,n){function r(A,t){de(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},de(e,A,t,n)}function pe(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function ge(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,he(n.key),n)}}function he(e){var A=function(e){if("object"!=le(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=le(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==le(A)?A:A+""}const fe=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)},A=[{key:"resample",value:(t=ue().m(function e(A,t,n){var o,r,i,a,s,c,l,u,d,p,g,h,f;return ue().w(function(e){for(;;)switch(e.n){case 0:if(t!==n){e.n=1;break}return e.a(2,A);case 1:for(o=new Int16Array(A),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/t),c=new OfflineAudioContext(1,s,n),(l=c.createBuffer(1,r.length,t)).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),g=new Int16Array(p.length),h=0;h<p.length;h++)f=Math.max(-1,Math.min(1,p[h])),g[h]=Math.round(32767*f);return e.a(2,g.buffer)}},e)}),n=function(){var e=this,A=arguments;return new Promise(function(n,o){var r=t.apply(e,A);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,A,t){return n.apply(this,arguments)})}],A&&ge(e,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=me(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=me(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==me(A)?A:A+""}const we=function(){function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e)}return A=e,t=[{key:"convert",value:function(A,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(t===n)return A;if(1===t&&1===n)return A;if(1===t&&2===n)return e.monoToStereo(A,o);if(2===t&&1===n)return e.stereoToMono(A,o);throw new Error("Unsupported channel conversion: ".concat(t," → ").concat(n))}},{key:"monoToStereo",value:function(e,A){for(var t=A/8,n=e.byteLength/t,o=new ArrayBuffer(n*t*2),r=new Uint8Array(e),i=new Uint8Array(o),a=0;a<n;a++)for(var s=a*t,c=a*t*2,l=0;l<t;l++)i[c+l]=r[s+l],i[c+t+l]=r[s+l];return o}},{key:"stereoToMono",value:function(e,A){var t=A/8,n=e.byteLength/(2*t),o=new ArrayBuffer(n*t),r=new Uint8Array(e),i=new Uint8Array(o);if(16===A)for(var a=0;a<n;a++){var s=a*t*2,c=s+t,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*t;i[p]=255&d,i[p+1]=d>>8&255}else for(var g=0;g<n;g++)for(var h=g*t*2,f=g*t,m=0;m<t;m++)i[f+m]=r[h+m];return o}}],null&&ve(A.prototype,null),t&&ve(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ce(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Ce(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ce=function(e,A,t,n){function r(A,t){Ce(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Ce(e,A,t,n)}function xe(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function Qe(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?xe(Object(t),!0).forEach(function(A){Fe(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Fe(e,A,t){return(A=ke(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function Ue(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Se(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=ye(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ye(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ye(A)?A:A+""}const Ee=function(){return e=function e(A,t){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.requestedFormat=A,this.actualFormat=t,this.encodingConverter=new re,this.conversionSteps=[],this._analyzeConversions()},A=[{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:(t=be().m(function e(A){var t,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,A instanceof ArrayBuffer?A:A.buffer);case 1:if(t=A instanceof ArrayBuffer?A:A.buffer,n=Qe({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=Ae.extractPcmFromWav(t),t=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")&&(t=this.encodingConverter.decodeToPcm(t,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)&&(t=ce.convert(t,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(t,n.sampleRate,this.requestedFormat.sampleRate);case 2:t=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")&&(t=we.convert(t,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")&&(t=ce.convert(t,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(t,this.requestedFormat.encoding),t=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")&&(t=Ae.wrapPcmInWav(t,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),e.a(2,t)}},e,this)}),n=function(){var e=this,A=arguments;return new Promise(function(n,o){var r=t.apply(e,A);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)})}],A&&Se(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return He(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(He(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}He=function(e,A,t,n){function r(A,t){He(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},He(e,A,t,n)}function De(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Pe(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Ie(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Ie(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ie(A)?A:A+""}const Ke=function(){return e=function e(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.handlers=new Map,this.sendMessage=A,this.getConversationId=t},A=[{key:"registerHandler",value:function(e,A){if("function"!=typeof A)throw new Error("Handler for tool '".concat(e,"' must be a function"));this.handlers.set(e,A),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:(t=Te().m(function e(A){var t,n,o,r,i,a,s,c,l,u,d,p,g,h;return Te().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=A.toolCallId,n=A.toolName,o=A.parameters,r=Date.now(),i=(new Date).toISOString(),console.log("🔧 ClientTools: [".concat(i,"] Received tool call '").concat(n,"' (id: ").concat(t,")")),console.log(" 📋 Full message received:",JSON.stringify(A,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(t,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(t,n,c,l),e.n=4;break;case 3:e.p=3,h=e.v,p=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),h),g="EXECUTION_ERROR","NotAllowedError"===h.name||null!==(u=h.message)&&void 0!==u&&u.includes("permission")?g="PERMISSION_DENIED":("NotSupportedError"===h.name||null!==(d=h.message)&&void 0!==d&&d.includes("not supported"))&&(g="API_UNAVAILABLE"),this.sendError(t,n,h.message||"Unknown error",g,p);case 4:return e.a(2)}},e,this,[[1,3]])}),n=function(){var e=this,A=arguments;return new Promise(function(n,o){var r=t.apply(e,A);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,A,t,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:e,toolName:A,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] Sending result for tool '").concat(A,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(A)),console.log(" 📋 result:",t),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,A,t,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:A,conversationId:a,error:t,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(A,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(A)),console.log(" 📋 error: ".concat(t,", 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}}],A&&Pe(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();var Le=t(354),Me=t.n(Le);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,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ve(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Ve(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ve=function(e,A,t,n){function r(A,t){Ve(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Ve(e,A,t,n)}function je(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function Ne(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?je(Object(t),!0).forEach(function(A){Ge(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Ge(e,A,t){return(A=function(e){var A=function(e){if("object"!=Re(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Re(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Re(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function We(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(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 A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,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(t=(A=U.length>0&&void 0!==U[0]?U[0]:{}).selector,n=void 0===t?null:t,o=A.format,r=void 0===o?"jpeg":o,i=A.quality,a=void 0===i?.85:i,s=A.scale,c=void 0===s?1:s,l=A.maxWidth,u=void 0===l?1280:l,d=A.maxHeight,p=void 0===d?1280:d,g=A.fullPage,h=void 0!==g&&g,console.log("📸 SDK Screenshot: Starting capture with options:",A),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}),h&&!n&&(B.windowHeight=document.documentElement.scrollHeight,B.height=document.documentElement.scrollHeight,B.y=0),e.n=5,Me()(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 A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);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,A,t){var n=e.width,o=e.height,r=1;if(A&&n>A&&(r=Math.min(r,A/n)),t&&o>t&&(r=Math.min(r,t/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,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return Ze(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Ze(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];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 eA(e){if(!e)return!1;var A=(e.type||"").toLowerCase(),t=(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(t," ").concat(n," ").concat(o," ").concat(i," ").concat(a);if($e.types.includes(A))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 g=d.value;if(e.hasAttribute(g))return!0}}catch(e){p.e(e)}finally{p.f()}return"password"===(e.inputMode||"").toLowerCase()}function AA(e){return AA="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},AA(e)}function tA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return nA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(nA(A={},n,function(){return this}),A),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]"}),(tA=function(){return{w:r,m:d}})()}function nA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nA=function(e,A,t,n){function r(A,t){nA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},nA(e,A,t,n)}function oA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function rA(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?oA(Object(t),!0).forEach(function(A){iA(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oA(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function iA(e,A,t){return(A=function(e){var A=function(e){if("object"!=AA(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=AA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AA(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function aA(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function sA(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return cA(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cA(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function cA(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}var lA={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function uA(e){var A,t;if(!e||!e.tagName)return null;if(null!==(A=e.dataset)&&void 0!==A&&A.testid)return'[data-testid="'.concat(e.dataset.testid,'"]');if(null!==(t=e.dataset)&&void 0!==t&&t.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&&!dA(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 A;return(null===(A=e.innerText)||void 0===A?void 0:A.trim())===i}).length)return"".concat(a,':contains("').concat(i.replace(/"/g,'\\"'),'")')}}return function(e){for(var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=[],n=e,o=0;n&&n!==document.body&&o<A;){var r=n.tagName.toLowerCase();if(n.id&&!dA(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var i=pA(n);if(i)t.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;t.unshift("".concat(r,":nth-child(").concat(c,")"))}else t.unshift(r)}n=n.parentElement,o++}return t.join(" > ")}(e)}function dA(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(A){return A.test(e)})}function pA(e){var A=Array.from(e.classList||[]),t=[/^(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 A.filter(function(e){return!t.some(function(A){return A.test(e)})&&e.length>2&&e.length<30})[0]||null}function gA(e){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=e.getBoundingClientRect();return t.bottom>=-A&&t.top<=window.innerHeight+A&&t.right>=0&&t.left<=window.innerWidth}function hA(e){if(!e)return!1;var A=window.getComputedStyle(e);return"none"!==A.display&&"hidden"!==A.visibility&&"0"!==A.opacity&&e.offsetWidth>0&&e.offsetHeight>0}function fA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=sA(document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button'));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(t.length>=A.buttons)break;if(hA(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&t.push({selector:uA(o),text:r.substring(0,A.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:gA(o,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function mA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=sA(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(t.length>=A.links)break;if(hA(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){}t.push({selector:uA(i),text:a.substring(0,A.maxTextLength),href:s,internal:c,inViewport:gA(i,0)})}}}}}catch(e){r.e(e)}finally{r.f()}return t}function vA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=0,o=sA(document.querySelectorAll("form"));try{for(o.s();!(e=o.n()).done;){var r=e.value;if(t.length>=A.forms)break;if(hA(r)){var i,a=[],s=sA(r.querySelectorAll("input, textarea, select"));try{for(s.s();!(i=s.n()).done;){var c,l,u=i.value;if(a.length>=A.fieldsPerForm)break;if("hidden"!==u.type)if(eA(u))n++;else{var d=null;if(u.id){var p,g=document.querySelector('label[for="'.concat(u.id,'"]'));d=null==g||null===(p=g.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:uA(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&&t.push({selector:uA(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:t,sensitiveCount:n}}function BA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=sA(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(t.length>=A.sections)break;if(hA(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,A.maxSummaryLength))||(null===(i=a.innerText)||void 0===i?void 0:i.trim().substring(0,A.maxSummaryLength))||"";t.push({selector:uA(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,A.maxSummaryLength),inViewport:gA(a,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function wA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lA,t=[],n=sA(document.querySelectorAll("h1, h2, h3"));try{for(n.s();!(e=n.n()).done;){var o,r=e.value;if(t.length>=A.headings)break;if(hA(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&t.push({selector:uA(r),level:r.tagName.toLowerCase(),text:i.substring(0,A.maxTextLength),inViewport:gA(r,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function yA(){return bA.apply(this,arguments)}function bA(){return e=tA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f=arguments;return tA().w(function(e){for(;;)if(0===e.n)return t=f.length>0&&void 0!==f[0]?f[0]:{},n=rA(rA({},lA),t.limits),o=fA(n),r=mA(n),i=vA(n),a=i.forms,s=i.sensitiveCount,c=BA(n),l=wA(n),u=o.length+r.length+a.reduce(function(e,A){return e+A.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===(A=document.querySelector("html"))||void 0===A?void 0:A.getAttribute("lang"))||null,g=navigator.language||navigator.languages&&navigator.languages[0]||null,h=p||g||null,e.a(2,{url:window.location.href,title:document.title,timestamp:Date.now(),language:h,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)}),bA=function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){aA(r,n,o,i,a,"next",e)}function a(e){aA(r,n,o,i,a,"throw",e)}i(void 0)})},bA.apply(this,arguments);var e}function CA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(xA(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xA=function(e,A,t,n){function r(A,t){xA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},xA(e,A,t,n)}function QA(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function FA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){QA(r,n,o,i,a,"next",e)}function a(e){QA(r,n,o,i,a,"throw",e)}i(void 0)})}}function UA(){return SA.apply(this,arguments)}function SA(){return SA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u=arguments;return CA().w(function(e){for(;;)switch(e.n){case 0:if(n=(t=u.length>0&&void 0!==u[0]?u[0]:{}).selector,o=t.color,r=void 0===o?"#6366f1":o,i=t.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,LA(400);case 3:return c=s.getBoundingClientRect(),kA(),(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===(A=s.innerText)||void 0===A?void 0:A.trim().substring(0,100))||null,position:{top:c.top,left:c.left,width:c.width,height:c.height}}})}},e)})),SA.apply(this,arguments)}function kA(){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 EA(){return IA.apply(this,arguments)}function IA(){return IA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return CA().w(function(e){for(;;)switch(e.n){case 0:if(t=(A=B.length>0&&void 0!==B[0]?B[0]:{}).selector,n=A.x,o=A.y,r=A.direction,i=A.amount,a=void 0===i?500:i,s=A.position,c=void 0===s?"center":s,l=A.behavior,u=void 0===l?"smooth":l,!t){e.n=3;break}if(d=document.querySelector(t)){e.n=1;break}return e.a(2,{success:!1,error:"Element not found: ".concat(t)});case 1:return p="top"===c?"start":"bottom"===c?"end":"center",d.scrollIntoView({behavior:u,block:p,inline:"nearest"}),e.n=2,LA("smooth"===u?500:100);case 2:return g=d.getBoundingClientRect(),e.a(2,{success:!0,scrollType:"element",selector:t,elementPosition:{top:g.top,left:g.left}});case 3:if("up"!==r&&"down"!==r){e.n=5;break}return h=a||500,f=window.scrollY,m=document.documentElement.scrollHeight-window.innerHeight,v="up"===r?Math.max(0,f-h):Math.min(m,f+h),window.scrollTo({top:v,left:window.scrollX,behavior:u}),e.n=4,LA("smooth"===u?500:100);case 4:return e.a(2,{success:!0,scrollType:"relative",direction:r,amount:h,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,LA("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)})),IA.apply(this,arguments)}function TA(){return HA.apply(this,arguments)}function HA(){return HA=FA(CA().m(function e(){var A,t,n,o,r=arguments;return CA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=(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,t=new URL(A,window.location.origin),e.n=3;break;case 2:return e.p=2,e.v,e.a(2,{success:!1,error:"Invalid URL: ".concat(A)});case 3:if(["http:","https:"].includes(t.protocol)){e.n=4;break}return e.a(2,{success:!1,error:"Invalid protocol: ".concat(t.protocol)});case 4:if(t.origin===window.location.origin){e.n=7;break}return e.p=5,window.open(t.href,"_blank","noopener,noreferrer"),e.a(2,{success:!0,openedInNewTab:!0,navigatedTo:t.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:t.href});case 7:return n=window.location.href,window.location.href=t.href,e.a(2,{success:!0,navigatedTo:t.href,from:n})}},e,null,[[5,6],[1,2]])})),HA.apply(this,arguments)}function DA(){return PA.apply(this,arguments)}function PA(){return PA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p=arguments;return CA().w(function(e){for(;;)switch(e.n){case 0:if(t=(A=p.length>0&&void 0!==p[0]?p[0]:{}).selector,n=A.value,o=A.triggerEvents,r=void 0===o||o,t){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(t)){e.n=3;break}return e.a(2,{success:!1,error:"Element not found: ".concat(t)});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(!eA(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,LA(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})))),kA(),i.classList.add("ttp-fill-success"),setTimeout(function(){i.classList.remove("ttp-fill-success")},2e3),e.a(2,{success:!0,selector:t,fieldType:i.type||a,fieldName:i.name||null,filled:!0})}},e)})),PA.apply(this,arguments)}function OA(){return KA.apply(this,arguments)}function KA(){return KA=FA(CA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b=arguments;return CA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=(t=b.length>0&&void 0!==b[0]?b[0]:{}).selector,o=t.waitForNavigation,r=void 0!==o&&o,i=t.openInNewTab,a=void 0!==i&&i,s=t.isExternal,c=void 0!==s&&s,l=t.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,LA(300);case 5:return(g=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(g),e.n=6,LA(200);case 6:if(g.remove(),!a&&!c){e.n=9;break}if(!(h=u||d.href||("A"===d.tagName?d.getAttribute("href"):null))||"#"===h||h.startsWith("javascript:")){e.n=9;break}return e.p=7,window.open(h,"_blank","noopener,noreferrer"),e.a(2,{success:!0,selector:n,clicked:!0,openedInNewTab:!0,url:h,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 A=setTimeout(function(){e({navigated:!1})},5e3),t=function(){clearTimeout(A),window.removeEventListener("beforeunload",t),e({navigated:!0})};window.addEventListener("beforeunload",t)}),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===(A=d.innerText)||void 0===A?void 0:A.trim().substring(0,50))||null}})}},e,null,[[7,8]])})),KA.apply(this,arguments)}function LA(e){return new Promise(function(A){return setTimeout(A,e)})}function MA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return RA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(RA(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,RA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,RA(u,"constructor",c),RA(c,"constructor",s),s.displayName="GeneratorFunction",RA(c,o,"GeneratorFunction"),RA(u),RA(u,o,"Generator"),RA(u,n,function(){return this}),RA(u,"toString",function(){return"[object Generator]"}),(MA=function(){return{w:r,m:d}})()}function RA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}RA=function(e,A,t,n){function r(A,t){RA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},RA(e,A,t,n)}function _A(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function VA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){_A(r,n,o,i,a,"next",e)}function a(e){_A(r,n,o,i,a,"throw",e)}i(void 0)})}}function jA(){return(jA=VA(MA().m(function e(){var A;return MA().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,yA();case 1:return A=e.v,e.a(2,{url:A.url,title:A.title,timestamp:A.timestamp,language:A.language,viewport:A.viewport,dom:{buttons:A.buttons,links:A.links,forms:A.forms,sections:A.sections,headings:A.headings,metadata:A.metadata}})}},e)}))).apply(this,arguments)}function NA(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return GA(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(GA(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,GA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,GA(u,"constructor",c),GA(c,"constructor",s),s.displayName="GeneratorFunction",GA(c,o,"GeneratorFunction"),GA(u),GA(u,o,"Generator"),GA(u,n,function(){return this}),GA(u,"toString",function(){return"[object Generator]"}),(NA=function(){return{w:r,m:d}})()}function GA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}GA=function(e,A,t,n){function r(A,t){GA(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},GA(e,A,t,n)}function WA(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function zA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){WA(r,n,o,i,a,"next",e)}function a(e){WA(r,n,o,i,a,"throw",e)}i(void 0)})}}function XA(e){return XA="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},XA(e)}function JA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function YA(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?JA(Object(t),!0).forEach(function(A){At(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):JA(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function qA(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tt(n.key),n)}}function ZA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ZA=function(){return!!e})()}function $A(e){return $A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$A(e)}function et(e,A){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},et(e,A)}function At(e,A,t){return(A=tt(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function tt(e){var A=function(e){if("object"!=XA(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=XA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==XA(A)?A:A+""}var nt=function(e){function A(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(e=function(e,A,t){return A=$A(A),function(e,A){if(A&&("object"==XA(A)||"function"==typeof A))return A;if(void 0!==A)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,ZA()?Reflect.construct(A,t||[],$A(e).constructor):A.apply(e,t))}(this,A)).version="2.0.0",e.config={signedUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:t.agentId,appId:t.appId,sampleRate:t.sampleRate||16e3,channels:t.channels||1,bitDepth:t.bitDepth||16,audioProcessorPath:t.audioProcessorPath,outputContainer:t.outputContainer||e.getDefaultContainer(t),outputEncoding:t.outputEncoding||t.outputCodec||"pcm",outputSampleRate:t.outputSampleRate||16e3,outputChannels:t.outputChannels||1,outputBitDepth:t.outputBitDepth||16,outputFrameDurationMs:t.outputFrameDurationMs||600,outputCodec:t.outputCodec,agentSettingsOverride:t.agentSettingsOverride||null,visualAssistant:t.visualAssistant||null,variables:t.variables||null,autoReconnect:!1!==t.autoReconnect,audioConstraints:t.audioConstraints||null,protocolVersion:t.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=YA(YA({},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(A){return e.sendMessage(A)},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,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&et(e,A)}(A,e),t=A,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:",XA(Xe)),this.clientToolsRegistry.registerHandler("capture_screen",zA(NA().m(function A(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return NA().w(function(A){for(;;)switch(A.p=A.n){case 0:return t=B.length>0&&void 0!==B[0]?B[0]:{},console.log("📸 VoiceSDK: capture_screen tool called with params:",t),n=t.selector,o=void 0===n?null:n,r=t.format,i=void 0===r?"jpeg":r,a=t.quality,s=void 0===a?.85:a,c=t.scale,l=void 0===c?1:c,u=t.fullPage,d=void 0!==u&&u,p=t.maxWidth,g=void 0===p?1280:p,h=t.maxHeight,f=void 0===h?1280:h,A.p=1,A.n=2,Xe({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:g,maxHeight:f});case 2:return m=A.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}),A.a(2,m);case 3:throw A.p=3,v=A.v,console.error("📸 VoiceSDK: Screenshot capture failed:",v),e.emit("screenshotError",{error:v.message}),v;case 4:return A.a(2)}},A,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",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Reading page structure..."),e.n=1,yA(A);case 1:return t=e.v,console.log("[TTP] ✅ Page structure extracted:",{buttons:t.buttons.length,links:t.links.length,forms:t.forms.length,headings:t.headings.length}),e.a(2,t)}},e)}))),e.registerHandler("highlight_element",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] ✨ Highlighting element:",A.selector),e.n=1,UA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",t.error),e.a(2,t)}},e)}))),e.registerHandler("scroll_to_element",VA(MA().m(function e(){var A,t,n,o,r=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return(A=r.length>0&&void 0!==r[0]?r[0]:{}).selector?console.log("[TTP] 📜 Scrolling to element:",A.selector):A.direction?console.log("[TTP] 📜 Scrolling",A.direction,"by",A.amount||500,"px"):void 0!==A.x||void 0!==A.y?console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(t=A.x)&&void 0!==t?t:"current",", ").concat(null!==(n=A.y)&&void 0!==n?n:"current",")")):console.log("[TTP] 📜 Scroll called with params:",A),e.n=1,EA(A);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",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 🔗 Navigating to:",A.url),e.n=1,TA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",t.error),e.a(2,t)}},e)}))),e.registerHandler("fill_field",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📝 Filling field:",A.selector),e.n=1,DA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",t.error),e.a(2,t)}},e)}))),e.registerHandler("click_element",VA(MA().m(function e(){var A,t,n=arguments;return MA().w(function(e){for(;;)switch(e.n){case 0:return A=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 👆 Clicking element:",A.selector),e.n=1,OA(A);case 1:return(t=e.v).success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",t.error),e.a(2,t)}},e)})));var A=e.getRegisteredTools(),t=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(function(e){return!A.includes(e)});t.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",t):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",A)}(this.clientToolsRegistry);var A=this.clientToolsRegistry.getRegisteredTools(),t=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=A.filter(function(e){return t.includes(e)});if(n.length!==t.length){var o=t.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(A.RESUME_STORAGE_KEY);if(e){var t=JSON.parse(e);if(t&&t.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",t.conversationId),t.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 t={},n=sessionStorage.getItem(A.RESUME_STORAGE_KEY);if(n)try{t=JSON.parse(n)}catch(e){}t.conversationId=e,t.timestamp=Date.now(),t.fromPage=t.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(A.RESUME_STORAGE_KEY,JSON.stringify(t)),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(A.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(A.RESUME_STORAGE_KEY);if(!e)return null;var t=JSON.parse(e),n=Date.now()-t.timestamp;return n>A.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",n,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",t,"age:",n,"ms"),t)}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(A.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 A=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",e.conversationId),console.log("[VoiceSDK] Page change:",e.fromPage,"→",A),{conversationId:e.conversationId,fromPage:e.fromPage,toPage:A}}},{key:"getDefaultContainer",value:function(e){return"wav"===e.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(e){var t;if(!e)return"Input format is required";var n=null===(t=e.encoding)||void 0===t?void 0:t.toLowerCase();return n&&A.SUPPORTED_INPUT_ENCODINGS.includes(n)?e.sampleRate&&A.SUPPORTED_INPUT_SAMPLE_RATES.includes(e.sampleRate)?e.bitDepth&&A.SUPPORTED_INPUT_BIT_DEPTHS.includes(e.bitDepth)?e.channels&&A.SUPPORTED_INPUT_CHANNELS.includes(e.channels)?null:"Unsupported input channels: ".concat(e.channels,". Supported: ").concat(A.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(e.bitDepth,". Supported: ").concat(A.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(e.sampleRate,". Supported: ").concat(A.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(e.encoding,". Supported: ").concat(A.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(e){var t,n;if(!e)return"Output format is required";var o=null===(t=e.encoding)||void 0===t?void 0:t.toLowerCase();if(!o||!A.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(e.encoding,". Supported: ").concat(A.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!e.sampleRate||!A.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(e.sampleRate))return"Unsupported output sample rate: ".concat(e.sampleRate,". Supported: ").concat(A.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!e.bitDepth||!A.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(e.bitDepth))return"Unsupported output bit depth: ".concat(e.bitDepth,". Supported: ").concat(A.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!e.channels||!A.SUPPORTED_OUTPUT_CHANNELS.includes(e.channels))return"Unsupported output channels: ".concat(e.channels,". Supported: ").concat(A.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=e.container)||void 0===n?void 0:n.toLowerCase();return r&&A.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(e.container,". Supported: ").concat(A.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){var e={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},A=this.validateInputFormat(e);if(A)return console.error("❌ VoiceSDK v2: Invalid input format:",A),void this.emit("error",new Error(A));var t={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},n=this.validateOutputFormat(t);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(A){var t=e.currentPlayingSentenceId?e.currentPlayingSentenceId+1:1;e.currentPlayingSentenceId=t;var n={text:A.text,role:"assistant",sentenceId:t,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(A){e.emit("playbackError",A),e.emit("error",A)})}},{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(A){e.isConnected&&e.sendBinary(A)}),this.audioRecorder.on("error",function(A){A.isServerRejection||"ServerRejected"===A.name||(console.error("❌ AudioRecorder error:",A),e.emit("error",A))})}},{key:"buildWebSocketUrl",value:function(){var e=this.config.signedUrl||this.config.websocketUrl,A=new URL(e,"wss://placeholder.com"),t=A.searchParams;this.config.agentId&&!t.has("agentId")&&t.append("agentId",this.config.agentId),this.config.appId&&!t.has("appId")&&t.append("appId",this.config.appId);var n=this.getStoredConversationId();n&&!t.has("conversationId")&&(t.append("conversationId",n),console.log("🔄 VoiceSDK v2: Attempting resume via query param:",n));var o=window.location.pathname+window.location.search;o&&!t.has("currentPage")&&t.append("currentPage",o);var r=t.toString();return r?"".concat(A.origin).concat(A.pathname,"?").concat(r):"".concat(A.origin).concat(A.pathname)}},{key:"connect",value:(p=zA(NA().m(function e(){var A,t,n=this;return NA().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,A=this.buildWebSocketUrl(),e.n=3,new Promise(function(e,t){n.websocket=new WebSocket(A),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 A=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",A);var t=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(function(e){return!A.includes(e)});if(t.length>0){console.warn("⚠️ VoiceSDK v2: Missing tools detected, re-registering:",t),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),t(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 A=new Error("Connection closed - data injection cancelled");A.error="CONNECTION_CLOSED",n.pendingInjections.forEach(function(e,t){clearTimeout(e.timeout),e.reject(A),n.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:t})}),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,t=e.v,console.error("🔌 VoiceSDK v2: Connection failed:",t),this.emit("error",t),e.a(2,!1)}},e,this,[[2,4]])})),function(){return p.apply(this,arguments)})},{key:"detectBrowserLocale",value:function(){var e,A,t=navigator.language||(null===(e=navigator.languages)||void 0===e?void 0:e[0])||"en-US";return{language:(null===(A=t.split("-")[0])||void 0===A?void 0:A.toLowerCase())||"en",fullLocale:t}}},{key:"sendHelloMessage",value:(d=zA(NA().m(function e(){var A,t,n,o,r;return NA().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(A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},t={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},!(n=this.validateInputFormat(A))){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(t))){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:A,requestedOutputFormat:t,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 A,t=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===(A=this.audioPlayer.scheduledSources)||void 0===A?void 0:A.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 jA.apply(this,arguments)}().then(function(e){t.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),t.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){t.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),t.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(A){var a,s,c="string"==typeof e.data?e.data:String(e.data),l=(null===(a=A.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:",A),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),g=c.substring(d,p),h=" ".repeat(u-d)+"^";console.error("VoiceSDK v2: Context around error:"),console.error(g),console.error(h);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=A.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,A,t){var n=t.charCodeAt(0);return A+({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:A,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 A={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},t=[];if(this.requestedOutputFormat.container!==A.container&&t.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(A.container,'"')),this.requestedOutputFormat.encoding!==A.encoding&&t.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(A.encoding,'"')),this.requestedOutputFormat.sampleRate!==A.sampleRate&&t.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(A.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==A.bitDepth&&t.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(A.bitDepth,"-bit")),this.requestedOutputFormat.channels!==A.channels&&t.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(A.channels)),t.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",A),console.warn(" Differences:",t.join(", "));try{if(this.formatConverter=new Ee(this.requestedOutputFormat,A),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!",A),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=zA(NA().m(function e(A){var t,n,o,r,i,a,s,c,l,u=this,d=arguments;return NA().w(function(e){for(;;)switch(e.n){case 0:if(t=d.length>1&&void 0!==d[1]?d[1]:{},n=null==A?void 0:A.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=t.timeout||1e4,c=t.source||"programmatic",l={t:"data_inject",data:n,correlationId:a,source:c,timestamp:Date.now()},t.metadata&&(l.metadata=t.metadata),e.a(2,new Promise(function(e,A){var t=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),A(new Error(e.message))},s);if(u.pendingInjections.set(a,{resolve:function(A){clearTimeout(t),e(A)},reject:function(e){clearTimeout(t),A(e)},timeout:t}),u.sendMessage(l))console.log("📤 VoiceSDK v2: Sent data_inject message:",{correlationId:a,dataLength:n.length,source:c});else{u.pendingInjections.delete(a),clearTimeout(t);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),A(new Error(o.message))}}))}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"handleDataInjectAck",value:function(e){var A=e.correlationId;if(A){var t=this.pendingInjections.get(A);t?(this.pendingInjections.delete(A),t.resolve(e),this.emit("dataInjected",{correlationId:A,data:e.data,metadata:e.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",A)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",A)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}},{key:"handleDataInjectError",value:function(e){var A=e.correlationId;if(A){var t=this.pendingInjections.get(A);if(t){this.pendingInjections.delete(A);var n=new Error(e.message||"Data injection failed");n.error=e.error,n.correlationId=A,t.reject(n),this.emit("dataInjectionError",{error:e.error,message:e.message,correlationId:A}),console.warn("❌ VoiceSDK v2: Data injection error:",A,e.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",A)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}},{key:"handleTranscript",value:function(e){if(e.sentenceId&&e.text){var A=e.sentenceId,t={text:e.text,role:e.role||"assistant",sentenceId:A,final:!1!==e.final,timestamp:e.timestamp||Date.now()};this.transcriptQueue.push(t),console.log("📝 VoiceSDK v2: Received transcript for sentence",A,":",t.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",A),this.emit("transcriptDisplay",t),this.currentPlayingSentenceId=A,this.emit("transcript",t)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",e)}},{key:"handleBinaryMessage",value:(l=zA(NA().m(function e(A){var t,n,o,r,i,a,s,c,l;return NA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(A instanceof Blob)){e.n=2;break}return e.n=1,A.arrayBuffer();case 1:t=e.v,e.n=3;break;case 2:t=A;case 3:if(n=t,!this.formatConverter||!this.formatConverter.needsConversion()){e.n=7;break}return e.p=4,e.n=5,this.formatConverter.convert(t);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=t;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 A=(new Date).toISOString(),t=this.websocket?this.websocket.readyState:"NO_WEBSOCKET",n=this.websocket?{0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"}[t]:"NO_WEBSOCKET";if("client_tool_result"!==e.t&&"client_tool_error"!==e.t||(console.log("📤 VoiceSDK v2: [".concat(A,"] Sending tool ").concat(e.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(t,")")),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(A,"] 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=zA(NA().m(function e(){var A,t,n,o;return NA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isConnected){e.n=1;break}throw A=new Error("Not connected to voice server"),this.emit("error",A),A;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(t=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",t.isServerRejection=!0,t;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=zA(NA().m(function e(){var A;return NA().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,A=e.v,console.error("VoiceSDK v2: Error stopping recording:",A),this.emit("error",A),e.a(2,!1)}},e,this,[[2,4]])})),function(){return s.apply(this,arguments)})},{key:"toggleRecording",value:(a=zA(NA().m(function e(){return NA().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=zA(NA().m(function e(){var A,t=this;return NA().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"),t.wakeLock=null}),e.n=5;break;case 4:e.p=4,A=e.v,console.warn("📱 VoiceSDK v2: Failed to request wake lock:",A.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=zA(NA().m(function e(){var A;return NA().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,A=e.v,console.warn("📱 VoiceSDK v2: Error releasing wake lock:",A.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=zA(NA().m(function e(){return NA().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=YA(YA({},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(),A=Math.random().toString(36).substr(2,9);return"inj_".concat(e,"_").concat(this.injectionCounter,"_").concat(A)}},{key:"registerToolHandler",value:function(e,A){return this.clientToolsRegistry.registerHandler(e,A)}},{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 A=new Error("SDK destroyed - data injection cancelled");A.error="SDK_DESTROYED",this.pendingInjections.forEach(function(e,t){clearTimeout(e.timeout),e.reject(A)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(A){return e.clientToolsRegistry.unregisterHandler(A)}),this.removeAllListeners()}}}],n&&qA(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c,l,u,d,p}(a);At(nt,"RESUME_STORAGE_KEY","voice_resume_state"),At(nt,"RESUME_TTL_MS",1e4),At(nt,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(nt,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(nt,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),At(nt,"SUPPORTED_INPUT_CHANNELS",[1]),At(nt,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(nt,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(nt,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),At(nt,"SUPPORTED_OUTPUT_CHANNELS",[1]),At(nt,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const ot=nt;function rt(e){return rt="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},rt(e)}function it(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return at(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(at(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,at(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,at(u,"constructor",c),at(c,"constructor",s),s.displayName="GeneratorFunction",at(c,o,"GeneratorFunction"),at(u),at(u,o,"Generator"),at(u,n,function(){return this}),at(u,"toString",function(){return"[object Generator]"}),(it=function(){return{w:r,m:d}})()}function at(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}at=function(e,A,t,n){function r(A,t){at(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},at(e,A,t,n)}function st(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function ct(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function lt(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?ct(Object(t),!0).forEach(function(A){ut(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function ut(e,A,t){return(A=pt(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function dt(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pt(n.key),n)}}function pt(e){var A=function(e){if("object"!=rt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=rt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rt(A)?A:A+""}function gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gt=function(){return!!e})()}function ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ht(e)}function ft(e,A){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},ft(e,A)}var mt=function(e){function A(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A);var n=(e=function(e,A,t){return A=ht(A),function(e,A){if(A&&("object"==rt(A)||"function"==typeof A))return A;if(void 0!==A)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,gt()?Reflect.construct(A,t||[],ht(e).constructor):A.apply(e,t))}(this,A)).readScriptTagConfig();return e.config=lt({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:t.appId||n.appId,agentId:t.agentId||n.agentId,conversationId:void 0!==t.conversationId?t.conversationId:e.getPersistedConversationId(),forceConversationId:t.forceConversationId,queue:[],inFlight:!1},t),e.fullResponseBuffer="",e}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&ft(e,A)}(A,e),t=A,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,A=new URLSearchParams;return this.config.appId&&A.append("appId",this.config.appId),this.config.agentId&&A.append("agentId",this.config.agentId),this.config.conversationId&&A.append("conversationId",this.config.conversationId),"".concat(e,"?").concat(A.toString())}},{key:"sendMessage",value:(o=it().m(function e(A){var t=this;return it().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){if(A&&A.trim())if(t.config.appId&&t.config.agentId){var o={text:A,resolve:e,reject:n};t.config.inFlight?t.config.queue.push(o):t.executeTask(o)}else n(new Error("Missing appId or agentId"));else n(new Error("Message is empty"))}))},e)}),r=function(){var e=this,A=arguments;return new Promise(function(t,n){var r=o.apply(e,A);function i(e){st(r,t,n,i,a,"next",e)}function a(e){st(r,t,n,i,a,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"executeTask",value:function(e){var A=this;if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var t=this.getPersistedConversationId();t&&(this.config.conversationId=t,console.log("🔍 TextChatSDK hydrated conversationId from storage:",t))}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(t){if(!s)try{var n={message:e.text},o=A.config.forceConversationId||A.config.conversationId;o&&(n.conversationId=o,A.config.forceConversationId&&!A.config.conversationId&&(A.config.conversationId=o,A.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",A.config.conversationId),t.send(JSON.stringify(n)),s=!0}catch(n){e.reject(n),A.emit("error",n);try{t.close()}catch(e){}}},u=function(e){return function(){A.config.conversationId?l(e):c=setTimeout(function(){return l(e)},200)}},d=function(t){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),A.config.conversationId=o.conversationId,A.persistConversationId(o.conversationId),A.emit&&A.emit("conversationIdChanged",o.conversationId),!s&&t&&1===t.readyState){if(c)try{clearTimeout(c)}catch(e){}l(t)}return}if(!A.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),A.config.conversationId=o.conversationId,A.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)A.fullResponseBuffer+=o.content,A.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!A.fullResponseBuffer&&(A.fullResponseBuffer=r)}catch(e){}!A.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),A.config.conversationId=o.conversationId),A.persistConversationId(A.config.conversationId),A.emit("done",{text:A.fullResponseBuffer}),e.resolve({conversationId:A.config.conversationId,fullText:A.fullResponseBuffer});try{t.close()}catch(e){}}else if("error"===o.type){var i=new Error(o.message||"Server error");A.emit("error",i),e.reject(i);try{t.close()}catch(e){}}}catch(e){}}},p=function(t){if(1008===t.code&&t.reason&&(t.reason.includes("Domain not whitelisted")||t.reason.includes("domain")||t.reason.includes("whitelist"))){var n=new Error("DOMAIN_NOT_WHITELISTED");return n.reason=t.reason,n.code=t.code,A.emit("domainError",n),e.reject(n),A.config.inFlight=!1,void A.drainQueue()}A.config.inFlight=!1,A.drainQueue()},g=new WebSocket(o);g.onopen=u(g),g.onmessage=d(g),g.onerror=(n=g,function(t){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(t){A.emit("error",t),e.reject(t)},void(o.onclose=p)}A.emit("error",t),e.reject(t)}),g.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=lt(lt({},this.config),e)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&dt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(O);function vt(e){return vt="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},vt(e)}function Bt(e,A){return function(e){if(Array.isArray(e))return e}(e)||function(e,A){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(e)).next,0===A){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==A);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,A)||yt(e,A)||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 wt(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=yt(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function yt(e,A){if(e){if("string"==typeof e)return bt(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bt(e,A):void 0}}function bt(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function Ct(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xt(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(xt(A={},n,function(){return this}),A),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,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xt=function(e,A,t,n){function r(A,t){xt(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},xt(e,A,t,n)}function Qt(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Ft(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ut(n.key),n)}}function Ut(e){var A=function(e){if("object"!=vt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=vt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vt(A)?A:A+""}function St(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(St=function(){return!!e})()}function kt(e){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kt(e)}function Et(e,A){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Et(e,A)}const It=new(function(e){function A(){var e;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(e=function(e,A,t){return A=kt(A),function(e,A){if(A&&("object"==vt(A)||"function"==typeof A))return A;if(void 0!==A)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,St()?Reflect.construct(A,t||[],kt(e).constructor):A.apply(e,t))}(this,A)).connections=new Map,e.connectionCounts=new Map,e.creatingConnections=new Set,e}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&Et(e,A)}(A,e),t=A,n=[{key:"getConnection",value:(o=Ct().m(function e(A){var t,n,o=this;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(!this.connections.has(A)){e.n=1;break}return t=this.connections.get(A),this.connectionCounts.set(A,(this.connectionCounts.get(A)||0)+1),e.a(2,t);case 1:if(!this.creatingConnections||!this.creatingConnections.has(A)){e.n=2;break}return e.a(2,new Promise(function(e){var t=function(){if(o.connections.has(A)){var n=o.connections.get(A);o.connectionCounts.set(A,(o.connectionCounts.get(A)||0)+1),e(n)}else setTimeout(t,50)};t()}));case 2:return this.creatingConnections.add(A),n=new WebSocket(A),this.connections.set(A,n),this.connectionCounts.set(A,1),n.addEventListener("open",function(e){o.creatingConnections.delete(A),o.emit("open",e,A)}),n.addEventListener("close",function(e){o.creatingConnections.delete(A),o.connections.delete(A),o.connectionCounts.delete(A),o.emit("close",e,A)}),n.addEventListener("error",function(e){o.creatingConnections.delete(A),o.emit("error",e,A)}),n.addEventListener("message",function(e){o.emit("message",e,A)}),e.a(2,n)}},e,this)}),r=function(){var e=this,A=arguments;return new Promise(function(t,n){var r=o.apply(e,A);function i(e){Qt(r,t,n,i,a,"next",e)}function a(e){Qt(r,t,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 A=this.connectionCounts.get(e)||0,t=Math.max(0,A-1);if(this.connectionCounts.set(e,t),0===t){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 A=this.connections.get(e);A&&A.readyState===WebSocket.OPEN&&A.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,A={},t=wt(this.connections.entries());try{for(t.s();!(e=t.n()).done;){var n=Bt(e.value,2),o=n[0],r=n[1];A[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(e){t.e(e)}finally{t.f()}return A}},{key:"clearAll",value:function(){var e,A=wt(this.connections.entries());try{for(A.s();!(e=A.n()).done;){var t=Bt(e.value,2),n=(t[0],t[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(e){A.e(e)}finally{A.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&Ft(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(O));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 Ht(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Dt(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Dt(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Dt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Dt(u,"constructor",c),Dt(c,"constructor",s),s.displayName="GeneratorFunction",Dt(c,o,"GeneratorFunction"),Dt(u),Dt(u,o,"Generator"),Dt(u,n,function(){return this}),Dt(u,"toString",function(){return"[object Generator]"}),(Ht=function(){return{w:r,m:d}})()}function Dt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Dt=function(e,A,t,n){function r(A,t){Dt(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Dt(e,A,t,n)}function Pt(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Ot(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kt(n.key),n)}}function Kt(e){var A=function(e){if("object"!=Tt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Tt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tt(A)?A:A+""}function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lt=function(){return!!e})()}function Mt(e){return Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mt(e)}function Rt(e,A){return Rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Rt(e,A)}var _t=function(e){function A(e){var t;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(t=function(e,A,t){return A=Mt(A),function(e,A){if(A&&("object"==Tt(A)||"function"==typeof A))return A;if(void 0!==A)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,Lt()?Reflect.construct(A,t||[],Mt(e).constructor):A.apply(e,t))}(this,A)).config=e,t.ws=null,t.isConnected=!1,t.connectionId=null,t}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&Rt(e,A)}(A,e),t=A,n=[{key:"connect",value:(r=Ht().m(function e(){var A=this;return Ht().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,t){try{A.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),A.connectResolve=e,A.connectReject=t;var n=A.config.signedUrl||A.config.websocketUrl;It.getConnection(n,A.config).then(function(t){A.ws=t,A.setupEventListeners(),t.readyState===WebSocket.OPEN&&(A.isConnected=!0,A.emit("connected"),e(),A.connectResolve=null,A.connectReject=null)}).catch(function(e){console.error("🔌 WebSocketManager: Connection failed ".concat(A.connectionId),e),t(e),A.connectResolve=null,A.connectReject=null})}catch(e){console.error("🔌 WebSocketManager: Connection error ".concat(A.connectionId),e),t(e),A.connectResolve=null,A.connectReject=null}}))},e)}),i=function(){var e=this,A=arguments;return new Promise(function(t,n){var o=r.apply(e,A);function i(e){Pt(o,t,n,i,a,"next",e)}function a(e){Pt(o,t,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 A=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!0,e.emit("connected"),e.connectResolve&&(e.connectResolve(),e.connectResolve=null,e.connectReject=null))},t=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!1,e.emit("disconnected",A))},n=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&(e.emit("error",A),e.connectReject&&(e.connectReject(A),e.connectResolve=null,e.connectReject=null))},o=function(A,t){t===(e.config.signedUrl||e.config.websocketUrl)&&e.handleMessage(A)};It.on("open",A),It.on("close",t),It.on("error",n),It.on("message",o),this.eventHandlers={open:A,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(It.off("open",this.eventHandlers.open),It.off("close",this.eventHandlers.close),It.off("error",this.eventHandlers.error),It.off("message",this.eventHandlers.message));var e=this.config.signedUrl||this.config.websocketUrl;e&&It.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 A=this;if(e.data instanceof ArrayBuffer)this.emit("binaryAudio",e.data);else if(e.data instanceof Blob)e.data.arrayBuffer().then(function(e){A.emit("binaryAudio",e)}).catch(function(e){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",e)});else try{var t=JSON.parse(e.data);"barge_in_ack"!==t.t&&"stop_sending"!==t.t||this.emit("bargeIn",t),"stop_playing"===t.t&&this.emit("stopPlaying",t),this.emit("message",t)}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 It.getAllConnections()}},{key:"clearAllConnections",value:function(){It.clearAll()}}],n&&Ot(t.prototype,n),o&&Ot(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(O);function Vt(e){return Vt="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},Vt(e)}function jt(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Nt(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Nt(A={},n,function(){return this}),A),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]"}),(jt=function(){return{w:r,m:d}})()}function Nt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Nt=function(e,A,t,n){function r(A,t){Nt(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Nt(e,A,t,n)}function Gt(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Wt(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Gt(r,n,o,i,a,"next",e)}function a(e){Gt(r,n,o,i,a,"throw",e)}i(void 0)})}}function zt(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xt(n.key),n)}}function Xt(e){var A=function(e){if("object"!=Vt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Vt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vt(A)?A:A+""}function Jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jt=function(){return!!e})()}function Yt(e){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yt(e)}function qt(e,A){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},qt(e,A)}var Zt=function(e){function A(e){var t;return function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,A),(t=function(e,A,t){return A=Yt(A),function(e,A){if(A&&("object"==Vt(A)||"function"==typeof A))return A;if(void 0!==A)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,Jt()?Reflect.construct(A,t||[],Yt(e).constructor):A.apply(e,t))}(this,A)).config=e,t.audioContext=null,t.audioQueue=[],t.isPlaying=!1,t.isProcessingQueue=!1,t.currentSource=null,t.audioContextReady=!1,t.initializeAudioContext().catch(function(){}),t}return function(e,A){if("function"!=typeof A&&null!==A)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(A&&A.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),A&&qt(e,A)}(A,e),t=A,n=[{key:"initializeAudioContext",value:(i=Wt(jt().m(function e(){var A,t,n,o,r,i;return jt().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,A=this.config.sampleRate||this.config.outputSampleRate||44100,t={sampleRate:A},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(t),"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 A=this;try{var t=this.createAudioBlob(e);if(this.audioQueue.push(t),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return A.processQueue()},n)}}catch(e){this.emit("playbackError",e)}}},{key:"createAudioBlob",value:function(e){var A=new Uint8Array(e);if(A.length>=4){if(82===A[0]&&73===A[1]&&70===A[2]&&70===A[3])return new Blob([e],{type:"audio/wav"});if(255===A[0]&&!(224&~A[1]))return new Blob([e],{type:"audio/mpeg"});if(79===A[0]&&103===A[1]&&103===A[2]&&83===A[3])return new Blob([e],{type:"audio/ogg"})}return new Blob([e],{type:"audio/wav"})}},{key:"processQueue",value:(r=Wt(jt().m(function e(){var A,t,n,o,r,i,a,s,c=this;return jt().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,A=this.audioQueue.shift()){e.n=2;break}return this.isProcessingQueue=!1,e.a(2);case 2:if(e.p=2,t=!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(!t){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,A.arrayBuffer();case 8:return o=e.v,e.n=9,n.decodeAudioData(o);case 9:r=e.v,i=t&&!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=Wt(jt().m(function e(){var A;return jt().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,A=e.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",A);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&&zt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(O),$t=t(540),en=t(848);function An(e){return An="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},An(e)}function tn(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function nn(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?tn(Object(t),!0).forEach(function(A){on(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function on(e,A,t){return(A=function(e){var A=function(e){if("object"!=An(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=An(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==An(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function rn(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return an(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(an(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,an(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,an(u,"constructor",c),an(c,"constructor",s),s.displayName="GeneratorFunction",an(c,o,"GeneratorFunction"),an(u),an(u,o,"Generator"),an(u,n,function(){return this}),an(u,"toString",function(){return"[object Generator]"}),(rn=function(){return{w:r,m:d}})()}function an(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}an=function(e,A,t,n){function r(A,t){an(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},an(e,A,t,n)}function sn(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function cn(e,A){return function(e){if(Array.isArray(e))return e}(e)||function(e,A){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(e)).next,0===A){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==A);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,A)||function(e,A){if(e){if("string"==typeof e)return ln(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ln(e,A):void 0}}(e,A)||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 ln(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}const un=function(e){var A=e.signedUrl,t=e.websocketUrl,n=e.agentId,o=e.appId,r=e.voice,i=void 0===r?"default":r,a=e.language,s=void 0===a?"en":a,c=e.autoReconnect,l=void 0===c||c,u=e.agentSettingsOverride,d=void 0===u?null:u,p=e.visualAssistant,g=void 0===p?null:p,h=e.onConnected,f=e.onDisconnected,m=e.onRecordingStarted,v=e.onRecordingStopped,B=e.onPlaybackStarted,w=e.onPlaybackStopped,y=e.onError,b=e.onMessage,C=e.onBargeIn,x=e.onStopPlaying,Q=e.onStartConversation,F=e.onEndConversation,U=e.className,S=void 0===U?"":U,k=e.style,E=void 0===k?{}:k,I=e.children,T=cn((0,$t.useState)(!1),2),H=T[0],D=T[1],P=cn((0,$t.useState)(!1),2),O=P[0],K=P[1],L=cn((0,$t.useState)(!1),2),M=(L[0],L[1]),R=cn((0,$t.useState)("Disconnected"),2),_=(R[0],R[1]),V=(0,$t.useRef)(null);(0,$t.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||A)),V.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),V.current.destroy(),V.current=null);var e=new ot({signedUrl:t||A,websocketUrl:t||A,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,visualAssistant:g,onStartConversation:Q,onEndConversation:F});return e.on("connected",function(){D(!0),_("Connected"),null==h||h()}),e.on("disconnected",function(){D(!1),_("Disconnected"),null==f||f()}),e.on("recordingStarted",function(){K(!0),null==m||m()}),e.on("recordingStopped",function(){K(!1),null==v||v()}),e.on("playbackStarted",function(){M(!0),null==B||B()}),e.on("playbackStopped",function(){M(!1),null==w||w()}),e.on("error",function(e){null==y||y(e)}),e.on("message",function(e){null==b||b(e)}),e.on("bargeIn",function(e){null==C||C(e)}),e.on("stopPlaying",function(e){null==x||x(e)}),V.current=e,e.connect(),function(){var e=A||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(e)),V.current&&(V.current.destroy(),V.current=null)}},[A,t,n,o,i,s,d,g]);var j=function(){var e,A=(e=rn().m(function e(){var A;return rn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(V.current){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,V.current.toggleRecording();case 2:e.n=4;break;case 3:e.p=3,A=e.v,console.error("Error toggling recording:",A);case 4:return e.a(2)}},e,null,[[1,3]])}),function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){sn(r,n,o,i,a,"next",e)}function a(e){sn(r,n,o,i,a,"throw",e)}i(void 0)})});return function(){return A.apply(this,arguments)}}(),N=(0,en.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,en.jsx)("div",{style:{fontSize:"20px"},children:O?"🔴":"🎤"}),(0,en.jsx)("div",{children:O?"Stop Listening":"Start Listening"})]});return(0,en.jsx)("button",{className:"voice-button ".concat(O?"recording":""," ").concat(S),style:nn({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:O?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},E),onClick:j,disabled:!H,children:I||N})};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(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return gn(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(gn(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,gn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,gn(u,"constructor",c),gn(c,"constructor",s),s.displayName="GeneratorFunction",gn(c,o,"GeneratorFunction"),gn(u),gn(u,o,"Generator"),gn(u,n,function(){return this}),gn(u,"toString",function(){return"[object Generator]"}),(pn=function(){return{w:r,m:d}})()}function gn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}gn=function(e,A,t,n){function r(A,t){gn(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},gn(e,A,t,n)}function hn(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function fn(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){hn(r,n,o,i,a,"next",e)}function a(e){hn(r,n,o,i,a,"throw",e)}i(void 0)})}}function mn(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function vn(e,A,t){return(A=wn(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function Bn(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wn(n.key),n)}}function wn(e){var A=function(e){if("object"!=dn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=dn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dn(A)?A:A+""}var yn=function(){return e=function e(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=function(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?mn(Object(t),!0).forEach(function(A){vn(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mn(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}({websocketUrl:A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,voice:A.voice||"default",language:A.language||"en",container:A.container||document.body,buttonText:A.buttonText||"Start Listening",buttonClass:A.buttonClass||"voice-button"},A),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1;var t=this.options.websocketUrl||this.options.signedUrl;this.voiceSDK=new ot({signedUrl:t,websocketUrl:t,agentId:this.options.agentId,appId:this.options.appId,voice:this.options.voice,language:this.options.language,visualAssistant:this.options.visualAssistant}),this.setupEventListeners(),this.createButton(),this.connect()},A=[{key:"setupEventListeners",value:function(){var e=this;this.voiceSDK.on("connected",function(){var A,t;e.isConnected=!0,e.updateButton(),null===(A=(t=e.options).onConnected)||void 0===A||A.call(t)}),this.voiceSDK.on("disconnected",function(){var A,t;e.isConnected=!1,e.updateButton(),null===(A=(t=e.options).onDisconnected)||void 0===A||A.call(t)}),this.voiceSDK.on("recordingStarted",function(){var A,t;e.isRecording=!0,e.updateButton(),null===(A=(t=e.options).onRecordingStarted)||void 0===A||A.call(t)}),this.voiceSDK.on("recordingStopped",function(){var A,t;e.isRecording=!1,e.updateButton(),null===(A=(t=e.options).onRecordingStopped)||void 0===A||A.call(t)}),this.voiceSDK.on("playbackStarted",function(){var A,t;e.isPlaying=!0,null===(A=(t=e.options).onPlaybackStarted)||void 0===A||A.call(t)}),this.voiceSDK.on("playbackStopped",function(){var A,t;e.isPlaying=!1,null===(A=(t=e.options).onPlaybackStopped)||void 0===A||A.call(t)}),this.voiceSDK.on("error",function(A){var t,n;null===(t=(n=e.options).onError)||void 0===t||t.call(n,A)}),this.voiceSDK.on("message",function(A){var t,n;null===(t=(n=e.options).onMessage)||void 0===t||t.call(n,A)}),this.voiceSDK.on("bargeIn",function(A){var t,n;null===(t=(n=e.options).onBargeIn)||void 0===t||t.call(n,A)}),this.voiceSDK.on("stopPlaying",function(A){var t,n;null===(t=(n=e.options).onStopPlaying)||void 0===t||t.call(n,A)})}},{key:"createButton",value:function(){var e=this;this.button=document.createElement("button"),this.button.className=this.options.buttonClass,this.button.style.cssText="\n padding: 12px 24px;\n border: none;\n border-radius: 8px;\n background-color: #6c757d;\n color: white;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 8px;\n ",this.button.addEventListener("click",function(){return e.toggleRecording()}),this.options.container.appendChild(this.button),this.updateButton()}},{key:"updateButton",value:function(){if(this.button){var e=this.isRecording?"🔴":"🎤",A=this.isRecording?"Stop Listening":"Start Listening";this.button.innerHTML='\n <span style="font-size: 20px;">'.concat(e,"</span>\n <span>").concat(A,"</span>\n "),this.button.disabled=!this.isConnected,this.button.style.backgroundColor=this.isRecording?"#dc3545":this.isConnected?"#007bff":"#6c757d"}}},{key:"connect",value:(n=fn(pn().m(function e(){var A;return pn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.voiceSDK.connect();case 1:e.n=3;break;case 2:e.p=2,A=e.v,console.error("Failed to connect:",A);case 3:return e.a(2)}},e,this,[[0,2]])})),function(){return n.apply(this,arguments)})},{key:"toggleRecording",value:(t=fn(pn().m(function e(){var A;return pn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.voiceSDK){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,this.voiceSDK.toggleRecording();case 2:e.n=4;break;case 3:e.p=3,A=e.v,console.error("Error toggling recording:",A);case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"getStatus",value:function(){return{isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying}}},{key:"updateConfig",value:function(e){this.voiceSDK.updateConfig(e)}},{key:"destroy",value:function(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}],A&&Bn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function bn(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Cn(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Cn(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Cn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Cn(u,"constructor",c),Cn(c,"constructor",s),s.displayName="GeneratorFunction",Cn(c,o,"GeneratorFunction"),Cn(u),Cn(u,o,"Generator"),Cn(u,n,function(){return this}),Cn(u,"toString",function(){return"[object Generator]"}),(bn=function(){return{w:r,m:d}})()}function Cn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Cn=function(e,A,t,n){function r(A,t){Cn(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Cn(e,A,t,n)}function xn(e,A){return function(e){if(Array.isArray(e))return e}(e)||function(e,A){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(e)).next,0===A){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==A);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,A)||Fn(e,A)||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 Qn(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Fn(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Fn(e,A){if(e){if("string"==typeof e)return Un(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Un(e,A):void 0}}function Un(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}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 kn(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function En(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){kn(r,n,o,i,a,"next",e)}function a(e){kn(r,n,o,i,a,"throw",e)}i(void 0)})}}function In(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Sn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Sn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sn(A)?A:A+""}var Hn=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("🚀 AgentSDK v2.1.8 initialized with config:",A),this.config=A,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=A.onConversationStart||function(){},this.onConversationEnd=A.onConversationEnd||function(){},this.onBargeIn=A.onBargeIn||function(){},this.onAudioStartPlaying=A.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=A.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=A.onSubtitleDisplay||function(){}},A=[{key:"checkResumeBeforeConnect",value:function(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var e,A=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant),t=new ot({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:A,protocolVersion:2}).checkAndResume();return this._resumeChecked=!0,t?(console.log("🔄 [AGENT SDK] Found resume state before connect:",t),this._resumeInfo=t,t):(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=En(bn().m(function e(A){var t,n,o,r,i,a,s,c,l=this;return bn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,A){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===(t=this.config.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant),this.voiceSDK=new ot({signedUrl:A,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 A=new Error("DOMAIN_NOT_WHITELISTED");A.reason=e.reason,A.code=e.code,l.onError(A)}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!",Sn(l.onTranscript))),l.onSubtitleDisplay(e)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=Qn(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=xn(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:(t=En(bn().m(function e(){var A;return bn().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,!(A=e.v).isServerRejection&&"ServerRejected"!==A.name){e.n=4;break}throw A;case 4:throw console.error("❌ AgentSDK: Failed to start recording:",A),A;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 t.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,A){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(e,A);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(e,A),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 A;return this.voiceSDK?this.voiceSDK.hasToolHandler(e):(null===(A=this._pendingToolHandlers)||void 0===A?void 0:A.has(e))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],A&&In(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function Dn(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Pn(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Pn(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Pn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Pn(u,"constructor",c),Pn(c,"constructor",s),s.displayName="GeneratorFunction",Pn(c,o,"GeneratorFunction"),Pn(u),Pn(u,o,"Generator"),Pn(u,n,function(){return this}),Pn(u,"toString",function(){return"[object Generator]"}),(Dn=function(){return{w:r,m:d}})()}function Pn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Pn=function(e,A,t,n){function r(A,t){Pn(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Pn(e,A,t,n)}function On(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Kn(){var e=navigator.userAgent,A=/iPad|iPhone|iPod/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,t=/Android/.test(e),n=/Mac/.test(e)&&!A,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";A?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return A?u="ios":t?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:A,isAndroid:t,isMac:n,isWindows:o,isMobile:A||t,isDesktop:!A&&!t}}function Ln(){return Mn.apply(this,arguments)}function Mn(){var e;return e=Dn().m(function e(){var A;return Dn().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 A=e.v,e.a(2,A.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]])}),Mn=function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){On(r,n,o,i,a,"next",e)}function a(e){On(r,n,o,i,a,"throw",e)}i(void 0)})},Mn.apply(this,arguments)}function Rn(e){var A=e.platform,t=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"===A?n.ios:"android"===A?n["android_".concat(t)]||n.android_chrome:n["desktop_".concat(t)]||n.desktop_chrome}function _n(e){var A=e.isIOS,t=e.isAndroid,n=e.browser;if(A)try{return window.location.href="app-settings:",!0}catch(e){return console.warn("Could not open iOS settings:",e),!1}if(t&&"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 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,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Vn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Vn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vn(A)?A:A+""}function Gn(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,A){if(e){if("string"==typeof e)return Wn(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Wn(e,A):void 0}}(e))||A&&e&&"number"==typeof e.length){t&&(e=t);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(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Wn(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}var zn=function(){return e=function e(){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.overlay=null,this.modal=null},(A=[{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)}}])&&jn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Xn(e,A){var t=new zn,n=t.createOverlay(),o=Kn(),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),t.overlay=n,t.modal=r,r.querySelector('[data-action="accept"]').addEventListener("click",function(){t.close(),e()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){t.close(),A()}),n.addEventListener("click",function(e){e.target===n&&(t.close(),A())}),t.show(),t}function Jn(e,A){var t,n,o,r=new zn,i=r.createOverlay(),a=Kn(),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 A,t=e.platform,n=e.browser,o=document.getElementsByTagName("script"),r="",i=Gn(o);try{for(i.s();!(A=i.n()).done;){var a=A.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"===t?"ios-settings.svg":"android"===t?"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=Gn(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 g=window.location.pathname.split("/");g.pop(),(r=window.location.origin+g.join("/"))&&r!==window.location.origin||(r=window.location.origin)}}r=r.replace(/\/$/,"");var h="".concat(r,"/shared/mic-permission-assets/").concat(c);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",h,"Base path:",r,"Platform:",t,"Browser:",n),h}(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===(t=c.querySelector('[data-action="close"]'))||void 0===t||t.addEventListener("click",function(){r.close(),e()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){_n(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(),Kn();var A,t=document.getElementsByTagName("script"),n="",o=Gn(t);try{for(o.s();!(A=o.n()).done;){var r=A.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=Gn(t);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 g=document.createElement("div");g.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 h=document.createElement("div");h.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(){h.style.display="none"},h.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),g.appendChild(h),g.appendChild(m),g.appendChild(B),p.appendChild(g),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 g=p.nextElementSibling;g&&(g.style.display="none",p.addEventListener("click",function(){"none"===g.style.display?(g.style.display="block",p.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(g.style.display="none",p.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(A){A.target===i&&(r.close(),e())}),r.show(),r}function Yn(e){var A=new zn,t=A.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 ',t.appendChild(n),A.overlay=t,A.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){A.close(),e()}),t.addEventListener("click",function(n){n.target===t&&(A.close(),e())}),A.show(),A}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 Zn(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$n(n.key),n)}}function $n(e){var A=function(e){if("object"!=qn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=qn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qn(A)?A:A+""}var eo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config},(A=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"getText",value:function(e,A){return this.voiceInterface.getText(e,A)}},{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,A){return'<div class="mobile-waveform-bar" data-index="'.concat(A,'"></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>')}}])&&Zn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Ao(e){return Ao="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},Ao(e)}function to(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,no(n.key),n)}}function no(e){var A=function(e){if("object"!=Ao(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Ao(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ao(A)?A:A+""}var oo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config},(A=[{key:"generateCSS",value:function(){var e,A=this.config.avatarBackgroundColor||"#667eea",t=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",g=this.config.controlButtonSecondaryColor||"#64748b",h=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(A," 0%, ").concat(t," 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(g).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;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 5px 10px;\n background: rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 11px;\n color: #64748b;\n margin: 0 auto;\n }\n \n .desktop-timer .timer-dot {\n width: 5px;\n height: 5px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\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(A," 0%, ").concat(t,' 100%) !important;\n }\n \n .desktop-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: 36px;\n width: 100%;\n }\n \n .desktop-waveform-bar {\n width: 4px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 2px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .desktop-waveform-bar[data-index="0"] { height: 14px; animation-delay: 0s; }\n .desktop-waveform-bar[data-index="1"] { height: 26px; animation-delay: 0.1s; }\n .desktop-waveform-bar[data-index="2"] { height: 36px; animation-delay: 0.2s; }\n .desktop-waveform-bar[data-index="3"] { height: 22px; animation-delay: 0.3s; }\n .desktop-waveform-bar[data-index="4"] { height: 16px; animation-delay: 0.4s; }\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;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n width: 100%;\n max-width: 200px;\n margin: 0 auto;\n padding: 0 20px;\n }\n\n .desktop-main-waveform .waveform-bar {\n width: 3px;\n background: #a855f7;\n border-radius: 2px;\n height: 8px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n\n .desktop-main-waveform .waveform-bar:nth-child(1) { height: 12px; animation-delay: 0s; }\n .desktop-main-waveform .waveform-bar:nth-child(2) { height: 20px; animation-delay: 0.05s; }\n .desktop-main-waveform .waveform-bar:nth-child(3) { height: 28px; animation-delay: 0.1s; }\n .desktop-main-waveform .waveform-bar:nth-child(4) { height: 36px; animation-delay: 0.15s; }\n .desktop-main-waveform .waveform-bar:nth-child(5) { height: 44px; animation-delay: 0.2s; }\n .desktop-main-waveform .waveform-bar:nth-child(6) { height: 50px; animation-delay: 0.25s; }\n .desktop-main-waveform .waveform-bar:nth-child(7) { height: 54px; animation-delay: 0.3s; }\n .desktop-main-waveform .waveform-bar:nth-child(8) { height: 56px; animation-delay: 0.35s; }\n .desktop-main-waveform .waveform-bar:nth-child(9) { height: 54px; animation-delay: 0.4s; }\n .desktop-main-waveform .waveform-bar:nth-child(10) { height: 50px; animation-delay: 0.45s; }\n .desktop-main-waveform .waveform-bar:nth-child(11) { height: 44px; animation-delay: 0.5s; }\n .desktop-main-waveform .waveform-bar:nth-child(12) { height: 36px; animation-delay: 0.55s; }\n .desktop-main-waveform .waveform-bar:nth-child(13) { height: 28px; animation-delay: 0.6s; }\n .desktop-main-waveform .waveform-bar:nth-child(14) { height: 20px; animation-delay: 0.65s; }\n .desktop-main-waveform .waveform-bar:nth-child(15) { height: 12px; animation-delay: 0.7s; }\n\n .desktop-status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n font-size: 12px;\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;\n height: 5px;\n background: ").concat(r,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\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(A,", ").concat(t,");\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;\n align-items: center;\n justify-content: center;\n gap: 2px;\n height: 100%;\n width: 100%;\n padding: 4px;\n transform: scale(0.75);\n transform-origin: center;\n }\n \n /* Ensure waveform bars are visible and animated in compact mode */\n .compact-avatar .desktop-main-waveform .waveform-bar {\n width: 2px;\n min-width: 2px;\n background: #a855f7;\n border-radius: 1px;\n flex-shrink: 0;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(1) { height: 6px; animation-delay: 0s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(2) { height: 10px; animation-delay: 0.05s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(3) { height: 14px; animation-delay: 0.1s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(4) { height: 18px; animation-delay: 0.15s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(5) { height: 22px; animation-delay: 0.2s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(6) { height: 26px; animation-delay: 0.25s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(7) { height: 28px; animation-delay: 0.3s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(8) { height: 30px; animation-delay: 0.35s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(9) { height: 28px; animation-delay: 0.4s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(10) { height: 26px; animation-delay: 0.45s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(11) { height: 22px; animation-delay: 0.5s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(12) { height: 18px; animation-delay: 0.55s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(13) { height: 14px; animation-delay: 0.6s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(14) { height: 10px; animation-delay: 0.65s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(15) { height: 6px; animation-delay: 0.7s; }\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;\n height: 6px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\n }\n \n .compact-status {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: ").concat(n,";\n }\n \n .compact-status .status-dot {\n width: 5px;\n height: 5px;\n background: ").concat(r,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\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(h).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(h).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(A," !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 ")}},{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 ")}}])&&to(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();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 io(e,A){(null==A||A>e.length)&&(A=e.length);for(var t=0,n=Array(A);t<A;t++)n[t]=e[t];return n}function ao(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,so(n.key),n)}}function so(e){var A=function(e){if("object"!=ro(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ro(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ro(A)?A:A+""}var co=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.conversationMessages=[],this.currentLiveMessage=null},(A=[{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 A=document.getElementById("mobileTranscriptText");A&&(A.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 t=document.getElementById("mobileMessagesContainer");if(t){var n=t.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"),A=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),t=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"),A&&A.classList.add("expanded"),t&&(t.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"),A&&A.classList.remove("expanded"),t&&(t.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,A){if(!this.voiceInterface.isMobile&&A&&A.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==e)return this.currentLiveMessage={role:e,content:A},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:e,content:A}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}},{key:"updateLiveMessageRow",value:function(){var e=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),A=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),t=null==e?void 0:e.querySelector(".message-avatar");if(e&&A)if(this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()){t&&("user"===this.currentLiveMessage.role?(t.textContent="U",t.className="message-avatar user"):(t.innerHTML='<div class="orb"></div>',t.className="message-avatar assistant")),A.textContent=this.currentLiveMessage.content,e.style.display="flex";var n=A.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",A.querySelector(".typing-cursor")||A.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,A=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(A){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(A.innerHTML="");var t=function(e){return function(e){if(Array.isArray(e))return io(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,A){if(e){if("string"==typeof e)return io(e,A);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?io(e,A):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&&t.length>0){var n=t[t.length-1];n.role===this.currentLiveMessage.role&&n.content===this.currentLiveMessage.content&&(t=t.slice(0,-1))}console.log("📝 [TRANSCRIPT] Rendering",t.length,"messages (live message excluded)"),A.innerHTML=t.map(function(A){var t="user"===A.role;return'\n <div class="message-row '.concat(A.role,'">\n <div class="message-avatar ').concat(A.role,'">\n ').concat(t?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(e.escapeHtml(A.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")}}])&&ao(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function lo(e){return lo="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},lo(e)}function uo(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,po(n.key),n)}}function po(e){var A=function(e){if("object"!=lo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=lo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lo(A)?A:A+""}var go=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null},A=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"setupTextInjectAckHandler",value:function(){var e,A=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){A.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 A,t;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!==(A=n.value)&&void 0!==A&&A.trim()));var r=document.getElementById("mobileTextInput"),i=document.getElementById("mobileSendBtn");if(r&&(r.disabled=!1),i&&(i.disabled=!(null!=r&&null!==(t=r.value)&&void 0!==t&&t.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"),A=this.shadowRoot.getElementById("voiceSendBtn");if(e&&A){var t=e.value.trim();t&&this._sendTextMessage(t,e,A,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}},{key:"sendMobileTextMessage",value:function(){var e=document.getElementById("mobileTextInput"),A=document.getElementById("mobileSendBtn");e&&A?this._sendTextMessage(e.value,e,A,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}},{key:"_sendTextMessage",value:function(e,A,t,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){A.value="",t&&(t.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,A.disabled=!1,t&&(t.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 A.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(e){console.error("Error sending text message:",e),A.disabled=!1,t&&(t.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,A,t){"mobile"===e?this.showMobileTextInputStatus(A,t):this.showDesktopTextInputStatus(A,t)}},{key:"showDesktopTextInputStatus",value:function(e,A){var t=this.shadowRoot.querySelector(".voice-input-hint");t&&(this._originalHintText||(this._originalHintText=t.textContent),t.classList.remove("voice-input-hint--sending","voice-input-hint--success","voice-input-hint--queued","voice-input-hint--error"),"sending"===e?(t.classList.add("voice-input-hint--sending"),t.textContent=A||"Sending..."):"success"===e?(t.classList.add("voice-input-hint--success"),t.textContent=A||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===e?(t.classList.add("voice-input-hint--queued"),t.textContent=A||"Queued"):"error"===e?(t.classList.add("voice-input-hint--error"),t.textContent=A||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===e&&(t.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}},{key:"showMobileTextInputStatus",value:function(e,A){var t=document.querySelector(".mobile-input-hint");t&&(this._originalMobileHintText||(this._originalMobileHintText=t.textContent),t.classList.remove("mobile-input-hint--sending","mobile-input-hint--success","mobile-input-hint--queued","mobile-input-hint--error"),"sending"===e?(t.classList.add("mobile-input-hint--sending"),t.textContent=A||"Sending..."):"success"===e?(t.classList.add("mobile-input-hint--success"),t.textContent=A||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===e?(t.classList.add("mobile-input-hint--queued"),t.textContent=A||"Queued"):"error"===e?(t.classList.add("mobile-input-hint--error"),t.textContent=A||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===e&&(t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}},{key:"clearTextInputStatusAfterDelay",value:function(){var e=this,A=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},A)}},{key:"clearMobileTextInputStatusAfterDelay",value:function(){var e=this,A=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},A)}}],A&&uo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function ho(e){return ho="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},ho(e)}function fo(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=ho(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ho(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ho(A)?A:A+""}var vo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot},A=[{key:"setupEventHandlers",value:function(e){var A=this,t=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(t&&(t.onclick=function(){return A.voiceInterface.startVoiceCall()}),n&&(n.onclick=function(){return A.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){return A.voiceInterface.toggleMute()}),r&&(r.onclick=function(){return A.voiceInterface.toggleSpeaker()}),i&&(i.onclick=function(){return A.voiceInterface.endVoiceCall()}),a&&(a.onclick=function(){return A.voiceInterface.toggleMute()}),s&&(s.onclick=function(){return A.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(){A.voiceInterface.sendDesktopTextMessage()});var u=this.shadowRoot.getElementById("conversationHeader");u&&u.addEventListener("click",function(){A.voiceInterface.transcript.toggleConversationPanel()})}}},{key:"setupMobileEventHandlers",value:function(){var e=this;if(this.voiceInterface.isMobile){var A=document.getElementById("mobileMuteBtn"),t=document.getElementById("mobileSpeakerBtn"),n=document.getElementById("mobileEndCallBtn"),o=document.getElementById("mobileTranscriptRow"),r=document.getElementById("mobileCloseTranscriptBtn"),i=document.getElementById("mobileTextInput"),a=document.getElementById("mobileSendBtn");A&&(A.onclick=function(){return e.voiceInterface.toggleMute()}),t&&(t.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()})}}}],A&&fo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Bo(e){return Bo="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},Bo(e)}function wo(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yo(n.key),n)}}function yo(e){var A=function(e){if("object"!=Bo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Bo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bo(A)?A:A+""}var bo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._liveWaveformInterval=null},(A=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"adjustSizesForContainer",value:function(){var e=this.shadowRoot.getElementById("voiceInterface");if(e){var A,t,n,o,r,i,a=e.clientHeight||e.offsetHeight||400,s=e.clientWidth||e.offsetWidth||400;a<=350?(A=80,t=80,n=48,o=54,r=6,i=12):a<=450?(A=100,t=100,n=56,o=62,r=8,i=14):a<=550?(A=120,t=120,n=64,o=70,r=10,i=16):a<=700?(A=140,t=140,n=72,o=78,r=12,i=18):(A=160,t=160,n=80,o=86,r=14,i=20);var c=this.shadowRoot.querySelector(".voice-avatar, .voice-avatar-active");c&&(c.style.width="".concat(A,"px"),c.style.height="".concat(A,"px"),c.style.fontSize="".concat(.5*A,"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(t,"px"),d.style.maxHeight="".concat(t,"px"),d.style.height="".concat(t,"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 g=this.shadowRoot.querySelector(".transcript-text");g&&(g.style.fontSize="".concat(Math.max(10,i-2),"px"));var h=this.shadowRoot.querySelector(".voice-text-input-area");if(h){var f=h.querySelector(".voice-input-wrapper"),m=h.querySelector(".voice-text-input"),v=h.querySelector(".voice-send-btn"),B=h.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 A=e.querySelector("svg");if(A){var t=.65*n;A.style.setProperty("width","".concat(t,"px"),"important"),A.style.setProperty("height","".concat(t,"px"),"important"),A.style.setProperty("min-width","".concat(t,"px"),"important"),A.style.setProperty("min-height","".concat(t,"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 A;A=this.config.statusText||(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected")),e.textContent=A;var t=this.shadowRoot.getElementById("desktopStatusText");t&&t!==e&&(t.textContent=A)}}}},{key:"updateLiveWaveform",value:function(e){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopLiveWaveform");A&&A.querySelectorAll(".desktop-live-bar").forEach(function(A,t){if(e){var n=40*Math.random()+8;A.style.height="".concat(n,"px")}else A.style.height="8px"})}}},{key:"showError",value:function(e){var A=this.shadowRoot.getElementById("transcriptText");A&&(A.textContent="".concat(this.t("error"),": ").concat(e),A.classList.remove("empty"))}},{key:"showDomainError",value:function(){var e=this;console.log("🚫 Showing domain error in widget UI...");var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.querySelector("#startCallBtn"),r=this.t("domainNotValidated"),i=this.t("domainErrorMessage");console.log("🚫 Domain error title:",r),console.log("🚫 Domain error message:",i),t?(t.textContent=r,t.style.color="#991B1B",t.style.fontSize="20px",t.style.fontWeight="600",t.style.marginLeft="20px",t.style.marginRight="20px",t.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=A.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=A.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(a,s.nextSibling):n&&n.parentNode?n.parentNode.insertBefore(a,n.nextSibling):A.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")}A.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"),A=this.shadowRoot.getElementById("liveTextCollapsed");if(e){var t=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=t,t&&""!==t.trim()||e.classList.add("empty"))},5e3)}else if(A){var o=A.textContent;A.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(){A&&(A.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()}}])&&wo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Co(e){return Co="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},Co(e)}function xo(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qo(n.key),n)}}function Qo(e){var A=function(e){if("object"!=Co(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Co(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Co(A)?A:A+""}var Fo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=A,this.config=A.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])},(A=[{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 A=document.createElement("style");A.id="mobile-voice-call-bar-styles",A.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(A)}var t=document.createElement("div");t.id="mobile-voice-call-bar-container",t.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,A){return'<div class="mobile-waveform-bar" data-index="'.concat(A,'"></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(t);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 A=document.getElementById("mobileTextInput");A&&setTimeout(function(){return A.focus()},100);var t=document.getElementById("mobileMessagesContainer");t&&setTimeout(function(){t.scrollTop=t.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 A=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(A||t){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"),A&&(A.textContent=r),t&&(t.textContent=r),n&&(n.style.backgroundColor=i,n.style.boxShadow="paused"===e?"none":"0 0 8px ".concat(i))}}},{key:"addMobileMessage",value:function(e,A){this.voiceInterface.messages.push({type:e,text:A});var t=document.getElementById("mobileMessagesContainer");if(t){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(e),n.textContent=A,t.appendChild(n),t.scrollTop=t.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,A){var t=60*Math.random()+10;e.style.height="".concat(t,"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=[]}}])&&xo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Uo(e){return Uo="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},Uo(e)}function So(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return ko(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(ko(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ko(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,ko(u,"constructor",c),ko(c,"constructor",s),s.displayName="GeneratorFunction",ko(c,o,"GeneratorFunction"),ko(u),ko(u,o,"Generator"),ko(u,n,function(){return this}),ko(u,"toString",function(){return"[object Generator]"}),(So=function(){return{w:r,m:d}})()}function ko(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ko=function(e,A,t,n){function r(A,t){ko(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},ko(e,A,t,n)}function Eo(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Io(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Eo(r,n,o,i,a,"next",e)}function a(e){Eo(r,n,o,i,a,"throw",e)}i(void 0)})}}function To(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ho(n.key),n)}}function Ho(e){var A=function(e){if("object"!=Uo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Uo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uo(A)?A:A+""}var Do=function(){return e=function e(A){var t;!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=A,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=A.shadowRoot||document,this.textSDK=A.textSDK||null,this.deviceInfo=Kn(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=A.visualAssistant||(null===(t=A.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);this.sdk=new Hn({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,visualAssistant:n,variables:A.variables||{},language:A.language||"en",outputContainer:A.outputContainer,outputEncoding:A.outputEncoding,outputSampleRate:A.outputSampleRate,outputChannels:A.outputChannels,outputBitDepth:A.outputBitDepth,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay}),this.templates=new eo(this),this.styles=new oo(this),this.transcript=new co(this),this.textHandlers=new go(this),this.handlers=new vo(this),this.desktop=new bo(this),this.mobile=new Fo(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()},A=[{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(A){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",A),e.updateTranscript(A)},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(A){var t=e.shadowRoot.getElementById("voiceAvatarActive");t&&(A?(t.classList.add("speaking"),e.isMobile?(e.updateMobileStatus("speaking"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())):(t.classList.remove("speaking"),e.isMobile?(e.updateMobileStatus("listening"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var A=Io(So().m(function A(t){return So().w(function(A){for(;;)switch(A.n){case 0:if(console.log("🔌 WebSocket disconnected, hanging up call..."),!t||!(1008===t.code&&t.reason&&(t.reason.includes("Domain not whitelisted")||t.reason.includes("domain")||t.reason.includes("whitelist"))||1008===t.code&&t.reason&&t.reason.includes("localhost"))){A.n=2;break}return console.error("❌ Domain not whitelisted - WebSocket closed:",t.code,t.reason),A.n=1,e.endCallOnServerRejection();case 1:A.n=3;break;case 2:e.isActive&&(e.isActive=!1,e.endVoiceCall());case 3:return A.a(2)}},A)}));return function(e){return A.apply(this,arguments)}}(),this.sdk.onError=function(){var A=Io(So().m(function A(t){return So().w(function(A){for(;;)switch(A.n){case 0:if(!t||!("DOMAIN_NOT_WHITELISTED"===t.message||t.message&&t.message.includes("Domain not whitelisted"))){A.n=2;break}return console.error("❌ Voice SDK Error: Domain not whitelisted:",t),A.n=1,e.endCallOnServerRejection();case 1:return A.a(2);case 2:if(!t.isServerRejection&&"ServerRejected"!==t.name){A.n=3;break}return A.a(2);case 3:console.error("❌ Voice SDK Error:",t),e.showError(t.message||t);case 4:return A.a(2)}},A)}));return function(e){return A.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 A,t,n=this.config.language||"en";return((null===(A=this.config.translations)||void 0===A?void 0:A[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[e]||e}},{key:"getText",value:function(e,A){return void 0!==this.config[e]&&null!==this.config[e]?this.config[e]:this.t(A)}},{key:"getTooltip",value:function(e){var A,t=null===(A=this.config.tooltips)||void 0===A?void 0:A[e];return null!=t?t:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[e]||""}},{key:"_updateTimerElements",value:function(e,A){var t=this.shadowRoot.getElementById("voiceTimer");t&&(t.textContent=e);var n=this.shadowRoot.getElementById("desktopTimerText"),o=this.shadowRoot.getElementById("compactTimerText");if(n&&(n.textContent=e),o&&(o.textContent=e),!o&&!n&&A<2e3){console.warn("⚠️ Timer elements not found - compactTimerText:",!!o,"desktopTimerText:",!!n,"elapsed:",A);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){return 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=Io(So().m(function e(){var A,t=this;return So().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,Ln();case 2:if(A=e.v,console.log("📋 Current permission state: ".concat(A)),"denied"!==A){e.n=3;break}throw console.log("🚫 Permission is denied, showing blocked modal..."),this.resetConnectingState(),Kn(),Jn(function(){console.log("Blocked modal closed")}),new Error("Microphone permission denied");case 3:if("prompt"!==A&&"unknown"!==A){e.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),e.a(2,new Promise(function(e,A){Xn(Io(So().m(function n(){var o;return So().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,t.proceedWithVoiceCall();case 2:e(),n.n=4;break;case 3:n.p=3,o=n.v,A(o);case 4:return n.a(2)}},n,null,[[1,3]])})),function(){console.log("❌ Pre-prompt cancelled"),t.resetConnectingState(),A(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=Io(So().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,L,M,R,_,V,j,N,G,W=this;return So().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,A=this.shadowRoot.getElementById("desktopConversationPanel"),t=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"),A&&(A.classList.remove("expanded"),A.classList.add("collapsed")),t&&t.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="":(g=document.getElementById("text-chat-button"))&&(g.style.display=""),(h=this.shadowRoot.getElementById("voiceIdleState"))&&(h.style.display="flex"),(f=this.shadowRoot.getElementById("text-chat-panel"))?f.style.display="":(m=document.getElementById("text-chat-panel"))&&(m.style.display=""),Kn(),Jn(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,A=Math.floor(e/6e4),t=Math.floor(e%6e4/1e3),n="".concat(A.toString().padStart(2,"0"),":").concat(t.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=""),(L=this.shadowRoot.getElementById("text-chat-button"))?L.style.display="":(M=document.getElementById("text-chat-button"))&&(M.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,A=Math.floor(e/6e4),t=Math.floor(e%6e4/1e3),n="".concat(A.toString().padStart(2,"0"),":").concat(t.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}Kn(),Jn(function(){W.resetUIState()}),e.n=44;break;case 40:if("NotFoundError"!==G.name&&"DevicesNotFoundError"!==G.name){e.n=41;break}Yn(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 A=document.getElementById("text-chat-panel");A&&(A.style.display="")}}var t=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState");t&&(t.style.display="flex"),n&&(n.style.display="none")}},{key:"endCallOnServerRejection",value:(t=Io(So().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m;return So().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"),A=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("landingScreen"),A&&(A.classList.add("active"),console.log("✅ Made voice interface visible")),t&&(t.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,g=e.v,console.warn("Error calling stopRecording:",g);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,h=e.v,console.warn("Error calling stopListening:",h);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 t.apply(this,arguments)})},{key:"endVoiceCall",value:function(){var e,A=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 t=this.shadowRoot.getElementById("text-chat-panel");if(t)t.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 A.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(){var e=this.shadowRoot.getElementById("voiceIdleState"),A=this.shadowRoot.getElementById("voiceActiveState");if(e){var t=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(t&&(t.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"}A&&(A.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 A=e.querySelector("#domainErrorBackBtn");A&&A.parentNode&&A.parentNode.removeChild(A);var t=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(t&&(t.textContent=this.getText("startCallTitle","clickToStartCall"),t.style.color="",t.style.fontSize="",t.style.fontWeight="",t.style.marginLeft="",t.style.marginRight="",t.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,A){return this.transcript.addConversationMessage(e,A)}},{key:"renderConversationMessages",value:function(){return this.transcript.renderConversationMessages()}},{key:"escapeHtml",value:function(e){var A=document.createElement("div");return A.textContent=e,A.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 A=this.shadowRoot.getElementById("desktopMuteBtn"),t=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),A){var n=A.querySelector(".desktop-mic-icon"),o=A.querySelector(".desktop-mic-off-icon");n&&o&&(e.enabled?(A.classList.remove("muted"),n.style.display="block",o.style.display="none"):(A.classList.add("muted"),n.style.display="none",o.style.display="block"))}if(t){var r=t.querySelector(".desktop-mic-icon"),i=t.querySelector(".desktop-mic-off-icon");r&&i&&(e.enabled?(t.classList.remove("muted"),r.style.display="block",i.style.display="none"):(t.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"),A=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(e){var t=e.querySelector(".desktop-speaker-icon"),n=e.querySelector(".desktop-speaker-off-icon");t&&n&&(this.isSpeakerMuted?(e.classList.add("muted"),t.style.display="none",n.style.display="block"):(e.classList.remove("muted"),t.style.display="block",n.style.display="none"))}if(A){var o=A.querySelector(".desktop-speaker-icon"),r=A.querySelector(".desktop-speaker-off-icon");o&&r&&(this.isSpeakerMuted?(A.classList.add("muted"),o.style.display="none",r.style.display="block"):(A.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,A){return this.mobile.addMobileMessage(e,A)}},{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)}}],A&&To(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n,o}();function Po(e){return Po="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},Po(e)}function Oo(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ko(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Ko(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ko(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ko(u,"constructor",c),Ko(c,"constructor",s),s.displayName="GeneratorFunction",Ko(c,o,"GeneratorFunction"),Ko(u),Ko(u,o,"Generator"),Ko(u,n,function(){return this}),Ko(u,"toString",function(){return"[object Generator]"}),(Oo=function(){return{w:r,m:d}})()}function Ko(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ko=function(e,A,t,n){function r(A,t){Ko(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Ko(e,A,t,n)}function Lo(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function Mo(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Lo(r,n,o,i,a,"next",e)}function a(e){Lo(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ro(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_o(n.key),n)}}function _o(e){var A=function(e){if("object"!=Po(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Po(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Po(A)?A:A+""}var Vo=function(){return e=function e(A,t){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=A,this.sdk=t,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=A.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},A=[{key:"t",value:function(e){var A,t,n=this.config.language||"en";return((null===(A=this.config.translations)||void 0===A?void 0:A[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[e]||e}},{key:"generateHTML",value:function(){var e,A,t,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!==(A=this.config.sendButtonHint)&&void 0!==A&&A.text||null!==(t=this.config.panel)&&void 0!==t&&null!==(t=t.sendButtonHint)&&void 0!==t&&t.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,A,t,n,o,r,i,a,s,c,l,u,d,p=this.config.messages,g=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonColor)||"#7C3AED"),h=this.config.sendButtonHoverColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonHoverColor)||"#6D28D9",f=this.config.sendButtonTextColor||(null===(t=this.config.panel)||void 0===t?void 0:t.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(g,";\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(h,";\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,A=this.shadowRoot.getElementById("sendButton"),t=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(A&&(A.onclick=function(){return e.sendMessage()}),n&&(n.onclick=function(){return e.startNewChat()}),this.updateInputAttributes(),t){t.style.height="32px",t.style.overflow="hidden";var o=function(){t.style.height="auto";var e=Math.min(t.scrollHeight,120);t.style.height=e+"px",t.style.overflowY=e>=120?"auto":"hidden",e>=120&&setTimeout(function(){t.scrollTop=t.scrollHeight},0)};t.addEventListener("input",o),t.addEventListener("keydown",function(A){"Enter"!==A.key||A.shiftKey?"Enter"===A.key&&A.shiftKey&&setTimeout(o,0):(A.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 A=this.shadowRoot.getElementById("messageInput");A&&A.focus()}},{key:"updateInputAttributes",value:function(){var e=this.shadowRoot.getElementById("messageInput");if(e){var A,t=this.config.inputPlaceholder||(null===(A=this.config.panel)||void 0===A?void 0:A.inputPlaceholder)||this.t("typeMessage")||"Type your message...";e.placeholder=t,e.dir=this.config.direction||"ltr",e.style.textAlign="rtl"===this.config.direction?"right":"left"}}},{key:"show",value:function(){var e=this,A=this.shadowRoot.getElementById("textInterface");A&&A.classList.add("active"),setTimeout(function(){var A=e.shadowRoot.getElementById("messageInput");A&&A.focus()},50)}},{key:"hide",value:function(){var e=this.shadowRoot.getElementById("textInterface");e&&e.classList.remove("active")}},{key:"startChat",value:(n=Mo(Oo().m(function e(){return Oo().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:(t=Mo(Oo().m(function e(){var A,t,n;return Oo().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=this.shadowRoot.getElementById("messageInput"),t=A.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",t),A.value="",A.style.height="32px",A.style.overflow="hidden",e.p=3,this.beginStreaming(),e.n=4,this.sdk.sendMessage(t);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 t.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var e=this.shadowRoot.getElementById("sendButton");e&&(e.disabled=!this.isActive)}},{key:"addMessage",value:function(e,A){var t,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===(t=this.config.messages)||void 0===t?void 0:t.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=A,i.appendChild(s),i.appendChild(l),o.appendChild(i),o.scrollTop=o.scrollHeight}}},{key:"beginStreaming",value:function(){var e,A=this.shadowRoot.getElementById("messagesContainer");if(A){this.stopStreamingState();var t=document.createElement("div"),n="rtl"===this.config.direction?"edge-right":"edge-left";t.className="message agent ".concat(n),t.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>',t.appendChild(o),t.appendChild(r),A.appendChild(t),this.streamingEl=r,this.hasStartedStreaming=!1,A.scrollTop=A.scrollHeight}}},{key:"appendStreamingChunk",value:function(e){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=e;var A=this.shadowRoot.getElementById("messagesContainer");A&&(A.scrollTop=A.scrollHeight)}}},{key:"finalizeStreaming",value:function(e){if(this.streamingEl){this.streamingEl.textContent=e||this.streamingEl.textContent;var A=this.shadowRoot.getElementById("agent-streaming");A&&(A.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 A=this.shadowRoot.getElementById("messagesContainer");if(A){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 t,n=document.createElement("div");n.className="error-message",n.style.cssText="padding: 16px; margin: 12px; border-radius: 8px; background: "+((null===(t=this.config.messages)||void 0===t?void 0:t.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),A.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,A.appendChild(i)}A.scrollTop=A.scrollHeight}}},{key:"setActive",value:function(e){this.isActive=e,this.updateSendButtonState()}}],A&&Ro(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function jo(e){return jo="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},jo(e)}function No(e,A){for(var t=0;t<A.length;t++){var n=A[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Go(n.key),n)}}function Go(e){var A=function(e){if("object"!=jo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=jo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jo(A)?A:A+""}var Wo=function(){return e=function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=A,this.translations=A.translations||{},this.shadowRoot=A.shadowRoot},A=[{key:"t",value:function(e){var A=this.config.language||"en";return(this.translations[A]||this.translations.en||{})[e]||e}},{key:"generateHTML",value:function(){var e,A=this.config.landing||{};return e="image"===A.logoType&&A.logoImageUrl?'<img src="'.concat(A.logoImageUrl,'" alt="Logo" style="max-width: 44px; max-height: 44px; object-fit: contain; border: none; outline: none;">'):'<span class="landing-avatar-emoji">'.concat(A.logoIcon||A.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(A.title||this.t("landingTitle"),'</h2>\n <p class="landing-subtitle">').concat(A.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(A.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(A.textCardTitle||this.t("textChat"),"</span>\n </button>\n </div>\n </div>\n ")}},{key:"generateCSS",value:function(){var e=this.config.landing||{},A=(this.config.animation,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(A,"; \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(A,"; \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 A=e.logoBackgroundColor||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;")}return"background: transparent; box-shadow: none; border: none; outline: none;"}var t=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;")}(),"\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,A=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");A&&A.classList.add("active")}},{key:"hide",value:function(){var e,A=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");A&&A.classList.remove("active")}},{key:"setupEventHandlers",value:function(){var e,A,t=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===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("mode-card-text");n&&t.onSelectVoice&&(n.onclick=t.onSelectVoice),o&&t.onSelectText&&(o.onclick=t.onSelectText)}}],A&&No(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();const zo={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 Xo(){var e,A,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Jo(c,"_invoke",function(t,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(A,t){return r=A,a=0,s=e,d.n=t,i}};function p(t,n){for(a=t,s=n,A=0;!u&&c&&!o&&A<l.length;A++){var o,r=l[A],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=t<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<g&&(o=t<3||r[0]>n||n>g)&&(r[4]=t,r[5]=n,d.n=g,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,g){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,g),a=l,s=g;(A=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"),A=r[o]){if(!(A=A.call(r,s)))throw TypeError("iterator result is not an object");if(!A.done)return A;s=A.value,a<2&&(a=0)}else 1===a&&(A=r.return)&&A.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((A=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(A){r=e,a=1,s=A}finally{c=1}}return{value:A,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}A=Object.getPrototypeOf;var l=[][n]?A(A([][n]())):(Jo(A={},n,function(){return this}),A),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Jo(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Jo(u,"constructor",c),Jo(c,"constructor",s),s.displayName="GeneratorFunction",Jo(c,o,"GeneratorFunction"),Jo(u),Jo(u,o,"Generator"),Jo(u,n,function(){return this}),Jo(u,"toString",function(){return"[object Generator]"}),(Xo=function(){return{w:r,m:d}})()}function Jo(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Jo=function(e,A,t,n){function r(A,t){Jo(e,A,function(e){return this._invoke(A,t,e)})}A?o?o(e,A,{value:t,enumerable:!n,configurable:!n,writable:!n}):e[A]=t:(r("next",0),r("throw",1),r("return",2))},Jo(e,A,t,n)}function Yo(e,A,t,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void t(e)}a.done?A(s):Promise.resolve(s).then(n,o)}function qo(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Yo(r,n,o,i,a,"next",e)}function a(e){Yo(r,n,o,i,a,"throw",e)}i(void 0)})}}function Zo(e){return Zo="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},Zo(e)}function $o(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),t.push.apply(t,n)}return t}function er(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?$o(Object(t),!0).forEach(function(A){Ar(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$o(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Ar(e,A,t){return(A=nr(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function tr(e,A){for(var t=0;t<A.length;t++){var n=A[t];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 A=function(e){if("object"!=Zo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Zo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zo(A)?A:A+""}var or=function(){return e=function e(){var A,t,n,o,r,i,a,s,c,l=this,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=this.mergeWithDefaults(u),this.sdk=new mt(this.config),this.isOpen=!1,this.isActive=!1,this.translations=zo,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=er(er(er({},this.config),this.config.voice),{},{inputPlaceholder:(null===(A=this.config.text)||void 0===A?void 0:A.inputPlaceholder)||this.config.inputPlaceholder||"Type your message...",sendButtonColor:(null===(t=this.config.text)||void 0===t?void 0:t.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,A,t=null===(e=l.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(t&&"none"!==t.style.display){var n=t.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===(A=l.config.behavior)||void 0===A?void 0:A.mode)||"unified")&&l.showLanding()},onShowVoice:function(){l.showVoice()},onShowLanding:function(){l.showLanding()},onErrorToast:function(e,A){l.showErrorToast(e,A)}});this.voiceInterface=new Do(d);var p=er(er(er({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Vo(p,this.sdk),"unified"===((null===(c=this.config.behavior)||void 0===c?void 0:c.mode)||"unified")){var g=er(er({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new Wo(g)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var h,f=null===(h=this.shadowRoot)||void 0===h?void 0:h.getElementById("text-chat-panel");f&&(this.isOpen=!0,f.classList.add("open"))}this.checkAndHandleResume()},A=[{key:"checkAndHandleResume",value:function(){var e=this,A=this.voiceInterface.checkAndHandleResume();A&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(function(){e.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(A){var t;console.error("❌ [WIDGET] Failed to auto-resume call:",A),"unified"===((null===(t=e.config.behavior)||void 0===t?void 0:t.mode)||"unified")&&e.showLanding()})},100))}},{key:"open",value:function(){var e;if(!this.isOpen){var A=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("text-chat-panel");A&&(this.isOpen=!0,A.classList.add("open"))}}},{key:"mergeWithDefaults",value:function(e){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,L,M,R,_,V,j,N,G,W,z,X,J,Y,q,Z,$,ee,Ae,te,ne,oe,re,ie,ae,se,ce,le,ue,de,pe,ge,he,fe,me,ve,Be,we,ye,be,Ce,xe,Qe,Fe,Ue,Se,ke,Ee,Ie,Te,He,De,Pe,Oe,Ke,Le,Me,Re,_e,Ve,je,Ne,Ge,We,ze,Xe,Je,Ye,qe,Ze,$e,eA,AA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,pA,gA,hA,fA,mA,vA,BA,wA,yA,bA,CA,xA,QA,FA,UA,SA,kA,EA,IA,TA=e.position||"bottom-right";if("string"==typeof TA){var HA=TA.split("-");TA={vertical:HA[0]||"bottom",horizontal:HA[1]||"right",offset:e.positionOffset||{x:20,y:20}}}var DA,PA,OA=e.primaryColor||(null===(A=e.button)||void 0===A?void 0:A.primaryColor)||(null===(t=e.button)||void 0===t?void 0:t.backgroundColor)||"#FFFFFF";return er({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:er({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:er({vertical:TA.vertical||"bottom",horizontal:TA.horizontal||"right",offset:TA.offset||{x:20,y:20}},"object"===Zo(e.position)?e.position:{}),button:er({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===(g=e.button)||void 0===g?void 0:g.shadow),shadowColor:(null===(h=e.button)||void 0===h?void 0:h.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:er({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:er({micButtonColor:(null===(x=e.voice)||void 0===x?void 0:x.micButtonColor)||(null===(Q=e.panel)||void 0===Q?void 0:Q.micButtonColor)||OA,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:er(er({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===(L=e.voice)||void 0===L?void 0:L.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(M=e.voice)||void 0===M?void 0:M.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:er({sendButtonColor:(null===(ee=e.text)||void 0===ee?void 0:ee.sendButtonColor)||(null===(Ae=e.panel)||void 0===Ae?void 0:Ae.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(te=e.text)||void 0===te?void 0:te.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:er(er({text:(null===(ge=e.text)||void 0===ge||null===(ge=ge.sendButtonHint)||void 0===ge?void 0:ge.text)||(null===(he=e.panel)||void 0===he||null===(he=he.sendButtonHint)||void 0===he?void 0:he.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:(PA={},e.landing&&Object.keys(e.landing).forEach(function(A){var t=e.landing[A];(null!=t&&""!==t||!1===t)&&(PA[A]=t)}),er({backgroundColor:PA.backgroundColor||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:PA.logo||"🤖",title:PA.title||null,titleColor:PA.titleColor||"#1e293b",modeCardBackgroundColor:PA.modeCardBackgroundColor||"#FFFFFF",modeCardBorderColor:PA.modeCardBorderColor||"#E2E8F0",modeCardHoverBorderColor:PA.modeCardHoverBorderColor||"#7C3AED",modeCardIconBackgroundColor:PA.modeCardIconBackgroundColor||"#7C3AED",modeCardTitleColor:PA.modeCardTitleColor||"#111827",voiceCardIcon:PA.voiceCardIcon||"🎤",textCardIcon:PA.textCardIcon||"💬",voiceCardTitle:PA.voiceCardTitle||null,textCardTitle:PA.textCardTitle||null},PA)),header:(DA={},e.header&&Object.keys(e.header).forEach(function(A){var t=e.header[A];A.startsWith("onlineIndicator")?null!=t&&(DA[A]=t):null!=t&&""!==t&&(DA[A]=t)}),er({title:DA.title||"Chat Assistant",showTitle:!1!==DA.showTitle,backgroundColor:DA.backgroundColor||"#7C3AED",textColor:DA.textColor||"#FFFFFF",showCloseButton:!1!==DA.showCloseButton},DA)),footer:er({show:!1!==(null===(Le=e.footer)||void 0===Le?void 0:Le.show),backgroundColor:(null===(Me=e.footer)||void 0===Me?void 0:Me.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:er({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:er({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===(eA=e.messages)||void 0===eA?void 0:eA.textColor)||"#1F2937",agentTextColor:(null===(AA=e.messages)||void 0===AA?void 0:AA.agentTextColor)||(null===(tA=e.messages)||void 0===tA?void 0:tA.textColor)||"#1F2937",userAvatarIcon:(null===(nA=e.messages)||void 0===nA?void 0:nA.userAvatarIcon)||"👤",agentAvatarIcon:(null===(oA=e.messages)||void 0===oA?void 0:oA.agentAvatarIcon)||"🤖",fontSize:(null===(rA=e.messages)||void 0===rA?void 0:rA.fontSize)||"14px",borderRadius:(null===(iA=e.messages)||void 0===iA?void 0:iA.borderRadius)||16},e.messages),animation:er({enableHover:!1!==(null===(aA=e.animation)||void 0===aA?void 0:aA.enableHover),enablePulse:!1!==(null===(sA=e.animation)||void 0===sA?void 0:sA.enablePulse),enableSlide:!1!==(null===(cA=e.animation)||void 0===cA?void 0:cA.enableSlide),duration:(null===(lA=e.animation)||void 0===lA?void 0:lA.duration)||.3},e.animation),promptAnimation:er({enabled:!0===(null===(uA=e.promptAnimation)||void 0===uA?void 0:uA.enabled),text:(null===(dA=e.promptAnimation)||void 0===dA?void 0:dA.text)||"Try me!",backgroundColor:(null===(pA=e.promptAnimation)||void 0===pA?void 0:pA.backgroundColor)||"linear-gradient(135deg, #7c3aed, #4f46e5)",textColor:(null===(gA=e.promptAnimation)||void 0===gA?void 0:gA.textColor)||"#ffffff",animationType:(null===(hA=e.promptAnimation)||void 0===hA?void 0:hA.animationType)||"bounce",showShimmer:!1!==(null===(fA=e.promptAnimation)||void 0===fA?void 0:fA.showShimmer),showPulseRings:!1!==(null===(mA=e.promptAnimation)||void 0===mA?void 0:mA.showPulseRings),hideAfterClick:!1!==(null===(vA=e.promptAnimation)||void 0===vA?void 0:vA.hideAfterClick),hideAfterSeconds:void 0!==(null===(BA=e.promptAnimation)||void 0===BA?void 0:BA.hideAfterSeconds)?e.promptAnimation.hideAfterSeconds:null,position:(null===(wA=e.promptAnimation)||void 0===wA?void 0:wA.position)||"top"},e.promptAnimation),behavior:er({autoOpen:(null===(yA=e.behavior)||void 0===yA?void 0:yA.autoOpen)||!1,startOpen:(null===(bA=e.behavior)||void 0===bA?void 0:bA.startOpen)||!1,hidden:(null===(CA=e.behavior)||void 0===CA?void 0:CA.hidden)||!1,autoConnect:(null===(xA=e.behavior)||void 0===xA?void 0:xA.autoConnect)||!1,showWelcomeMessage:!1!==(null===(QA=e.behavior)||void 0===QA?void 0:QA.showWelcomeMessage),welcomeMessage:(null===(FA=e.behavior)||void 0===FA?void 0:FA.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(UA=e.behavior)||void 0===UA?void 0:UA.enableVoiceMode)||e.behavior.enableVoiceMode,mode:(null===(SA=e.behavior)||void 0===SA?void 0:SA.mode)||"unified"},e.behavior),accessibility:er({ariaLabel:(null===(kA=e.accessibility)||void 0===kA?void 0:kA.ariaLabel)||"Chat Assistant",ariaDescription:(null===(EA=e.accessibility)||void 0===EA?void 0:EA.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(IA=e.accessibility)||void 0===IA?void 0:IA.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:OA},"string"==typeof e.position?{positionString:e.position}:{})}},{key:"setupEventHandlers",value:function(){var e=this;this.sdk.on("domainError",function(A){e.textInterface.showError(A),e.textInterface.stopStreamingState()}),this.sdk.on("error",function(A){A&&("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))||(e.textInterface.showError(A.message||A),e.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(A){e.textInterface.appendStreamingChunk(A)}),this.sdk.on("done",function(A){var t=A.text;e.textInterface.finalizeStreaming(t)})}},{key:"createShadowHost",value:function(){var e=document.getElementById("ttp-widget-shadow-host");e&&e.remove();var A=document.createElement("div");A.id="ttp-widget-shadow-host",A.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=A.attachShadow({mode:"open"}),document.body.appendChild(A)}},{key:"createRegularContainer",value:function(){var e=document.getElementById("ttp-widget-container");e&&e.remove();var A=document.createElement("div");A.id="ttp-widget-container",A.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(A),this.regularContainer=A}},{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 A;A=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 t=this.generateWidgetHTML();if(this.config.useShadowDOM){var n="\n <style>".concat(A,"</style>\n ").concat(t,"\n ");this.shadowRoot.innerHTML=n}else this.injectStylesIntoHead(A),this.container.innerHTML=t;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 A,t,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(A=this.config.button)||void 0===A?void 0:A.size]||60,r={small:20,medium:28,large:36,xl:44}[null===(t=this.config.icon)||void 0===t?void 0:t.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,A=this,t=(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}[t.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 t=A.config.language||"en";return(A.translations[t]||A.translations.en)[e]||e},g=function(e){var t,n=null===(t=A.config.tooltips)||void 0===t?void 0:t[e];return null!=n?n:{newChat:p("newChat"),back:p("back"),close:p("close"),mute:p("mute"),speaker:p("speaker"),endCall:p("endCall")}[e]||""},h=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(h,"\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(g("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(g("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="'+g("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"),A="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(A,'" 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,A=e.offset||{x:20,y:20},t="";return"top"===e.vertical?t+="top: ".concat(A.y,"px;"):"bottom"===e.vertical?t+="bottom: ".concat(A.y,"px;"):"center"===e.vertical&&(t+="top: 50%; transform: translateY(-50%);"),"left"===e.horizontal?t+="left: ".concat(A.x,"px;"):"right"===e.horizontal?t+="right: ".concat(A.x,"px;"):"center"===e.horizontal&&(t+="left: 50%; transform: translateX(-50%);"),t}},{key:"generateIconHTML",value:function(e){var A=this.config.icon;switch(A.type){case"custom":return'<img src="'.concat(A.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(A.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*e),'px; font-weight: bold; color: white;">').concat(A.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,A){var t="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var n=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);n&&(t=n[0])}else t=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(t,';">\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 A="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var t=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);t&&(A=t[0])}else A=e.backgroundColor;return'\n <div class="prompt-pulse-rings" id="prompt-pulse-rings">\n <div class="prompt-pulse-ring" style="background-color: '.concat(A,'33;"></div>\n <div class="prompt-pulse-ring" style="background-color: ').concat(A,'1a;"></div>\n </div>\n ')}},{key:"generateCSS",value:function(e,A,t){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",g="unified"===p,h="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(A,"px;\n height: ").concat(A,"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(A,"px;\n height: ").concat(A,"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(A,"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(A,"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(g&&this.landingScreen?this.landingScreen.generateCSS():"","\n\n ").concat(h?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,A=this;if(this.shadowRoot){this.setupPromptAnimation();var t=this.shadowRoot.getElementById("text-chat-button");t&&(t.onclick=function(){A.config.promptAnimation.hideAfterClick&&A.hidePrompt(),A.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=function(){A._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,t,n;if(null!==(e=A.voiceInterface)&&void 0!==e&&e.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),A.voiceInterface.isShowingDomainError=!1,null!==(n=A.voiceInterface)&&void 0!==n&&n.resetConnectingState&&A.voiceInterface.resetConnectingState(),void A.showLanding();null!==(t=A.voiceInterface)&&void 0!==t&&t.isActive?A.showBackButtonWarning():A.showLanding()}),i&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=qo(Xo().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,x;return Xo().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!A.isStartingCall){e.n=1;break}return console.log("⚠️ Call already starting, ignoring duplicate click"),e.a(2);case 1:if("function"==typeof A.config.onVoiceCallButtonClick)try{A.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"start"})}catch(e){console.error("Error in onVoiceCallButtonClick callback:",e)}if(A.isStartingCall=!0,e.p=2,A.showVoice(),null!==(t=A.voiceInterface)&&void 0!==t&&t.showConnectingState&&A.voiceInterface.showConnectingState(),null===(n=A.voiceInterface)||void 0===n||!n.isMobile||null===(o=A.voiceInterface)||void 0===o||!o.createMobileMinimizedBar){e.n=3;break}return(a=(null===(i=A.shadowRoot)||void 0===i?void 0:i.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(a.style.display="none"),A.voiceInterface.createMobileMinimizedBar(),A.voiceInterface.updateMobileStatus("connecting"),e.n=3,new Promise(function(e){return requestAnimationFrame(function(){return requestAnimationFrame(e)})});case 3:return e.n=4,A.startVoiceCall();case 4:if(null===(r=A.voiceInterface)||void 0===r||!r.isActive){e.n=5;break}console.log("✅ Voice call started successfully"),e.n=7;break;case 5:if(console.warn("⚠️ startVoiceCall() returned but call is not active"),u=null===(s=A.voiceInterface)||void 0===s||null===(s=s.shadowRoot)||void 0===s?void 0:s.getElementById("voiceIdleState"),d=!1,u&&"none"!==u.style.display&&(p=u.querySelector(".voice-status-title"))&&(h=p.textContent.trim(),f=null===(g=A.voiceInterface)||void 0===g?void 0:g.t("domainNotValidated"),console.log("🔍 Checking for domain error - titleText:",h,"domainErrorTitle:",f),(h===f||h.includes("Domain not")||h.includes("not whitelisted"))&&(d=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))),!d){e.n=6;break}return A.currentView="voice",A.showVoice(),console.log("✅ Staying on voice interface with domain error displayed"),e.a(2);case 6:console.log("⚠️ Not a domain error - returning to landing screen"),null!==(c=A.voiceInterface)&&void 0!==c&&c.resetConnectingState&&A.voiceInterface.resetConnectingState(),"unified"===((null===(l=A.config.behavior)||void 0===l?void 0:l.mode)||"unified")&&A.showLanding();case 7:e.n=10;break;case 8:if(e.p=8,!(x=e.v).isServerRejection&&"ServerRejected"!==x.name){e.n=9;break}return null!==(w=A.voiceInterface)&&void 0!==w&&w.resetConnectingState&&A.voiceInterface.resetConnectingState(),e.a(2);case 9:console.error("❌ Failed to start voice call:",x),null!==(m=A.voiceInterface)&&void 0!==m&&m.resetConnectingState&&A.voiceInterface.resetConnectingState(),null!==(v=A.voiceInterface)&&void 0!==v&&v.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&null!==(y=A.voiceInterface)&&void 0!==y&&y.removeMobileMinimizedBar&&A.voiceInterface.removeMobileMinimizedBar(),(C=(null===(b=A.shadowRoot)||void 0===b?void 0:b.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(C.style.display="")),"Call cancelled by user"!==x.message&&A.showErrorToast(x.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(B=A.config.behavior)||void 0===B?void 0:B.mode)||"unified")&&A.showLanding();case 10:return e.p=10,A.isStartingCall=!1,e.f(10);case 11:return e.a(2)}},e,null,[[2,8,10,11]])})),function(){return o.apply(this,arguments)}),onSelectText:function(){return A.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 A.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 A=null===(e=this.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(A&&"none"!==A.style.display){var t=A.querySelector(".voice-status-title");if(t){var n,o=t.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"),A=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),A&&A.classList.remove("active"),this.textInterface.show();var o=this.config.behavior.mode||"unified";t&&"unified"===o&&t.classList.add("visible"),n&&(n.style.display="")}}},{key:"showVoice",value:function(){if(this.shadowRoot){this.currentView="voice";var e=this.shadowRoot.getElementById("landingScreen"),A=this.shadowRoot.getElementById("textInterface"),t=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),A&&A.classList.remove("active"),t&&t.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(A){"Escape"===A.key&&e.isOpen&&e.togglePanel()})}},{key:"setupPromptAnimation",value:function(){var e=this;if(this.shadowRoot){var A=this.config.promptAnimation||{},t=!0===A.enabled;if(console.log("🎨 setupPromptAnimation called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:A,enabled:A.enabled,isPromptEnabled:t,isOpen:this.isOpen}),!t)return console.log("❌ Prompt disabled, hiding"),void this.hidePrompt();if(this.isOpen?this.hidePrompt():this.showPrompt(),!this.isOpen&&null!==A.hideAfterSeconds&&A.hideAfterSeconds>0&&(this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*A.hideAfterSeconds)),this.voiceInterface&&this.voiceInterface.sdk){var n=this.config.onConversationStart;this.config.onConversationStart=function(){var A=e.shadowRoot.getElementById("prompt-pulse-rings");A&&(A.style.display="none"),n&&n.apply(void 0,arguments)},this.voiceInterface.sdk.voiceSDK&&this.voiceInterface.sdk.voiceSDK.on("recordingStarted",function(){var A=e.shadowRoot.getElementById("prompt-pulse-rings");A&&(A.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 A=this.shadowRoot.getElementById("prompt-pulse-rings");A||this.shadowRoot===document||(A=document.getElementById("prompt-pulse-rings")),A&&(A.style.display="none",A.style.visibility="hidden")}}},{key:"showPrompt",value:function(){var e=this;if(this.shadowRoot){var A=this.config.promptAnimation||{},t=!1!==A.enabled;if(console.log("👁️ showPrompt called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:A,enabled:A.enabled,isPromptEnabled:t,shadowRoot:!!this.shadowRoot}),t){var n=function(){var t=e.shadowRoot.getElementById("prompt-bubble");if(t||e.shadowRoot===document||(t=document.getElementById("prompt-bubble")),t?(t.style.display="block",t.style.visibility="visible",t.style.opacity="1",console.log("✅ Prompt bubble shown:",t)):console.warn("⚠️ Prompt bubble not found in shadowRoot or document"),!1!==A.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!==A.showPulseRings?this.shadowRoot.getElementById("prompt-pulse-rings"):null;o&&(!1===A.showPulseRings||r)||(setTimeout(function(){n()},100),setTimeout(function(){n()},500)),null!==A.hideAfterSeconds&&A.hideAfterSeconds>0&&(this.promptAutoHideTimer&&clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*A.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 A=this.shadowRoot.getElementById("text-chat-panel");A&&A.classList.toggle("open"),this.isOpen?(this.hidePrompt(),setTimeout(function(){var A=e.shadowRoot.getElementById("messageInput");A&&A.focus()},100)):(this.showPrompt(),setTimeout(function(){var A,t=e.shadowRoot.getElementById("prompt-bubble");t&&"none"===t.style.display&&(t.style.display="block");var n=e.shadowRoot.getElementById("prompt-pulse-rings");n&&!1!==(null===(A=e.config.promptAnimation)||void 0===A?void 0:A.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 A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",t=document.createElement("div");t.className="widget-toast widget-toast-".concat(A),t.textContent=e;var n="error"===A?"#ef4444":"warning"===A?"#f59e0b":"#3b82f6";if(Object.assign(t.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(t),setTimeout(function(){t.style.animation="slideDown 0.3s ease-out",setTimeout(function(){t.parentNode&&t.parentNode.removeChild(t)},300)},4e3)}},{key:"showConfirmModal",value:function(e){var A=e.title,t=void 0===A?"Confirm":A,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 g=document.createElement("div");g.className="widget-confirm-modal",g.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 h="danger"===l?"widget-modal-btn--danger":"widget-modal-btn--primary";g.innerHTML='\n <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #1e293b;">'.concat(t,'</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(h,'" 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(g),(this.shadowRoot||document.body).appendChild(p),g.querySelector('[data-action="confirm"]').onclick=function(){p.remove(),null==u||u()},g.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=qo(Xo().m(function e(){return Xo().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=qo(Xo().m(function e(){return Xo().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,A;null!==(e=this.voiceInterface)&&void 0!==e&&e.isActive&&null!==(A=this.voiceInterface.desktop)&&void 0!==A&&A.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}},{key:"getSignedUrl",value:(o=qo(Xo().m(function e(){var A,t,n;return Xo().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 A=this.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",(t=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&t.append("appId",this.config.appId),!1!==this.config.demo&&t.append("demo","true"),n="".concat(A,"?").concat(t.toString()),e.a(2,n)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"addMessage",value:function(e,A){this.textInterface.addMessage(e,A)}},{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 A,t,n,o,r,i,a,s,c,l,u=er({},this.config);e.panel&&(u.panel=er(er({},this.config.panel),e.panel)),e.voice&&(u.voice=er(er({},this.config.voice),e.voice),e.voice.micButtonHint&&(u.voice.micButtonHint=er(er({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),e.voice.micButtonHint))),e.text&&(u.text=er(er({},this.config.text),e.text),e.text.sendButtonHint&&(u.text.sendButtonHint=er(er({},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=er(er({},this.config.button),e.button)),e.header&&(u.header=er(er({},this.config.header),e.header)),e.icon&&(u.icon=er(er({},this.config.icon),e.icon)),e.messages&&(u.messages=er(er({},this.config.messages),e.messages)),e.animation&&(u.animation=er(er({},this.config.animation),e.animation)),e.behavior&&(u.behavior=er(er({},this.config.behavior),e.behavior)),e.accessibility&&(u.accessibility=er(er({},this.config.accessibility),e.accessibility)),e.tooltips&&(u.tooltips=er(er({},this.config.tooltips),e.tooltips)),e.landing&&(u.landing=er(er({},this.config.landing),e.landing)),e.footer&&(u.footer=er(er({},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(A){["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(A)||(u[A]=e[A])}),null===(A=this.config)||void 0===A||A.language;var d=!1!==(null===(t=this.config)||void 0===t?void 0:t.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 g=document.getElementById("ttp-widget-container");if(g&&this.config.useShadowDOM&&g.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var h=document.getElementById("ttp-widget-shadow-host");h?(this.shadowRoot=h.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=er(er(er({},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 Do(y);var b=er(er(er({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Vo(b,this.sdk),"unified"===((null===(s=this.config.behavior)||void 0===s?void 0:s.mode)||"unified")){var C=er(er({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new Wo(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 A=document.getElementById("ttp-widget-container");A&&A.remove();var t=document.getElementById("ttp-widget-styles");t&&t.remove(),this.sdk&&this.sdk.destroy(),this.voiceInterface&&this.voiceInterface.destroy()}},{key:"startVoiceCall",value:(n=qo(Xo().m(function e(){return Xo().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:(t=qo(Xo().m(function e(A){var t,n,o,r,i=arguments;return Xo().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},A&&A.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===(t=this.voiceInterface)||void 0===t?void 0:t.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(A,er(er({},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 t.apply(this,arguments)})},{key:"registerToolHandler",value:function(e,A){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.registerToolHandler(e,A):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:e,handler:A}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}},{key:"unregisterToolHandler",value:function(e){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.unregisterToolHandler(e):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(function(A){return A.name!==e})),this)}},{key:"hasToolHandler",value:function(e){var A;return!(null===(A=this.voiceInterface)||void 0===A||!A.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,A=this;this._pendingClientTools&&null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk&&(this._pendingClientTools.forEach(function(e){var t=e.name,n=e.handler;A.voiceInterface.sdk.registerToolHandler(t,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(e,A){return this.registerToolHandler(e,A)}},{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()}}],A&&tr(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n,o,r,i}();console.log("[TTP SDK] ✅ Sandbox Deployment Test - v2.33.9-SANDBOX (with NEW conversation panel: collapsed/expanded states & compact design)");var rr="2.18.0";const ir={VoiceSDK_v2:ot,TextChatSDK:mt,WebSocketManager:_t,AudioRecorder:q,AudioPlayer:Zt,EventEmitter:O,VoiceButton:un,VanillaVoiceButton:yn,AgentSDK:Hn,TTPChatWidget:or,VERSION:rr}})(),n})());
3
3
  //# sourceMappingURL=agent-widget.js.map