ttp-agent-sdk 2.34.0 → 2.34.3

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(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TTPAgentSDK=e():A.TTPAgentSDK=e()}(window,()=>(()=>{var A={354:function(A){A.exports=function(){"use strict";var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};function e(e,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=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var t=function(){return t=Object.assign||function(A){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(A[o]=e[o]);return A},t.apply(this,arguments)};function n(A,e,t,n){return new(t||(t=Promise))(function(o,r){function i(A){try{s(n.next(A))}catch(A){r(A)}}function a(A){try{s(n.throw(A))}catch(A){r(A)}}function s(A){var e;A.done?o(A.value):(e=A.value,e instanceof t?e:new t(function(A){A(e)})).then(i,a)}s((n=n.apply(A,e||[])).next())})}function o(A,e){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=e.call(A,i)}catch(A){r=[6,A],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(A,e,t){if(t||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return A.concat(n||e)}for(var i=function(){function A(A,e,t,n){this.left=A,this.top=e,this.width=t,this.height=n}return A.prototype.add=function(e,t,n,o){return new A(this.left+e,this.top+t,this.width+n,this.height+o)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var n=Array.from(t).find(function(A){return 0!==A.width});return n?new A(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),a=function(A,e){return i.fromClientRect(A,e.getBoundingClientRect())},s=function(A){for(var e=[],t=0,n=A.length;t<n;){var o=A.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+65536):(e.push(o),t--)}else e.push(o)}return e},c=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],o=-1,r="";++o<t;){var i=A[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(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},m=function(){function A(A,e,t,n,o,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),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,Q=17,x=18,F=19,U=20,S=21,k=22,E=24,I=25,H=26,T=27,D=28,O=30,P=32,K=33,L=34,M=35,R=37,_=38,j=39,V=40,N=42,G=[9001,65288],W="×",z="÷",X=function(A){var e,t,n,o=function(A){var e,t,n,o,r,i=.75*A.length,a=A.length,s=0;"="===A[A.length-1]&&(i--,"="===A[A.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(e=0;e<a;e+=4)t=g[A.charCodeAt(e)],n=g[A.charCodeAt(e+1)],o=g[A.charCodeAt(e+2)],r=g[A.charCodeAt(e+3)],l[s++]=t<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(A),r=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(o):new Uint32Array(o),i=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(o):new Uint16Array(o),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(e=r,t=Math.ceil((24+r[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,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=[O,36],Y=[1,2,3,5],q=[y,8],Z=[T,H],$=Y.concat(q),AA=[_,j,V,L,M],eA=[C,b],tA=function(A,e,t,n){var o=n[t];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var r=t;r<=n.length;){if((s=n[++r])===e)return!0;if(s!==y)break}if(o===y)for(r=t;r>0;){var i=n[--r];if(Array.isArray(A)?-1!==A.indexOf(i):A===i)for(var a=t;a<=n.length;){var s;if((s=n[++a])===e)return!0;if(s!==y)break}if(i!==y)break}return!1},nA=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==y)return n;t--}return 0},oA=function(A,e,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=e[r],c=i>=0?e[i]:0,l=e[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===nA(r,e))return z;if(11===X.get(A[r]))return W;if((s===P||s===K)&&11===X.get(A[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!==[Q,x,F,E,D].indexOf(l))return W;if(nA(r,e)===k)return W;if(tA(23,k,r,e))return W;if(tA([Q,x],S,r,e))return W;if(tA(12,12,r,e))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!==eA.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===T&&-1!==[R,P,K].indexOf(l)||-1!==[R,P,K].indexOf(s)&&l===H)return W;if(-1!==J.indexOf(s)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(s)&&-1!==J.indexOf(l))return W;if(-1!==[T,H].indexOf(s)&&(l===I||-1!==[k,C].indexOf(l)&&e[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,Q,x].indexOf(l))for(var u=r;u>=0;){if((d=e[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(-1!==[T,H].indexOf(l))for(u=-1!==[Q,x].indexOf(s)?i:r;u>=0;){var d;if((d=e[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(_===s&&-1!==[_,j,L,M].indexOf(l)||-1!==[j,L].indexOf(s)&&-1!==[j,V].indexOf(l)||-1!==[V,M].indexOf(s)&&l===V)return W;if(-1!==AA.indexOf(s)&&-1!==[U,H].indexOf(l)||-1!==AA.indexOf(l)&&s===T)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(A[a])||-1!==J.concat(I).indexOf(l)&&s===x)return W;if(41===s&&41===l){for(var p=t[r],g=1;p>0&&41===e[--p];)g++;if(g%2!=0)return W}return s===P&&l===K?W:z},rA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],n=[],o=[];return A.forEach(function(A,r){var i=X.get(A);if(i>50?(o.push(!0),i-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(r),t.push(16);if(4===i||11===i){if(0===r)return n.push(r),t.push(O);var a=t[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),t.push(a)):(n.push(r),t.push(O))}return n.push(r),31===i?t.push("strict"===e?S:R):i===N||29===i?t.push(O):43===i?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(R):t.push(O):void t.push(i)}),[n,t,o]}(A,e.lineBreak),n=t[0],o=t[1],r=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(o=o.map(function(A){return-1!==[I,O,N].indexOf(A)?R:A}));var i="keep-all"===e.wordBreak?r.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):void 0;return[n,o,i]},iA=function(){function A(A,e,t,n){this.codePoints=A,this.required="!"===e,this.start=t,this.end=n}return A.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),aA=45,sA=43,cA=-1,lA=function(A){return A>=48&&A<=57},uA=function(A){return lA(A)||A>=65&&A<=70||A>=97&&A<=102},dA=function(A){return 10===A||9===A||32===A},pA=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},gA=function(A){return pA(A)||lA(A)||A===aA},hA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},fA=function(A,e){return 92===A&&10!==e},mA=function(A,e,t){return A===aA?pA(e)||fA(e,t):!!pA(A)||!(92!==A||!fA(A,e))},vA=function(A,e,t){return A===sA||A===aA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},BA=function(A){var e=0,t=1;A[e]!==sA&&A[e]!==aA||(A[e]===aA&&(t=-1),e++);for(var n=[];lA(A[e]);)n.push(A[e++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===A[e]&&e++;for(var r=[];lA(A[e]);)r.push(A[e++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==A[e]&&101!==A[e]||e++;var s=1;A[e]!==sA&&A[e]!==aA||(A[e]===aA&&(s=-1),e++);for(var l=[];lA(A[e]);)l.push(A[e++]);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)},wA={type:2},yA={type:3},bA={type:4},CA={type:13},QA={type:8},xA={type:21},FA={type:9},UA={type:10},SA={type:11},kA={type:12},EA={type:14},IA={type:23},HA={type:1},TA={type:25},DA={type:24},OA={type:26},PA={type:27},KA={type:28},LA={type:29},MA={type:31},RA={type:32},_A=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(s(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==RA;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(gA(e)||fA(t,n)){var o=mA(e,t,n)?2:1;return{type:5,value:this.consumeName(),flags:o}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),CA;break;case 39:return this.consumeStringToken(39);case 40:return wA;case 41:return yA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case sA:if(vA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return bA;case aA:var r=A,i=this.peekCodePoint(0),a=this.peekCodePoint(1);if(vA(r,i,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(mA(r,i,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(i===aA&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(vA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),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===cA)return this.consumeToken()}break;case 58:return OA;case 59:return PA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===aA&&this.peekCodePoint(2)===aA)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 64:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),d=this.peekCodePoint(2);if(mA(l,u,d))return{type:7,value:this.consumeName()};break;case 91:return KA;case 92:if(fA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return LA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),QA;break;case 123:return SA;case 125:return kA;case 117:case 85:var p=this.peekCodePoint(0),g=this.peekCodePoint(1);return p!==sA||!uA(g)&&63!==g||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),FA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),xA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),UA;break;case cA:return RA}return dA(A)?(this.consumeWhiteSpace(),MA):lA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):pA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:c(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();uA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(c.apply(void 0,A.map(function(A){return 63===A?48:A})),16),end:parseInt(c.apply(void 0,A.map(function(A){return 63===A?70:A})),16)};var n=parseInt(c.apply(void 0,A),16);if(this.peekCodePoint(0)===aA&&uA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];uA(e)&&o.length<6;)o.push(e),e=this.consumeCodePoint();return{type:30,start:n,end:parseInt(c.apply(void 0,o),16)}}return{type:30,start:n,end:n}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),IA)}for(;;){var n=this.consumeCodePoint();if(n===cA||41===n)return{type:22,value:c.apply(void 0,A)};if(dA(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),IA);if(34===n||39===n||40===n||hA(n))return this.consumeBadUrlRemnants(),IA;if(92===n){if(!fA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),IA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;dA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;fA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=c.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var n=this._value[t];if(n===cA||void 0===n||n===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),HA;if(92===n){var o=this._value[t+1];o!==cA&&void 0!==o&&(10===o?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):fA(n,o)&&(e+=this.consumeStringSlice(t),e+=c(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==sA&&t!==aA||A.push(this.consumeCodePoint());lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&lA(n))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===t||101===t)&&((n===sA||n===aA)&&lA(o)||lA(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[BA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);return mA(n,o,r)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(uA(A)){for(var e=c(A);uA(this.peekCodePoint(0))&&e.length<6;)e+=c(this.consumeCodePoint());dA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===cA?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(gA(e))A+=c(e);else{if(!fA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=c(this.consumeEscapedCodePoint())}}},A}(),jA=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new _A;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||qA(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?RA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),VA=function(A){return 15===A.type},NA=function(A){return 17===A.type},GA=function(A){return 20===A.type},WA=function(A){return 0===A.type},zA=function(A,e){return GA(A)&&A.value===e},XA=function(A){return 31!==A.type},JA=function(A){return 31!==A.type&&4!==A.type},YA=function(A){var e=[],t=[];return A.forEach(function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)}),t.length&&e.push(t),e},qA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},ZA=function(A){return 17===A.type||15===A.type},$A=function(A){return 16===A.type||ZA(A)},Ae=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},ee={type:17,number:0,flags:4},te={type:16,number:50,flags:4},ne={type:16,number:100,flags:4},oe=function(A,e,t){var n=A[0],o=A[1];return[re(n,e),re(void 0!==o?o:n,t)]},re=function(A,e){if(16===A.type)return A.number/100*e;if(VA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},ie="grad",ae="turn",se=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case ie:return Math.PI/200*e.number;case"rad":return e.number;case ae:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===ie||"rad"===A.unit||A.unit===ae)},le=function(A){switch(A.filter(GA).map(function(A){return A.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ee,ee];case"to top":case"bottom":return ue(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ee,ne];case"to right":case"left":return ue(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ne,ne];case"to bottom":case"top":return ue(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ne,ee];case"to left":case"right":return ue(270)}return 0},ue=function(A){return Math.PI*A/180},de=function(A,e){if(18===e.type){var t=we[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var n=e.value.substring(0,1),o=e.value.substring(1,2),r=e.value.substring(2,3);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===e.value.length){n=e.value.substring(0,1),o=e.value.substring(1,2),r=e.value.substring(2,3);var i=e.value.substring(3,4);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),r=e.value.substring(4,6),he(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),r=e.value.substring(4,6),i=e.value.substring(6,8),he(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===e.type){var a=be[e.value.toUpperCase()];if(void 0!==a)return a}return be.TRANSPARENT},pe=function(A){return!(255&A)},ge=function(A){var e=255&A,t=255&A>>8,n=255&A>>16,o=255&A>>24;return e<255?"rgba("+o+","+n+","+t+","+e/255+")":"rgb("+o+","+n+","+t+")"},he=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n))>>>0},fe=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},me=function(A,e){var t=e.filter(JA);if(3===t.length){var n=t.map(fe),o=n[0],r=n[1],i=n[2];return he(o,r,i,1)}if(4===t.length){var a=t.map(fe),s=(o=a[0],r=a[1],i=a[2],a[3]);return he(o,r,i,s)}return 0};function ve(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var Be=function(A,e){var t=e.filter(JA),n=t[0],o=t[1],r=t[2],i=t[3],a=(17===n.type?ue(n.number):se(A,n))/(2*Math.PI),s=$A(o)?o.number/100:0,c=$A(r)?r.number/100:0,l=void 0!==i&&$A(i)?re(i,1):1;if(0===s)return he(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,p=ve(d,u,a+1/3),g=ve(d,u,a),h=ve(d,u,a-1/3);return he(255*p,255*g,255*h,l)},we={hsl:Be,hsla:Be,rgb:me,rgba:me},ye=function(A,e){return de(A,jA.create(e).parseComponentValue())},be={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},Ce={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(GA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Qe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},xe=function(A,e){var t=de(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},Fe=function(A,e){var t=A[0],n=A[A.length-1];null===t.stop&&(t.stop=ee),null===n.stop&&(n.stop=ne);for(var o=[],r=0,i=0;i<A.length;i++){var a=A[i].stop;if(null!==a){var s=re(a,e);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 A.map(function(A,t){return{color:A.color,stop:Math.max(Math.min(1,o[t]/e),0)}})},Ue=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,o=t/2,r=re(A[0],e)-n,i=o-re(A[1],t);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(A,e,t),o=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),r=e/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]},Se=function(A,e){return Math.sqrt(A*A+e*e)},ke=function(A,e,t,n,o){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var r=e[0],i=e[1],a=Se(t-r,n-i);return(o?a<A.optimumDistance:a>A.optimumDistance)?{optimumCorner:e,optimumDistance:a}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Ee=function(A,e){var t=ue(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var r=e[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=le(e));if(ce(r))return void(t=(se(A,r)+ue(270))%ue(360))}var i=xe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},Ie="closest-side",He="farthest-side",Te="closest-corner",De="farthest-corner",Oe="circle",Pe="ellipse",Ke="cover",Le="contain",Me=function(A,e){var t=0,n=3,o=[],r=[];return YA(e).forEach(function(e,i){var a=!0;if(0===i?a=e.reduce(function(A,e){if(GA(e))switch(e.value){case"center":return r.push(te),!1;case"top":case"left":return r.push(ee),!1;case"right":case"bottom":return r.push(ne),!1}else if($A(e)||ZA(e))return r.push(e),!1;return A},a):1===i&&(a=e.reduce(function(A,e){if(GA(e))switch(e.value){case Oe:return t=0,!1;case Pe:return t=1,!1;case Le:case Ie:return n=0,!1;case He:return n=1,!1;case Te:return n=2,!1;case Ke:case De:return n=3,!1}else if(ZA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},a)),a){var s=xe(A,e);o.push(s)}}),{size:n,shape:t,stops:o,position:r,type:2}},Re=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var n=je[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(A,e.values)}throw new Error("Unsupported image type "+e.type)};var _e,je={"linear-gradient":function(A,e){var t=ue(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var r=e[0];if(20===r.type&&"to"===r.value)return void(t=le(e));if(ce(r))return void(t=se(A,r))}var i=xe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ee,"-ms-linear-gradient":Ee,"-o-linear-gradient":Ee,"-webkit-linear-gradient":Ee,"radial-gradient":function(A,e){var t=0,n=3,o=[],r=[];return YA(e).forEach(function(e,i){var a=!0;if(0===i){var s=!1;a=e.reduce(function(A,e){if(s)if(GA(e))switch(e.value){case"center":return r.push(te),A;case"top":case"left":return r.push(ee),A;case"right":case"bottom":return r.push(ne),A}else($A(e)||ZA(e))&&r.push(e);else if(GA(e))switch(e.value){case Oe:return t=0,!1;case Pe:return t=1,!1;case"at":return s=!0,!1;case Ie:return n=0,!1;case Ke:case He:return n=1,!1;case Le:case Te:return n=2,!1;case De:return n=3,!1}else if(ZA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},a)}if(a){var c=xe(A,e);o.push(c)}}),{size:n,shape:t,stops:o,position:r,type:2}},"-moz-radial-gradient":Me,"-ms-radial-gradient":Me,"-o-radial-gradient":Me,"-webkit-radial-gradient":Me,"-webkit-gradient":function(A,e){var t=ue(180),n=[],o=1;return YA(e).forEach(function(e,t){var r=e[0];if(0===t){if(GA(r)&&"linear"===r.value)return void(o=1);if(GA(r)&&"radial"===r.value)return void(o=2)}if(18===r.type)if("from"===r.name){var i=de(A,r.values[0]);n.push({stop:ee,color:i})}else if("to"===r.name)i=de(A,r.values[0]),n.push({stop:ne,color:i});else if("color-stop"===r.name){var a=r.values.filter(JA);if(2===a.length){i=de(A,a[1]);var s=a[0];NA(s)&&n.push({stop:{type:16,number:100*s.number,flags:s.flags},color:i})}}}),1===o?{angle:(t+ue(180))%ue(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},Ve={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter(function(A){return JA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!je[A.name])}(A)}).map(function(e){return Re(A,e)})}},Ne={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(GA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Ge={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return YA(e).map(function(A){return A.filter($A)}).map(Ae)}},We={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(GA).map(function(A){return A.value}).join(" ")}).map(ze)}},ze=function(A){switch(A){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(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(_e||(_e={}));var Xe,Je={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(Ye)})}},Ye=function(A){return GA(A)||$A(A)},qe=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Ze=qe("top"),$e=qe("right"),At=qe("bottom"),et=qe("left"),tt=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Ae(e.filter($A))}}},nt=tt("top-left"),ot=tt("top-right"),rt=tt("bottom-right"),it=tt("bottom-left"),at=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){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(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return VA(e)?e.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(A,e){return"rtl"===e?1:0}},Bt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(GA).reduce(function(A,e){return A|wt(e.value)},0)}},wt=function(A){switch(A){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(A,e){switch(e){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(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Xe||(Xe={}));var Ct,Qt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Xe.STRICT:Xe.NORMAL}},xt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ft=function(A,e){return GA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?re(A,e):e},Ut={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Re(A,e)}},St={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},kt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){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(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},It=Et("top"),Ht=Et("right"),Tt=Et("bottom"),Dt=Et("left"),Ot={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(GA).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Pt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Kt=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Lt=Kt("top"),Mt=Kt("right"),Rt=Kt("bottom"),_t=Kt("left"),jt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Vt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){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(A,e){return 1===e.length&&zA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:be.TRANSPARENT,offsetX:ee,offsetY:ee,blur:ee},n=0,o=0;o<e.length;o++){var r=e[o];ZA(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=de(A,r)}return t})}},Gt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){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(A,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var t=zt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},zt={matrix:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number});return 6===e.length?e:null},matrix3d:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number}),t=e[0],n=e[1];e[2],e[3];var o=e[4],r=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var i=e[12],a=e[13];return e[14],e[15],16===e.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(A,e){var t=e.filter($A);return 2!==t.length?Jt:[t[0],t[1]]}},qt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"}(Ct||(Ct={}));for(var Zt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){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(A,e){if(20===e.type)return{auto:!0,order:0};if(NA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},An={name:"time",parse:function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},en={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.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(A,e){return e.filter(GA).map(function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(A){return 0!==A})}},on={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],n=[];return e.forEach(function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}}),t.length&&n.push(t.join(" ")),n.map(function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"})}},rn={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},an={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.number:GA(e)&&"bold"===e.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(GA).map(function(A){return A.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(A,e){return 0!==(A&e)},un={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},dn={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],o=e.filter(XA),r=0;r<o.length;r++){var i=o[r],a=o[r+1];if(20===i.type){var s=a&&NA(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(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(XA),o=0;o<n.length;o++){var r=n[o],i=n[o+1];if(GA(r)&&"none"!==r.value){var a=i&&NA(i)?i.number:0;t.push({counter:r.value,reset:a})}}return t}},gn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(VA).map(function(e){return An.parse(A,e)})}},hn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var n=[],o=e.filter(WA);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(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&zA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:255,offsetX:ee,offsetY:ee,blur:ee,spread:ee,inset:!1},n=0,o=0;o<e.length;o++){var r=e[o];zA(r,"inset")?t.inset=!0:ZA(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=de(A,r)}return t})}},vn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(GA).forEach(function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}}),[0,1,2].forEach(function(A){-1===t.indexOf(A)&&t.push(A)}),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(A,e){return VA(e)?e.number:0}},yn=function(){function A(A,e){var t,n;this.animationDuration=Qn(A,gn,e.animationDuration),this.backgroundClip=Qn(A,Ce,e.backgroundClip),this.backgroundColor=Qn(A,Qe,e.backgroundColor),this.backgroundImage=Qn(A,Ve,e.backgroundImage),this.backgroundOrigin=Qn(A,Ne,e.backgroundOrigin),this.backgroundPosition=Qn(A,Ge,e.backgroundPosition),this.backgroundRepeat=Qn(A,We,e.backgroundRepeat),this.backgroundSize=Qn(A,Je,e.backgroundSize),this.borderTopColor=Qn(A,Ze,e.borderTopColor),this.borderRightColor=Qn(A,$e,e.borderRightColor),this.borderBottomColor=Qn(A,At,e.borderBottomColor),this.borderLeftColor=Qn(A,et,e.borderLeftColor),this.borderTopLeftRadius=Qn(A,nt,e.borderTopLeftRadius),this.borderTopRightRadius=Qn(A,ot,e.borderTopRightRadius),this.borderBottomRightRadius=Qn(A,rt,e.borderBottomRightRadius),this.borderBottomLeftRadius=Qn(A,it,e.borderBottomLeftRadius),this.borderTopStyle=Qn(A,st,e.borderTopStyle),this.borderRightStyle=Qn(A,ct,e.borderRightStyle),this.borderBottomStyle=Qn(A,lt,e.borderBottomStyle),this.borderLeftStyle=Qn(A,ut,e.borderLeftStyle),this.borderTopWidth=Qn(A,pt,e.borderTopWidth),this.borderRightWidth=Qn(A,gt,e.borderRightWidth),this.borderBottomWidth=Qn(A,ht,e.borderBottomWidth),this.borderLeftWidth=Qn(A,ft,e.borderLeftWidth),this.boxShadow=Qn(A,mn,e.boxShadow),this.color=Qn(A,mt,e.color),this.direction=Qn(A,vt,e.direction),this.display=Qn(A,Bt,e.display),this.float=Qn(A,yt,e.cssFloat),this.fontFamily=Qn(A,on,e.fontFamily),this.fontSize=Qn(A,rn,e.fontSize),this.fontStyle=Qn(A,cn,e.fontStyle),this.fontVariant=Qn(A,sn,e.fontVariant),this.fontWeight=Qn(A,an,e.fontWeight),this.letterSpacing=Qn(A,bt,e.letterSpacing),this.lineBreak=Qn(A,Qt,e.lineBreak),this.lineHeight=Qn(A,xt,e.lineHeight),this.listStyleImage=Qn(A,Ut,e.listStyleImage),this.listStylePosition=Qn(A,St,e.listStylePosition),this.listStyleType=Qn(A,kt,e.listStyleType),this.marginTop=Qn(A,It,e.marginTop),this.marginRight=Qn(A,Ht,e.marginRight),this.marginBottom=Qn(A,Tt,e.marginBottom),this.marginLeft=Qn(A,Dt,e.marginLeft),this.opacity=Qn(A,en,e.opacity);var o=Qn(A,Ot,e.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=Qn(A,Pt,e.overflowWrap),this.paddingTop=Qn(A,Lt,e.paddingTop),this.paddingRight=Qn(A,Mt,e.paddingRight),this.paddingBottom=Qn(A,Rt,e.paddingBottom),this.paddingLeft=Qn(A,_t,e.paddingLeft),this.paintOrder=Qn(A,vn,e.paintOrder),this.position=Qn(A,Vt,e.position),this.textAlign=Qn(A,jt,e.textAlign),this.textDecorationColor=Qn(A,tn,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=Qn(A,nn,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=Qn(A,Nt,e.textShadow),this.textTransform=Qn(A,Gt,e.textTransform),this.transform=Qn(A,Wt,e.transform),this.transformOrigin=Qn(A,Yt,e.transformOrigin),this.visibility=Qn(A,qt,e.visibility),this.webkitTextStrokeColor=Qn(A,Bn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Qn(A,wn,e.webkitTextStrokeWidth),this.wordBreak=Qn(A,Zt,e.wordBreak),this.zIndex=Qn(A,$t,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return pe(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.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)},A}(),bn=function(A,e){this.content=Qn(A,un,e.content),this.quotes=Qn(A,hn,e.quotes)},Cn=function(A,e){this.counterIncrement=Qn(A,dn,e.counterIncrement),this.counterReset=Qn(A,pn,e.counterReset)},Qn=function(A,e,t){var n=new _A,o=null!=t?t.toString():e.initialValue;n.write(o);var r=new jA(n.read());switch(e.type){case 2:var i=r.parseComponentValue();return e.parse(A,GA(i)?i.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return se(A,r.parseComponentValue());case"color":return de(A,r.parseComponentValue());case"image":return Re(A,r.parseComponentValue());case"length":var a=r.parseComponentValue();return ZA(a)?a:ee;case"length-percentage":var s=r.parseComponentValue();return $A(s)?s:ee;case"time":return An.parse(A,r.parseComponentValue())}}},xn=function(A,e){var t=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===t||e===t},Fn=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,xn(e,3),this.styles=new yn(A,window.getComputedStyle(e,null)),Io(e)&&(this.styles.animationDuration.some(function(A){return A>0})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=a(this.context,e),xn(e,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(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},In=function(){function A(A,e,t,n,o,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Tn[Hn.charCodeAt(Dn)]=Dn;var On,Pn=8,Kn=9,Ln=11,Mn=12,Rn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],o=-1,r="";++o<t;){var i=A[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(A){var e,t,n,o=function(A){var e,t,n,o,r,i=.75*A.length,a=A.length,s=0;"="===A[A.length-1]&&(i--,"="===A[A.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(e=0;e<a;e+=4)t=Sn[A.charCodeAt(e)],n=Sn[A.charCodeAt(e+1)],o=Sn[A.charCodeAt(e+2)],r=Sn[A.charCodeAt(e+3)],l[s++]=t<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(A),r=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(o):new Uint32Array(o),i=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(o):new Uint16Array(o),a=En(i,12,r[4]/2),s=2===r[5]?En(i,(24+r[4])/2):(e=r,t=Math.ceil((24+r[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,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="),jn="×",Vn=function(A){return _n.get(A)},Nn=function(A,e,t){var n=t-2,o=e[n],r=e[t-1],i=e[t];if(2===r&&3===i)return jn;if(2===r||3===r||4===r)return"÷";if(2===i||3===i||4===i)return"÷";if(r===Pn&&-1!==[Pn,Kn,Ln,Mn].indexOf(i))return jn;if(!(r!==Ln&&r!==Kn||i!==Kn&&10!==i))return jn;if((r===Mn||10===r)&&10===i)return jn;if(13===i||5===i)return jn;if(7===i)return jn;if(1===r)return jn;if(13===r&&14===i){for(;5===o;)o=e[--n];if(14===o)return jn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=e[--n];if(a%2==0)return jn}return"÷"},Gn=function(A){var e=function(A){for(var e=[],t=0,n=A.length;t<n;){var o=A.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+65536):(e.push(o),t--)}else e.push(o)}return e}(A),t=e.length,n=0,o=0,r=e.map(Vn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=jn;n<t&&(A=Nn(0,r,++n))===jn;);if(A!==jn||n===t){var i=Rn.apply(null,e.slice(o,n));return o=n,{value:i,done:!1}}return{done:!0,value:null}}}},Wn=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},zn=function(A,e,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",A.toString()),i.setAttributeNS(null,"height",e.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(A){return new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))})},Jn={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var n=e.getBoundingClientRect(),o=Math.round(n.height);if(A.body.removeChild(t),123===o)return!0}}return!1}(document);return Object.defineProperty(Jn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=Jn.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var n=e.firstChild,o=s(n.data).map(function(A){return c(A)}),r=0,i={},a=o.every(function(A,e){t.setStart(n,r),t.setEnd(n,r+A.length);var o=t.getBoundingClientRect();r+=A.length;var a=o.x>i.x||o.y>i.y;return i=o,0===e||a});return A.body.removeChild(e),a}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Jn,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.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=e.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(e){n.drawImage(e,0,0);var o=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var i=A.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(A){return n.drawImage(A,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:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Jn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Jn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Jn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Jn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},Yn=function(A,e){this.text=A,this.bounds=e},qn=function(A,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var o=e.parentNode;if(o){o.replaceChild(n,e);var r=a(A,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},Zn=function(A,e,t){var n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(A,e),o.setEnd(A,e+t),o},$n=function(A){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(function(A){return A.segment})}return function(A){for(var e,t=Gn(A),n=[];!(e=t.next()).done;)e.value&&n.push(e.value.slice());return n}(A)},Ao=function(A,e){return 0!==e.letterSpacing?$n(A):function(A,e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(function(A){return A.segment})}return to(A,e)}(A,e)},eo=[32,160,4961,65792,65793,4153,4241],to=function(A,e){for(var t,n=function(A,e){var t=s(A),n=rA(t,e),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 A=W;l<a&&(A=oA(t,r,o,++l,i))===W;);if(A!==W||l===a){var e=new iA(t,A,c,l);return c=l,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),o=[],r=function(){if(t.value){var A=t.value.slice(),e=s(A),n="";e.forEach(function(A){-1===eo.indexOf(A)?n+=c(A):(n.length&&o.push(n),o.push(c(A)),n="")}),n.length&&o.push(n)}};!(t=n.next()).done;)r();return o},no=function(A,e,t){this.text=oo(e.data,t.textTransform),this.textBounds=function(A,e,t,n){var o=Ao(e,t),r=[],a=0;return o.forEach(function(e){if(t.textDecorationLine.length||e.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,a,e.length).getClientRects();if(o.length>1){var s=$n(e),c=0;s.forEach(function(e){r.push(new Yn(e,i.fromDOMRectList(A,Zn(n,c+a,e.length).getClientRects()))),c+=e.length})}else r.push(new Yn(e,i.fromDOMRectList(A,o)))}else{var l=n.splitText(e.length);r.push(new Yn(e,qn(A,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));a+=e.length}),r}(A,this.text,t,e)},oo=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ro,io);case 2:return A.toUpperCase();default:return A}},ro=/(^|\s|:|-|\(|\))([a-z])/g,io=function(A,e,t){return A.length>0?e+t.toUpperCase():A},ao=function(A){function t(e,t){var n=A.call(this,e,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 e(t,A),t}(Fn),so=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return e(t,A),t}(Fn),co=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=new XMLSerializer,r=a(e,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 e(t,A),t}(Fn),lo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return e(t,A),t}(Fn),uo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return e(t,A),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(A){function t(e,t){var n,o,r,a=A.call(this,e,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 e(t,A),t}(Fn),wo=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=t.options[t.selectedIndex||0];return n.value=o&&o.text||"",n}return e(t,A),t}(Fn),yo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return e(t,A),t}(Fn),bo=function(A){function t(e,t){var n=A.call(this,e,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(e,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?ye(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):be.TRANSPARENT,r=t.contentWindow.document.body?ye(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):be.TRANSPARENT;n.backgroundColor=pe(o)?pe(r)?n.styles.backgroundColor:r:o}}catch(A){}return n}return e(t,A),t}(Fn),Co=["OL","UL","MENU"],Qo=function(A,e,t,n){for(var o=e.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,ko(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Eo(o))if(Go(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return Qo(A,e,t,n)});else{var i=xo(A,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?Qo(A,o.shadowRoot,i,n):Vo(o)||Po(o)||No(o)||Qo(A,o,i,n))}},xo=function(A,e){return Ro(e)?new ao(A,e):Lo(e)?new so(A,e):Po(e)?new co(A,e):To(e)?new lo(A,e):Do(e)?new uo(A,e):Oo(e)?new Bo(A,e):No(e)?new wo(A,e):Vo(e)?new yo(A,e):_o(e)?new bo(A,e):new Fn(A,e)},Fo=function(A,e){var t=xo(A,e);return t.flags|=4,Qo(A,e,t,t),t},Uo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Ko(A)&&t.styles.isTransparent()},So=function(A){return A.isPositioned()||A.isFloating()},ko=function(A){return A.nodeType===Node.TEXT_NODE},Eo=function(A){return A.nodeType===Node.ELEMENT_NODE},Io=function(A){return Eo(A)&&void 0!==A.style&&!Ho(A)},Ho=function(A){return"object"==typeof A.className},To=function(A){return"LI"===A.tagName},Do=function(A){return"OL"===A.tagName},Oo=function(A){return"INPUT"===A.tagName},Po=function(A){return"svg"===A.tagName},Ko=function(A){return"BODY"===A.tagName},Lo=function(A){return"CANVAS"===A.tagName},Mo=function(A){return"VIDEO"===A.tagName},Ro=function(A){return"IMG"===A.tagName},_o=function(A){return"IFRAME"===A.tagName},jo=function(A){return"STYLE"===A.tagName},Vo=function(A){return"TEXTAREA"===A.tagName},No=function(A){return"SELECT"===A.tagName},Go=function(A){return"SLOT"===A.tagName},Wo=function(A){return A.tagName.indexOf("-")>0},zo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,n=A.counterReset,o=!0;null!==t&&t.forEach(function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(o=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)});var r=[];return o&&n.forEach(function(A){var t=e.counters[A.counter];r.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)}),r},A}(),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(A,e,t,n,o,r){return A<e||A>t?ar(A,o,r.length>0):n.integers.reduce(function(e,t,o){for(;A>=t;)A-=t,e+=n.values[o];return e},"")+r},$o=function(A,e,t,n){var o="";do{t||A--,o=n(A)+o,A/=e}while(A*e>=e);return o},Ar=function(A,e,t,n,o){var r=t-e+1;return(A<0?"-":"")+($o(Math.abs(A),r,n,function(A){return c(Math.floor(A%r)+e)})+o)},er=function(A,e,t){void 0===t&&(t=". ");var n=e.length;return $o(Math.abs(A),n,!1,function(A){return e[Math.floor(A%n)]})+t},tr=function(A,e,t,n,o,r){if(A<-9999||A>9999)return ar(A,4,o.length>0);var i=Math.abs(A),a=o;if(0===i)return e[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=e[c]+a:c>1||1===c&&0===s||1===c&&1===s&&ln(r,2)||1===c&&1===s&&ln(r,4)&&A>100||1===c&&s>1&&ln(r,8)?a=e[c]+(s>0?t[s-1]:"")+a:1===c&&s>0&&(a=t[s-1]+a),i=Math.floor(i/10)}return(A<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(A,e,t){var n=t?". ":"",o=t?"、":"",r=t?", ":"",i=t?" ":"";switch(e){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:var a=Ar(A,48,57,!0,n);return a.length<4?"0"+a:a;case 4:return er(A,"〇一二三四五六七八九",o);case 6:return Zo(A,1,3999,Xo,3,n).toLowerCase();case 7:return Zo(A,1,3999,Xo,3,n);case 8:return Ar(A,945,969,!1,n);case 9:return Ar(A,97,122,!1,n);case 10:return Ar(A,65,90,!1,n);case 11:return Ar(A,1632,1641,!0,n);case 12:case 49:return Zo(A,1,9999,Jo,3,n);case 35:return Zo(A,1,9999,Jo,3,n).toLowerCase();case 13:return Ar(A,2534,2543,!0,n);case 14:case 30:return Ar(A,6112,6121,!0,n);case 15:return er(A,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return er(A,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return tr(A,"零一二三四五六七八九",nr,"負",o,14);case 47:return tr(A,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return tr(A,"零一二三四五六七八九",nr,"负",o,14);case 41:return tr(A,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return tr(A,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return tr(A,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return tr(A,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return tr(A,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return tr(A,"零壹貳參四五六七八九","拾百千",ir,r,7);case 18:return Ar(A,2406,2415,!0,n);case 20:return Zo(A,1,19999,qo,3,n);case 21:return Ar(A,2790,2799,!0,n);case 22:return Ar(A,2662,2671,!0,n);case 22:return Zo(A,1,10999,Yo,3,n);case 23:return er(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return er(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Ar(A,3302,3311,!0,n);case 28:return er(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return er(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return Ar(A,3792,3801,!0,n);case 37:return Ar(A,6160,6169,!0,n);case 38:return Ar(A,4160,4169,!0,n);case 39:return Ar(A,2918,2927,!0,n);case 40:return Ar(A,1776,1785,!0,n);case 43:return Ar(A,3046,3055,!0,n);case 44:return Ar(A,3174,3183,!0,n);case 45:return Ar(A,3664,3673,!0,n);case 46:return Ar(A,3872,3881,!0,n);default:return Ar(A,48,57,!0,n)}},sr="data-html2canvas-ignore",cr=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new zo,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,r=ur(A,e);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=A.defaultView.pageXOffset,a=A.defaultView.pageYOffset,s=r.contentWindow,c=s.document,l=gr(r).then(function(){return n(t,void 0,void 0,function(){var A,t;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Br),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0))),A=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 A?[2,Promise.resolve().then(function(){return A(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},A.prototype.createElementClone=function(A){if(xn(A,2),Lo(A))return this.createCanvasClone(A);if(Mo(A))return this.createVideoClone(A);if(jo(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Ro(e)&&(Ro(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),Wo(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return fr(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A},""),n=A.cloneNode(!1);return n.textContent=t,n}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var n=A.cloneNode(!1);try{n.width=A.width,n.height=A.height;var o=A.getContext("2d"),r=n.getContext("2d");if(r)if(!this.options.allowTaint&&o)r.putImageData(o.getImageData(0,0,A.width,A.height),0,0);else{var i=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.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",A)}r.drawImage(A,0,0)}return n}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return n},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}var n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n},A.prototype.appendChildNode=function(A,e,t){Eo(e)&&("SCRIPT"===e.tagName||e.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Eo(e)&&jo(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var n=this,o=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;o;o=o.nextSibling)if(Eo(o)&&Go(o)&&"function"==typeof o.assignedNodes){var r=o.assignedNodes();r.length&&r.forEach(function(A){return n.appendChildNode(e,A,t)})}else this.appendChildNode(e,o,t)},A.prototype.cloneNode=function(A,e){if(ko(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Eo(A)&&(Io(A)||Ho(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var o=t.getComputedStyle(A),r=t.getComputedStyle(A,":before"),i=t.getComputedStyle(A,":after");this.referenceElement===A&&Io(n)&&(this.clonedReferenceElement=n),Ko(n)&&Cr(n);var a=this.counters.parse(new Cn(this.context,o)),s=this.resolvePseudoContent(A,n,r,On.BEFORE);Wo(A)&&(e=!0),Mo(A)||this.cloneChildNodes(A,n,e),s&&n.insertBefore(s,n.firstChild);var c=this.resolvePseudoContent(A,n,i,On.AFTER);return c&&n.appendChild(c),this.counters.pop(a),(o&&(this.options.copyStyles||Ho(A))&&!_o(A)||e)&&fr(o,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(Vo(A)||No(A))&&(Vo(n)||No(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var o=this;if(t){var r=t.content,i=e.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(e){if(0===e.type)s.appendChild(i.createTextNode(e.value));else if(22===e.type){var t=i.createElement("img");t.src=e.value,t.style.opacity="1",s.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(GA);n.length&&s.appendChild(i.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var r=e.values.filter(JA),c=r[0],l=r[1];if(c&&GA(c)){var u=o.counters.getCounterValue(c.value),d=l&&GA(l)?kt.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===e.name){var p=e.values.filter(JA),g=(c=p[0],p[1]);if(l=p[2],c&&GA(c)){var h=o.counters.getCounterValues(c.value),f=l&&GA(l)?kt.parse(o.context,l.value):3,m=g&&0===g.type?g.value:"",v=h.map(function(A){return ar(A,f,!1)}).join(m);s.appendChild(i.createTextNode(v))}}}else if(20===e.type)switch(e.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(e.value))}}),s.className=wr+" "+yr;var c=n===On.BEFORE?" "+wr:" "+yr;return Ho(e)?e.className.baseValue+=c:e.className+=c,s}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(On||(On={}));var lr,ur=function(A,e){var t=A.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=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(sr,"true"),A.body.appendChild(t),t},dr=function(A){return new Promise(function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()})},pr=function(A){return Promise.all([].slice.call(A.images,0).map(dr))},gr=function(A){return new Promise(function(e,t){var n=A.contentWindow;if(!n)return t("No window assigned for iframe");var o=n.document;n.onload=A.onload=function(){n.onload=A.onload=null;var t=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(t),e(A))},50)}})},hr=["all","d","content"],fr=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===hr.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},mr=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},vr=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},Br=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},wr="___html2canvas___pseudoelement_before",yr="___html2canvas___pseudoelement_after",br='{\n content: "" !important;\n display: none !important;\n}',Cr=function(A){Qr(A,"."+wr+":before"+br+"\n ."+yr+":after"+br)},Qr=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},xr=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),Fr=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:Tr(A)||Er(A)?((this._cache[A]=this.loadImage(A)).catch(function(){}),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return n(this,void 0,void 0,function(){var e,t,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return e=xr.isSameOrigin(A),t=!Ir(A)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!e,n=!Ir(A)&&!e&&!Tr(A)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Ir(A)||Tr(A)||n||t?(r=A,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 "+A.substring(0,256)),[4,new Promise(function(A,e){var n=new Image;n.onload=function(){return A(n)},n.onerror=e,(Hr(r)||t)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return A(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.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 A=new FileReader;A.addEventListener("load",function(){return o(A.result)},!1),A.addEventListener("error",function(A){return r(A)},!1),A.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(A)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return r("Timed out ("+c+"ms) proxying "+n)}}a.send()})},A}(),Ur=/^data:image\/svg\+xml/i,Sr=/^data:image\/.*;base64,/i,kr=/^data:image\/.*/i,Er=function(A){return Jn.SUPPORT_SVG_DRAWING||!Dr(A)},Ir=function(A){return kr.test(A)},Hr=function(A){return Sr.test(A)},Tr=function(A){return"blob"===A.substr(0,4)},Dr=function(A){return"svg"===A.substr(-3).toLowerCase()||Ur.test(A)},Or=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Pr=function(A,e,t){return new Or(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Kr=function(){function A(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,t){var n=Pr(this.start,this.startControl,e),o=Pr(this.startControl,this.endControl,e),r=Pr(this.endControl,this.end,e),i=Pr(n,o,e),a=Pr(o,r,e),s=Pr(i,a,e);return t?new A(this.start,n,i,s):new A(s,a,r,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Lr=function(A){return 1===A.type},Mr=function(A){var e=A.styles,t=A.bounds,n=oe(e.borderTopLeftRadius,t.width,t.height),o=n[0],r=n[1],i=oe(e.borderTopRightRadius,t.width,t.height),a=i[0],s=i[1],c=oe(e.borderBottomRightRadius,t.width,t.height),l=c[0],u=c[1],d=oe(e.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=e.borderTopWidth,b=e.borderRightWidth,C=e.borderBottomWidth,Q=e.borderLeftWidth,x=re(e.paddingTop,A.bounds.width),F=re(e.paddingRight,A.bounds.width),U=re(e.paddingBottom,A.bounds.width),S=re(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Rr(t.left+Q/3,t.top+y/3,o-Q/3,r-y/3,lr.TOP_LEFT):new Or(t.left+Q/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 Or(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 Or(t.left+t.width-b/3,t.top+t.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||g>0?Rr(t.left+Q/3,t.top+w,p-Q/3,g-C/3,lr.BOTTOM_LEFT):new Or(t.left+Q/3,t.top+t.height-C/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Rr(t.left+2*Q/3,t.top+2*y/3,o-2*Q/3,r-2*y/3,lr.TOP_LEFT):new Or(t.left+2*Q/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 Or(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 Or(t.left+t.width-2*b/3,t.top+t.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=p>0||g>0?Rr(t.left+2*Q/3,t.top+w,p-2*Q/3,g-2*C/3,lr.BOTTOM_LEFT):new Or(t.left+2*Q/3,t.top+t.height-2*C/3),this.topLeftBorderStroke=o>0||r>0?Rr(t.left+Q/2,t.top+y/2,o-Q/2,r-y/2,lr.TOP_LEFT):new Or(t.left+Q/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 Or(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 Or(t.left+t.width-b/2,t.top+t.height-C/2),this.bottomLeftBorderStroke=p>0||g>0?Rr(t.left+Q/2,t.top+w,p-Q/2,g-C/2,lr.BOTTOM_LEFT):new Or(t.left+Q/2,t.top+t.height-C/2),this.topLeftBorderBox=o>0||r>0?Rr(t.left,t.top,o,r,lr.TOP_LEFT):new Or(t.left,t.top),this.topRightBorderBox=a>0||s>0?Rr(t.left+m,t.top,a,s,lr.TOP_RIGHT):new Or(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 Or(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 Or(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||r>0?Rr(t.left+Q,t.top+y,Math.max(0,o-Q),Math.max(0,r-y),lr.TOP_LEFT):new Or(t.left+Q,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 Or(t.left+t.width-b,t.top+y),this.bottomRightPaddingBox=l>0||u>0?Rr(t.left+Math.min(B,t.width-Q),t.top+Math.min(v,t.height-C),Math.max(0,l-b),Math.max(0,u-C),lr.BOTTOM_RIGHT):new Or(t.left+t.width-b,t.top+t.height-C),this.bottomLeftPaddingBox=p>0||g>0?Rr(t.left+Q,t.top+Math.min(w,t.height-C),Math.max(0,p-Q),Math.max(0,g-C),lr.BOTTOM_LEFT):new Or(t.left+Q,t.top+t.height-C),this.topLeftContentBox=o>0||r>0?Rr(t.left+Q+S,t.top+y+x,Math.max(0,o-(Q+S)),Math.max(0,r-(y+x)),lr.TOP_LEFT):new Or(t.left+Q+S,t.top+y+x),this.topRightContentBox=a>0||s>0?Rr(t.left+Math.min(m,t.width+Q+S),t.top+y+x,m>t.width+Q+S?0:a-Q+S,s-(y+x),lr.TOP_RIGHT):new Or(t.left+t.width-(b+F),t.top+y+x),this.bottomRightContentBox=l>0||u>0?Rr(t.left+Math.min(B,t.width-(Q+S)),t.top+Math.min(v,t.height+y+x),Math.max(0,l-(b+F)),u-(C+U),lr.BOTTOM_RIGHT):new Or(t.left+t.width-(b+F),t.top+t.height-(C+U)),this.bottomLeftContentBox=p>0||g>0?Rr(t.left+Q+S,t.top+w,Math.max(0,p-(Q+S)),g-(C+U),lr.BOTTOM_LEFT):new Or(t.left+Q+S,t.top+t.height-(C+U))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(lr||(lr={}));var Rr=function(A,e,t,n,o){var r=(Math.sqrt(2)-1)/3*4,i=t*r,a=n*r,s=A+t,c=e+n;switch(o){case lr.TOP_LEFT:return new Kr(new Or(A,c),new Or(A,c-a),new Or(s-i,e),new Or(s,e));case lr.TOP_RIGHT:return new Kr(new Or(A,e),new Or(A+i,e),new Or(s,c-a),new Or(s,c));case lr.BOTTOM_RIGHT:return new Kr(new Or(s,e),new Or(s,e+a),new Or(A+i,c),new Or(A,c));case lr.BOTTOM_LEFT:default:return new Kr(new Or(s,c),new Or(s-i,c),new Or(A,e+a),new Or(A,e))}},_r=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},jr=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Vr=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Nr=function(A,e){this.path=A,this.target=e,this.type=1},Gr=function(A){this.opacity=A,this.type=2,this.target=6},Wr=function(A){return 1===A.type},zr=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Xr=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Jr=function(){function A(A,e){if(this.container=A,this.parent=e,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 Vr(t,n,o))}if(0!==this.container.styles.overflowX){var r=_r(this.curves),i=jr(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 A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var o=t.effects.filter(function(A){return!Wr(A)});if(e||0!==t.container.styles.position||!t.parent){if(n.unshift.apply(n,o),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var r=_r(t.curves),i=jr(t.curves);zr(r,i)||n.unshift(new Nr(i,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(e){return ln(e.target,A)})},A}(),Yr=function(A,e,t,n){A.container.elements.forEach(function(o){var r=ln(o.flags,4),i=ln(o.flags,2),a=new Jr(o,A);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:e,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(A,e){return u>A.element.container.styles.zIndex.order?(d=e,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var p=0;c.positiveZIndex.some(function(A,e){return u>=A.element.container.styles.zIndex.order?(p=e+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()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),Yr(a,e,t,s);ln(o.flags,8)&&qr(o,s)})},qr=function(A,e){for(var t=A instanceof uo?A.start:1,n=A instanceof uo&&A.reversed,o=0;o<e.length;o++){var r=e[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(A,e){switch(e){case 0:return Ai(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Ai(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Ai(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Ai(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},$r=function(A,e){var t=[];return Lr(A)?t.push(A.subdivide(.5,!1)):t.push(A),Lr(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Ai=function(A,e,t,n){var o=[];return Lr(A)?o.push(A.subdivide(.5,!1)):o.push(A),Lr(t)?o.push(t.subdivide(.5,!0)):o.push(t),Lr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Lr(e)?o.push(e.subdivide(.5,!1).reverse()):o.push(e),o},ei=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ti=function(A){var e=A.styles,t=A.bounds,n=re(e.paddingLeft,t.width),o=re(e.paddingRight,t.width),r=re(e.paddingTop,t.width),i=re(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+o),-(e.borderTopWidth+e.borderBottomWidth+r+i))},ni=function(A,e,t){var n=function(A,e){return 0===A?e.bounds:2===A?ti(e):ei(e)}(ai(A.styles.backgroundOrigin,e),A),o=function(A,e){return 0===A?e.bounds:2===A?ti(e):ei(e)}(ai(A.styles.backgroundClip,e),A),r=ii(ai(A.styles.backgroundSize,e),t,n),i=r[0],a=r[1],s=oe(ai(A.styles.backgroundPosition,e),n.width-i,n.height-a);return[si(ai(A.styles.backgroundRepeat,e),s,r,n,o),Math.round(n.left+s[0]),Math.round(n.top+s[1]),i,a]},oi=function(A){return GA(A)&&A.value===_e.AUTO},ri=function(A){return"number"==typeof A},ii=function(A,e,t){var n=e[0],o=e[1],r=e[2],i=A[0],a=A[1];if(!i)return[0,0];if($A(i)&&a&&$A(a))return[re(i,t.width),re(a,t.height)];var s=ri(r);if(GA(i)&&(i.value===_e.CONTAIN||i.value===_e.COVER))return ri(r)?t.width/t.height<r!=(i.value===_e.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 $A(i)?d=re(i,t.width):$A(a)&&(p=re(a,t.height)),oi(i)?d=p*r:a&&!oi(a)||(p=d/r),[d,p]}var g=null,h=null;if($A(i)?g=re(i,t.width):a&&$A(a)&&(h=re(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(A,e){var t=A[e];return void 0===t?A[0]:t},si=function(A,e,t,n,o){var r=e[0],i=e[1],a=t[0],s=t[1];switch(A){case 2:return[new Or(Math.round(n.left),Math.round(n.top+i)),new Or(Math.round(n.left+n.width),Math.round(n.top+i)),new Or(Math.round(n.left+n.width),Math.round(s+n.top+i)),new Or(Math.round(n.left),Math.round(s+n.top+i))];case 3:return[new Or(Math.round(n.left+r),Math.round(n.top)),new Or(Math.round(n.left+r+a),Math.round(n.top)),new Or(Math.round(n.left+r+a),Math.round(n.height+n.top)),new Or(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Or(Math.round(n.left+r),Math.round(n.top+i)),new Or(Math.round(n.left+r+a),Math.round(n.top+i)),new Or(Math.round(n.left+r+a),Math.round(n.top+i+s)),new Or(Math.round(n.left+r),Math.round(n.top+i+s))];default:return[new Or(Math.round(o.left),Math.round(o.top)),new Or(Math.round(o.left+o.width),Math.round(o.top)),new Or(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Or(Math.round(o.left),Math.round(o.height+o.top))]}},ci="Hidden Text",li=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){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=A,t.style.fontSize=e,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=A,o.style.fontSize=e,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}},A.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),ui=function(A,e){this.context=A,this.options=e},di=function(A){function t(e,t){var n=A.call(this,e,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 e(t,A),t.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach(function(A){return e.applyEffect(A)})},t.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 2===A.type}(A)&&(this.ctx.globalAlpha=A.opacity),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),Wr(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(A){return n(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(A){return n(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return ln(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(A,e,t){var n=this;0===e?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):$n(A.text).reduce(function(e,o){return n.ctx.fillText(o,e,A.bounds.top+t),e+n.ctx.measureText(o).width},A.bounds.left)},t.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return"normal"===A||"small-caps"===A}).join(""),t=mi(A.fontFamily).join(", "),n=VA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]},t.prototype.renderTextNode=function(A,e){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(e),n=t[0],r=t[1],i=t[2],this.ctx.font=n,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=e.paintOrder,A.textBounds.forEach(function(A){l.forEach(function(t){switch(t){case 0:u.ctx.fillStyle=ge(e.color),u.renderTextWithLetterSpacing(A,e.letterSpacing,s);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach(function(t){u.ctx.shadowColor=ge(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(A,e.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),e.textDecorationLine.length&&(u.ctx.fillStyle=ge(e.textDecorationColor||e.color),e.textDecorationLine.forEach(function(e){switch(e){case 1:u.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+s),A.bounds.width,1);break;case 2:u.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:u.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+c),A.bounds.width,1)}}));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(u.ctx.strokeStyle=ge(e.webkitTextStrokeColor),u.ctx.lineWidth=e.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+s)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},t.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var n=ti(A),o=jr(e);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(A){return n(this,void 0,void 0,function(){var e,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(A.getEffects(4)),e=A.container,n=A.curves,r=e.styles,a=0,s=e.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(!(e instanceof ao))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return v=o.sent(),this.renderReplacedElement(e,n,v),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof so&&this.renderReplacedElement(e,n,e.canvas),!(e instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return v=o.sent(),this.renderReplacedElement(e,n,v),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof bo&&e.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:l=o.sent(),e.width&&e.height&&this.ctx.drawImage(l,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),o.label=14;case 14:if(e instanceof Bo&&(u=Math.min(e.bounds.width,e.bounds.height),e.type===ho?e.checked&&(this.ctx.save(),this.path([new Or(e.bounds.left+.39363*u,e.bounds.top+.79*u),new Or(e.bounds.left+.16*u,e.bounds.top+.5549*u),new Or(e.bounds.left+.27347*u,e.bounds.top+.44071*u),new Or(e.bounds.left+.39694*u,e.bounds.top+.5649*u),new Or(e.bounds.left+.72983*u,e.bounds.top+.23*u),new Or(e.bounds.left+.84*u,e.bounds.top+.34085*u),new Or(e.bounds.left+.39363*u,e.bounds.top+.79*u)]),this.ctx.fillStyle=ge(vo),this.ctx.fill(),this.ctx.restore()):e.type===fo&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+u/2,e.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=ge(vo),this.ctx.fill(),this.ctx.restore())),pi(e)&&e.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=ge(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hi(e.styles.textAlign),y=ti(e),h=0,e.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 Or(y.left,y.top),new Or(y.left+y.width,y.top),new Or(y.left+y.width,y.top+y.height),new Or(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Yn(e.value,f),r.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(m=e.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,e.bounds.left-(v.width+10),e.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:A.listValue&&-1!==e.styles.listStyleType&&(w=this.createFontStyle(r)[0],this.ctx.font=w,this.ctx.fillStyle=ge(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(e.bounds.left,e.bounds.top+re(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ft(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(A.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(A){return n(this,void 0,void 0,function(){var e,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(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:o.sent(),e=0,t=A.negativeZIndex,o.label=2;case 2:return e<t.length?(f=t[e],[4,this.renderStack(f)]):[3,5];case 3:o.sent(),o.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:o.sent(),n=0,r=A.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=A.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=A.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=A.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=A.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=A.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(A){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(A.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},t.prototype.formatPath=function(A){var e=this;A.forEach(function(A,t){var n=Lr(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),Lr(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},t.prototype.renderRepeat=function(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},t.prototype.resizeImage=function(A,e,t){var n;if(A.width===e&&A.height===t)return A;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,e),o.height=Math.max(1,t),o.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),o},t.prototype.renderBackgroundImage=function(A){return n(this,void 0,void 0,function(){var e,t,n,r,i,a;return o(this,function(s){switch(s.label){case 0:e=A.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,Q,x,F,U,S,k,E,I,H,T,D,O;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(A,e,[r.width,r.height,r.width/r.height]),w=a[0],F=a[1],U=a[2],C=a[3],Q=a[4],v=n.ctx.createPattern(n.resizeImage(r,C,Q),"repeat"),n.renderRepeat(w,v,F,U)),[3,6];case 5:1===t.type?(s=ni(A,e,[null,null,null]),w=s[0],F=s[1],U=s[2],C=s[3],Q=s[4],c=Ue(t.angle,C,Q),l=c[0],u=c[1],d=c[2],p=c[3],g=c[4],(h=document.createElement("canvas")).width=C,h.height=Q,f=h.getContext("2d"),m=f.createLinearGradient(u,p,d,g),Fe(t.stops,l).forEach(function(A){return m.addColorStop(A.stop,ge(A.color))}),f.fillStyle=m,f.fillRect(0,0,C,Q),C>0&&Q>0&&(v=n.ctx.createPattern(h,"repeat"),n.renderRepeat(w,v,F,U))):function(A){return 2===A.type}(t)&&(B=ni(A,e,[null,null,null]),w=B[0],y=B[1],b=B[2],C=B[3],Q=B[4],x=0===t.position.length?[te]:t.position,F=re(x[0],C),U=re(x[x.length-1],Q),S=function(A,e,t,n,o){var r=0,i=0;switch(A.size){case 0:0===A.shape?r=i=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(r=Math.min(Math.abs(e),Math.abs(e-n)),i=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===A.shape)r=i=Math.min(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){var a=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(e),Math.abs(e-n)),s=ke(n,o,e,t,!0),c=s[0],l=s[1];i=a*(r=Se(c-e,(l-t)/a))}break;case 1:0===A.shape?r=i=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(r=Math.max(Math.abs(e),Math.abs(e-n)),i=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===A.shape)r=i=Math.max(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){a=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(e),Math.abs(e-n));var u=ke(n,o,e,t,!1);c=u[0],l=u[1],i=a*(r=Se(c-e,(l-t)/a))}}return Array.isArray(A.size)&&(r=re(A.size[0],n),i=2===A.size.length?re(A.size[1],o):r),[r,i]}(t,F,U,C,Q),k=S[0],E=S[1],k>0&&E>0&&(I=n.ctx.createRadialGradient(y+F,b+U,0,y+F,b+U,k),Fe(t.stops,2*k).forEach(function(A){return I.addColorStop(A.stop,ge(A.color))}),n.path(w),n.ctx.fillStyle=I,k!==E?(H=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,O=1/(D=E/k),n.ctx.save(),n.ctx.translate(H,T),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-H,-T),n.ctx.fillRect(y,O*(b-T)+T,C,Q*O),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return e--,[2]}})},n=this,r=0,i=A.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(A,e,t){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zr(t,e)),this.ctx.fillStyle=ge(A),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(A,e,t,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Ai(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Ai(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Ai(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(r,t),this.path(n),this.ctx.fillStyle=ge(A),this.ctx.fill(),i=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Ai(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Ai(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Ai(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(r,t),this.path(i),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(A){return n(this,void 0,void 0,function(){var e,t,n,r,i,a,s,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!pe(e.backgroundColor)||e.backgroundImage.length,n=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],r=gi(ai(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),pe(e.backgroundColor)||(this.ctx.fillStyle=ge(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(e){l.ctx.save();var t,n,o,r,i,a=_r(A.curves),s=e.inset?0:1e4,c=(t=a,n=-s+(e.inset?1:-1)*e.spread.number,o=(e.inset?1:-1)*e.spread.number,r=e.spread.number*(e.inset?-2:2),i=e.spread.number*(e.inset?-2:2),t.map(function(A,e){switch(e){case 0:return A.add(n,o);case 1:return A.add(n+r,o);case 2:return A.add(n+r,o+i);case 3:return A.add(n,o+i)}return A}));e.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=e.offsetX.number+s,l.ctx.shadowOffsetY=e.offsetY.number,l.ctx.shadowColor=ge(e.color),l.ctx.shadowBlur=e.blur.number,l.ctx.fillStyle=e.inset?ge(e.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&&!pe(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,i,A.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,A.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,A.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,i,A.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(A,e,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(A,e){switch(e){case 0:return $r(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $r(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $r(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $r(A.bottomLeftBorderStroke,A.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=e<3?3*e:2*e,g=e<3?2*e:e,3===i&&(p=e,g=e),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=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=ge(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Lr(a[0])&&(w=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Or(w.end.x,w.end.y),new Or(y.start.x,y.start.y)]),this.ctx.stroke()),Lr(a[1])&&(w=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Or(w.end.x,w.end.y),new Or(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(A){return n(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ge(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new Jr(A,null),o=new Xr(n),Yr(n,o,o,r=[]),qr(n.container,r),e=o,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},t}(ui),pi=function(A){return A instanceof yo||A instanceof wo||A instanceof Bo&&A.type!==fo&&A.type!==ho},gi=function(A,e){switch(A){case 0:return _r(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return jr(e)}},hi=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],mi=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===fi.indexOf(A)}):A},vi=function(A){function t(e,t){var n=A.call(this,e,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 e(t,A),t.prototype.render=function(A){return n(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return e=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,Bi(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ge(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(A){return new Promise(function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))})},wi=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,r([this.id,this.getTime()+"ms"],A))},A.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.instances={},A}(),yi=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new wi({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Fr(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&xr.setContext(window);var bi=function(A,e){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,Q,x,F,U,S,k,E,I,H,T,D,O,P,K,L,M,R,_,j,V;return o(this,function(o){switch(o.label){case 0:if(!A||"object"!=typeof A)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=A.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=e.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=e.imageTimeout)&&void 0!==S?S:15e3,proxy:e.proxy,useCORS:null!==(k=e.useCORS)&&void 0!==k&&k},c=t({logging:null===(E=e.logging)||void 0===E||E,cache:e.cache},s),l={windowWidth:null!==(I=e.windowWidth)&&void 0!==I?I:r.innerWidth,windowHeight:null!==(H=e.windowHeight)&&void 0!==H?H:r.innerHeight,scrollX:null!==(T=e.scrollX)&&void 0!==T?T:r.pageXOffset,scrollY:null!==(D=e.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!==(O=e.foreignObjectRendering)&&void 0!==O&&O,g={allowTaint:null!==(P=e.allowTaint)&&void 0!==P&&P,onclone:e.onclone,ignoreElements:e.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,A,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(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var n=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),o=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.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,e.backgroundColor),Q={canvas:e.canvas,backgroundColor:C,scale:null!==(L=null!==(K=e.scale)&&void 0!==K?K:r.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(M=e.x)&&void 0!==M?M:0)+y,y:(null!==(R=e.y)&&void 0!==R?R:0)+b,width:null!==(_=e.width)&&void 0!==_?_:Math.ceil(B),height:null!==(j=e.height)&&void 0!==j?j:Math.ceil(w)},p?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new vi(d,Q).render(f)]):[3,3];case 2:return x=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=be.TRANSPARENT),d.logger.debug("Starting renderer for element at "+Q.x+","+Q.y+" with size "+Q.width+"x"+Q.height),[4,new di(d,Q).render(F)];case 4:x=o.sent(),o.label=5;case 5:return(null===(V=e.removeContainer)||void 0===V||V)&&(cr.destroy(m)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,x]}})})},Ci=function(A,e,t){var n=e.ownerDocument,o=n.documentElement?ye(A,getComputedStyle(n.documentElement).backgroundColor):be.TRANSPARENT,r=n.body?ye(A,getComputedStyle(n.body).backgroundColor):be.TRANSPARENT,i="string"==typeof t?ye(A,t):null===t?be.TRANSPARENT:4294967295;return e===n.documentElement?pe(o)?pe(r)?i:r:o:i};return function(A,e){return void 0===e&&(e={}),bi(A,e)}}()},540:(A,e,t)=>{"use strict";A.exports=t(869)},698:(A,e)=>{"use strict";var t=Symbol.for("react.transitional.element");function n(A,e,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==e.key&&(o=""+e.key),"key"in e)for(var r in n={},e)"key"!==r&&(n[r]=e[r]);else n=e;return e=n.ref,{$$typeof:t,type:A,key:o,ref:void 0!==e?e:null,props:n}}Symbol.for("react.fragment"),e.jsx=n,e.jsxs=n},848:(A,e,t)=>{"use strict";A.exports=t(698)},869:(A,e)=>{"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(A,e,n){this.props=A,this.context=e,this.refs=o,this.updater=n||t}function i(){}function a(A,e,n){this.props=A,this.context=e,this.refs=o,this.updater=n||t}r.prototype.isReactComponent={},r.prototype.setState=function(A,e){if("object"!=typeof A&&"function"!=typeof A&&null!=A)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,e,"setState")},r.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"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;e.useEffect=function(A,e){return c.H.useEffect(A,e)},e.useRef=function(A){return c.H.useRef(A)},e.useState=function(A){return c.H.useState(A)}}},e={};function t(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={exports:{}};return A[n].call(r.exports,r,r.exports,t),r.exports}t.n=A=>{var e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(var n in e)t.o(e,n)&&!t.o(A,n)&&Object.defineProperty(A,n,{enumerable:!0,get:e[n]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var n={};return(()=>{"use strict";t.r(n),t.d(n,{AgentSDK:()=>Dn,AudioPlayer:()=>$t,AudioRecorder:()=>Z,EventEmitter:()=>K,MicPermissionModals:()=>e,MicPermissionUtils:()=>A,TTPChatWidget:()=>rr,TextChatSDK:()=>vt,VERSION:()=>ir,VanillaVoiceButton:()=>bn,VoiceButton:()=>dn,VoiceSDK_v2:()=>rt,WebSocketManager:()=>jt,default:()=>ar});var A={};t.r(A),t.d(A,{checkPermissionState:()=>Mn,getDeviceInfo:()=>Ln,getPermissionInstructions:()=>_n,openSettings:()=>jn});var e={};function o(A){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(A)}function r(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,i(n.key),n)}}function i(A){var e=function(A){if("object"!=o(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==o(e)?e:e+""}t.r(e),t.d(e,{showBlockedModal:()=>Yn,showNoMicrophoneModal:()=>qn,showPrePromptModal:()=>Jn});const a=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.events={}},e=[{key:"on",value:function(A,e){return this.events[A]||(this.events[A]=[]),this.events[A].push(e),this}},{key:"off",value:function(A,e){return this.events[A]?(this.events[A]=this.events[A].filter(function(A){return A!==e}),this):this}},{key:"emit",value:function(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return!!this.events[A]&&(this.events[A].forEach(function(A){A.apply(void 0,t)}),!0)}},{key:"once",value:function(A,e){var t=this,n=function(){e.apply(void 0,arguments),t.off(A,n)};return this.on(A,n)}},{key:"removeAllListeners",value:function(A){return A?delete this.events[A]:this.events={},this}}],e&&r(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function s(A){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},s(A)}function c(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,l(n.key),n)}}function l(A){var e=function(A){if("object"!=s(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==s(e)?e:e+""}const u=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCM"},(e=[{key:"decode",value:function(A){if(A instanceof ArrayBuffer)return A;if(A instanceof Uint8Array)return A.buffer;throw new Error("Invalid PCM data type")}},{key:"encode",value:function(A){return A}}])&&c(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function d(A){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},d(A)}function p(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,g(n.key),n)}}function g(A){var e=function(A){if("object"!=d(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==d(e)?e:e+""}const h=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCMU"},(e=[{key:"decode",value:function(A){for(var e=A instanceof Uint8Array?A:new Uint8Array(A),t=new Int16Array(e.length),n=0;n<e.length;n++)t[n]=this.mulawToLinear(e[n]);return t.buffer}},{key:"encode",value:function(A){for(var e=A instanceof Int16Array?A:new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=this.linearToMulaw(e[n]);return t}},{key:"mulawToLinear",value:function(A){var e=1<<3+(A>>4&7);return(128&A?-1:1)*(132+(15&A)*e+(e>>1)-4)}},{key:"linearToMulaw",value:function(A){var e=A>>8&128;e&&(A=-A),A>32635&&(A=32635),A+=132;for(var t=7,n=16384;0===(A&n)&&t>0;t--,n>>=1);return 255&~(e|t<<4|A>>t+3&15)}}])&&p(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function f(A){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},f(A)}function m(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,v(n.key),n)}}function v(A){var e=function(A){if("object"!=f(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=f(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==f(e)?e:e+""}const B=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCMA"},(e=[{key:"decode",value:function(A){for(var e=A instanceof Uint8Array?A:new Uint8Array(A),t=new Int16Array(e.length),n=0;n<e.length;n++)t[n]=this.alawToLinear(e[n]);return t.buffer}},{key:"encode",value:function(A){for(var e=A instanceof Int16Array?A:new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=this.linearToAlaw(e[n]);return t}},{key:"alawToLinear",value:function(A){var e=(A^=85)>>4&7,t=15&A;return(128&A?-1:1)*(0===e?8+(t<<4):264+(t<<4)<<e-1)}},{key:"linearToAlaw",value:function(A){var e,t,n=A>>8&128;if(n&&(A=-A),A>32635&&(A=32635),A<256)e=0,t=A>>4;else{e=7;for(var o=16384;0===(A&o)&&e>0;e--,o>>=1);t=A>>e+3&15}return 85^(n|e<<4|t)}}])&&m(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function w(A){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},w(A)}function y(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return b(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?b(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function b(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function C(A){if(null!=A){var e=A["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(e)return e.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length))return{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}}throw new TypeError(w(A)+" is not iterable")}function Q(){var A,e,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:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(x(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,x(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}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]"}),(Q=function(){return{w:r,m:d}})()}function x(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}x=function(A,e,t,n){function r(e,t){x(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},x(A,e,t,n)}function F(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function U(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){F(r,n,o,i,a,"next",A)}function a(A){F(r,n,o,i,a,"throw",A)}i(void 0)})}}function S(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,k(n.key),n)}}function k(A){var e=function(A){if("object"!=w(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=w(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==w(e)?e:e+""}function E(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(E=function(){return!!A})()}function I(A){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},I(A)}function H(A,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},H(A,e)}const T=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=I(e),function(A,e){if(e&&("object"==w(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,E()?Reflect.construct(e,t||[],I(A).constructor):e.apply(A,t))}(this,e)).config=t,A.audioContext=null,A.gainNode=null,A._waitForReadyStateHandler=null,A.audioQueue=[],A.isPlaying=!1,A.isProcessingQueue=!1,A.currentSource=null,A.outputFormat=null,A.nextStartTime=0,A.scheduledBuffers=0,A.scheduledSources=new Set,A.pcmChunkQueue=[],A.preparedBuffer=[],A.isProcessingPcmQueue=!1,A.isSchedulingFrames=!1,A.MAX_LOOKAHEAD_SECONDS=.02,A.pendingSentenceText=null,A.sentenceTimings=[],A.isCheckingTranscripts=!1,A.codecs={pcm:new u,pcmu:new h,pcma:new B},A.SUPPORTED_CONTAINERS=["wav","raw"],A.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],A.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],A.SUPPORTED_BIT_DEPTHS=[8,16,24],A.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized"),A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&H(A,e)}(e,A),t=e,n=[{key:"setOutputFormat",value:function(A){var e;this.validateFormat(A)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",A),A=this.getDefaultFormat());var t=null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate,n=A.sampleRate;this.outputFormat=A,console.log("✅ AudioPlayer v2: Format set:",A),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(A){var e,t;if(!A)return!1;var n=null===(e=A.container)||void 0===e?void 0:e.toLowerCase(),o=null===(t=A.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(A.sampleRate)&&this.SUPPORTED_BIT_DEPTHS.includes(A.bitDepth)&&(!A.channels||this.SUPPORTED_CHANNELS.includes(A.channels))}},{key:"getDefaultFormat",value:function(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}},{key:"playAudio",value:function(A){var e=this;try{var t=this.createAudioBlob(A);this.audioQueue.push(t),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return e.processQueue()},50)}catch(A){console.error("❌ AudioPlayer v2: Playback error:",A),this.emit("playbackError",A)}}},{key:"playChunk",value:(c=U(Q().m(function A(e){var t,n,o=this;return Q().w(function(A){for(;;)switch(A.n){case 0:(t=this.prepareChunk(e))?(this.preparedBuffer.push(t),this.isSchedulingFrames?setTimeout(function(){o.preparedBuffer.length>0&&!o.isSchedulingFrames&&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==e?void 0:e.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 1:return A.a(2)}},A,this)})),function(A){return c.apply(this,arguments)})},{key:"prepareChunk",value:function(A){try{var e;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=A;if(A.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",A.byteLength);var n=new Uint8Array(A.byteLength+1);n.set(new Uint8Array(A),0),n[A.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===(e=this.outputFormat)||void 0===e?void 0:e.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(A){return console.error("❌ AudioPlayer: Error preparing chunk:",A),null}}},{key:"applyFadeOut",value:function(A){return A}},{key:"schedulePreparedFrames",value:(s=U(Q().m(function A(){var e,t,n,o,r,i,a,s,c,l=this;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isSchedulingFrames){A.n=1;break}return A.a(2);case 1:return this.isSchedulingFrames=!0,e=this.preparedBuffer.length,0===(t=Math.min(e,5))&&e>0&&(t=1),A.p=2,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),A.n=3,this.waitForAudioContextReady();case 3: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=Q().m(function A(){var e,t,n,o,r,i,s;return Q().w(function(A){for(;;)switch(A.n){case 0:if(e=l.preparedBuffer.shift()){A.n=1;break}return A.a(2,1);case 1:(t=l.audioContext.createBufferSource()).buffer=e.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=o?.1:0,l.nextStartTime=n+r,console.log("🎵 [scheduleWAV] FIRST FRAME - state: ".concat(l.audioContext.state,", currentTime: ").concat(n,", nextStartTime: ").concat(l.nextStartTime),o?"(mobile)":"(desktop)")):(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+=e.duration,l.nextStartTime=Math.round(1e6*l.nextStartTime)/1e6,s=l.nextStartTime-e.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(e.duration.toFixed(4),"s (").concat((1e3*e.duration).toFixed(2),"ms), Queued: ").concat(l.preparedBuffer.length,", Scheduled: ").concat(l.scheduledBuffers))),l.scheduledBuffers++,a++,t.onended=function(){if(l.scheduledSources.delete(t),l.scheduledBuffers--,0===l.scheduledBuffers&&0===l.preparedBuffer.length&&0===l.pcmChunkQueue.length)l.isPlaying=!1,l.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),l.emit("playbackStopped");else if(l.preparedBuffer.length>0)setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.schedulePreparedFrames()},0);else if(l.scheduledBuffers>0){var A=function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0?l.schedulePreparedFrames():l.scheduledBuffers>0&&setTimeout(A,10)};setTimeout(A,10)}},l.isPlaying||(l.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),l.emit("playbackStarted"));case 2:return A.a(2)}},A)});case 4:if(!(this.preparedBuffer.length>0&&a<t)){A.n=7;break}return A.d(C(s()),5);case 5:if(!A.v){A.n=6;break}return A.a(3,7);case 6:A.n=4;break;case 7:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&requestAnimationFrame(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.schedulePreparedFrames()}),this.scheduledBuffers>0&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0?l.schedulePreparedFrames():l.scheduledBuffers>0&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0&&l.schedulePreparedFrames()},10)},10),A.n=9;break;case 8:A.p=8,c=A.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",c),this.emit("playbackError",c),this.isSchedulingFrames=!1;case 9:return A.a(2)}},A,this,[[2,8]])})),function(){return s.apply(this,arguments)})},{key:"processPcmQueue",value:(a=U(Q().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y=this;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingPcmQueue){A.n=1;break}return A.a(2);case 1:return this.isProcessingPcmQueue=!0,A.p=2,this.audioContext||this.initializeAudioContext(),A.n=3,this.waitForAudioContextReady();case 3:if(!(this.pcmChunkQueue.length>0)){A.n=5;break}if(n=this.pcmChunkQueue.shift()){A.n=4;break}return A.a(3,3);case 4: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===(e=this.outputFormat)||void 0===e?void 0:e.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")),A.n=3;break;case 5:this.isProcessingPcmQueue=!1,A.n=7;break;case 6:A.p=6,w=A.v,console.error("❌ AudioPlayer v2: Error playing chunk:",w),this.emit("playbackError",w),this.isProcessingPcmQueue=!1;case 7:return A.a(2)}},A,this,[[2,6]])})),function(){return a.apply(this,arguments)})},{key:"createAudioBlob",value:function(A){var e=new Uint8Array(A);console.log("🎵 AudioPlayer: Processing ".concat(e.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(e);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(e);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(e);if(t&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(e);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(e);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(e)}},{key:"isWavFile",value:function(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}},{key:"handleWavFile",value:function(A){var e=this.parseWavHeader(A);if(console.log("🎵 WAV file detected:",{format:e.audioFormat,encoding:this.getEncodingName(e.audioFormat),sampleRate:e.sampleRate,channels:e.channels,bitDepth:e.bitsPerSample}),1===e.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([A],{type:"audio/wav"});var t=this.getCodecForWavFormat(e.audioFormat);if(!t)throw new Error("Unsupported WAV format code: ".concat(e.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=A.slice(44),o=t.decode(n),r=this.createWavHeader(o.byteLength,e.sampleRate,e.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(A){var e,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;A.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."),e=this.convert24BitTo16Bit(A),t=16):8===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),e=this.convert8BitTo16Bit(A),t=16):(e=A.buffer,t=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else e=o.decode(A),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(e.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([i,e],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(A){for(var e=Math.floor(A.length/3),t=new Int16Array(e),n=0;n<e;n++){var o=A[3*n],r=A[3*n+1],i=A[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(A){for(var e=A.length,t=new Int16Array(e),n=0;n<e;n++){var o=A[n];t[n]=256*(o-128)}return t.buffer}},{key:"getCodec",value:function(A){var e={pcm:"pcm",linear:"pcm",l16:"pcm",pcmu:"pcmu",ulaw:"pcmu",mulaw:"pcmu",g711u:"pcmu",pcma:"pcma",alaw:"pcma",g711a:"pcma"}[A.toLowerCase()];return this.codecs[e]}},{key:"getCodecForWavFormat",value:function(A){switch(A){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(A){switch(A){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(A,")")}}},{key:"parseWavHeader",value:function(A){var e=new DataView(A.buffer,A.byteOffset,A.byteLength);return{audioFormat:e.getUint16(20,!0),channels:e.getUint16(22,!0),sampleRate:e.getUint32(24,!0),byteRate:e.getUint32(28,!0),blockAlign:e.getUint16(32,!0),bitsPerSample:e.getUint16(34,!0)}}},{key:"createWavHeader",value:function(A,e,t,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+A,!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,e,!0),r.setUint32(28,e*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,A,!0),o}},{key:"waitForAudioContextReady",value:(i=U(Q().m(function A(){var e,t,n,o=this;return Q().w(function(A){for(;;)switch(A.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===(e=this.audioContext)||void 0===e?void 0:e.state,"currentTime:",null===(t=this.audioContext)||void 0===t?void 0:t.currentTime)),this.audioContext){A.n=1;break}return console.error("❌ AudioPlayer: Failed to create AudioContext"),A.a(2,Promise.resolve());case 1:if(n=this.audioContext,console.log("🔍 [waitForAudioContextReady] Initial state:",n.state,"currentTime:",n.currentTime),"running"!==n.state){A.n=2;break}return console.log("🔍 [waitForAudioContextReady] Already running - returning immediately, currentTime:",n.currentTime),A.a(2,Promise.resolve());case 2:if("suspended"!==n.state){A.n=5;break}return console.log("🔍 [waitForAudioContextReady] State is suspended - calling resume()..."),A.n=3,n.resume();case 3:if(console.log("🔍 [waitForAudioContextReady] After resume() - state:",n.state,"currentTime:",n.currentTime),"running"===n.state){A.n=4;break}return console.log("🔍 [waitForAudioContextReady] Still not running after resume() - waiting for statechange event..."),A.a(2,new Promise(function(A){var e=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),A()},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(e),o._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void A();"running"===n.state&&(clearTimeout(e),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),A())};o._waitForReadyStateHandler=t,n.addEventListener("statechange",t),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(e),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] State became running synchronously, currentTime:",n.currentTime),A())}));case 4:console.log("🔍 [waitForAudioContextReady] State is running after resume() - returning, currentTime:",n.currentTime);case 5:if("closed"!==n.state){A.n=6;break}return console.warn("⚠️ AudioPlayer: AudioContext was closed, recreating..."),this.initializeAudioContext(),A.a(2,this.waitForAudioContextReady());case 6:return console.log("🔍 [waitForAudioContextReady] EXIT - state:",n.state,"currentTime:",n.currentTime),A.a(2,Promise.resolve())}},A,this)})),function(){return i.apply(this,arguments)})},{key:"initializeAudioContext",value:function(){var A,e,t=(null===(A=this.outputFormat)||void 0===A?void 0:A.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===(e=this.outputFormat)||void 0===e?void 0:e.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")}catch(A){console.error("❌ Failed to create AudioContext:",A),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)")}}},{key:"_cleanupAudioContext",value:function(){if(console.log("[TTP AudioPlayer] 🧹 Cleaning up AudioContext (refactored method)"),this.gainNode){try{this.gainNode.disconnect()}catch(A){}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}},{key:"setupAudioContextStateMonitoring",value:function(){var A=this;this.audioContext&&(this._audioContextStateChangeHandler&&this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=function(){A.audioContext?(console.log("🎵 AudioPlayer: AudioContext state changed to: ".concat(A.audioContext.state)),"suspended"===A.audioContext.state&&A.isPlaying?console.warn("⚠️ AudioPlayer: AudioContext suspended during playback"):"running"===A.audioContext.state&&!A.isPlaying&&(A.audioQueue.length>0||A.pcmChunkQueue.length>0||A.preparedBuffer.length>0)&&(console.log("✅ AudioPlayer: AudioContext resumed - resuming queue processing"),A.audioQueue.length>0&&!A.isProcessingQueue&&setTimeout(function(){return A.processQueue()},50),A.pcmChunkQueue.length>0&&!A.isProcessingPcmQueue&&setTimeout(function(){return A.processPcmQueue()},50),A.preparedBuffer.length>0&&!A.isSchedulingFrames&&setTimeout(function(){return A.scheduleFrames()},50))):console.warn("⚠️ AudioPlayer: State change handler fired but AudioContext is null")},this.audioContext.addEventListener("statechange",this._audioContextStateChangeHandler))}},{key:"processQueue",value:(r=U(Q().m(function A(){var e,t,n,o,r,i,a,s,c=this;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){A.n=1;break}return A.a(2);case 1:if(this.isProcessingQueue=!0,e=this.audioQueue.shift()){A.n=2;break}return this.isProcessingQueue=!1,A.a(2);case 2:return A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),A.n=3,this.waitForAudioContextReady();case 3:return n=this.audioContext,A.n=4,e.arrayBuffer();case 4:return o=A.v,A.n=5,n.decodeAudioData(o);case 5:r=A.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(),A.n=7;break;case 6:A.p=6,s=A.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 7:return A.a(2)}},A,this,[[2,6]])})),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 A=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.currentSource){try{console.log(" Stopping currentSource..."),this.currentSource.stop()}catch(A){console.log(" currentSource already stopped or error:",A.message)}this.currentSource=null}if(this.scheduledSources.size>0){console.log(" Stopping ".concat(this.scheduledSources.size," scheduled sources..."));var e,t=0,n=y(this.scheduledSources);try{for(n.s();!(e=n.n()).done;){var o=e.value;try{o.stop(),t++}catch(A){console.log(" Source already stopped or not started:",A.message)}}}catch(A){n.e(A)}finally{n.f()}console.log(" Stopped ".concat(t," sources")),this.scheduledSources.clear()}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this.nextStartTime=0,this.scheduledBuffers=0,this.clearTranscriptState(),A&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}},{key:"markNewSentence",value:function(A){this.pendingSentenceText=A,console.log('📝 AudioPlayer: New sentence marked: "'.concat(A.substring(0,40),'..."'))}},{key:"startTranscriptChecker",value:function(){var A=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var e=function(){if(A.isCheckingTranscripts&&A.audioContext){var t,n=A.audioContext.currentTime,o=y(A.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),'..."')),A.emit("transcriptDisplay",{text:r.text}))}}catch(A){o.e(A)}finally{o.f()}A.isPlaying||A.scheduledBuffers>0?requestAnimationFrame(e):(A.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(e)}}},{key:"clearTranscriptState",value:function(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}},{key:"resumeAudioContext",value:(o=U(Q().m(function A(){var e;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){A.n=2;break}return A.n=1,this.initializeAudioContext();case 1:return A.a(2);case 2:if("suspended"!==this.audioContext.state){A.n=6;break}return A.p=3,A.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission"),A.n=6;break;case 5:A.p=5,e=A.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",e);case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"setVolume",value:function(A){this.gainNode?(this.gainNode.gain.value=Math.max(0,Math.min(1,A)),console.log("🔊 AudioPlayer: Volume set to ".concat(this.gainNode.gain.value))):console.warn("⚠️ AudioPlayer: Cannot set volume - gainNode not initialized")}},{key:"setMuted",value:function(A){this.setVolume(A?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&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c}(a);function D(A){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},D(A)}function O(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,P(n.key),n)}}function P(A){var e=function(A){if("object"!=D(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=D(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==D(e)?e:e+""}var K=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.events={}},e=[{key:"on",value:function(A,e){this.events[A]||(this.events[A]=[]),this.events[A].push(e)}},{key:"off",value:function(A,e){this.events[A]&&(this.events[A]=this.events[A].filter(function(A){return A!==e}))}},{key:"emit",value:function(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];this.events[A]&&this.events[A].forEach(function(e){try{e.apply(void 0,t)}catch(e){console.error("Error in event listener for ".concat(A,":"),e)}})}},{key:"removeAllListeners",value:function(A){A?delete this.events[A]:this.events={}}}],e&&O(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function L(A){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},L(A)}function M(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function R(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?M(Object(t),!0).forEach(function(e){_(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function _(A,e,t){return(e=X(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function j(){var A,e,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:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(V(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,V(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}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]"}),(j=function(){return{w:r,m:d}})()}function V(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}V=function(A,e,t,n){function r(e,t){V(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},V(A,e,t,n)}function N(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function G(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){N(r,n,o,i,a,"next",A)}function a(A){N(r,n,o,i,a,"throw",A)}i(void 0)})}}function W(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function z(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,X(n.key),n)}}function X(A){var e=function(A){if("object"!=L(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=L(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==L(e)?e:e+""}function J(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(J=function(){return!!A})()}function Y(A){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Y(A)}function q(A,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},q(A,e)}var Z=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=Y(e),function(A,e){if(e&&("object"==L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,J()?Reflect.construct(e,t||[],Y(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&q(A,e)}(e,A),t=e,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A,e=function(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return W(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?W(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(e.s();!(A=e.n()).done;){var t=A.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(A){var o=t.substring(0,t.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}}catch(A){e.e(A)}finally{e.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var A=G(j().m(function A(){var e;return j().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!navigator.permissions||!navigator.permissions.query){A.n=2;break}return A.n=1,navigator.permissions.query({name:"microphone"});case 1:return e=A.v,A.a(2,e.state);case 2:A.n=4;break;case 3:A.p=3,A.v,console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone");case 4:return A.a(2,null)}},A,null,[[0,3]])}));return function(){return A.apply(this,arguments)}}()},{key:"requestPermission",value:(a=G(j().m(function A(){var e,t,n,o;return j().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,A.n=1,this.checkPermissionState();case 1:if("granted"!==A.v){A.n=2;break}return console.log("✅ AudioRecorder: Microphone permission already granted"),A.a(2,!0);case 2:return console.log("🎤 AudioRecorder: Requesting microphone permission..."),e=this.config.sampleRate||this.config.outputSampleRate||44100,t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=this.config.audioConstraints?R(R({},t),this.config.audioConstraints):t,A.n=3,navigator.mediaDevices.getUserMedia({audio:R({sampleRate:e,channelCount:1},n)});case 3:return A.v.getTracks().forEach(function(A){return A.stop()}),console.log("✅ AudioRecorder: Microphone permission granted"),A.a(2,!0);case 4:return A.p=4,o=A.v,console.error("❌ AudioRecorder: Failed to get microphone permission:",o),A.a(2,!1)}},A,this,[[0,4]])})),function(){return a.apply(this,arguments)})},{key:"start",value:(i=G(j().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g=this;return j().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,console.log("🎤 AudioRecorder: Requesting microphone access..."),A.n=1,this.checkPermissionState();case 1:return(e=A.v)&&(console.log("📋 AudioRecorder: Current permission state: ".concat(e)),"denied"===e&&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?R(R({},n),this.config.audioConstraints):n,A.n=2,navigator.mediaDevices.getUserMedia({audio:R({sampleRate:t,channelCount:1},o)});case 2:if(this.mediaStream=A.v,!this.config.checkConnection||"function"!=typeof this.config.checkConnection){A.n=3;break}if(this.config.checkConnection()){A.n=3;break}throw this.mediaStream.getTracks().forEach(function(A){return A.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){A.n=4;break}return A.n=4,this.audioContext.resume();case 4:if(!this.config.checkConnection||"function"!=typeof this.config.checkConnection){A.n=6;break}if(this.config.checkConnection()){A.n=6;break}if(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null,!this.audioContext||"closed"===this.audioContext.state){A.n=5;break}return A.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(),A.n=7,this.audioContext.audioWorklet.addModule(a);case 7:if(!this.config.checkConnection||"function"!=typeof this.config.checkConnection){A.n=9;break}if(this.config.checkConnection()){A.n=9;break}if(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null,!this.audioContext||"closed"===this.audioContext.state){A.n=8;break}return A.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(A){var e=A.data,t=e.type,n=e.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"),A.n=15;break;case 10:if(A.p=10,!(p=A.v).isServerRejection&&"ServerRejected"!==p.name){A.n=11;break}throw p;case 11:if(l=p.message,"NotAllowedError"!==p.name&&"PermissionDeniedError"!==p.name){A.n=13;break}return A.n=12,this.checkPermissionState();case 12:"denied"===(u=A.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.")),A.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 A.a(2)}},A,this,[[0,10]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=G(j().m(function A(){var e;return j().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return A.a(2);case 1:if(A.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(A){console.warn("⚠️ AudioRecorder: Error disconnecting source:",A)}if(!this.audioWorkletNode){A.n=4;break}return console.log("🛑 AudioRecorder: Sending stop message to AudioWorklet to stop VAD..."),this.audioWorkletNode.port.postMessage({type:"stop"}),A.n=2,new Promise(function(A){return setTimeout(A,150)});case 2:return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=3,new Promise(function(A){return setTimeout(A,50)});case 3:try{this.audioWorkletNode.disconnect(),console.log("✅ AudioRecorder: AudioWorkletNode disconnected")}catch(A){console.log("⚠️ AudioRecorder: AudioWorkletNode already disconnected")}case 4:if(this.mediaStream&&(console.log("🛑 AudioRecorder: Stopping media stream tracks..."),this.mediaStream.getTracks().forEach(function(A){A.stop(),console.log("✅ AudioRecorder: Stopped track:",A.kind)}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=6;break}return console.log("🛑 AudioRecorder: Closing AudioContext..."),A.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"),A.n=8;break;case 7:throw A.p=7,e=A.v,this.emit("error",e),e;case 8:return A.a(2)}},A,this,[[1,7]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=G(j().m(function A(){var e,t;return j().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording&&this.audioContext){A.n=1;break}return A.a(2);case 1:if(A.p=1,"suspended"!==this.audioContext.state){A.n=3;break}return console.log("🔄 AudioRecorder: Resuming suspended AudioContext..."),A.n=2,this.audioContext.resume();case 2:console.log("✅ AudioRecorder: AudioContext resumed");case 3:this.mediaStream&&0===(e=this.mediaStream.getAudioTracks()).filter(function(A){return"live"===A.readyState}).length&&e.length>0&&(console.warn("⚠️ AudioRecorder: All audio tracks are inactive. Recording may have stopped."),this.emit("tracksInactive")),A.n=5;break;case 4:A.p=4,t=A.v,console.error("❌ AudioRecorder: Failed to resume AudioContext:",t),this.emit("error",t);case 5:return A.a(2)}},A,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&&z(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a}(K);function $(A){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},$(A)}function AA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,eA(n.key),n)}}function eA(A){var e=function(A){if("object"!=$(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=$(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==$(e)?e:e+""}const tA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"extractPcmFromWav",value:function(A){var e=A instanceof Uint8Array?A:new Uint8Array(A);if(e.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(e[0],e[1],e[2],e[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(e[8],e[9],e[10],e[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var t=e[22]|e[23]<<8,n=e[24]|e[25]<<8|e[26]<<16|e[27]<<24,o=e[34]|e[35]<<8,r=-1,i=12;i<e.length-8;i+=4){if("data"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3])){r=i;break}i+=4+(e[i+4]|e[i+5]<<8|e[i+6]<<16|e[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=e[r+4]|e[r+5]<<8|e[r+6]<<16|e[r+7]<<24,s=r+8,c=Math.min(a,e.length-s);return{pcmData:e.slice(s,s+c).buffer,format:{sampleRate:n,channels:t,bitDepth:o}}}},{key:"isWavFile",value:function(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}},{key:"createWavHeader",value:function(A,e,t,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+A,!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,e,!0),r.setUint32(28,e*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,A,!0),o}},{key:"wrapPcmInWav",value:function(e,t){var n=A.createWavHeader(e.byteLength,t.sampleRate,t.channels||1,t.bitDepth||16),o=new Uint8Array(n.byteLength+e.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(e),n.byteLength),o.buffer}}],null&&AA(e.prototype,null),t&&AA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function nA(A){return nA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},nA(A)}function oA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,rA(n.key),n)}}function rA(A){var e=function(A){if("object"!=nA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=nA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==nA(e)?e:e+""}const iA=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.codecs={pcm:new u,pcmu:new h,pcma:new B}},(e=[{key:"decodeToPcm",value:function(A,e){var t=null==e?void 0:e.toLowerCase();if(!t||"pcm"===t)return A instanceof ArrayBuffer?A:A instanceof Uint8Array?A.buffer:A;var n=this.codecs[t];if(!n)throw new Error("Unsupported encoding: ".concat(e));var o=A instanceof Uint8Array?A:new Uint8Array(A);return n.decode(o)}},{key:"encodeFromPcm",value:function(A,e){var t=null==e?void 0:e.toLowerCase();if(!t||"pcm"===t)return A;var n=this.codecs[t];if(!n)throw new Error("Unsupported target encoding: ".concat(e));var o=n.encode(A);return o instanceof Uint8Array?o.buffer:o}},{key:"getCodec",value:function(A){var e=null==A?void 0:A.toLowerCase();return this.codecs[e]||null}}])&&oA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function aA(A){return aA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},aA(A)}function sA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,cA(n.key),n)}}function cA(A){var e=function(A){if("object"!=aA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=aA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==aA(e)?e:e+""}const lA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"convert",value:function(e,t,n){if(t===n)return e;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=e.byteLength/o;if(new ArrayBuffer(i*r),16===t&&16===n)return e;if(24===t&&16===n)return A.convert24To16(e);if(16===t&&24===n)return A.convert16To24(e);if(16===t&&8===n)return A.convert16To8(e);if(24===t&&8===n)return A.convert24To8(e);throw new Error("Unsupported bit depth conversion: ".concat(t,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(A){for(var e=new Uint8Array(A),t=Math.floor(e.length/3),n=new Int16Array(t),o=0;o<t;o++){var r=e[3*o],i=e[3*o+1],a=e[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(A){for(var e=new Int16Array(A),t=new Uint8Array(3*e.length),n=0;n<e.length;n++){var o=256*e[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(A){for(var e=new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++){var o=e[n];t[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return t.buffer}},{key:"convert24To8",value:function(e){var t=A.convert24To16(e);return A.convert16To8(t)}}],null&&sA(e.prototype,null),t&&sA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function uA(A){return uA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},uA(A)}function dA(){var A,e,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 pA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(pA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,pA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,pA(u,"constructor",c),pA(c,"constructor",s),s.displayName="GeneratorFunction",pA(c,o,"GeneratorFunction"),pA(u),pA(u,o,"Generator"),pA(u,n,function(){return this}),pA(u,"toString",function(){return"[object Generator]"}),(dA=function(){return{w:r,m:d}})()}function pA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}pA=function(A,e,t,n){function r(e,t){pA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},pA(A,e,t,n)}function gA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function hA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,fA(n.key),n)}}function fA(A){var e=function(A){if("object"!=uA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=uA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==uA(e)?e:e+""}const mA=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)},e=[{key:"resample",value:(t=dA().m(function A(e,t,n){var o,r,i,a,s,c,l,u,d,p,g,h,f;return dA().w(function(A){for(;;)switch(A.n){case 0:if(t!==n){A.n=1;break}return A.a(2,e);case 1:for(o=new Int16Array(e),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(),A.n=2,c.startRendering();case 2:for(d=A.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 A.a(2,g.buffer)}},A)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){gA(r,n,o,i,a,"next",A)}function a(A){gA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A,e,t){return n.apply(this,arguments)})}],e&&hA(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function vA(A){return vA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},vA(A)}function BA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,wA(n.key),n)}}function wA(A){var e=function(A){if("object"!=vA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=vA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==vA(e)?e:e+""}const yA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"convert",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(t===n)return e;if(1===t&&1===n)return e;if(1===t&&2===n)return A.monoToStereo(e,o);if(2===t&&1===n)return A.stereoToMono(e,o);throw new Error("Unsupported channel conversion: ".concat(t," → ").concat(n))}},{key:"monoToStereo",value:function(A,e){for(var t=e/8,n=A.byteLength/t,o=new ArrayBuffer(n*t*2),r=new Uint8Array(A),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(A,e){var t=e/8,n=A.byteLength/(2*t),o=new ArrayBuffer(n*t),r=new Uint8Array(A),i=new Uint8Array(o);if(16===e)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&&BA(e.prototype,null),t&&BA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function bA(A){return bA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},bA(A)}function CA(){var A,e,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 QA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(QA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,QA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,QA(u,"constructor",c),QA(c,"constructor",s),s.displayName="GeneratorFunction",QA(c,o,"GeneratorFunction"),QA(u),QA(u,o,"Generator"),QA(u,n,function(){return this}),QA(u,"toString",function(){return"[object Generator]"}),(CA=function(){return{w:r,m:d}})()}function QA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}QA=function(A,e,t,n){function r(e,t){QA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},QA(A,e,t,n)}function xA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function FA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?xA(Object(t),!0).forEach(function(e){UA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):xA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function UA(A,e,t){return(e=EA(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function SA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function kA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,EA(n.key),n)}}function EA(A){var e=function(A){if("object"!=bA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=bA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==bA(e)?e:e+""}const IA=function(){return A=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.requestedFormat=e,this.actualFormat=t,this.encodingConverter=new iA,this.conversionSteps=[],this._analyzeConversions()},e=[{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 A=[];return this.conversionSteps.includes("extract_wav")&&A.push("Extract PCM from WAV (".concat(this.actualFormat.container," → raw)")),this.conversionSteps.includes("decode_encoding")&&A.push("Decode ".concat(this.actualFormat.encoding.toUpperCase()," → PCM")),this.conversionSteps.includes("resample")&&A.push("Resample ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz")),this.conversionSteps.includes("convert_bitdepth")&&A.push("Convert bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit")),this.conversionSteps.includes("convert_channels")&&A.push("Convert channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels)),this.conversionSteps.includes("encode_encoding")&&A.push("Encode PCM → ".concat(this.requestedFormat.encoding.toUpperCase())),this.conversionSteps.includes("wrap_wav")&&A.push("Wrap in WAV container (raw → ".concat(this.requestedFormat.container,")")),A}},{key:"convert",value:(t=CA().m(function A(e){var t,n,o,r;return CA().w(function(A){for(;;)switch(A.n){case 0:if(this.needsConversion()){A.n=1;break}return A.a(2,e instanceof ArrayBuffer?e:e.buffer);case 1:if(t=e instanceof ArrayBuffer?e:e.buffer,n=FA({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=tA.extractPcmFromWav(t),t=o.pcmData,n=FA(FA({},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=lA.convert(t,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),!this.conversionSteps.includes("resample")){A.n=3;break}return A.n=2,mA.resample(t,n.sampleRate,this.requestedFormat.sampleRate);case 2:t=A.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=yA.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=lA.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=tA.wrapPcmInWav(t,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),A.a(2,t)}},A,this)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){SA(r,n,o,i,a,"next",A)}function a(A){SA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})}],e&&kA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function HA(A){return HA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},HA(A)}function TA(){var A,e,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 DA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(DA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,DA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,DA(u,"constructor",c),DA(c,"constructor",s),s.displayName="GeneratorFunction",DA(c,o,"GeneratorFunction"),DA(u),DA(u,o,"Generator"),DA(u,n,function(){return this}),DA(u,"toString",function(){return"[object Generator]"}),(TA=function(){return{w:r,m:d}})()}function DA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}DA=function(A,e,t,n){function r(e,t){DA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},DA(A,e,t,n)}function OA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function PA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,KA(n.key),n)}}function KA(A){var e=function(A){if("object"!=HA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=HA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==HA(e)?e:e+""}const LA=function(){return A=function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.handlers=new Map,this.sendMessage=e,this.getConversationId=t},e=[{key:"registerHandler",value:function(A,e){if("function"!=typeof e)throw new Error("Handler for tool '".concat(A,"' must be a function"));this.handlers.set(A,e),console.log("🔧 ClientTools: Registered handler for '".concat(A,"'"))}},{key:"unregisterHandler",value:function(A){this.handlers.delete(A),console.log("🔧 ClientTools: Unregistered handler for '".concat(A,"'"))}},{key:"hasHandler",value:function(A){return this.handlers.has(A)}},{key:"getRegisteredTools",value:function(){return Array.from(this.handlers.keys())}},{key:"handleToolCall",value:(t=TA().m(function A(e){var t,n,o,r,i,a,s,c,l,u,d,p,g,h;return TA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=e.toolCallId,n=e.toolName,o=e.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(e,null,2)),console.log(" ⏱️ Start time: ".concat(r,"ms (").concat(new Date(r).toISOString(),")")),a=this.handlers.get(n)){A.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),A.a(2);case 1:return A.p=1,A.n=2,a(o);case 2:c=A.v,l=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(l,"ms")),this.sendResult(t,n,c,l),A.n=4;break;case 3:A.p=3,h=A.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 A.a(2)}},A,this,[[1,3]])}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){OA(r,n,o,i,a,"next",A)}function a(A){OA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})},{key:"sendResult",value:function(A,e,t,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:A,toolName:e,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] Sending result for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(e)),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(A,e,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:A,toolName:e,conversationId:a,error:t,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(e)),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(A){this.sendMessage=A}}],e&&PA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();var MA=t(354),RA=t.n(MA);function _A(A){return _A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},_A(A)}function jA(){var A,e,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 VA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(VA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,VA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,VA(u,"constructor",c),VA(c,"constructor",s),s.displayName="GeneratorFunction",VA(c,o,"GeneratorFunction"),VA(u),VA(u,o,"Generator"),VA(u,n,function(){return this}),VA(u,"toString",function(){return"[object Generator]"}),(jA=function(){return{w:r,m:d}})()}function VA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}VA=function(A,e,t,n){function r(e,t){VA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},VA(A,e,t,n)}function NA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function GA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?NA(Object(t),!0).forEach(function(e){WA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):NA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function WA(A,e,t){return(e=function(A){var e=function(A){if("object"!=_A(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=_A(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==_A(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function zA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}var XA={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function JA(){return YA.apply(this,arguments)}function YA(){var A;return A=jA().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,Q,x,F,U=arguments;return jA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=(e=U.length>0&&void 0!==U[0]?U[0]:{}).selector,n=void 0===t?null:t,o=e.format,r=void 0===o?"jpeg":o,i=e.quality,a=void 0===i?.85:i,s=e.scale,c=void 0===s?1:s,l=e.maxWidth,u=void 0===l?1280:l,d=e.maxHeight,p=void 0===d?1280:d,g=e.fullPage,h=void 0!==g&&g,console.log("📸 SDK Screenshot: Starting capture with options:",e),f=Date.now(),A.p=1,m=document.body,!n){A.n=3;break}if(v=document.querySelector(n)){A.n=2;break}throw new Error("Element not found: ".concat(n));case 2:m=v,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),A.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return B=GA(GA({},XA),{},{scale:c}),h&&!n&&(B.windowHeight=document.documentElement.scrollHeight,B.height=document.documentElement.scrollHeight,B.y=0),A.n=5,RA()(m,B);case 5:return w=A.v,console.log("📸 SDK Screenshot: Canvas created (".concat(w.width,"x").concat(w.height,")")),y=w,(u||p)&&(y=qA(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),Q=C.split(",")[1],x=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(x,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(Q.length/1024),"KB")),A.a(2,{image:Q,mimeType:b,width:y.width,height:y.height,captureTimeMs:x,selector:n||"body"});case 6:throw A.p=6,F=A.v,console.error("📸 SDK Screenshot: Capture failed:",F),new Error("Screenshot capture failed: ".concat(F.message));case 7:return A.a(2)}},A,null,[[1,6]])}),YA=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){zA(r,n,o,i,a,"next",A)}function a(A){zA(r,n,o,i,a,"throw",A)}i(void 0)})},YA.apply(this,arguments)}function qA(A,e,t){var n=A.width,o=A.height,r=1;if(e&&n>e&&(r=Math.min(r,e/n)),t&&o>t&&(r=Math.min(r,t/o)),1===r)return A;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(A,0,0,i,a),s}function ZA(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return $A(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?$A(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function $A(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}var Ae={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 ee(A){if(!A)return!1;var e=(A.type||"").toLowerCase(),t=(A.name||"").toLowerCase(),n=(A.id||"").toLowerCase(),o=(A.className||"").toLowerCase(),r=(A.autocomplete||"").toLowerCase(),i=(A.placeholder||"").toLowerCase(),a=(A.getAttribute("aria-label")||"").toLowerCase(),s="".concat(t," ").concat(n," ").concat(o," ").concat(i," ").concat(a);if(Ae.types.includes(e))return!0;if(Ae.autocomplete.includes(r))return!0;var c,l=ZA(Ae.names);try{for(l.s();!(c=l.n()).done;){var u=c.value;if(s.includes(u))return!0}}catch(A){l.e(A)}finally{l.f()}var d,p=ZA(Ae.dataAttributes);try{for(p.s();!(d=p.n()).done;){var g=d.value;if(A.hasAttribute(g))return!0}}catch(A){p.e(A)}finally{p.f()}return"password"===(A.inputMode||"").toLowerCase()}function te(A){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},te(A)}function ne(){var A,e,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 oe(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(oe(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,oe(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,oe(u,"constructor",c),oe(c,"constructor",s),s.displayName="GeneratorFunction",oe(c,o,"GeneratorFunction"),oe(u),oe(u,o,"Generator"),oe(u,n,function(){return this}),oe(u,"toString",function(){return"[object Generator]"}),(ne=function(){return{w:r,m:d}})()}function oe(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}oe=function(A,e,t,n){function r(e,t){oe(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},oe(A,e,t,n)}function re(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function ie(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?re(Object(t),!0).forEach(function(e){ae(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):re(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function ae(A,e,t){return(e=function(A){var e=function(A){if("object"!=te(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=te(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==te(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function se(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function ce(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return le(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?le(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function le(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}var ue={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function de(A){var e,t;if(!A||!A.tagName)return null;if(null!==(e=A.dataset)&&void 0!==e&&e.testid)return'[data-testid="'.concat(A.dataset.testid,'"]');if(null!==(t=A.dataset)&&void 0!==t&&t.cy)return'[data-cy="'.concat(A.dataset.cy,'"]');var n=A.getAttribute("aria-label");if(n&&n.length<50)return'[aria-label="'.concat(n.replace(/"/g,'\\"'),'"]');if(A.id&&!pe(A.id))return"#".concat(CSS.escape(A.id));if(A.name){var o=A.tagName.toLowerCase();return"".concat(o,'[name="').concat(A.name,'"]')}if(["BUTTON","A"].includes(A.tagName)){var r,i=null===(r=A.innerText)||void 0===r?void 0:r.trim();if(i&&i.length<30&&i.length>0){var a=A.tagName.toLowerCase(),s=document.querySelectorAll("".concat(a));if(1===Array.from(s).filter(function(A){var e;return(null===(e=A.innerText)||void 0===e?void 0:e.trim())===i}).length)return"".concat(a,':contains("').concat(i.replace(/"/g,'\\"'),'")')}}return function(A){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=[],n=A,o=0;n&&n!==document.body&&o<e;){var r=n.tagName.toLowerCase();if(n.id&&!pe(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var i=ge(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(" > ")}(A)}function pe(A){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(e){return e.test(A)})}function ge(A){var e=Array.from(A.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 e.filter(function(A){return!t.some(function(e){return e.test(A)})&&A.length>2&&A.length<30})[0]||null}function he(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=A.getBoundingClientRect();return t.bottom>=-e&&t.top<=window.innerHeight+e&&t.right>=0&&t.left<=window.innerWidth}function fe(A){if(!A)return!1;var e=window.getComputedStyle(A);return"none"!==e.display&&"hidden"!==e.visibility&&"0"!==e.opacity&&A.offsetWidth>0&&A.offsetHeight>0}function me(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue,t=[],n=ce(document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button'));try{for(n.s();!(A=n.n()).done;){var o=A.value;if(t.length>=e.buttons)break;if(fe(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&t.push({selector:de(o),text:r.substring(0,e.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:he(o,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function ve(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue,t=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=ce(n);try{for(r.s();!(A=r.n()).done;){var i=A.value;if(t.length>=e.links)break;if(fe(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(A){}t.push({selector:de(i),text:a.substring(0,e.maxTextLength),href:s,internal:c,inViewport:he(i,0)})}}}}}catch(A){r.e(A)}finally{r.f()}return t}function Be(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue,t=[],n=0,o=ce(document.querySelectorAll("form"));try{for(o.s();!(A=o.n()).done;){var r=A.value;if(t.length>=e.forms)break;if(fe(r)){var i,a=[],s=ce(r.querySelectorAll("input, textarea, select"));try{for(s.s();!(i=s.n()).done;){var c,l,u=i.value;if(a.length>=e.fieldsPerForm)break;if("hidden"!==u.type)if(ee(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:de(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(A){s.e(A)}finally{s.f()}0!==a.length&&t.push({selector:de(r),id:r.id||null,action:r.action||null,method:(r.method||"get").toUpperCase(),fields:a})}}}catch(A){o.e(A)}finally{o.f()}return{forms:t,sensitiveCount:n}}function we(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue,t=[],n=ce(document.querySelectorAll('section, article, main, [role="main"], [role="region"], .section'));try{for(n.s();!(A=n.n()).done;){var o,r,i,a=A.value;if(t.length>=e.sections)break;if(fe(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,e.maxSummaryLength))||(null===(i=a.innerText)||void 0===i?void 0:i.trim().substring(0,e.maxSummaryLength))||"";t.push({selector:de(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,e.maxSummaryLength),inViewport:he(a,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function ye(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ue,t=[],n=ce(document.querySelectorAll("h1, h2, h3"));try{for(n.s();!(A=n.n()).done;){var o,r=A.value;if(t.length>=e.headings)break;if(fe(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&t.push({selector:de(r),level:r.tagName.toLowerCase(),text:i.substring(0,e.maxTextLength),inViewport:he(r,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function be(){return Ce.apply(this,arguments)}function Ce(){return A=ne().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f=arguments;return ne().w(function(A){for(;;)if(0===A.n)return t=f.length>0&&void 0!==f[0]?f[0]:{},n=ie(ie({},ue),t.limits),o=me(n),r=ve(n),i=Be(n),a=i.forms,s=i.sensitiveCount,c=we(n),l=ye(n),u=o.length+r.length+a.reduce(function(A,e){return A+e.fields.length},0)+c.length+l.length,d=o.filter(function(A){return A.inViewport}).length+r.filter(function(A){return A.inViewport}).length+c.filter(function(A){return A.inViewport}).length+l.filter(function(A){return A.inViewport}).length,p=document.documentElement.lang||(null===(e=document.querySelector("html"))||void 0===e?void 0:e.getAttribute("lang"))||null,g=navigator.language||navigator.languages&&navigator.languages[0]||null,h=p||g||null,A.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}})},A)}),Ce=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){se(r,n,o,i,a,"next",A)}function a(A){se(r,n,o,i,a,"throw",A)}i(void 0)})},Ce.apply(this,arguments);var A}function Qe(){var A,e,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 xe(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(xe(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,xe(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,xe(u,"constructor",c),xe(c,"constructor",s),s.displayName="GeneratorFunction",xe(c,o,"GeneratorFunction"),xe(u),xe(u,o,"Generator"),xe(u,n,function(){return this}),xe(u,"toString",function(){return"[object Generator]"}),(Qe=function(){return{w:r,m:d}})()}function xe(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}xe=function(A,e,t,n){function r(e,t){xe(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},xe(A,e,t,n)}function Fe(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ue(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Fe(r,n,o,i,a,"next",A)}function a(A){Fe(r,n,o,i,a,"throw",A)}i(void 0)})}}function Se(){return ke.apply(this,arguments)}function ke(){return ke=Ue(Qe().m(function A(){var e,t,n,o,r,i,a,s,c,l,u=arguments;return Qe().w(function(A){for(;;)switch(A.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){A.n=1;break}return A.a(2,{success:!1,error:"Selector is required"});case 1:if(s=document.querySelector(n)){A.n=2;break}return A.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:return s.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),A.n=3,Me(400);case 3:return c=s.getBoundingClientRect(),Ee(),(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),A.a(2,{success:!0,selector:n,elementInfo:{tag:s.tagName.toLowerCase(),id:s.id||null,text:(null===(e=s.innerText)||void 0===e?void 0:e.trim().substring(0,100))||null,position:{top:c.top,left:c.left,width:c.width,height:c.height}}})}},A)})),ke.apply(this,arguments)}function Ee(){if(!document.getElementById("ttp-highlight-styles")){var A=document.createElement("style");A.id="ttp-highlight-styles",A.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(A)}}function Ie(){return He.apply(this,arguments)}function He(){return He=Ue(Qe().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return Qe().w(function(A){for(;;)switch(A.n){case 0:if(t=(e=B.length>0&&void 0!==B[0]?B[0]:{}).selector,n=e.x,o=e.y,r=e.direction,i=e.amount,a=void 0===i?500:i,s=e.position,c=void 0===s?"center":s,l=e.behavior,u=void 0===l?"smooth":l,!t){A.n=3;break}if(d=document.querySelector(t)){A.n=1;break}return A.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"}),A.n=2,Me("smooth"===u?500:100);case 2:return g=d.getBoundingClientRect(),A.a(2,{success:!0,scrollType:"element",selector:t,elementPosition:{top:g.top,left:g.left}});case 3:if("up"!==r&&"down"!==r){A.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}),A.n=4,Me("smooth"===u?500:100);case 4:return A.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){A.n=7;break}return window.scrollTo({top:null!=o?o:window.scrollY,left:null!=n?n:window.scrollX,behavior:u}),A.n=6,Me("smooth"===u?500:100);case 6:return A.a(2,{success:!0,scrollType:"position",scrolledTo:{x:null!=n?n:window.scrollX,y:null!=o?o:window.scrollY}});case 7:return A.a(2,{success:!1,error:"Either selector, x/y position, or direction (up/down) required"})}},A)})),He.apply(this,arguments)}function Te(){return De.apply(this,arguments)}function De(){return De=Ue(Qe().m(function A(){var e,t,n,o,r=arguments;return Qe().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=(r.length>0&&void 0!==r[0]?r[0]:{}).url){A.n=1;break}return A.a(2,{success:!1,error:"URL is required"});case 1:A.p=1,t=new URL(e,window.location.origin),A.n=3;break;case 2:return A.p=2,A.v,A.a(2,{success:!1,error:"Invalid URL: ".concat(e)});case 3:if(["http:","https:"].includes(t.protocol)){A.n=4;break}return A.a(2,{success:!1,error:"Invalid protocol: ".concat(t.protocol)});case 4:if(t.origin===window.location.origin){A.n=7;break}return A.p=5,window.open(t.href,"_blank","noopener,noreferrer"),A.a(2,{success:!0,openedInNewTab:!0,navigatedTo:t.href,message:"Opened external link in a new tab"});case 6:return A.p=6,o=A.v,A.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,A.a(2,{success:!0,navigatedTo:t.href,from:n})}},A,null,[[5,6],[1,2]])})),De.apply(this,arguments)}function Oe(){return Pe.apply(this,arguments)}function Pe(){return Pe=Ue(Qe().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p=arguments;return Qe().w(function(A){for(;;)switch(A.n){case 0:if(t=(e=p.length>0&&void 0!==p[0]?p[0]:{}).selector,n=e.value,o=e.triggerEvents,r=void 0===o||o,t){A.n=1;break}return A.a(2,{success:!1,error:"Selector is required"});case 1:if(null!=n){A.n=2;break}return A.a(2,{success:!1,error:"Value is required"});case 2:if(i=document.querySelector(t)){A.n=3;break}return A.a(2,{success:!1,error:"Element not found: ".concat(t)});case 3:if(a=i.tagName.toLowerCase(),["input","textarea","select"].includes(a)){A.n=4;break}return A.a(2,{success:!1,error:"Element is not a form field: ".concat(a)});case 4:if(!ee(i)){A.n=5;break}return A.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"}),A.n=6,Me(300);case 6:return i.focus(),"select"===a?(s=Array.from(i.options),c=s.find(function(A){return A.value===n||A.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})))),Ee(),i.classList.add("ttp-fill-success"),setTimeout(function(){i.classList.remove("ttp-fill-success")},2e3),A.a(2,{success:!0,selector:t,fieldType:i.type||a,fieldName:i.name||null,filled:!0})}},A)})),Pe.apply(this,arguments)}function Ke(){return Le.apply(this,arguments)}function Le(){return Le=Ue(Qe().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b=arguments;return Qe().w(function(A){for(;;)switch(A.p=A.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){A.n=1;break}return A.a(2,{success:!1,error:"Selector is required"});case 1:if(d=document.querySelector(n)){A.n=2;break}return A.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:if(0!==(p=d.getBoundingClientRect()).width&&0!==p.height){A.n=3;break}return A.a(2,{success:!1,error:"Element is not visible (zero size)"});case 3:if(!d.disabled){A.n=4;break}return A.a(2,{success:!1,error:"Element is disabled"});case 4:return d.scrollIntoView({behavior:"smooth",block:"center"}),A.n=5,Me(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),A.n=6,Me(200);case 6:if(g.remove(),!a&&!c){A.n=9;break}if(!(h=u||d.href||("A"===d.tagName?d.getAttribute("href"):null))||"#"===h||h.startsWith("javascript:")){A.n=9;break}return A.p=7,window.open(h,"_blank","noopener,noreferrer"),A.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:A.p=8,y=A.v,console.warn("[TTP] Failed to open in new tab:",y);case 9:if(!r){A.n=11;break}return v=window.location.href,B=new Promise(function(A){var e=setTimeout(function(){A({navigated:!1})},5e3),t=function(){clearTimeout(e),window.removeEventListener("beforeunload",t),A({navigated:!0})};window.addEventListener("beforeunload",t)}),d.click(),A.n=10,B;case 10:return w=A.v,A.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(),A.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(e=d.innerText)||void 0===e?void 0:e.trim().substring(0,50))||null}})}},A,null,[[7,8]])})),Le.apply(this,arguments)}function Me(A){return new Promise(function(e){return setTimeout(e,A)})}function Re(){var A,e,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 _e(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(_e(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,_e(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,_e(u,"constructor",c),_e(c,"constructor",s),s.displayName="GeneratorFunction",_e(c,o,"GeneratorFunction"),_e(u),_e(u,o,"Generator"),_e(u,n,function(){return this}),_e(u,"toString",function(){return"[object Generator]"}),(Re=function(){return{w:r,m:d}})()}function _e(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}_e=function(A,e,t,n){function r(e,t){_e(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},_e(A,e,t,n)}function je(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ve(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){je(r,n,o,i,a,"next",A)}function a(A){je(r,n,o,i,a,"throw",A)}i(void 0)})}}function Ne(){return(Ne=Ve(Re().m(function A(){var e;return Re().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,be();case 1:return e=A.v,A.a(2,{url:e.url,title:e.title,timestamp:e.timestamp,language:e.language,viewport:e.viewport,dom:{buttons:e.buttons,links:e.links,forms:e.forms,sections:e.sections,headings:e.headings,metadata:e.metadata}})}},A)}))).apply(this,arguments)}function Ge(){var A,e,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 We(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(We(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,We(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,We(u,"constructor",c),We(c,"constructor",s),s.displayName="GeneratorFunction",We(c,o,"GeneratorFunction"),We(u),We(u,o,"Generator"),We(u,n,function(){return this}),We(u,"toString",function(){return"[object Generator]"}),(Ge=function(){return{w:r,m:d}})()}function We(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}We=function(A,e,t,n){function r(e,t){We(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},We(A,e,t,n)}function ze(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Xe(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){ze(r,n,o,i,a,"next",A)}function a(A){ze(r,n,o,i,a,"throw",A)}i(void 0)})}}function Je(A){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Je(A)}function Ye(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function qe(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ye(Object(t),!0).forEach(function(e){tt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Ye(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Ze(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,nt(n.key),n)}}function $e(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return($e=function(){return!!A})()}function At(A){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},At(A)}function et(A,e){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},et(A,e)}function tt(A,e,t){return(e=nt(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function nt(A){var e=function(A){if("object"!=Je(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Je(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Je(e)?e:e+""}var ot=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=At(e),function(A,e){if(e&&("object"==Je(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,$e()?Reflect.construct(e,t||[],At(A).constructor):e.apply(A,t))}(this,e)).version="2.0.0",A.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||A.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},A.isConnected=!1,A.hasEverConnected=!1,A.isRecording=!1,A.isPlaying=!1,A.isDestroyed=!1,A.outputAudioFormat=null,A.requestedOutputFormat=null,A.formatConverter=null,A.websocket=null,A.conversationId=null,A.transcriptQueue=[],A.currentPlayingSentenceId=null,A.audioFrameCount=0,A.wakeLock=null,A._wakeLockRequesting=!1,A.pendingInjections=new Map,A.injectionCounter=0,A.audioPlayer=new T(A.config);var n=qe(qe({},A.config),{},{checkConnection:function(){return A.isConnected&&A.websocket&&A.websocket.readyState===WebSocket.OPEN}});return A.audioRecorder=new Z(n),A.setupAudioPlayerEvents(),A.setupAudioRecorderEvents(),A.clientToolsRegistry=new LA(function(e){return A.sendMessage(e)},function(){return A.conversationId}),A._registerBuiltInTools(),A.validateConfig(),A._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:A.version,outputContainer:A.config.outputContainer,outputEncoding:A.config.outputEncoding,outputSampleRate:A.config.outputSampleRate}),A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&et(A,e)}(e,A),t=e,n=[{key:"_registerBuiltInTools",value:function(){var A=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==JA);try{if(void 0===JA)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:",Je(JA)),this.clientToolsRegistry.registerHandler("capture_screen",Xe(Ge().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return Ge().w(function(e){for(;;)switch(e.p=e.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,e.p=1,e.n=2,JA({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:g,maxHeight:f});case 2:return m=e.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(m.width,"x").concat(m.height,", ").concat(Math.round(m.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:m.width,height:m.height,sizeKB:Math.round(m.image.length/1024),selector:m.selector}),e.a(2,m);case 3:throw e.p=3,v=e.v,console.error("📸 VoiceSDK: Screenshot capture failed:",v),A.emit("screenshotError",{error:v.message}),v;case 4:return e.a(2)}},e,null,[[1,3]])}))),console.log("📸 VoiceSDK: Built-in capture_screen tool registered")}catch(A){console.error("❌ VoiceSDK: Error registering built-in tools:",A),console.error(" Error details:",A.message,A.stack)}try{!function(A){A.registerHandler("read_page",Ve(Re().m(function A(){var e,t,n=arguments;return Re().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Reading page structure..."),A.n=1,be(e);case 1:return t=A.v,console.log("[TTP] ✅ Page structure extracted:",{buttons:t.buttons.length,links:t.links.length,forms:t.forms.length,headings:t.headings.length}),A.a(2,t)}},A)}))),A.registerHandler("highlight_element",Ve(Re().m(function A(){var e,t,n=arguments;return Re().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] ✨ Highlighting element:",e.selector),A.n=1,Se(e);case 1:return(t=A.v).success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",t.error),A.a(2,t)}},A)}))),A.registerHandler("scroll_to_element",Ve(Re().m(function A(){var e,t,n,o,r=arguments;return Re().w(function(A){for(;;)switch(A.n){case 0:return(e=r.length>0&&void 0!==r[0]?r[0]:{}).selector?console.log("[TTP] 📜 Scrolling to element:",e.selector):e.direction?console.log("[TTP] 📜 Scrolling",e.direction,"by",e.amount||500,"px"):void 0!==e.x||void 0!==e.y?console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(t=e.x)&&void 0!==t?t:"current",", ").concat(null!==(n=e.y)&&void 0!==n?n:"current",")")):console.log("[TTP] 📜 Scroll called with params:",e),A.n=1,Ie(e);case 1:return(o=A.v).success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",o.error),A.a(2,o)}},A)}))),A.registerHandler("navigate_to",Ve(Re().m(function A(){var e,t,n=arguments;return Re().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 🔗 Navigating to:",e.url),A.n=1,Te(e);case 1:return(t=A.v).success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",t.error),A.a(2,t)}},A)}))),A.registerHandler("fill_field",Ve(Re().m(function A(){var e,t,n=arguments;return Re().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📝 Filling field:",e.selector),A.n=1,Oe(e);case 1:return(t=A.v).success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",t.error),A.a(2,t)}},A)}))),A.registerHandler("click_element",Ve(Re().m(function A(){var e,t,n=arguments;return Re().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 👆 Clicking element:",e.selector),A.n=1,Ke(e);case 1:return(t=A.v).success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",t.error),A.a(2,t)}},A)})));var e=A.getRegisteredTools(),t=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(function(A){return!e.includes(A)});t.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",t):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",e)}(this.clientToolsRegistry);var e=this.clientToolsRegistry.getRegisteredTools(),t=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=e.filter(function(A){return t.includes(A)});if(n.length!==t.length){var o=t.filter(function(A){return!n.includes(A)});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(A){console.error("❌ VoiceSDK: Error registering visual assistant tools:",A),console.error(" Error details:",A.message,A.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(A){return i.includes(A)});if(a.length!==i.length){var s=i.filter(function(A){return!a.includes(A)});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 A=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(A){var t=JSON.parse(A);if(t&&t.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",t.conversationId),t.conversationId}return null}catch(A){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",A),null}}},{key:"storeConversationId",value:function(A){if(A)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var t={},n=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(n)try{t=JSON.parse(n)}catch(A){}t.conversationId=A,t.timestamp=Date.now(),t.fromPage=t.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(e.RESUME_STORAGE_KEY,JSON.stringify(t)),console.log("💾 VoiceSDK v2: Stored conversationId:",A)}catch(A){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",A)}}},{key:"clearStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(e.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(A){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",A)}}},{key:"_getResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return null;var A=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(!A)return null;var t=JSON.parse(A),n=Date.now()-t.timestamp;return n>e.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(A){return console.warn("[VoiceSDK] Failed to get resume state:",A),null}}},{key:"_clearResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(e.RESUME_STORAGE_KEY)}catch(A){}}},{key:"_setupPageUnloadHandler",value:function(){var A=this;window.addEventListener("beforeunload",function(){A.conversationId&&A.websocket&&A.websocket.readyState===WebSocket.OPEN&&A.storeConversationId(A.conversationId)}),document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState&&(A.isRecording&&A.isConnected&&A._requestWakeLock(),A.isRecording&&A.audioRecorder&&A.audioRecorder.resumeAudioContext().catch(function(A){console.error("VoiceSDK v2: Error resuming AudioContext on visibility change:",A)}),A.audioPlayer&&A.audioPlayer.resumeAudioContext().catch(function(A){console.error("VoiceSDK v2: Error resuming playback AudioContext on visibility change:",A)})),"hidden"===document.visibilityState&&A.conversationId&&A.websocket&&A.websocket.readyState===WebSocket.OPEN&&A.storeConversationId(A.conversationId)})}},{key:"checkAndResume",value:function(){var A=this._getResumeState();if(!A)return null;var e=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",A.conversationId),console.log("[VoiceSDK] Page change:",A.fromPage,"→",e),{conversationId:A.conversationId,fromPage:A.fromPage,toPage:e}}},{key:"getDefaultContainer",value:function(A){return"wav"===A.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(A){var t;if(!A)return"Input format is required";var n=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();return n&&e.SUPPORTED_INPUT_ENCODINGS.includes(n)?A.sampleRate&&e.SUPPORTED_INPUT_SAMPLE_RATES.includes(A.sampleRate)?A.bitDepth&&e.SUPPORTED_INPUT_BIT_DEPTHS.includes(A.bitDepth)?A.channels&&e.SUPPORTED_INPUT_CHANNELS.includes(A.channels)?null:"Unsupported input channels: ".concat(A.channels,". Supported: ").concat(e.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(A.bitDepth,". Supported: ").concat(e.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(A.sampleRate,". Supported: ").concat(e.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(A.encoding,". Supported: ").concat(e.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(A){var t,n;if(!A)return"Output format is required";var o=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();if(!o||!e.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(A.encoding,". Supported: ").concat(e.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!A.sampleRate||!e.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(A.sampleRate))return"Unsupported output sample rate: ".concat(A.sampleRate,". Supported: ").concat(e.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!A.bitDepth||!e.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(A.bitDepth))return"Unsupported output bit depth: ".concat(A.bitDepth,". Supported: ").concat(e.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!A.channels||!e.SUPPORTED_OUTPUT_CHANNELS.includes(A.channels))return"Unsupported output channels: ".concat(A.channels,". Supported: ").concat(e.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=A.container)||void 0===n?void 0:n.toLowerCase();return r&&e.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(A.container,". Supported: ").concat(e.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){var A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},e=this.validateInputFormat(A);if(e)return console.error("❌ VoiceSDK v2: Invalid input format:",e),void this.emit("error",new Error(e));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 A=this;this.audioPlayer.on("playbackStarted",function(){A.isPlaying=!0,A.emit("playbackStarted"),A.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),A.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",function(e){var t=A.currentPlayingSentenceId?A.currentPlayingSentenceId+1:1;A.currentPlayingSentenceId=t;var n={text:e.text,role:"assistant",sentenceId:t,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",n),A.emit("transcriptDisplay",n),A.emit("transcript",n)}),this.audioPlayer.on("playbackStopped",function(){A.isPlaying=!1,A.emit("playbackStopped"),A.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),A.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",function(e){A.emit("playbackError",e),A.emit("error",e)})}},{key:"setupAudioRecorderEvents",value:function(){var A=this;this.audioRecorder.on("recordingStarted",function(){A.isRecording=!0,A.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",function(){A.isRecording&&(A.isRecording=!1,A.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",function(e){A.isConnected&&A.sendBinary(e)}),this.audioRecorder.on("error",function(e){e.isServerRejection||"ServerRejected"===e.name||(console.error("❌ AudioRecorder error:",e),A.emit("error",e))})}},{key:"buildWebSocketUrl",value:function(){var A=this.config.signedUrl||this.config.websocketUrl,e=new URL(A,"wss://placeholder.com"),t=e.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(e.origin).concat(e.pathname,"?").concat(r):"".concat(e.origin).concat(e.pathname)}},{key:"connect",value:(p=Xe(Ge().m(function A(){var e,t,n=this;return Ge().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isDestroyed){A.n=1;break}return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),A.a(2,!1);case 1:if(!this.isConnected){A.n=2;break}return console.warn("VoiceSDK v2: Already connected"),A.a(2,!0);case 2:return A.p=2,e=this.buildWebSocketUrl(),A.n=3,new Promise(function(A,t){n.websocket=new WebSocket(e),n.websocket.onopen=function(){if(console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry){n.clientToolsRegistry.setSendMessage(function(A){return n.sendMessage(A)});var e=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",e);var t=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(function(A){return!e.includes(A)});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"),A(!0)},n.websocket.onerror=function(A){console.error("❌ VoiceSDK v2: WebSocket error:",A),t(A)},n.websocket.onclose=function(A){if(console.log("🔌 VoiceSDK v2: WebSocket closed:",A.code,A.reason),n.isConnected=!1,n.isRecording&&n.stopRecording().catch(function(A){return console.error("Error stopping recording:",A)}),n._releaseWakeLock(),n.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(n.pendingInjections.size," pending data injections due to disconnect"));var e=new Error("Connection closed - data injection cancelled");e.error="CONNECTION_CLOSED",n.pendingInjections.forEach(function(A,t){clearTimeout(A.timeout),A.reject(e),n.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:t})}),n.pendingInjections.clear()}n.emit("disconnected",A),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(A){n.handleMessage(A)}});case 3:return A.a(2,A.v);case 4:return A.p=4,t=A.v,console.error("🔌 VoiceSDK v2: Connection failed:",t),this.emit("error",t),A.a(2,!1)}},A,this,[[2,4]])})),function(){return p.apply(this,arguments)})},{key:"sendHelloMessage",value:(d=Xe(Ge().m(function A(){var e,t,n,o,r;return Ge().w(function(A){for(;;)switch(A.n){case 0:if(this.isConnected){A.n=1;break}return console.warn("VoiceSDK v2: Cannot send hello - not connected"),A.a(2);case 1:if(e={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(e))){A.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))),A.a(2);case 2:if(!(o=this.validateOutputFormat(t))){A.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))),A.a(2);case 3:r={t:"hello",v:this.config.protocolVersion,inputFormat:e,requestedOutputFormat:t,outputFrameDurationMs:this.config.outputFrameDurationMs},this.config.agentSettingsOverride&&(r.agentSettingsOverride=this.config.agentSettingsOverride),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(A){console.error("VoiceSDK v2: Failed to send hello:",A),this.emit("error",A)}case 4:return A.a(2)}},A,this)})),function(){return d.apply(this,arguments)})},{key:"handleMessage",value:function(A){var e=this;if(A.data instanceof ArrayBuffer||A.data instanceof Blob)this.handleBinaryMessage(A.data);else try{var t=JSON.parse(A.data);switch("audio"!==t.t&&console.log("📥 VoiceSDK v2: Received message type:",t.t,"Full message:",JSON.stringify(t).substring(0,200)),!this.conversationId&&t.conversationId&&(this.conversationId=t.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==t.t&&console.log("📨 VoiceSDK v2: Received message type:",t.t,t),t.t){case"hello_ack":this.handleHelloAck(t);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",t),this.handleTranscript(t);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",t),this.emit("message",t);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",t),(t.text||t.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",t.text||t.transcript),t.sentenceId&&(t.text||t.transcript))){var n={t:"transcript",sentenceId:t.sentenceId,text:t.text||t.transcript,role:t.role||"assistant",final:!1!==t.final,timestamp:t.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",n),this.handleTranscript(n)}this.emit("message",t);break;case"error":this.emit("message",t);break;case"barge_in":this.emit("bargeIn",t),this.stopAudioPlayback();break;case"stop_playing":this.emit("stopPlaying",t),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",t.text),t.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(t.text),this.emit("message",t);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(t);break;case"text_inject_ack":this.handleTextInjectAck(t);break;case"data_inject_ack":this.handleDataInjectAck(t);break;case"data_inject_error":this.handleDataInjectError(t);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 Ne.apply(this,arguments)}().then(function(A){e.sendMessage({t:"page_context",pageContext:A}),console.log("📖 [VISUAL ASSISTANT] Page context sent:",A.url)}).catch(function(A){console.error("❌ [VISUAL ASSISTANT] Failed to scan page:",A),e.sendMessage({t:"page_context",pageContext:null,error:A.message})});break;case"get_screenshot":console.log("📸 [VISUAL ASSISTANT] Backend requested screenshot");try{JA().then(function(A){e.sendMessage({t:"screenshot",screenshot:{image:A.base64,mimeType:A.mimeType||"image/png",width:A.width,height:A.height}}),console.log("📸 [VISUAL ASSISTANT] Screenshot sent:",A.width+"x"+A.height)}).catch(function(A){console.error("❌ [VISUAL ASSISTANT] Screenshot capture failed:",A),e.sendMessage({t:"screenshot",screenshot:null,error:A.message})})}catch(A){console.error("❌ [VISUAL ASSISTANT] Screenshot error:",A),this.sendMessage({t:"screenshot",screenshot:null,error:A.message})}break;case"page_context_ack":t.ok?console.log("✅ [VISUAL ASSISTANT] Page context acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Page context error:",t.error);break;case"screenshot_ack":t.ok?console.log("✅ [VISUAL ASSISTANT] Screenshot acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Screenshot error:",t.error);break;default:if(console.log("VoiceSDK v2: Unknown message type:",t.t,"Full message:",JSON.stringify(t).substring(0,300)),(t.text||t.transcript||t.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:t.text,transcript:t.transcript,transcription:t.transcription,sentenceId:t.sentenceId,role:t.role}),t.sentenceId&&(t.text||t.transcript||t.transcription))){var o={t:"transcript",sentenceId:t.sentenceId,text:t.text||t.transcript||t.transcription,role:t.role||"assistant",final:!1!==t.final,timestamp:t.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",o),this.handleTranscript(o)}this.emit("message",t)}}catch(A){console.error("VoiceSDK v2: Error parsing message:",A)}}},{key:"handleHelloAck",value:function(A){if(console.log("📥 VoiceSDK v2: Received hello_ack:",{hasOutputFormat:!!A.outputAudioFormat,outputFormat:A.outputAudioFormat,hasConversationId:!!A.conversationId,messageType:A.t}),A.conversationId&&(this.conversationId=A.conversationId,console.log("🔍 VoiceSDK v2: Received conversationId:",this.conversationId),this.emit("conversationIdChanged",this.conversationId),this.storeConversationId(this.conversationId)),!0===A.resumed?(console.log("✅ VoiceSDK v2: Conversation resumed successfully"),this.emit("callResumed",{conversationId:this.conversationId,timestamp:Date.now()})):!1===A.resumed&&A.resumeRejectedReason&&(console.warn("⚠️ VoiceSDK v2: Resume rejected:",A.resumeRejectedReason),this.clearStoredConversationId(),this.emit("resumeRejected",{reason:A.resumeRejectedReason,conversationId:A.conversationId||null,timestamp:Date.now()})),A.outputAudioFormat){this.outputAudioFormat=A.outputAudioFormat,this.audioPlayer.setOutputFormat(A.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 e={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!==e.container&&t.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(e.container,'"')),this.requestedOutputFormat.encoding!==e.encoding&&t.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(e.encoding,'"')),this.requestedOutputFormat.sampleRate!==e.sampleRate&&t.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(e.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==e.bitDepth&&t.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(e.bitDepth,"-bit")),this.requestedOutputFormat.channels!==e.channels&&t.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(e.channels)),t.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",e),console.warn(" Differences:",t.join(", "));try{if(this.formatConverter=new IA(this.requestedOutputFormat,e),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(A){console.error("❌ VoiceSDK v2: Failed to create format converter:",A),console.warn(" Will use backend format without conversion"),this.formatConverter=null}}else console.log("✅ VoiceSDK v2: Format perfectly matched!",e),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(A){console.log("📝 VoiceSDK v2: Text inject ack received:",A),this.emit("textInjectAck",A)}},{key:"injectData",value:(u=Xe(Ge().m(function A(e){var t,n,o,r,i,a,s,c,l,u=this,d=arguments;return Ge().w(function(A){for(;;)switch(A.n){case 0:if(t=d.length>1&&void 0!==d[1]?d[1]:{},n=null==e?void 0:e.trim()){A.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){A.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)){A.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),A.a(2,new Promise(function(A,e){var t=setTimeout(function(){u.pendingInjections.delete(a);var A={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",A),e(new Error(A.message))},s);if(u.pendingInjections.set(a,{resolve:function(e){clearTimeout(t),A(e)},reject:function(A){clearTimeout(t),e(A)},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),e(new Error(o.message))}}))}},A,this)})),function(A){return u.apply(this,arguments)})},{key:"handleDataInjectAck",value:function(A){var e=A.correlationId;if(e){var t=this.pendingInjections.get(e);t?(this.pendingInjections.delete(e),t.resolve(A),this.emit("dataInjected",{correlationId:e,data:A.data,metadata:A.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",e)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",e)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}},{key:"handleDataInjectError",value:function(A){var e=A.correlationId;if(e){var t=this.pendingInjections.get(e);if(t){this.pendingInjections.delete(e);var n=new Error(A.message||"Data injection failed");n.error=A.error,n.correlationId=e,t.reject(n),this.emit("dataInjectionError",{error:A.error,message:A.message,correlationId:e}),console.warn("❌ VoiceSDK v2: Data injection error:",e,A.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",e)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}},{key:"handleTranscript",value:function(A){if(A.sentenceId&&A.text){var e=A.sentenceId,t={text:A.text,role:A.role||"assistant",sentenceId:e,final:!1!==A.final,timestamp:A.timestamp||Date.now()};this.transcriptQueue.push(t),console.log("📝 VoiceSDK v2: Received transcript for sentence",e,":",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",e),this.emit("transcriptDisplay",t),this.currentPlayingSentenceId=e,this.emit("transcript",t)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",A)}},{key:"handleBinaryMessage",value:(l=Xe(Ge().m(function A(e){var t,n,o,r,i,a,s,c,l;return Ge().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!(e instanceof Blob)){A.n=2;break}return A.n=1,e.arrayBuffer();case 1:t=A.v,A.n=3;break;case 2:t=e;case 3:if(n=t,!this.formatConverter||!this.formatConverter.needsConversion()){A.n=7;break}return A.p=4,A.n=5,this.formatConverter.convert(t);case 5:n=A.v,console.log("✅ VoiceSDK v2: Audio converted to requested format"),A.n=7;break;case 6:A.p=6,l=A.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 A.a(2)}},A,this,[[4,6]])})),function(A){return l.apply(this,arguments)})},{key:"sendMessage",value:function(A){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send message - not connected"),!1;try{var e=(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"!==A.t&&"client_tool_error"!==A.t||(console.log("📤 VoiceSDK v2: [".concat(e,"] Sending tool ").concat(A.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(t,")")),console.log(" 📋 toolCallId: ".concat(A.toolCallId)),console.log(" 📋 conversationId: ".concat(A.conversationId||"null")),console.log(" 📋 toolName: ".concat(A.toolName)),"client_tool_result"===A.t?console.log(" 📋 result:",A.result):console.log(" 📋 error: ".concat(A.error,", errorCode: ").concat(A.errorCode)),console.log(" 📋 Full message:",JSON.stringify(A,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(A);return this.websocket.send(o),"client_tool_result"!==A.t&&"client_tool_error"!==A.t||console.log("✅ VoiceSDK v2: [".concat(e,"] Tool ").concat(A.t," message sent successfully (").concat(o.length," bytes)")),!0}catch(A){return console.error("VoiceSDK v2: Error sending message:",A),this.emit("error",A),!1}}},{key:"sendBinary",value:function(A){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send audio - not connected"),!1;try{return this.websocket.send(A),!0}catch(A){return console.error("VoiceSDK v2: Error sending audio:",A),this.emit("error",A),!1}}},{key:"hangup",value:function(){var A=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(){A.websocket&&A.websocket.readyState===WebSocket.OPEN&&(A.websocket.close(1e3,"User hangup"),A.websocket=null),A.isConnected=!1},100)}catch(A){console.error("VoiceSDK v2: Error sending hangup message:",A),this.websocket&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1}}}},{key:"startRecording",value:(c=Xe(Ge().m(function A(){var e,t,n,o;return Ge().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isConnected){A.n=1;break}throw e=new Error("Not connected to voice server"),this.emit("error",e),e;case 1:if(!this.isRecording){A.n=2;break}return console.warn("VoiceSDK v2: Already recording"),A.a(2,!0);case 2:return console.log("🎤 VoiceSDK v2: Starting recording..."),A.p=3,console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),A.n=4,this.audioRecorder.start();case 4:if(this.isConnected&&this.websocket&&this.websocket.readyState===WebSocket.OPEN){A.n=9;break}return A.p=5,A.n=6,this.audioRecorder.stop();case 6:A.n=8;break;case 7:A.p=7,A.v;case 8:throw(t=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",t.isServerRejection=!0,t;case 9:return A.n=10,this.audioPlayer.resumeAudioContext();case 10:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),this._requestWakeLock(),A.a(2,!0);case 11:if(A.p=11,o=A.v,!this.audioRecorder||!this.audioRecorder.isRecording){A.n=15;break}return A.p=12,A.n=13,this.audioRecorder.stop();case 13:A.n=15;break;case 14:A.p=14,A.v;case 15:if(!o.isServerRejection&&"ServerRejected"!==o.name){A.n=16;break}return A.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),A.a(2,!1)}},A,this,[[12,14],[5,7],[3,11]])})),function(){return c.apply(this,arguments)})},{key:"stopRecording",value:(s=Xe(Ge().m(function A(){var e;return Ge().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return console.warn("VoiceSDK v2: Not recording"),A.a(2,!0);case 1:return console.log("🛑 VoiceSDK v2: Stopping recording..."),A.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(),A.n=3,this.audioRecorder.stop();case 3:return this.stopAudioPlayback(),A.a(2,!0);case 4:return A.p=4,e=A.v,console.error("VoiceSDK v2: Error stopping recording:",e),this.emit("error",e),A.a(2,!1)}},A,this,[[2,4]])})),function(){return s.apply(this,arguments)})},{key:"toggleRecording",value:(a=Xe(Ge().m(function A(){return Ge().w(function(A){for(;;)switch(A.n){case 0:if(!this.isRecording){A.n=2;break}return A.n=1,this.stopRecording();case 1:case 3:return A.a(2,A.v);case 2:return A.n=3,this.startRecording();case 4:return A.a(2)}},A,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=Xe(Ge().m(function A(){var e,t=this;return Ge().w(function(A){for(;;)switch(A.p=A.n){case 0:if("wakeLock"in navigator){A.n=1;break}return console.log("📱 VoiceSDK v2: Wake Lock API not available in this browser"),A.a(2);case 1:if(null===this.wakeLock&&!this._wakeLockRequesting){A.n=2;break}return console.log("📱 VoiceSDK v2: Wake lock already active or being requested"),A.a(2);case 2:return A.p=2,this._wakeLockRequesting=!0,A.n=3,navigator.wakeLock.request("screen");case 3:this.wakeLock=A.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}),A.n=5;break;case 4:A.p=4,e=A.v,console.warn("📱 VoiceSDK v2: Failed to request wake lock:",e.message),this.wakeLock=null;case 5:return A.p=5,this._wakeLockRequesting=!1,A.f(5);case 6:return A.a(2)}},A,this,[[2,4,5,6]])})),function(){return i.apply(this,arguments)})},{key:"_releaseWakeLock",value:(r=Xe(Ge().m(function A(){var e;return Ge().w(function(A){for(;;)switch(A.p=A.n){case 0:if(null!==this.wakeLock){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,this.wakeLock.release();case 2:this.wakeLock=null,console.log("📱 VoiceSDK v2: Screen wake lock released"),A.n=4;break;case 3:A.p=3,e=A.v,console.warn("📱 VoiceSDK v2: Error releasing wake lock:",e.message),this.wakeLock=null;case 4:return A.a(2)}},A,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"stopAudioPlayback",value:function(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}},{key:"handleBargeIn",value:(o=Xe(Ge().m(function A(){return Ge().w(function(A){for(;;)switch(A.n){case 0:if(this.stopAudioPlayback(),this.isRecording){A.n=1;break}return A.n=1,this.startRecording();case 1:return A.a(2)}},A,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(A){this.config=qe(qe({},this.config),A)}},{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 A=Date.now(),e=Math.random().toString(36).substr(2,9);return"inj_".concat(A,"_").concat(this.injectionCounter,"_").concat(e)}},{key:"registerToolHandler",value:function(A,e){return this.clientToolsRegistry.registerHandler(A,e)}},{key:"unregisterToolHandler",value:function(A){return this.clientToolsRegistry.unregisterHandler(A)}},{key:"hasToolHandler",value:function(A){return this.clientToolsRegistry.hasHandler(A)}},{key:"getRegisteredTools",value:function(){return this.clientToolsRegistry.getRegisteredTools()}},{key:"destroy",value:function(){var A=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 e=new Error("SDK destroyed - data injection cancelled");e.error="SDK_DESTROYED",this.pendingInjections.forEach(function(A,t){clearTimeout(A.timeout),A.reject(e)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(e){return A.clientToolsRegistry.unregisterHandler(e)}),this.removeAllListeners()}}}],n&&Ze(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c,l,u,d,p}(a);tt(ot,"RESUME_STORAGE_KEY","voice_resume_state"),tt(ot,"RESUME_TTL_MS",1e4),tt(ot,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),tt(ot,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tt(ot,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),tt(ot,"SUPPORTED_INPUT_CHANNELS",[1]),tt(ot,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),tt(ot,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tt(ot,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),tt(ot,"SUPPORTED_OUTPUT_CHANNELS",[1]),tt(ot,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const rt=ot;function it(A){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},it(A)}function at(){var A,e,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 st(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(st(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,st(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,st(u,"constructor",c),st(c,"constructor",s),s.displayName="GeneratorFunction",st(c,o,"GeneratorFunction"),st(u),st(u,o,"Generator"),st(u,n,function(){return this}),st(u,"toString",function(){return"[object Generator]"}),(at=function(){return{w:r,m:d}})()}function st(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}st=function(A,e,t,n){function r(e,t){st(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},st(A,e,t,n)}function ct(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function lt(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function ut(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(t),!0).forEach(function(e){dt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):lt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function dt(A,e,t){return(e=gt(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function pt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,gt(n.key),n)}}function gt(A){var e=function(A){if("object"!=it(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=it(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==it(e)?e:e+""}function ht(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(ht=function(){return!!A})()}function ft(A){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},ft(A)}function mt(A,e){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},mt(A,e)}var vt=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=(A=function(A,e,t){return e=ft(e),function(A,e){if(e&&("object"==it(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,ht()?Reflect.construct(e,t||[],ft(A).constructor):e.apply(A,t))}(this,e)).readScriptTagConfig();return A.config=ut({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:t.appId||n.appId,agentId:t.agentId||n.agentId,conversationId:void 0!==t.conversationId?t.conversationId:A.getPersistedConversationId(),forceConversationId:t.forceConversationId,queue:[],inFlight:!1},t),A.fullResponseBuffer="",A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&mt(A,e)}(e,A),t=e,n=[{key:"readScriptTagConfig",value:function(){try{var A=Array.from(document.getElementsByTagName("script")).reverse().find(function(A){return A.dataset&&(A.dataset.appId||A.dataset.agentId)||A.src&&A.src.includes("agent-widget")});return A?{appId:A.dataset.appId,agentId:A.dataset.agentId}:{}}catch(A){return{}}}},{key:"buildWebSocketUrl",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.baseWsUrl,e=new URLSearchParams;return this.config.appId&&e.append("appId",this.config.appId),this.config.agentId&&e.append("agentId",this.config.agentId),this.config.conversationId&&e.append("conversationId",this.config.conversationId),"".concat(A,"?").concat(e.toString())}},{key:"sendMessage",value:(o=at().m(function A(e){var t=this;return at().w(function(A){for(;;)if(0===A.n)return A.a(2,new Promise(function(A,n){if(e&&e.trim())if(t.config.appId&&t.config.agentId){var o={text:e,resolve:A,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"))}))},A)}),r=function(){var A=this,e=arguments;return new Promise(function(t,n){var r=o.apply(A,e);function i(A){ct(r,t,n,i,a,"next",A)}function a(A){ct(r,t,n,i,a,"throw",A)}i(void 0)})},function(A){return r.apply(this,arguments)})},{key:"executeTask",value:function(A){var e=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:A.text},o=e.config.forceConversationId||e.config.conversationId;o&&(n.conversationId=o,e.config.forceConversationId&&!e.config.conversationId&&(e.config.conversationId=o,e.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",e.config.conversationId),t.send(JSON.stringify(n)),s=!0}catch(n){A.reject(n),e.emit("error",n);try{t.close()}catch(A){}}},u=function(A){return function(){e.config.conversationId?l(A):c=setTimeout(function(){return l(A)},200)}},d=function(t){return function(n){try{try{console.log("🔎 [TextChatSDK] WS <= raw:",n.data)}catch(A){}var o=JSON.parse(n.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",o)}catch(A){}if("hello"===o.type&&o.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",o.conversationId),e.config.conversationId=o.conversationId,e.persistConversationId(o.conversationId),e.emit&&e.emit("conversationIdChanged",o.conversationId),!s&&t&&1===t.readyState){if(c)try{clearTimeout(c)}catch(A){}l(t)}return}if(!e.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),e.config.conversationId=o.conversationId,e.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)e.fullResponseBuffer+=o.content,e.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!e.fullResponseBuffer&&(e.fullResponseBuffer=r)}catch(A){}!e.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),e.config.conversationId=o.conversationId),e.persistConversationId(e.config.conversationId),e.emit("done",{text:e.fullResponseBuffer}),A.resolve({conversationId:e.config.conversationId,fullText:e.fullResponseBuffer});try{t.close()}catch(A){}}else if("error"===o.type){var i=new Error(o.message||"Server error");e.emit("error",i),A.reject(i);try{t.close()}catch(A){}}}catch(A){}}},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,e.emit("domainError",n),A.reject(n),e.config.inFlight=!1,void e.drainQueue()}e.config.inFlight=!1,e.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(A){}var o=new WebSocket(i);return o.onopen=u(o),o.onmessage=d(o),o.onerror=function(t){e.emit("error",t),A.reject(t)},void(o.onclose=p)}e.emit("error",t),A.reject(t)}),g.onclose=p}},{key:"drainQueue",value:function(){if(0!==this.config.queue.length&&!this.config.inFlight){var A=this.config.queue.shift();this.executeTask(A)}}},{key:"persistConversationId",value:function(A){try{A&&localStorage.setItem("ttp_text_chat_conversation_id",A)}catch(A){}}},{key:"getPersistedConversationId",value:function(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(A){return null}}},{key:"updateConfig",value:function(A){this.config=ut(ut({},this.config),A)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&pt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(K);function Bt(A){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Bt(A)}function wt(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||bt(A,e)||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 yt(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=bt(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function bt(A,e){if(A){if("string"==typeof A)return Ct(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ct(A,e):void 0}}function Ct(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function Qt(){var A,e,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:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(xt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,xt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}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]"}),(Qt=function(){return{w:r,m:d}})()}function xt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}xt=function(A,e,t,n){function r(e,t){xt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},xt(A,e,t,n)}function Ft(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ut(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,St(n.key),n)}}function St(A){var e=function(A){if("object"!=Bt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Bt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Bt(e)?e:e+""}function kt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(kt=function(){return!!A})()}function Et(A){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Et(A)}function It(A,e){return It=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},It(A,e)}const Ht=new(function(A){function e(){var A;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=Et(e),function(A,e){if(e&&("object"==Bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,kt()?Reflect.construct(e,t||[],Et(A).constructor):e.apply(A,t))}(this,e)).connections=new Map,A.connectionCounts=new Map,A.creatingConnections=new Set,A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&It(A,e)}(e,A),t=e,n=[{key:"getConnection",value:(o=Qt().m(function A(e){var t,n,o=this;return Qt().w(function(A){for(;;)switch(A.n){case 0:if(!this.connections.has(e)){A.n=1;break}return t=this.connections.get(e),this.connectionCounts.set(e,(this.connectionCounts.get(e)||0)+1),A.a(2,t);case 1:if(!this.creatingConnections||!this.creatingConnections.has(e)){A.n=2;break}return A.a(2,new Promise(function(A){var t=function(){if(o.connections.has(e)){var n=o.connections.get(e);o.connectionCounts.set(e,(o.connectionCounts.get(e)||0)+1),A(n)}else setTimeout(t,50)};t()}));case 2:return this.creatingConnections.add(e),n=new WebSocket(e),this.connections.set(e,n),this.connectionCounts.set(e,1),n.addEventListener("open",function(A){o.creatingConnections.delete(e),o.emit("open",A,e)}),n.addEventListener("close",function(A){o.creatingConnections.delete(e),o.connections.delete(e),o.connectionCounts.delete(e),o.emit("close",A,e)}),n.addEventListener("error",function(A){o.creatingConnections.delete(e),o.emit("error",A,e)}),n.addEventListener("message",function(A){o.emit("message",A,e)}),A.a(2,n)}},A,this)}),r=function(){var A=this,e=arguments;return new Promise(function(t,n){var r=o.apply(A,e);function i(A){Ft(r,t,n,i,a,"next",A)}function a(A){Ft(r,t,n,i,a,"throw",A)}i(void 0)})},function(A){return r.apply(this,arguments)})},{key:"releaseConnection",value:function(A){if(this.connections.has(A)){var e=this.connectionCounts.get(A)||0,t=Math.max(0,e-1);if(this.connectionCounts.set(A,t),0===t){var n=this.connections.get(A);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"No more subscribers"),this.connections.delete(A),this.connectionCounts.delete(A)}}}},{key:"forceClose",value:function(A){if(this.connections.has(A)){var e=this.connections.get(A);e&&e.readyState===WebSocket.OPEN&&e.close(1e3,"Force close"),this.connections.delete(A),this.connectionCounts.delete(A)}}},{key:"getConnectionStatus",value:function(A){return this.connections.has(A)?{exists:!0,readyState:this.connections.get(A).readyState,subscribers:this.connectionCounts.get(A)||0}:{exists:!1,readyState:null,subscribers:0}}},{key:"getAllConnections",value:function(){var A,e={},t=yt(this.connections.entries());try{for(t.s();!(A=t.n()).done;){var n=wt(A.value,2),o=n[0],r=n[1];e[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(A){t.e(A)}finally{t.f()}return e}},{key:"clearAll",value:function(){var A,e=yt(this.connections.entries());try{for(e.s();!(A=e.n()).done;){var t=wt(A.value,2),n=(t[0],t[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(A){e.e(A)}finally{e.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&Ut(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(K));function Tt(A){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Tt(A)}function Dt(){var A,e,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 Ot(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Ot(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Ot(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Ot(u,"constructor",c),Ot(c,"constructor",s),s.displayName="GeneratorFunction",Ot(c,o,"GeneratorFunction"),Ot(u),Ot(u,o,"Generator"),Ot(u,n,function(){return this}),Ot(u,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:r,m:d}})()}function Ot(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Ot=function(A,e,t,n){function r(e,t){Ot(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Ot(A,e,t,n)}function Pt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Kt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Lt(n.key),n)}}function Lt(A){var e=function(A){if("object"!=Tt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Tt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Tt(e)?e:e+""}function Mt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Mt=function(){return!!A})()}function Rt(A){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Rt(A)}function _t(A,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},_t(A,e)}var jt=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=Rt(e),function(A,e){if(e&&("object"==Tt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,Mt()?Reflect.construct(e,t||[],Rt(A).constructor):e.apply(A,t))}(this,e)).config=A,t.ws=null,t.isConnected=!1,t.connectionId=null,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&_t(A,e)}(e,A),t=e,n=[{key:"connect",value:(r=Dt().m(function A(){var e=this;return Dt().w(function(A){for(;;)if(0===A.n)return A.a(2,new Promise(function(A,t){try{e.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),e.connectResolve=A,e.connectReject=t;var n=e.config.signedUrl||e.config.websocketUrl;Ht.getConnection(n,e.config).then(function(t){e.ws=t,e.setupEventListeners(),t.readyState===WebSocket.OPEN&&(e.isConnected=!0,e.emit("connected"),A(),e.connectResolve=null,e.connectReject=null)}).catch(function(A){console.error("🔌 WebSocketManager: Connection failed ".concat(e.connectionId),A),t(A),e.connectResolve=null,e.connectReject=null})}catch(A){console.error("🔌 WebSocketManager: Connection error ".concat(e.connectionId),A),t(A),e.connectResolve=null,e.connectReject=null}}))},A)}),i=function(){var A=this,e=arguments;return new Promise(function(t,n){var o=r.apply(A,e);function i(A){Pt(o,t,n,i,a,"next",A)}function a(A){Pt(o,t,n,i,a,"throw",A)}i(void 0)})},function(){return i.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var A=this;if(this.ws){var e=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.isConnected=!0,A.emit("connected"),A.connectResolve&&(A.connectResolve(),A.connectResolve=null,A.connectReject=null))},t=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.isConnected=!1,A.emit("disconnected",e))},n=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.emit("error",e),A.connectReject&&(A.connectReject(e),A.connectResolve=null,A.connectReject=null))},o=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&A.handleMessage(e)};Ht.on("open",e),Ht.on("close",t),Ht.on("error",n),Ht.on("message",o),this.eventHandlers={open:e,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(Ht.off("open",this.eventHandlers.open),Ht.off("close",this.eventHandlers.close),Ht.off("error",this.eventHandlers.error),Ht.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&Ht.releaseConnection(A),this.ws=null,this.isConnected=!1}},{key:"sendMessage",value:function(A){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(A))}catch(A){console.warn("🔌 WebSocketManager: Failed to send message:",A.message)}}},{key:"sendBinary",value:function(A){if(this.isConnected&&this.ws)try{this.ws.send(A)}catch(A){console.warn("🔌 WebSocketManager: Failed to send binary data:",A.message)}}},{key:"handleMessage",value:function(A){var e=this;if(A.data instanceof ArrayBuffer)this.emit("binaryAudio",A.data);else if(A.data instanceof Blob)A.data.arrayBuffer().then(function(A){e.emit("binaryAudio",A)}).catch(function(A){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",A)});else try{var t=JSON.parse(A.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(A){this.emit("error",A)}}},{key:"getStatus",value:function(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}}],o=[{key:"getSingletonStatus",value:function(){return Ht.getAllConnections()}},{key:"clearAllConnections",value:function(){Ht.clearAll()}}],n&&Kt(t.prototype,n),o&&Kt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(K);function Vt(A){return Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Vt(A)}function Nt(){var A,e,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 Gt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Gt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Gt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Gt(u,"constructor",c),Gt(c,"constructor",s),s.displayName="GeneratorFunction",Gt(c,o,"GeneratorFunction"),Gt(u),Gt(u,o,"Generator"),Gt(u,n,function(){return this}),Gt(u,"toString",function(){return"[object Generator]"}),(Nt=function(){return{w:r,m:d}})()}function Gt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Gt=function(A,e,t,n){function r(e,t){Gt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Gt(A,e,t,n)}function Wt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function zt(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Wt(r,n,o,i,a,"next",A)}function a(A){Wt(r,n,o,i,a,"throw",A)}i(void 0)})}}function Xt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Jt(n.key),n)}}function Jt(A){var e=function(A){if("object"!=Vt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Vt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Vt(e)?e:e+""}function Yt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Yt=function(){return!!A})()}function qt(A){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},qt(A)}function Zt(A,e){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Zt(A,e)}var $t=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=qt(e),function(A,e){if(e&&("object"==Vt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,Yt()?Reflect.construct(e,t||[],qt(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioQueue=[],t.isPlaying=!1,t.isProcessingQueue=!1,t.currentSource=null,t.audioContextReady=!1,t.initializeAudioContext().catch(function(){}),t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&Zt(A,e)}(e,A),t=e,n=[{key:"initializeAudioContext",value:(i=zt(Nt().m(function A(){var e,t,n,o,r,i;return Nt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.audioContext||"closed"===this.audioContext.state){A.n=1;break}return A.a(2);case 1:if(A.p=1,e=this.config.sampleRate||this.config.outputSampleRate||44100,t={sampleRate:e},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(t),"suspended"!==this.audioContext.state){A.n=2;break}return A.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(A){console.debug("AudioPlayer: AudioContext warmup skipped:",A)}this.audioContextReady=!0,A.n=4;break;case 3:A.p=3,i=A.v,console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",i),this.audioContextReady=!1;case 4:return A.a(2)}},A,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"playAudio",value:function(A){var e=this;try{var t=this.createAudioBlob(A);if(this.audioQueue.push(t),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return e.processQueue()},n)}}catch(A){this.emit("playbackError",A)}}},{key:"createAudioBlob",value:function(A){var e=new Uint8Array(A);if(e.length>=4){if(82===e[0]&&73===e[1]&&70===e[2]&&70===e[3])return new Blob([A],{type:"audio/wav"});if(255===e[0]&&!(224&~e[1]))return new Blob([A],{type:"audio/mpeg"});if(79===e[0]&&103===e[1]&&103===e[2]&&83===e[3])return new Blob([A],{type:"audio/ogg"})}return new Blob([A],{type:"audio/wav"})}},{key:"processQueue",value:(r=zt(Nt().m(function A(){var e,t,n,o,r,i,a,s,c=this;return Nt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){A.n=1;break}return A.a(2);case 1:if(this.isProcessingQueue=!0,e=this.audioQueue.shift()){A.n=2;break}return this.isProcessingQueue=!1,A.a(2);case 2:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext&&"closed"!==this.audioContext.state){A.n=3;break}return A.n=3,this.initializeAudioContext();case 3:if("suspended"!==(n=this.audioContext).state){A.n=5;break}return A.n=4,n.resume();case 4:if(!t){A.n=5;break}return A.n=5,new Promise(function(A){return setTimeout(A,10)});case 5:if("running"===n.state){A.n=7;break}if(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=7;break}return A.n=6,n.resume();case 6:return A.n=7,new Promise(function(A){return setTimeout(A,10)});case 7:return A.n=8,e.arrayBuffer();case 8:return o=A.v,A.n=9,n.decodeAudioData(o);case 9:r=A.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(),A.n=11;break;case 10:A.p=10,s=A.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 A.a(2)}},A,this,[[2,10]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"stopImmediate",value:function(){var A=this.isPlaying||null!==this.currentSource;if(this.currentSource){try{this.currentSource.stop()}catch(A){}this.currentSource=null}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],A&&this.emit("playbackStopped")}},{key:"resumeAudioContext",value:(o=zt(Nt().m(function A(){var e;return Nt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){A.n=2;break}return A.n=1,this.initializeAudioContext();case 1:return A.a(2);case 2:if("suspended"!==this.audioContext.state){A.n=6;break}return A.p=3,A.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer: AudioContext resumed after mic permission"),A.n=6;break;case 5:A.p=5,e=A.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",e);case 6:return A.a(2)}},A,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&&Xt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(K),An=t(540),en=t(848);function tn(A){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},tn(A)}function nn(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function on(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(t),!0).forEach(function(e){rn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function rn(A,e,t){return(e=function(A){var e=function(A){if("object"!=tn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=tn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==tn(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function an(){var A,e,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 sn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(sn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,sn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,sn(u,"constructor",c),sn(c,"constructor",s),s.displayName="GeneratorFunction",sn(c,o,"GeneratorFunction"),sn(u),sn(u,o,"Generator"),sn(u,n,function(){return this}),sn(u,"toString",function(){return"[object Generator]"}),(an=function(){return{w:r,m:d}})()}function sn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}sn=function(A,e,t,n){function r(e,t){sn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},sn(A,e,t,n)}function cn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function ln(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||function(A,e){if(A){if("string"==typeof A)return un(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?un(A,e):void 0}}(A,e)||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 un(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}const dn=function(A){var e=A.signedUrl,t=A.websocketUrl,n=A.agentId,o=A.appId,r=A.voice,i=void 0===r?"default":r,a=A.language,s=void 0===a?"en":a,c=A.autoReconnect,l=void 0===c||c,u=A.agentSettingsOverride,d=void 0===u?null:u,p=A.visualAssistant,g=void 0===p?null:p,h=A.onConnected,f=A.onDisconnected,m=A.onRecordingStarted,v=A.onRecordingStopped,B=A.onPlaybackStarted,w=A.onPlaybackStopped,y=A.onError,b=A.onMessage,C=A.onBargeIn,Q=A.onStopPlaying,x=A.onStartConversation,F=A.onEndConversation,U=A.className,S=void 0===U?"":U,k=A.style,E=void 0===k?{}:k,I=A.children,H=ln((0,An.useState)(!1),2),T=H[0],D=H[1],O=ln((0,An.useState)(!1),2),P=O[0],K=O[1],L=ln((0,An.useState)(!1),2),M=(L[0],L[1]),R=ln((0,An.useState)("Disconnected"),2),_=(R[0],R[1]),j=(0,An.useRef)(null);(0,An.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||e)),j.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),j.current.destroy(),j.current=null);var A=new rt({signedUrl:t||e,websocketUrl:t||e,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,visualAssistant:g,onStartConversation:x,onEndConversation:F});return A.on("connected",function(){D(!0),_("Connected"),null==h||h()}),A.on("disconnected",function(){D(!1),_("Disconnected"),null==f||f()}),A.on("recordingStarted",function(){K(!0),null==m||m()}),A.on("recordingStopped",function(){K(!1),null==v||v()}),A.on("playbackStarted",function(){M(!0),null==B||B()}),A.on("playbackStopped",function(){M(!1),null==w||w()}),A.on("error",function(A){null==y||y(A)}),A.on("message",function(A){null==b||b(A)}),A.on("bargeIn",function(A){null==C||C(A)}),A.on("stopPlaying",function(A){null==Q||Q(A)}),j.current=A,A.connect(),function(){var A=e||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),j.current&&(j.current.destroy(),j.current=null)}},[e,t,n,o,i,s,d,g]);var V=function(){var A,e=(A=an().m(function A(){var e;return an().w(function(A){for(;;)switch(A.p=A.n){case 0:if(j.current){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,j.current.toggleRecording();case 2:A.n=4;break;case 3:A.p=3,e=A.v,console.error("Error toggling recording:",e);case 4:return A.a(2)}},A,null,[[1,3]])}),function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){cn(r,n,o,i,a,"next",A)}function a(A){cn(r,n,o,i,a,"throw",A)}i(void 0)})});return function(){return e.apply(this,arguments)}}(),N=(0,en.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,en.jsx)("div",{style:{fontSize:"20px"},children:P?"🔴":"🎤"}),(0,en.jsx)("div",{children:P?"Stop Listening":"Start Listening"})]});return(0,en.jsx)("button",{className:"voice-button ".concat(P?"recording":""," ").concat(S),style:on({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:P?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},E),onClick:V,disabled:!T,children:I||N})};function pn(A){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},pn(A)}function gn(){var A,e,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 hn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(hn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,hn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,hn(u,"constructor",c),hn(c,"constructor",s),s.displayName="GeneratorFunction",hn(c,o,"GeneratorFunction"),hn(u),hn(u,o,"Generator"),hn(u,n,function(){return this}),hn(u,"toString",function(){return"[object Generator]"}),(gn=function(){return{w:r,m:d}})()}function hn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}hn=function(A,e,t,n){function r(e,t){hn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},hn(A,e,t,n)}function fn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function mn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){fn(r,n,o,i,a,"next",A)}function a(A){fn(r,n,o,i,a,"throw",A)}i(void 0)})}}function vn(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function Bn(A,e,t){return(e=yn(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function wn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,yn(n.key),n)}}function yn(A){var e=function(A){if("object"!=pn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=pn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==pn(e)?e:e+""}var bn=function(){return A=function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.options=function(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(t),!0).forEach(function(e){Bn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):vn(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}({websocketUrl:e.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:e.agentId,voice:e.voice||"default",language:e.language||"en",container:e.container||document.body,buttonText:e.buttonText||"Start Listening",buttonClass:e.buttonClass||"voice-button"},e),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1;var t=this.options.websocketUrl||this.options.signedUrl;this.voiceSDK=new rt({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()},e=[{key:"setupEventListeners",value:function(){var A=this;this.voiceSDK.on("connected",function(){var e,t;A.isConnected=!0,A.updateButton(),null===(e=(t=A.options).onConnected)||void 0===e||e.call(t)}),this.voiceSDK.on("disconnected",function(){var e,t;A.isConnected=!1,A.updateButton(),null===(e=(t=A.options).onDisconnected)||void 0===e||e.call(t)}),this.voiceSDK.on("recordingStarted",function(){var e,t;A.isRecording=!0,A.updateButton(),null===(e=(t=A.options).onRecordingStarted)||void 0===e||e.call(t)}),this.voiceSDK.on("recordingStopped",function(){var e,t;A.isRecording=!1,A.updateButton(),null===(e=(t=A.options).onRecordingStopped)||void 0===e||e.call(t)}),this.voiceSDK.on("playbackStarted",function(){var e,t;A.isPlaying=!0,null===(e=(t=A.options).onPlaybackStarted)||void 0===e||e.call(t)}),this.voiceSDK.on("playbackStopped",function(){var e,t;A.isPlaying=!1,null===(e=(t=A.options).onPlaybackStopped)||void 0===e||e.call(t)}),this.voiceSDK.on("error",function(e){var t,n;null===(t=(n=A.options).onError)||void 0===t||t.call(n,e)}),this.voiceSDK.on("message",function(e){var t,n;null===(t=(n=A.options).onMessage)||void 0===t||t.call(n,e)}),this.voiceSDK.on("bargeIn",function(e){var t,n;null===(t=(n=A.options).onBargeIn)||void 0===t||t.call(n,e)}),this.voiceSDK.on("stopPlaying",function(e){var t,n;null===(t=(n=A.options).onStopPlaying)||void 0===t||t.call(n,e)})}},{key:"createButton",value:function(){var A=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 A.toggleRecording()}),this.options.container.appendChild(this.button),this.updateButton()}},{key:"updateButton",value:function(){if(this.button){var A=this.isRecording?"🔴":"🎤",e=this.isRecording?"Stop Listening":"Start Listening";this.button.innerHTML='\n <span style="font-size: 20px;">'.concat(A,"</span>\n <span>").concat(e,"</span>\n "),this.button.disabled=!this.isConnected,this.button.style.backgroundColor=this.isRecording?"#dc3545":this.isConnected?"#007bff":"#6c757d"}}},{key:"connect",value:(n=mn(gn().m(function A(){var e;return gn().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,A.n=1,this.voiceSDK.connect();case 1:A.n=3;break;case 2:A.p=2,e=A.v,console.error("Failed to connect:",e);case 3:return A.a(2)}},A,this,[[0,2]])})),function(){return n.apply(this,arguments)})},{key:"toggleRecording",value:(t=mn(gn().m(function A(){var e;return gn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.voiceSDK){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,this.voiceSDK.toggleRecording();case 2:A.n=4;break;case 3:A.p=3,e=A.v,console.error("Error toggling recording:",e);case 4:return A.a(2)}},A,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(A){this.voiceSDK.updateConfig(A)}},{key:"destroy",value:function(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}],e&&wn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function Cn(){var A,e,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 Qn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Qn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Qn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Qn(u,"constructor",c),Qn(c,"constructor",s),s.displayName="GeneratorFunction",Qn(c,o,"GeneratorFunction"),Qn(u),Qn(u,o,"Generator"),Qn(u,n,function(){return this}),Qn(u,"toString",function(){return"[object Generator]"}),(Cn=function(){return{w:r,m:d}})()}function Qn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Qn=function(A,e,t,n){function r(e,t){Qn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Qn(A,e,t,n)}function xn(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||Un(A,e)||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 Fn(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Un(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Un(A,e){if(A){if("string"==typeof A)return Sn(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Sn(A,e):void 0}}function Sn(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function kn(A){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},kn(A)}function En(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function In(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){En(r,n,o,i,a,"next",A)}function a(A){En(r,n,o,i,a,"throw",A)}i(void 0)})}}function Hn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Tn(n.key),n)}}function Tn(A){var e=function(A){if("object"!=kn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=kn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==kn(e)?e:e+""}var Dn=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),console.log("🚀 AgentSDK v2.1.8 initialized with config:",e),this.config=e,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=function(){},this.onDisconnected=function(){},this.onError=function(A){return console.error("SDK Error:",A)},this.onTranscript=function(A){},this.onAgentSpeaking=function(A){},this.onConversationStart=e.onConversationStart||function(){},this.onConversationEnd=e.onConversationEnd||function(){},this.onBargeIn=e.onBargeIn||function(){},this.onAudioStartPlaying=e.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=e.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=e.onSubtitleDisplay||function(){}},e=[{key:"checkResumeBeforeConnect",value:function(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var A,e=this.config.visualAssistant||(null===(A=this.config.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant),t=new rt({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:e,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(A){return console.warn("⚠️ [AGENT SDK] Error checking resume:",A),this._resumeChecked=!0,this._resumeInfo=null,null}}},{key:"connect",value:(n=In(Cn().m(function A(e){var t,n,o,r,i,a,s,c,l=this;return Cn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,e){A.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 rt({signedUrl:e,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(A){if(l.isConnected=!1,A&&1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var e=new Error("DOMAIN_NOT_WHITELISTED");e.reason=A.reason,e.code=A.code,l.onError(e)}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(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",A)}l.onDisconnected()}),this.voiceSDK.on("domainError",function(A){l.onError(A)}),this.voiceSDK.on("error",function(A){l.onError(A)}),this.voiceSDK.on("message",function(A){l.handleWebSocketMessage(A)}),this.voiceSDK.on("recordingStarted",function(){if(l.isListening=!0,l.wasListening=!0,l.onConversationStart&&"function"==typeof l.onConversationStart)try{l.onConversationStart()}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",A)}}),this.voiceSDK.on("recordingStopped",function(){console.log("🎤 [AGENT SDK] recordingStopped event received");var A=l.isListening;if(l.isListening=!1,A&&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(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",A)}}),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(A){l.onBargeIn(A)}),this.voiceSDK.on("transcriptDisplay",function(A){console.log("📝 [AGENT SDK] transcriptDisplay event received:",A),A&&A.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",A.text),l.onTranscript&&"function"==typeof l.onTranscript?l.onTranscript(A.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",kn(l.onTranscript))),l.onSubtitleDisplay(A)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=Fn(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(A){o.e(A)}finally{o.f()}}return A.n=2,this.voiceSDK.connect();case 2:A.n=4;break;case 3:throw A.p=3,c=A.v,this.onError(c),c;case 4:return A.a(2)}},A,this,[[0,3]])})),function(A){return n.apply(this,arguments)})},{key:"handleWebSocketMessage",value:function(A){switch(A.t||A.type){case"connected":case"hello_ack":console.log("Session started successfully");break;case"user_transcript":this.onTranscript(A.user_transcription||A.text||A.transcript);break;case"agent_response":case"barge_in":case"stop_playing":default:break;case"error":this.onError(new Error(A.message||A.error||"Unknown error"))}}},{key:"startListening",value:(t=In(Cn().m(function A(){var e;return Cn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){A.n=6;break}return A.p=1,console.log("🎤 AgentSDK: Starting recording..."),A.n=2,this.voiceSDK.startRecording();case 2:A.v&&console.log("✅ AgentSDK: Recording started successfully"),A.n=5;break;case 3:if(A.p=3,!(e=A.v).isServerRejection&&"ServerRejected"!==e.name){A.n=4;break}throw e;case 4:throw console.error("❌ AgentSDK: Failed to start recording:",e),e;case 5:A.n=7;break;case 6:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 7:return A.a(2)}},A,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(A){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:A})}},{key:"disconnect",value:function(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}},{key:"registerToolHandler",value:function(A,e){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(A,e);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(A,e),console.log("🔧 AgentSDK: Queued tool handler '".concat(A,"' for registration after connect"))}},{key:"unregisterToolHandler",value:function(A){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(A);this._pendingToolHandlers&&this._pendingToolHandlers.delete(A)}},{key:"hasToolHandler",value:function(A){var e;return this.voiceSDK?this.voiceSDK.hasToolHandler(A):(null===(e=this._pendingToolHandlers)||void 0===e?void 0:e.has(A))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],e&&Hn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function On(){var A,e,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:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Pn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Pn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}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]"}),(On=function(){return{w:r,m:d}})()}function Pn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Pn=function(A,e,t,n){function r(e,t){Pn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Pn(A,e,t,n)}function Kn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ln(){var A=navigator.userAgent,e=/iPad|iPhone|iPod/.test(A)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,t=/Android/.test(A),n=/Mac/.test(A)&&!e,o=/Win/.test(A),r=/Chrome/.test(A)&&!/Edg|OPR/.test(A),i=/Safari/.test(A)&&!/Chrome/.test(A),a=/Firefox/.test(A),s=/Edg/.test(A),c=/SamsungBrowser/.test(A),l="unknown";e?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return e?u="ios":t?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:e,isAndroid:t,isMac:n,isWindows:o,isMobile:e||t,isDesktop:!e&&!t}}function Mn(){return Rn.apply(this,arguments)}function Rn(){var A;return A=On().m(function A(){var e;return On().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!navigator.permissions||!navigator.permissions.query){A.n=2;break}return A.n=1,navigator.permissions.query({name:"microphone"});case 1:return e=A.v,A.a(2,e.state);case 2:A.n=4;break;case 3:A.p=3,A.v,console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone");case 4:return A.a(2,"unknown")}},A,null,[[0,3]])}),Rn=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Kn(r,n,o,i,a,"next",A)}function a(A){Kn(r,n,o,i,a,"throw",A)}i(void 0)})},Rn.apply(this,arguments)}function _n(A){var e=A.platform,t=A.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"===e?n.ios:"android"===e?n["android_".concat(t)]||n.android_chrome:n["desktop_".concat(t)]||n.desktop_chrome}function jn(A){var e=A.isIOS,t=A.isAndroid,n=A.browser;if(e)try{return window.location.href="app-settings:",!0}catch(A){return console.warn("Could not open iOS settings:",A),!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(A){return console.warn("Could not open Android settings:",A),!1}return!1}function Vn(A){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Vn(A)}function Nn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Gn(n.key),n)}}function Gn(A){var e=function(A){if("object"!=Vn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Vn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Vn(e)?e:e+""}function Wn(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return zn(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?zn(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},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(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function zn(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}var Xn=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.overlay=null,this.modal=null},(e=[{key:"createOverlay",value:function(){var A=document.createElement("div");return A.className="mic-permission-overlay",A.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(),A}},{key:"injectStyles",value:function(){if(!document.getElementById("mic-permission-styles")){var A=document.createElement("style");A.id="mic-permission-styles",A.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(A)}}},{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)}}])&&Nn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function Jn(A,e){var t=new Xn,n=t.createOverlay(),o=Ln(),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(),A()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){t.close(),e()}),n.addEventListener("click",function(A){A.target===n&&(t.close(),e())}),t.show(),t}function Yn(A,e){var t,n,o,r=new Xn,i=r.createOverlay(),a=Ln(),s=_n(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(A){return'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(A,"</li>")}).join(""),"\n </ol>\n </div>\n "));var u=function(A){var e,t=A.platform,n=A.browser,o=document.getElementsByTagName("script"),r="",i=Wn(o);try{for(i.s();!(e=i.n()).done;){var a=e.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(A){var s=a.match(/^(.*\/)[^\/]+$/);if(s){r=s[1];break}}}}catch(A){i.e(A)}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=Wn(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(A){u.e(A)}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(A){return"<li>".concat(A,"</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(),A()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){jn(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(),A(),function(){var A=document.getElementById("mic-address-bar-hint");A&&A.remove(),Ln();var e,t=document.getElementsByTagName("script"),n="",o=Wn(t);try{for(o.s();!(e=o.n()).done;){var r=e.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(A){var i=r.match(/^(.*\/)[^\/]+$/);if(i){n=i[1];break}}}}catch(A){o.e(A)}finally{o.f()}if(!n||""===n||n.startsWith("/")){var a,s=Wn(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(A){s.e(A)}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(e){e.target===i&&(r.close(),A())}),r.show(),r}function qn(A){var e=new Xn,t=e.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),e.overlay=t,e.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){e.close(),A()}),t.addEventListener("click",function(n){n.target===t&&(e.close(),A())}),e.show(),e}function Zn(A){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Zn(A)}function $n(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Ao(n.key),n)}}function Ao(A){var e=function(A){if("object"!=Zn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Zn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Zn(e)?e:e+""}var eo=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config},(e=[{key:"t",value:function(A){return this.voiceInterface.t(A)}},{key:"getText",value:function(A,e){return this.voiceInterface.getText(A,e)}},{key:"getTooltip",value:function(A){return this.voiceInterface.getTooltip(A)}},{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(A,e){return'<div class="mobile-waveform-bar" data-index="'.concat(e,'"></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>')}}])&&$n(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function to(A){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},to(A)}function no(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,oo(n.key),n)}}function oo(A){var e=function(A){if("object"!=to(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=to(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==to(e)?e:e+""}var ro=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config},(e=[{key:"generateCSS",value:function(){var A=this.config.avatarBackgroundColor||"#667eea",e=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",t=this.config.statusTitleColor||"#1e293b",n=this.config.statusSubtitleColor||"#64748b",o=this.config.startCallButtonColor||"#667eea",r=this.config.startCallButtonTextColor||"#FFFFFF",i=this.config.transcriptBackgroundColor||"#FFFFFF",a=this.config.transcriptTextColor||"#1e293b",s=this.config.transcriptLabelColor||"#94a3b8",c=this.config.controlButtonColor||"#FFFFFF",l=this.config.controlButtonSecondaryColor||"#64748b",u=this.config.endCallButtonColor||"#ef4444",d=!1===this.config.useShadowDOM?" !important":"";return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(d,"; \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(d,'; }\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(e," 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(t,";\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(n,";\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(d,";\n height: clamp(48px, 8vh, 64px)").concat(d,";\n border-radius: clamp(24px, 4vh, 32px)").concat(d,";\n border: none").concat(d,";\n background: ").concat(o).concat(d,";\n color: ").concat(r).concat(d,";\n font-size: clamp(14px, 2.5vh, 18px)").concat(d,";\n font-weight: 600").concat(d,";\n cursor: pointer").concat(d,";\n display: flex").concat(d,";\n align-items: center").concat(d,";\n justify-content: center").concat(d,";\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(d,";\n visibility: visible").concat(d,";\n opacity: 1").concat(d,";\n width: auto").concat(d,";\n height: auto").concat(d,";\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(d,";\n opacity: 0.6").concat(d,";\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(r,";\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(i,";\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(s,";\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(a,";\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: #1e1b4b;\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: linear-gradient(135deg, #7c3aed, #a855f7);\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(d,";\n height: clamp(48px, 9vh, 72px)").concat(d,";\n min-width: clamp(48px, 9vh, 72px)").concat(d,";\n min-height: clamp(48px, 9vh, 72px)").concat(d,";\n max-width: clamp(48px, 9vh, 72px)").concat(d,";\n max-height: clamp(48px, 9vh, 72px)").concat(d,";\n aspect-ratio: 1").concat(d,";\n border-radius: 50%").concat(d,";\n border: none").concat(d,";\n cursor: pointer").concat(d,";\n display: flex").concat(d,";\n align-items: center").concat(d,";\n justify-content: center").concat(d,";\n transition: all 0.2s;\n position: relative").concat(d,";\n flex-shrink: 0;\n overflow: hidden").concat(d,";\n padding: 0").concat(d,";\n margin: 0").concat(d,";\n box-sizing: border-box").concat(d,";\n }\n \n .voice-control-btn svg {\n width: 48%").concat(d,";\n height: 48%").concat(d,";\n min-width: 48%").concat(d,";\n min-height: 48%").concat(d,";\n max-width: 48%").concat(d,";\n max-height: 48%").concat(d,";\n display: block").concat(d,";\n visibility: visible").concat(d,";\n opacity: 1").concat(d,";\n margin: 0").concat(d,";\n padding: 0").concat(d,";\n position: relative").concat(d,";\n flex-shrink: 0").concat(d,";\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px)").concat(d,";\n height: clamp(54px, 10vh, 80px)").concat(d,";\n min-width: clamp(54px, 10vh, 80px)").concat(d,";\n min-height: clamp(54px, 10vh, 80px)").concat(d,";\n max-width: clamp(54px, 10vh, 80px)").concat(d,";\n max-height: clamp(54px, 10vh, 80px)").concat(d,";\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)").concat(d,";\n color: white").concat(d,";\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: white").concat(d,";\n animation: recordingPulse 1.5s ease-in-out infinite;\n }\n \n .voice-control-btn.primary.active svg {\n fill: ").concat(u).concat(d,";\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 #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(c).concat(d,";\n color: ").concat(l).concat(d,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n width: clamp(48px, 9vh, 72px)").concat(d,";\n height: clamp(48px, 9vh, 72px)").concat(d,";\n min-width: clamp(48px, 9vh, 72px)").concat(d,";\n min-height: clamp(48px, 9vh, 72px)").concat(d,";\n max-width: clamp(48px, 9vh, 72px)").concat(d,";\n max-height: clamp(48px, 9vh, 72px)").concat(d,";\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc").concat(d,";\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6").concat(d,";\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(d,";\n height: 48%").concat(d,";\n display: block").concat(d,";\n visibility: visible").concat(d,";\n opacity: 1").concat(d,";\n margin: 0").concat(d,";\n padding: 0").concat(d,";\n position: relative").concat(d,";\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(e,' 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: #10b981;\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: #10b981;\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(e,");\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 .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: linear-gradient(135deg, #ef4444, #dc2626);\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: #1e1b4b;\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: #10b981;\n }\n \n .compact-status .status-dot {\n width: 5px;\n height: 5px;\n background: #10b981;\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 .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: linear-gradient(135deg, #ef4444, #dc2626);\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: #10b981;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n }\n \n .live-indicator .live-dot {\n width: 5px;\n height: 5px;\n background: #10b981;\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n .live-text-collapsed {\n font-size: 13px;\n color: #1e1b4b;\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: #1e1b4b;\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: #1e1b4b;\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-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-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 border-top: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .live-indicator {\n color: #34d399;\n }\n\n .live-indicator .live-dot {\n background: #34d399;\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: linear-gradient(135deg, ").concat(A,", ").concat(e,") !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(d),"\n ")}},{key:"_getSharedMobileCSS",value:function(A){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(A,";\n align-items: center").concat(A,";\n justify-content: center").concat(A,";\n width: 32px").concat(A,";\n height: 32px").concat(A,";\n min-width: 32px").concat(A,";\n min-height: 32px").concat(A,";\n max-width: 32px").concat(A,";\n max-height: 32px").concat(A,";\n border-radius: 50%").concat(A,";\n border: none").concat(A,";\n cursor: pointer").concat(A,";\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15)").concat(A,";\n position: relative").concat(A,";\n overflow: hidden").concat(A,";\n padding: 0").concat(A,";\n margin: 0").concat(A,";\n box-sizing: border-box").concat(A,";\n }\n\n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25)").concat(A,";\n }\n\n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3)").concat(A,";\n }\n\n .mobile-control-btn svg {\n position: absolute").concat(A,";\n top: 50%").concat(A,";\n left: 50%").concat(A,";\n transform: translate(-50%, -50%)").concat(A,";\n display: block").concat(A,";\n visibility: visible").concat(A,";\n opacity: 1").concat(A,";\n width: 15px").concat(A,";\n height: 15px").concat(A,";\n margin: 0").concat(A,";\n padding: 0").concat(A,";\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(A,";\n align-items: center").concat(A,";\n justify-content: center").concat(A,";\n width: 36px").concat(A,";\n height: 36px").concat(A,";\n min-width: 36px").concat(A,";\n min-height: 36px").concat(A,";\n max-width: 36px").concat(A,";\n max-height: 36px").concat(A,";\n border-radius: 50%").concat(A,";\n border: none").concat(A,";\n cursor: pointer").concat(A,";\n background-color: #ef4444").concat(A,";\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\n overflow: hidden").concat(A,";\n padding: 0").concat(A,";\n margin: 0").concat(A,";\n box-sizing: border-box").concat(A,";\n }\n\n .mobile-end-call-btn svg {\n display: block").concat(A,";\n visibility: visible").concat(A,";\n opacity: 1").concat(A,";\n width: 15px").concat(A,";\n height: 15px").concat(A,";\n margin: 0").concat(A,";\n padding: 0").concat(A,";\n position: relative").concat(A,";\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 A=!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(A),"\n ")}}])&&no(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function io(A){return io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},io(A)}function ao(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function so(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,co(n.key),n)}}function co(A){var e=function(A){if("object"!=io(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=io(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==io(e)?e:e+""}var lo=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config,this.conversationMessages=[],this.currentLiveMessage=null},(e=[{key:"t",value:function(A){return this.voiceInterface.t(A)}},{key:"escapeHtml",value:function(A){return this.voiceInterface.escapeHtml(A)}},{key:"updateTranscript",value:function(A){if(console.log("📝 [TRANSCRIPT] updateTranscript() called with text:",A?A.substring(0,50)+"...":"null/empty"),this.voiceInterface.isMobile){var e=document.getElementById("mobileTranscriptText");e&&(e.textContent=A),this.voiceInterface.messages.length>0&&"assistant"===this.voiceInterface.messages[this.voiceInterface.messages.length-1].type?this.voiceInterface.messages[this.voiceInterface.messages.length-1].text=A:this.voiceInterface.messages.push({type:"assistant",text:A});var t=document.getElementById("mobileMessagesContainer");if(t){var n=t.querySelector(".mobile-message-bubble.assistant:last-child");n?n.textContent=A:this.voiceInterface.addMobileMessage("assistant",A)}}else{var o=this.voiceInterface.shadowRoot.getElementById("liveTextCollapsed");if(o)if(A&&A.trim()){o.textContent=A,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(A&&A.trim()?(this.currentLiveMessage&&"assistant"===this.currentLiveMessage.role&&A.startsWith(this.currentLiveMessage.content)?this.currentLiveMessage.content=A:(this.currentLiveMessage&&this.finalizeLiveMessage(),this.currentLiveMessage={role:"assistant",content:A}),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 A=this.voiceInterface.shadowRoot.getElementById("desktopConversationPanel"),e=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),t=this.voiceInterface.shadowRoot.getElementById("conversationToggleText"),n=this.voiceInterface.shadowRoot.querySelector(".voice-interface");if(A){var o,r=this.voiceInterface.shadowRoot.getElementById("desktopVoiceSection"),i=this.voiceInterface.shadowRoot.getElementById("compactVoiceSection");this.voiceInterface.conversationExpanded?(A.classList.remove("collapsed"),A.classList.add("expanded"),e&&e.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()):(A.classList.remove("expanded"),A.classList.add("collapsed"),e&&e.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(A,e){if(!this.voiceInterface.isMobile&&e&&e.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==A)return this.currentLiveMessage={role:A,content:e},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:A,content:e}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}},{key:"updateLiveMessageRow",value:function(){var A=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),e=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),t=null==A?void 0:A.querySelector(".message-avatar");if(A&&e)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")),e.textContent=this.currentLiveMessage.content,A.style.display="flex";var n=e.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",e.querySelector(".typing-cursor")||e.appendChild(n)}else A.style.display="none"}},{key:"clearConversationMessages",value:function(){this.conversationMessages=[],this.currentLiveMessage=null;var A=this.voiceInterface.shadowRoot.getElementById("liveMessageRow");A&&(A.style.display="none")}},{key:"renderConversationMessages",value:function(){var A=this,e=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(e){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(e.innerHTML="");var t=function(A){return function(A){if(Array.isArray(A))return ao(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||function(A,e){if(A){if("string"==typeof A)return ao(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ao(A,e):void 0}}(A)||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)"),e.innerHTML=t.map(function(e){var t="user"===e.role;return'\n <div class="message-row '.concat(e.role,'">\n <div class="message-avatar ').concat(e.role,'">\n ').concat(t?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(A.escapeHtml(e.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")}}])&&so(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function uo(A){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},uo(A)}function po(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,go(n.key),n)}}function go(A){var e=function(A){if("object"!=uo(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=uo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==uo(e)?e:e+""}var ho=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config,this.shadowRoot=e.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null},e=[{key:"t",value:function(A){return this.voiceInterface.t(A)}},{key:"setupTextInjectAckHandler",value:function(){var A,e=this;null!==(A=this.voiceInterface.sdk)&&void 0!==A&&A.voiceSDK&&(this._textInjectAckHandler&&this.voiceInterface.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=function(A){e.handleTextInjectAck(A)},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(A){var e,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!==(e=n.value)&&void 0!==e&&e.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())),A.success){var a,s=null===(a=A.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=A.message||"Failed to send";this.voiceInterface.isMobile?this.showMobileTextInputStatus("error",u):this.showDesktopTextInputStatus("error",u)}}},{key:"sendDesktopTextMessage",value:function(){var A=this.shadowRoot.getElementById("voiceTextInput"),e=this.shadowRoot.getElementById("voiceSendBtn");if(A&&e){var t=A.value.trim();t&&this._sendTextMessage(t,A,e,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}},{key:"sendMobileTextMessage",value:function(){var A=document.getElementById("mobileTextInput"),e=document.getElementById("mobileSendBtn");A&&e?this._sendTextMessage(A.value,A,e,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}},{key:"_sendTextMessage",value:function(A,e,t,n){var o,r=this;if(this.voiceInterface.isActive&&null!==(o=this.voiceInterface.sdk)&&void 0!==o&&o.voiceSDK){var i=null==A?void 0:A.trim();if(i){e.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,e.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 e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(A){console.error("Error sending text message:",A),e.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(A,e,t){"mobile"===A?this.showMobileTextInputStatus(e,t):this.showDesktopTextInputStatus(e,t)}},{key:"showDesktopTextInputStatus",value:function(A,e){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"===A?(t.classList.add("voice-input-hint--sending"),t.textContent=e||"Sending..."):"success"===A?(t.classList.add("voice-input-hint--success"),t.textContent=e||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===A?(t.classList.add("voice-input-hint--queued"),t.textContent=e||"Queued"):"error"===A?(t.classList.add("voice-input-hint--error"),t.textContent=e||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===A&&(t.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}},{key:"showMobileTextInputStatus",value:function(A,e){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"===A?(t.classList.add("mobile-input-hint--sending"),t.textContent=e||"Sending..."):"success"===A?(t.classList.add("mobile-input-hint--success"),t.textContent=e||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===A?(t.classList.add("mobile-input-hint--queued"),t.textContent=e||"Queued"):"error"===A?(t.classList.add("mobile-input-hint--error"),t.textContent=e||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===A&&(t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}},{key:"clearTextInputStatusAfterDelay",value:function(){var A=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._statusClearTimeout&&clearTimeout(this._statusClearTimeout),this._statusClearTimeout=setTimeout(function(){A.showDesktopTextInputStatus("clear"),A._statusClearTimeout=null},e)}},{key:"clearMobileTextInputStatusAfterDelay",value:function(){var A=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._mobileStatusClearTimeout&&clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=setTimeout(function(){A.showMobileTextInputStatus("clear"),A._mobileStatusClearTimeout=null},e)}}],e&&po(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function fo(A){return fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},fo(A)}function mo(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,vo(n.key),n)}}function vo(A){var e=function(A){if("object"!=fo(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=fo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==fo(e)?e:e+""}var Bo=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config,this.shadowRoot=e.shadowRoot},e=[{key:"setupEventHandlers",value:function(A){var e=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 e.voiceInterface.startVoiceCall()}),n&&(n.onclick=function(){return e.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){return e.voiceInterface.toggleMute()}),r&&(r.onclick=function(){return e.voiceInterface.toggleSpeaker()}),i&&(i.onclick=function(){return e.voiceInterface.endVoiceCall()}),a&&(a.onclick=function(){return e.voiceInterface.toggleMute()}),s&&(s.onclick=function(){return e.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(A){"Enter"===A.key&&!A.shiftKey&&c.value.trim()&&(A.preventDefault(),l&&!l.disabled&&l.click())})),l&&(l.onclick=function(){e.voiceInterface.sendDesktopTextMessage()});var u=this.shadowRoot.getElementById("conversationHeader");u&&u.addEventListener("click",function(){e.voiceInterface.transcript.toggleConversationPanel()})}}},{key:"setupMobileEventHandlers",value:function(){var A=this;if(this.voiceInterface.isMobile){var e=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");e&&(e.onclick=function(){return A.voiceInterface.toggleMute()}),t&&(t.onclick=function(){return A.voiceInterface.toggleSpeaker()}),n&&(n.onclick=function(){return A.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){A.voiceInterface.expandMobileTranscript()}),r&&(r.onclick=function(){A.voiceInterface.collapseMobileTranscript()}),i&&(i.addEventListener("input",function(){a&&(a.disabled=!i.value.trim())}),i.addEventListener("keypress",function(A){"Enter"===A.key&&!A.shiftKey&&i.value.trim()&&(A.preventDefault(),a&&!a.disabled&&a.click())})),a&&(a.onclick=function(){A.voiceInterface.sendMobileTextMessage()})}}}],e&&mo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function wo(A){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},wo(A)}function yo(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,bo(n.key),n)}}function bo(A){var e=function(A){if("object"!=wo(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=wo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==wo(e)?e:e+""}var Co=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config,this.shadowRoot=e.shadowRoot,this._liveWaveformInterval=null},(e=[{key:"t",value:function(A){return this.voiceInterface.t(A)}},{key:"adjustSizesForContainer",value:function(){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e,t,n,o,r,i,a=A.clientHeight||A.offsetHeight||400,s=A.clientWidth||A.offsetWidth||400;a<=350?(e=80,t=80,n=48,o=54,r=6,i=12):a<=450?(e=100,t=100,n=56,o=62,r=8,i=14):a<=550?(e=120,t=120,n=64,o=70,r=10,i=16):a<=700?(e=140,t=140,n=72,o=78,r=12,i=18):(e=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(e,"px"),c.style.height="".concat(e,"px"),c.style.fontSize="".concat(.5*e,"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(A){A.style.width="".concat(n,"px"),A.style.height="".concat(n,"px");var e=A.querySelector("svg");if(e){var t=.65*n;e.style.setProperty("width","".concat(t,"px"),"important"),e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("min-width","".concat(t,"px"),"important"),e.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 Q=C.querySelector("svg");if(Q){var x=.7*o;Q.style.setProperty("width","".concat(x,"px"),"important"),Q.style.setProperty("height","".concat(x,"px"),"important"),Q.style.setProperty("min-width","".concat(x,"px"),"important"),Q.style.setProperty("min-height","".concat(x,"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 A=this.shadowRoot.getElementById("desktopWaveform");A&&(A.classList.remove("paused"),this.updateDesktopStatus())}}},{key:"stopDesktopWaveformAnimation",value:function(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopWaveform");A&&A.classList.add("paused")}}},{key:"updateDesktopStatus",value:function(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("compactStatusText")||this.shadowRoot.getElementById("desktopStatusText");if(A){var e=this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected");A.textContent=e;var t=this.shadowRoot.getElementById("desktopStatusText");t&&t!==A&&(t.textContent=e)}}}},{key:"updateLiveWaveform",value:function(A){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopLiveWaveform");e&&e.querySelectorAll(".desktop-live-bar").forEach(function(e,t){if(A){var n=40*Math.random()+8;e.style.height="".concat(n,"px")}else e.style.height="8px"})}}},{key:"showError",value:function(A){var e=this.shadowRoot.getElementById("transcriptText");e&&(e.textContent="".concat(this.t("error"),": ").concat(A),e.classList.remove("empty"))}},{key:"showDomainError",value:function(){var A=this;console.log("🚫 Showing domain error in widget UI...");var e=this.shadowRoot.getElementById("voiceIdleState");if(e){var t=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.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=e.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=e.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(a,s.nextSibling):n&&n.parentNode?n.parentNode.insertBefore(a,n.nextSibling):e.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"),A.voiceInterface.isShowingDomainError=!1,A.voiceInterface.resetConnectingState(),a&&a.parentNode&&a.parentNode.removeChild(a),A.voiceInterface.config.onShowLanding&&"function"==typeof A.voiceInterface.config.onShowLanding&&A.voiceInterface.config.onShowLanding()},console.log("✅ Created domain error back button")}e.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 A=this.shadowRoot.getElementById("transcriptText"),e=this.shadowRoot.getElementById("liveTextCollapsed");if(A){var t=A.textContent,n=A.innerHTML;A.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 ',A.classList.remove("empty"),setTimeout(function(){A&&(A.innerHTML=n,A.textContent=t,t&&""!==t.trim()||A.classList.add("empty"))},5e3)}else if(e){var o=e.textContent;e.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(){e&&(e.textContent=o)},5e3)}}},{key:"startLiveWaveformInterval",value:function(){var A=this;this.voiceInterface.isMobile||(this._liveWaveformInterval&&clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=setInterval(function(){A.updateLiveWaveform(A.voiceInterface.isActive&&!A.voiceInterface.isMicMuted)},100))}},{key:"stopLiveWaveformInterval",value:function(){this._liveWaveformInterval&&(clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=null)}},{key:"cleanup",value:function(){this.stopLiveWaveformInterval(),this.stopDesktopWaveformAnimation()}}])&&yo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function Qo(A){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Qo(A)}function xo(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Fo(n.key),n)}}function Fo(A){var e=function(A){if("object"!=Qo(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Qo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Qo(e)?e:e+""}var Uo=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.voiceInterface=e,this.config=e.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])},(e=[{key:"t",value:function(A){return this.voiceInterface.t(A)}},{key:"createMobileMinimizedBar",value:function(){var A=document.getElementById("mobile-voice-call-bar-container");if(A&&A.remove(),!document.getElementById("mobile-voice-call-bar-styles")){var e=document.createElement("style");e.id="mobile-voice-call-bar-styles",e.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(e)}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(A,e){return'<div class="mobile-waveform-bar" data-index="'.concat(e,'"></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 A=document.getElementById("mobile-voice-call-bar-container");A&&A.remove()}},{key:"expandMobileTranscript",value:function(){var A=document.getElementById("mobileTranscriptOverlay");if(A){A.style.display="flex",this.isTranscriptExpanded=!0;var e=document.getElementById("mobileTextInput");e&&setTimeout(function(){return e.focus()},100);var t=document.getElementById("mobileMessagesContainer");t&&setTimeout(function(){t.scrollTop=t.scrollHeight},100)}}},{key:"collapseMobileTranscript",value:function(){var A=document.getElementById("mobileTranscriptOverlay");A&&(A.style.display="none",this.isTranscriptExpanded=!1)}},{key:"updateMobileStatus",value:function(A){var e=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(e||t){var o="",r="#6b7280";"listening"===A||"recording"===A?(o=this.t("listening")||"Listening...",r="#22c55e"):"speaking"===A?(o=this.t("speaking")||"Speaking...",r="#a855f7"):(o=this.t("paused")||"Paused",r="#facc15"),e&&(e.textContent=o),t&&(t.textContent=o),n&&(n.style.backgroundColor=r,n.style.boxShadow="paused"===A?"none":"0 0 8px ".concat(r))}}},{key:"addMobileMessage",value:function(A,e){this.voiceInterface.messages.push({type:A,text:e});var t=document.getElementById("mobileMessagesContainer");if(t){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(A),n.textContent=e,t.appendChild(n),t.scrollTop=t.scrollHeight}}},{key:"startWaveformAnimation",value:function(){this.waveformInterval&&clearInterval(this.waveformInterval);var A=document.getElementById("mobileWaveform");A&&(this.waveformInterval=setInterval(function(){A.querySelectorAll(".mobile-waveform-bar").forEach(function(A,e){var t=60*Math.random()+10;A.style.height="".concat(t,"px")})},100))}},{key:"stopWaveformAnimation",value:function(){this.waveformInterval&&(clearInterval(this.waveformInterval),this.waveformInterval=null);var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(function(A){A.style.height="10px"})}},{key:"cleanup",value:function(){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.voiceInterface.messages=[]}}])&&xo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function So(A){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},So(A)}function ko(){var A,e,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 Eo(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Eo(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Eo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Eo(u,"constructor",c),Eo(c,"constructor",s),s.displayName="GeneratorFunction",Eo(c,o,"GeneratorFunction"),Eo(u),Eo(u,o,"Generator"),Eo(u,n,function(){return this}),Eo(u,"toString",function(){return"[object Generator]"}),(ko=function(){return{w:r,m:d}})()}function Eo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Eo=function(A,e,t,n){function r(e,t){Eo(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Eo(A,e,t,n)}function Io(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ho(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Io(r,n,o,i,a,"next",A)}function a(A){Io(r,n,o,i,a,"throw",A)}i(void 0)})}}function To(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Do(n.key),n)}}function Do(A){var e=function(A){if("object"!=So(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=So(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==So(e)?e:e+""}var Oo=function(){return A=function A(e){var t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=e.shadowRoot||document,this.textSDK=e.textSDK||null,this.deviceInfo=Ln(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=e.visualAssistant||(null===(t=e.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);this.sdk=new Dn({agentId:e.agentId,appId:e.appId,signedUrl:e.signedUrl,agentSettingsOverride:e.agentSettingsOverride,visualAssistant:n,variables:e.variables||{},language:e.language||"en",outputContainer:e.outputContainer,outputEncoding:e.outputEncoding,outputSampleRate:e.outputSampleRate,outputChannels:e.outputChannels,outputBitDepth:e.outputBitDepth,onConversationStart:e.onConversationStart,onConversationEnd:e.onConversationEnd,onBargeIn:e.onBargeIn,onAudioStartPlaying:e.onAudioStartPlaying,onAudioStoppedPlaying:e.onAudioStoppedPlaying,onSubtitleDisplay:e.onSubtitleDisplay}),this.templates=new eo(this),this.styles=new ro(this),this.transcript=new lo(this),this.textHandlers=new ho(this),this.handlers=new Bo(this),this.desktop=new Co(this),this.mobile=new Uo(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()},e=[{key:"getVoiceSDK",value:function(){var A;return(null===(A=this.sdk)||void 0===A?void 0:A.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 A=this.sdk.checkResumeBeforeConnect();return this._resumeInfo=A,A?(console.log("🔄 [WIDGET] Auto-resuming call:",A),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.config.onResume&&this.config.onResume(A),A):null}},{key:"setupSDKEventHandlers",value:function(){var A=this;this.sdk.onTranscript=function(e){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",e),A.updateTranscript(e)},this.sdk.onAgentSpeaking=function(e){var t=A.shadowRoot.getElementById("voiceAvatarActive");t&&(e?(t.classList.add("speaking"),A.isMobile?(A.updateMobileStatus("speaking"),A.startWaveformAnimation()):(A.updateDesktopStatus(),A.startDesktopWaveformAnimation())):(t.classList.remove("speaking"),A.isMobile?(A.updateMobileStatus("listening"),A.startWaveformAnimation()):(A.updateDesktopStatus(),A.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var e=Ho(ko().m(function e(t){return ko().w(function(e){for(;;)switch(e.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"))){e.n=2;break}return console.error("❌ Domain not whitelisted - WebSocket closed:",t.code,t.reason),e.n=1,A.endCallOnServerRejection();case 1:e.n=3;break;case 2:A.isActive&&(A.isActive=!1,A.endVoiceCall());case 3:return e.a(2)}},e)}));return function(A){return e.apply(this,arguments)}}(),this.sdk.onError=function(){var e=Ho(ko().m(function e(t){return ko().w(function(e){for(;;)switch(e.n){case 0:if(!t||!("DOMAIN_NOT_WHITELISTED"===t.message||t.message&&t.message.includes("Domain not whitelisted"))){e.n=2;break}return console.error("❌ Voice SDK Error: Domain not whitelisted:",t),e.n=1,A.endCallOnServerRejection();case 1:return e.a(2);case 2:if(!t.isServerRejection&&"ServerRejected"!==t.name){e.n=3;break}return e.a(2);case 3:console.error("❌ Voice SDK Error:",t),A.showError(t.message||t);case 4:return e.a(2)}},e)}));return function(A){return e.apply(this,arguments)}}()}},{key:"setupTextInjectAckHandler",value:function(){return this.textHandlers.setupTextInjectAckHandler()}},{key:"handleTextInjectAck",value:function(A){return this.textHandlers.handleTextInjectAck(A)}},{key:"sendDesktopTextMessage",value:function(){return this.textHandlers.sendDesktopTextMessage()}},{key:"sendMobileTextMessage",value:function(){return this.textHandlers.sendMobileTextMessage()}},{key:"t",value:function(A){var e,t,n=this.config.language||"en";return((null===(e=this.config.translations)||void 0===e?void 0:e[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[A]||A}},{key:"getText",value:function(A,e){return void 0!==this.config[A]&&null!==this.config[A]?this.config[A]:this.t(e)}},{key:"getTooltip",value:function(A){var e,t=null===(e=this.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[A]||""}},{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(A){return this.handlers.setupEventHandlers(A)}},{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(A){return this.desktop.updateLiveWaveform(A)}},{key:"showError",value:function(A){return this.desktop.showError(A)}},{key:"showDomainError",value:function(){return this.desktop.showDomainError()}},{key:"startVoiceCall",value:(o=Ho(ko().m(function A(){var e,t=this;return ko().w(function(A){for(;;)switch(A.n){case 0:if(!this.isActive){A.n=1;break}return console.log("⚠️ Voice call already active"),A.a(2);case 1:return console.log("🎤 Starting voice call..."),A.n=2,Mn();case 2:if(e=A.v,console.log("📋 Current permission state: ".concat(e)),"denied"!==e){A.n=3;break}throw console.log("🚫 Permission is denied, showing blocked modal..."),this.resetConnectingState(),Ln(),Yn(function(){console.log("Blocked modal closed")}),new Error("Microphone permission denied");case 3:if("prompt"!==e&&"unknown"!==e){A.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),A.a(2,new Promise(function(A,e){Jn(Ho(ko().m(function n(){var o;return ko().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:A(),n.n=4;break;case 3:n.p=3,o=n.v,e(o);case 4:return n.a(2)}},n,null,[[1,3]])})),function(){console.log("❌ Pre-prompt cancelled"),t.resetConnectingState(),e(new Error("Call cancelled by user"))})}));case 4:return A.n=5,this.proceedWithVoiceCall();case 5:return A.a(2)}},A,this)})),function(){return o.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(n=Ho(ko().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,Q,x,F,U,S,k,E,I,H,T,D,O,P,K,L,M,R,_,j=this;return ko().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.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,e=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"),e&&(e.classList.remove("expanded"),e.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){A.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..."),A.p=1,l=this.config.outputSampleRate||44100,A.n=2,navigator.mediaDevices.getUserMedia({audio:{sampleRate:l,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 2:A.v.getTracks().forEach(function(A){return A.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)")),A.n=4;break;case 3:return A.p=3,K=A.v,console.error("❌ Mobile: Permission denied before connecting:",K),this.resetConnectingState(),(p=this.shadowRoot.getElementById("voiceIdleState"))&&(p.style.display="flex"),(g=this.shadowRoot.getElementById("text-chat-panel"))?g.style.display="":(h=document.getElementById("text-chat-panel"))&&(h.style.display=""),Ln(),Yn(function(){j.resetUIState()}),A.a(2);case 4:A.n=6;break;case 5:this.resetConnectingState(),f=this.shadowRoot.getElementById("voiceIdleState"),m=this.shadowRoot.getElementById("voiceActiveState"),f&&(f.style.display="none"),m&&(m.style.display="flex");case 6:if(v=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return j.adjustSizesForContainer()},50),v&&(v.scrollTop=0),B=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)){A.n=7;break}throw new Error("signedUrl or agentId+appId required for voice calls");case 7:if(console.log("🔗 Got signed URL:",B),!this.sdk||!this.sdk.isConnected){A.n=11;break}return console.log("🔄 SDK already connected, disconnecting for clean retry..."),A.p=8,this.sdk.disconnect(),A.n=9,new Promise(function(A){return setTimeout(A,100)});case 9:A.n=11;break;case 10:A.p=10,L=A.v,console.warn("Warning: Error disconnecting existing connection:",L);case 11:return A.n=12,this.sdk.connect(B);case 12:w=A.v,console.log("✅ Connected to WebSocket, connected:",w),this.setupTextInjectAckHandler(),y=!1,b=this.sdk.onError,C=this.sdk.onDisconnected,this.sdk.onError=function(A){A&&("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))&&(y=!0,console.log("🚫 Server rejected connection before starting audio capture")),b&&b.call(j.sdk,A)},this.sdk.onDisconnected=function(A){A&&1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))&&(y=!0,console.log("🚫 Server disconnected due to domain error before starting audio capture")),C&&C.call(j.sdk,A)},Q=0;case 13:if(!(Q<50)){A.n=17;break}if(!y){A.n=14;break}throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 14:if(!this.sdk.isConnected){A.n=15;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=15;break}return A.a(3,17);case 15:return A.n=16,new Promise(function(A){return setTimeout(A,100)});case 16:Q++,A.n=13;break;case 17:if(!y){A.n=18;break}throw this.sdk.onError=b,this.sdk.onDisconnected=C,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){A.n=19;break}throw this.sdk.onError=b,this.sdk.onDisconnected=C,console.warn("⚠️ Connection lost before starting audio capture"),new Error("Connection lost before starting audio capture");case 19:if(this.sdk.onError=b,this.sdk.onDisconnected=C,!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=30;break}return console.log("✅ WebSocket ready, starting listening..."),A.p=20,A.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){A.n=26;break}if(null===(x=this.sdk.voiceSDK)||void 0===x||!x.isRecording){A.n=25;break}return A.p=22,A.n=23,this.sdk.voiceSDK.stopRecording();case 23:A.n=25;break;case 24:A.p=24,A.v;case 25:throw(F=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",F.isServerRejection=!0,F;case 26:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(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()),A.n=29;break;case 27:if(A.p=27,!(M=A.v).isServerRejection&&"ServerRejected"!==M.name){A.n=28;break}throw this.resetConnectingState(),M;case 28:throw console.error("❌ Failed to start listening - permission denied or error:",M),this.resetConnectingState(),this.isMobile&&((U=this.shadowRoot.getElementById("voiceIdleState"))&&(U.style.display="flex"),(S=this.shadowRoot.getElementById("text-chat-panel"))?S.style.display="":(k=document.getElementById("text-chat-panel"))&&(k.style.display=""),(E=this.shadowRoot.getElementById("text-chat-button"))?E.style.display="":(I=document.getElementById("text-chat-button"))&&(I.style.display="")),M;case 29:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-j.callStartTime,e=Math.floor(A/6e4),t=Math.floor(A%6e4/1e3),n="".concat(e.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0")),o=j.shadowRoot.getElementById("voiceTimer");o&&(o.textContent=n);var r=j.shadowRoot.getElementById("compactTimerText"),i=j.shadowRoot.getElementById("desktopTimerText"),a=r||i;if(a&&(a.textContent=n),j.isMobile){var s=document.getElementById("mobileDurationText"),c=document.getElementById("mobileHeaderDuration");s&&(s.textContent=n),c&&(c.textContent=n)}},1e3),A.n=38;break;case 30:if(!y){A.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){A.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..."),A.p=33,A.n=34,this.sdk.startListening();case 34:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(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()),A.n=37;break;case 35:if(A.p=35,!(R=A.v).isServerRejection&&"ServerRejected"!==R.name){A.n=36;break}throw this.resetConnectingState(),R;case 36:throw console.error("❌ Failed to start listening - permission denied or error:",R),this.resetConnectingState(),this.isMobile&&((H=this.shadowRoot.getElementById("voiceIdleState"))&&(H.style.display="flex"),(T=this.shadowRoot.getElementById("text-chat-panel"))?T.style.display="":(D=document.getElementById("text-chat-panel"))&&(D.style.display=""),(O=this.shadowRoot.getElementById("text-chat-button"))?O.style.display="":(P=document.getElementById("text-chat-button"))&&(P.style.display="")),R;case 37:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-j.callStartTime,e=Math.floor(A/6e4),t=Math.floor(A%6e4/1e3),n="".concat(e.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0")),o=j.shadowRoot.getElementById("voiceTimer");o&&(o.textContent=n);var r=j.shadowRoot.getElementById("compactTimerText"),i=j.shadowRoot.getElementById("desktopTimerText"),a=r||i;if(a&&(a.textContent=n),j.isMobile){var s=document.getElementById("mobileDurationText"),c=document.getElementById("mobileHeaderDuration");s&&(s.textContent=n),c&&(c.textContent=n)}},1e3);case 38:console.log("✅ Voice call started successfully"),A.n=44;break;case 39:if(A.p=39,(_=A.v).isServerRejection||"ServerRejected"===_.name||console.error("❌ Error starting voice call:",_),this.resetConnectingState(),this.isActive=!1,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&this.sdk.isConnected)try{this.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on error:",A)}if("NotAllowedError"!==_.name&&"PermissionDeniedError"!==_.name){A.n=40;break}Ln(),Yn(function(){j.resetUIState()}),A.n=44;break;case 40:if("NotFoundError"!==_.name&&"DevicesNotFoundError"!==_.name){A.n=41;break}qn(function(){j.resetUIState()}),A.n=44;break;case 41:if(!_||!("DOMAIN_NOT_WHITELISTED"===_.message||_.message&&_.message.includes("Domain not whitelisted"))){A.n=43;break}return A.n=42,this.endCallOnServerRejection();case 42:A.n=44;break;case 43:this.showError(_.message||_),this.resetUIState();case 44:return A.a(2)}},A,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 A=this.shadowRoot.getElementById("text-chat-panel");if(A)A.style.display="";else{var e=document.getElementById("text-chat-panel");e&&(e.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=Ho(ko().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m;return ko().w(function(A){for(;;)switch(A.p=A.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"),e=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("landingScreen"),e&&(e.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){A.n=22;break}if(A.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)){A.n=19;break}if(console.log("🛑 Stopping audio capture/VAD..."),null==r||!r.audioWorkletNode){A.n=5;break}return console.log("🛑 Sending stop message to AudioWorklet to stop VAD..."),A.p=2,r.audioWorkletNode.port.postMessage({type:"stop"}),A.n=3,new Promise(function(A){return setTimeout(A,150)});case 3:A.n=5;break;case 4:A.p=4,p=A.v,console.warn("Error sending stop message to AudioWorklet:",p);case 5:if(!this.sdk.voiceSDK||"function"!=typeof this.sdk.voiceSDK.stopRecording){A.n=10;break}return A.p=6,A.n=7,this.sdk.voiceSDK.stopRecording();case 7:console.log("✅ stopRecording() completed"),A.n=9;break;case 8:A.p=8,g=A.v,console.warn("Error calling stopRecording:",g);case 9:A.n=14;break;case 10:if(!this.sdk.stopListening){A.n=14;break}return A.p=11,this.sdk.stopListening(),A.n=12,new Promise(function(A){return setTimeout(A,200)});case 12:A.n=14;break;case 13:A.p=13,h=A.v,console.warn("Error calling stopListening:",h);case 14:if(!r||"function"!=typeof r.stop){A.n=18;break}return A.p=15,A.n=16,r.stop();case 16:console.log("✅ AudioRecorder.stop() completed"),A.n=18;break;case 17:A.p=17,f=A.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(A){"ended"!==A.readyState&&(A.stop(),console.log("✅ Force stopped track:",A.kind))})),this.audioStream&&(console.log("🛑 Stopping stored audio stream..."),this.audioStream.getTracks().forEach(function(A){"ended"!==A.readyState&&A.stop()}),this.audioStream=null),this.sdk.hangup(),A.n=21;break;case 20:A.p=20,m=A.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(A){return A.stop()}),this.audioStream&&(this.audioStream.getTracks().forEach(function(A){return A.stop()}),this.audioStream=null)}catch(A){console.warn("Error force-stopping media streams:",A)}case 21:if(this.sdk.isConnected)try{this.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on server rejection:",A)}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 A.a(2)}},A,this,[[15,17],[11,13],[6,8],[2,4],[1,20]])})),function(){return t.apply(this,arguments)})},{key:"endVoiceCall",value:function(){var A,e=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(A){return A.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!==(A=this.sdk)&&void 0!==A&&A.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"),this.config.onCallEnd)this.config.onCallEnd();else{var a=this.shadowRoot.getElementById("voiceIdleState");a&&(a.style.display="flex"),setTimeout(function(){return e.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 A=this.shadowRoot.getElementById("voiceIdleState"),e=this.shadowRoot.getElementById("voiceActiveState");if(A){var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.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")))}}A.style.display="flex"}e&&(e.style.display="none")}},{key:"resetConnectingState",value:function(){if(this.isShowingDomainError)console.log("🚫 resetConnectingState() called but domain error is displayed - skipping reset");else{var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var e=A.querySelector("#domainErrorBackBtn");e&&e.parentNode&&e.parentNode.removeChild(e);var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.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(A){return this.transcript.updateTranscript(A)}},{key:"toggleConversationPanel",value:function(){return this.transcript.toggleConversationPanel()}},{key:"addConversationMessage",value:function(A,e){return this.transcript.addConversationMessage(A,e)}},{key:"renderConversationMessages",value:function(){return this.transcript.renderConversationMessages()}},{key:"escapeHtml",value:function(A){var e=document.createElement("div");return e.textContent=A,e.innerHTML}},{key:"toggleMute",value:function(){if(this.sdk&&this.isActive){var A=null;if(this.sdk.voiceSDK&&this.sdk.voiceSDK.audioRecorder&&this.sdk.voiceSDK.audioRecorder.mediaStream&&(A=this.sdk.voiceSDK.audioRecorder.mediaStream.getAudioTracks()[0]),!A&&this.audioStream&&(A=this.audioStream.getAudioTracks()[0]),A){A.enabled=!A.enabled,this.isMicMuted=!A.enabled;var e=this.shadowRoot.getElementById("desktopMuteBtn"),t=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),e){var n=e.querySelector(".desktop-mic-icon"),o=e.querySelector(".desktop-mic-off-icon");n&&o&&(A.enabled?(e.classList.remove("muted"),n.style.display="block",o.style.display="none"):(e.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&&(A.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&&(A.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(A.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 A=this.shadowRoot.getElementById("desktopSpeakerBtn"),e=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(A){var t=A.querySelector(".desktop-speaker-icon"),n=A.querySelector(".desktop-speaker-off-icon");t&&n&&(this.isSpeakerMuted?(A.classList.add("muted"),t.style.display="none",n.style.display="block"):(A.classList.remove("muted"),t.style.display="block",n.style.display="none"))}if(e){var o=e.querySelector(".desktop-speaker-icon"),r=e.querySelector(".desktop-speaker-off-icon");o&&r&&(this.isSpeakerMuted?(e.classList.add("muted"),o.style.display="none",r.style.display="block"):(e.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(A){return this.mobile.updateMobileStatus(A)}},{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(A,e){return this.mobile.addMobileMessage(A,e)}},{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(A){return A.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}],e&&To(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o}();function Po(A){return Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Po(A)}function Ko(){var A,e,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 Lo(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Lo(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Lo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Lo(u,"constructor",c),Lo(c,"constructor",s),s.displayName="GeneratorFunction",Lo(c,o,"GeneratorFunction"),Lo(u),Lo(u,o,"Generator"),Lo(u,n,function(){return this}),Lo(u,"toString",function(){return"[object Generator]"}),(Ko=function(){return{w:r,m:d}})()}function Lo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Lo=function(A,e,t,n){function r(e,t){Lo(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Lo(A,e,t,n)}function Mo(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ro(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Mo(r,n,o,i,a,"next",A)}function a(A){Mo(r,n,o,i,a,"throw",A)}i(void 0)})}}function _o(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,jo(n.key),n)}}function jo(A){var e=function(A){if("object"!=Po(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Po(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Po(e)?e:e+""}var Vo=function(){return A=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.sdk=t,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=e.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},e=[{key:"t",value:function(A){var e,t,n=this.config.language||"en";return((null===(e=this.config.translations)||void 0===e?void 0:e[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[A]||A}},{key:"generateHTML",value:function(){var A,e,t,n,o,r,i,a,s,c=this.config.inputPlaceholder||(null===(A=this.config.panel)||void 0===A?void 0:A.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!==(e=this.config.sendButtonHint)&&void 0!==e&&e.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 A,e,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===(A=this.config.panel)||void 0===A?void 0:A.sendButtonColor)||"#7C3AED"),h=this.config.sendButtonHoverColor||(null===(e=this.config.panel)||void 0===e?void 0:e.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",Q=!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(Q,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(Q,"; }\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; \n max-width: 80%; \n font-size: ").concat(p.fontSize,"; \n color: ").concat(p.textColor,"; \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 { \n background: ").concat(p.userBackgroundColor,"; \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n background: ").concat(p.agentBackgroundColor,"; \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 A=this,e=this.shadowRoot.getElementById("sendButton"),t=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(e&&(e.onclick=function(){return A.sendMessage()}),n&&(n.onclick=function(){return A.startNewChat()}),this.updateInputAttributes(),t){t.style.height="32px",t.style.overflow="hidden";var o=function(){t.style.height="auto";var A=Math.min(t.scrollHeight,120);t.style.height=A+"px",t.style.overflowY=A>=120?"auto":"hidden",A>=120&&setTimeout(function(){t.scrollTop=t.scrollHeight},0)};t.addEventListener("input",o),t.addEventListener("keydown",function(e){"Enter"!==e.key||e.shiftKey?"Enter"===e.key&&e.shiftKey&&setTimeout(o,0):(e.preventDefault(),A.sendMessage())})}}},{key:"startNewChat",value:function(){try{localStorage.removeItem("ttp_text_chat_conversation_id")}catch(A){}this.sdk&&(this.sdk.config.conversationId=null);var A=this.shadowRoot.getElementById("messagesContainer");A&&(A.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 e=this.shadowRoot.getElementById("messageInput");e&&e.focus()}},{key:"updateInputAttributes",value:function(){var A=this.shadowRoot.getElementById("messageInput");if(A){var e,t=this.config.inputPlaceholder||(null===(e=this.config.panel)||void 0===e?void 0:e.inputPlaceholder)||this.t("typeMessage")||"Type your message...";A.placeholder=t,A.dir=this.config.direction||"ltr",A.style.textAlign="rtl"===this.config.direction?"right":"left"}}},{key:"show",value:function(){var A=this,e=this.shadowRoot.getElementById("textInterface");e&&e.classList.add("active"),setTimeout(function(){var e=A.shadowRoot.getElementById("messageInput");e&&e.focus()},50)}},{key:"hide",value:function(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.remove("active")}},{key:"startChat",value:(n=Ro(Ko().m(function A(){return Ko().w(function(A){for(;;)switch(A.n){case 0:this.isActive=!0,this.updateSendButtonState();case 1:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"sendMessage",value:(t=Ro(Ko().m(function A(){var e,t,n;return Ko().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=this.shadowRoot.getElementById("messageInput"),t=e.value.trim()){A.n=1;break}return A.a(2);case 1:if(this.isActive){A.n=2;break}return A.n=2,this.startChat();case 2:return this.addMessage("user",t),e.value="",e.style.height="32px",e.style.overflow="hidden",A.p=3,this.beginStreaming(),A.n=4,this.sdk.sendMessage(t);case 4:A.n=6;break;case 5:A.p=5,n=A.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 A.a(2)}},A,this,[[3,5]])})),function(){return t.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var A=this.shadowRoot.getElementById("sendButton");A&&(A.disabled=!this.isActive)}},{key:"addMessage",value:function(A,e){var t=this.shadowRoot.getElementById("messagesContainer");if(t){var n=t.querySelector(".empty-state");n&&n.remove();var o=document.createElement("div"),r="rtl"===this.config.direction?"user"===A?"edge-left":"edge-right":"user"===A?"edge-right":"edge-left";o.className="message ".concat(A," ").concat(r);var i=document.createElement("div");i.className="message-avatar ".concat(A),i.textContent="user"===A?"👤":"🤖";var a=document.createElement("div");a.className="message-bubble",a.textContent=e,o.appendChild(i),o.appendChild(a),t.appendChild(o),t.scrollTop=t.scrollHeight}}},{key:"beginStreaming",value:function(){var A=this.shadowRoot.getElementById("messagesContainer");if(A){this.stopStreamingState();var e=document.createElement("div"),t="rtl"===this.config.direction?"edge-right":"edge-left";e.className="message agent ".concat(t),e.id="agent-streaming";var n=document.createElement("div");n.className="message-avatar agent",n.textContent="🤖";var o=document.createElement("div");o.className="message-bubble",o.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',e.appendChild(n),e.appendChild(o),A.appendChild(e),this.streamingEl=o,this.hasStartedStreaming=!1,A.scrollTop=A.scrollHeight}}},{key:"appendStreamingChunk",value:function(A){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=A;var e=this.shadowRoot.getElementById("messagesContainer");e&&(e.scrollTop=e.scrollHeight)}}},{key:"finalizeStreaming",value:function(A){if(this.streamingEl){this.streamingEl.textContent=A||this.streamingEl.textContent;var e=this.shadowRoot.getElementById("agent-streaming");e&&(e.id=""),this.streamingEl=null}this.updateSendButtonState()}},{key:"stopStreamingState",value:function(){var A=this.shadowRoot.getElementById("agent-streaming");A&&A.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}},{key:"showError",value:function(A){var e=this.shadowRoot.getElementById("messagesContainer");if(e){if(A&&("DOMAIN_NOT_WHITELISTED"===A.message||"string"==typeof A&&A.includes("DOMAIN_NOT_WHITELISTED")||A.message&&A.message.includes("Domain not whitelisted")||"string"==typeof A&&A.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),e.appendChild(n)}else{var i=document.createElement("div");i.className="error-message",i.textContent="string"==typeof A?A:(null==A?void 0:A.message)||A,e.appendChild(i)}e.scrollTop=e.scrollHeight}}},{key:"setActive",value:function(A){this.isActive=A,this.updateSendButtonState()}}],e&&_o(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function No(A){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},No(A)}function Go(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Wo(n.key),n)}}function Wo(A){var e=function(A){if("object"!=No(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=No(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==No(e)?e:e+""}var zo=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.translations=e.translations||{},this.shadowRoot=e.shadowRoot},e=[{key:"t",value:function(A){var e=this.config.language||"en";return(this.translations[e]||this.translations.en||{})[A]||A}},{key:"generateHTML",value:function(){var A=this.config.landing||{};return'\n <div class="landing-screen" id="landingScreen">\n \x3c!-- Avatar --\x3e\n <div class="landing-avatar">\n <span class="landing-avatar-emoji">'.concat(A.logo||"🤖",'</span>\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 A=this.config.landing||{},e=this.config.header||{},t=(this.config.animation,e.backgroundColor,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(t,"; \n flex: 1; \n padding: 32px 24px; \n background: ").concat(A.backgroundColor||"linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.03) 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 0; \n overflow-y: auto; \n min-height: 0;\n text-align: center;\n }\n \n .landing-screen.active { \n display: flex").concat(t,"; \n }\n\n /* Avatar - Richer purple gradient */\n .landing-avatar {\n width: 88px;\n height: 88px;\n border-radius: 22px;\n margin-bottom: 20px;\n background: ").concat(A.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",";\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35);\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(A.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(A.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(A.modeCardBackgroundColor||"#ffffff","; \n border: 1px solid ").concat(A.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(A.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(A.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 A,e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("landingScreen");e&&e.classList.add("active")}},{key:"hide",value:function(){var A,e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("landingScreen");e&&e.classList.remove("active")}},{key:"setupEventHandlers",value:function(){var A,e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("mode-card-voice"),o=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("mode-card-text");n&&t.onSelectVoice&&(n.onclick=t.onSelectVoice),o&&t.onSelectText&&(o.onclick=t.onSelectText)}}],e&&Go(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();const Xo={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 Jo(){var A,e,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 Yo(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:p,f:p.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function p(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],p=d.p,g=r[2];t>3?(o=g===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):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;(e=a<2?A: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"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Yo(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Yo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Yo(u,"constructor",c),Yo(c,"constructor",s),s.displayName="GeneratorFunction",Yo(c,o,"GeneratorFunction"),Yo(u),Yo(u,o,"Generator"),Yo(u,n,function(){return this}),Yo(u,"toString",function(){return"[object Generator]"}),(Jo=function(){return{w:r,m:d}})()}function Yo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Yo=function(A,e,t,n){function r(e,t){Yo(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Yo(A,e,t,n)}function qo(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Zo(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){qo(r,n,o,i,a,"next",A)}function a(A){qo(r,n,o,i,a,"throw",A)}i(void 0)})}}function $o(A){return $o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},$o(A)}function Ar(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function er(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ar(Object(t),!0).forEach(function(e){tr(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Ar(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function tr(A,e,t){return(e=or(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function nr(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,or(n.key),n)}}function or(A){var e=function(A){if("object"!=$o(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=$o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==$o(e)?e:e+""}var rr=function(){return A=function A(){var e,t,n,o,r,i,a,s=this,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=this.mergeWithDefaults(c),this.sdk=new vt(this.config),this.isOpen=!1,this.isActive=!1,this.translations=Xo,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 l=er(er(er({},this.config),this.config.voice),{},{language:(null===(e=this.config.voice)||void 0===e?void 0:e.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===(t=this.config.voice)||void 0===t?void 0:t.outputContainer)||"raw",outputEncoding:(null===(n=this.config.voice)||void 0===n?void 0:n.outputEncoding)||"pcm",outputSampleRate:(null===(o=this.config.voice)||void 0===o?void 0:o.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(i=this.config.voice)||void 0===i?void 0:i.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,onCallEnd:function(){var A,e,t=null===(A=s.voiceInterface)||void 0===A||null===(A=A.shadowRoot)||void 0===A?void 0:A.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=s.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===(e=s.config.behavior)||void 0===e?void 0:e.mode)||"unified")&&s.showLanding()},onShowVoice:function(){s.showVoice()},onShowLanding:function(){s.showLanding()},onErrorToast:function(A,e){s.showErrorToast(A,e)}});this.voiceInterface=new Oo(l);var u=er(er(er({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Vo(u,this.sdk),"unified"===((null===(a=this.config.behavior)||void 0===a?void 0:a.mode)||"unified")){var d=er(er({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new zo(d)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var p,g=null===(p=this.shadowRoot)||void 0===p?void 0:p.getElementById("text-chat-panel");g&&(this.isOpen=!0,g.classList.add("open"))}this.checkAndHandleResume()},e=[{key:"checkAndHandleResume",value:function(){var A=this,e=this.voiceInterface.checkAndHandleResume();e&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",e.fromPage,"→ To:",e.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(function(){A.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(e){var t;console.error("❌ [WIDGET] Failed to auto-resume call:",e),"unified"===((null===(t=A.config.behavior)||void 0===t?void 0:t.mode)||"unified")&&A.showLanding()})},100))}},{key:"open",value:function(){var A;if(!this.isOpen){var e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("text-chat-panel");e&&(this.isOpen=!0,e.classList.add("open"))}}},{key:"mergeWithDefaults",value:function(A){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B,w,y,b,C,Q,x,F,U,S,k,E,I,H,T,D,O,P,K,L,M,R,_,j,V,N,G,W,z,X,J,Y,q,Z,$,AA,eA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,pA,gA,hA,fA,mA,vA,BA,wA,yA,bA,CA,QA,xA,FA,UA,SA,kA,EA,IA,HA,TA,DA,OA,PA,KA,LA,MA,RA,_A,jA,VA,NA,GA,WA,zA,XA,JA,YA,qA,ZA,$A,Ae,ee,te,ne,oe,re,ie,ae,se,ce,le,ue,de,pe,ge,he,fe,me,ve,Be,we,ye,be,Ce,Qe,xe,Fe,Ue,Se,ke,Ee,Ie,He,Te=A.position||"bottom-right";if("string"==typeof Te){var De=Te.split("-");Te={vertical:De[0]||"bottom",horizontal:De[1]||"right",offset:A.positionOffset||{x:20,y:20}}}var Oe=A.primaryColor||(null===(e=A.button)||void 0===e?void 0:e.primaryColor)||(null===(t=A.button)||void 0===t?void 0:t.backgroundColor)||"#FFFFFF",Pe=(null===(n=A.header)||void 0===n?void 0:n.backgroundColor)||"#7C3AED";return er({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,demo:!1!==A.demo,direction:A.direction||"ltr",language:A.language||"en",icon:er({type:(null===(o=A.icon)||void 0===o?void 0:o.type)||"custom",customImage:(null===(r=A.icon)||void 0===r?void 0:r.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(i=A.icon)||void 0===i?void 0:i.emoji)||"🎤",text:(null===(a=A.icon)||void 0===a?void 0:a.text)||"AI",size:(null===(s=A.icon)||void 0===s?void 0:s.size)||"medium",backgroundColor:(null===(c=A.icon)||void 0===c?void 0:c.backgroundColor)||"#FFFFFF"},A.icon),position:er({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"===$o(A.position)?A.position:{}),button:er({size:(null===(l=A.button)||void 0===l?void 0:l.size)||"medium",shape:(null===(u=A.button)||void 0===u?void 0:u.shape)||"circle",backgroundColor:(null===(d=A.button)||void 0===d?void 0:d.backgroundColor)||(null===(p=A.icon)||void 0===p?void 0:p.backgroundColor)||"#FFFFFF",hoverColor:(null===(g=A.button)||void 0===g?void 0:g.hoverColor)||"#D3D3D3",shadow:!1!==(null===(h=A.button)||void 0===h?void 0:h.shadow),shadowColor:(null===(f=A.button)||void 0===f?void 0:f.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(m=A.button)||void 0===m?void 0:m.backgroundColor)||(null===(v=A.icon)||void 0===v?void 0:v.backgroundColor)||"#FFFFFF"},A.button),panel:er({width:(null===(B=A.panel)||void 0===B?void 0:B.width)||360,height:(null===(w=A.panel)||void 0===w?void 0:w.height)||500,borderRadius:(null===(y=A.panel)||void 0===y?void 0:y.borderRadius)||24,backgroundColor:(null===(b=A.panel)||void 0===b?void 0:b.backgroundColor)||"#FFFFFF",backdropFilter:(null===(C=A.panel)||void 0===C?void 0:C.backdropFilter)||null,border:(null===(Q=A.panel)||void 0===Q?void 0:Q.border)||"1px solid #E5E7EB"},A.panel),voice:er({micButtonColor:(null===(x=A.voice)||void 0===x?void 0:x.micButtonColor)||(null===(F=A.panel)||void 0===F?void 0:F.micButtonColor)||Oe,micButtonActiveColor:(null===(U=A.voice)||void 0===U?void 0:U.micButtonActiveColor)||(null===(S=A.panel)||void 0===S?void 0:S.micButtonActiveColor)||"#EF4444",micButtonHint:er(er({text:(null===(k=A.voice)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.text)||(null===(E=A.panel)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.text)||"Click the button to start voice conversation",color:(null===(I=A.voice)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.color)||(null===(H=A.panel)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.color)||"#6B7280",fontSize:(null===(T=A.voice)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||(null===(D=A.panel)||void 0===D||null===(D=D.micButtonHint)||void 0===D?void 0:D.fontSize)||"12px"},null===(O=A.voice)||void 0===O?void 0:O.micButtonHint),null===(P=A.panel)||void 0===P?void 0:P.micButtonHint),avatarBackgroundColor:(null===(K=A.voice)||void 0===K?void 0:K.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(L=A.voice)||void 0===L?void 0:L.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(M=A.voice)||void 0===M?void 0:M.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(R=A.voice)||void 0===R?void 0:R.statusSubtitleColor)||"#64748b",startCallButtonColor:(null===(_=A.voice)||void 0===_?void 0:_.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(j=A.voice)||void 0===j?void 0:j.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(V=A.voice)||void 0===V?void 0:V.startCallTitle)||null,startCallSubtitle:(null===(N=A.voice)||void 0===N?void 0:N.startCallSubtitle)||null,startCallButtonText:(null===(G=A.voice)||void 0===G?void 0:G.startCallButtonText)||null,transcriptBackgroundColor:(null===(W=A.voice)||void 0===W?void 0:W.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(z=A.voice)||void 0===z?void 0:z.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(X=A.voice)||void 0===X?void 0:X.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(J=A.voice)||void 0===J?void 0:J.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(Y=A.voice)||void 0===Y?void 0:Y.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(q=A.voice)||void 0===q?void 0:q.endCallButtonColor)||"#ef4444",language:(null===(Z=A.voice)||void 0===Z?void 0:Z.language)||A.language||"en"},A.voice),text:er({sendButtonColor:(null===($=A.text)||void 0===$?void 0:$.sendButtonColor)||(null===(AA=A.panel)||void 0===AA?void 0:AA.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(eA=A.text)||void 0===eA?void 0:eA.sendButtonHoverColor)||(null===(tA=A.panel)||void 0===tA?void 0:tA.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(nA=A.text)||void 0===nA?void 0:nA.sendButtonActiveColor)||(null===(oA=A.panel)||void 0===oA?void 0:oA.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(rA=A.text)||void 0===rA?void 0:rA.sendButtonText)||(null===(iA=A.panel)||void 0===iA?void 0:iA.sendButtonText)||"➤",sendButtonTextColor:(null===(aA=A.text)||void 0===aA?void 0:aA.sendButtonTextColor)||(null===(sA=A.panel)||void 0===sA?void 0:sA.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(cA=A.text)||void 0===cA?void 0:cA.sendButtonFontSize)||(null===(lA=A.panel)||void 0===lA?void 0:lA.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(uA=A.text)||void 0===uA?void 0:uA.sendButtonFontWeight)||(null===(dA=A.panel)||void 0===dA?void 0:dA.sendButtonFontWeight)||"500",sendButtonHint:er(er({text:(null===(pA=A.text)||void 0===pA||null===(pA=pA.sendButtonHint)||void 0===pA?void 0:pA.text)||(null===(gA=A.panel)||void 0===gA||null===(gA=gA.sendButtonHint)||void 0===gA?void 0:gA.text)||"",color:(null===(hA=A.text)||void 0===hA||null===(hA=hA.sendButtonHint)||void 0===hA?void 0:hA.color)||(null===(fA=A.panel)||void 0===fA||null===(fA=fA.sendButtonHint)||void 0===fA?void 0:fA.color)||"#6B7280",fontSize:(null===(mA=A.text)||void 0===mA||null===(mA=mA.sendButtonHint)||void 0===mA?void 0:mA.fontSize)||(null===(vA=A.panel)||void 0===vA||null===(vA=vA.sendButtonHint)||void 0===vA?void 0:vA.fontSize)||"12px"},null===(BA=A.text)||void 0===BA?void 0:BA.sendButtonHint),null===(wA=A.panel)||void 0===wA?void 0:wA.sendButtonHint),inputPlaceholder:(null===(yA=A.text)||void 0===yA?void 0:yA.inputPlaceholder)||(null===(bA=A.panel)||void 0===bA?void 0:bA.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(CA=A.text)||void 0===CA?void 0:CA.inputBorderColor)||(null===(QA=A.panel)||void 0===QA?void 0:QA.inputBorderColor)||"#E5E7EB",inputFocusColor:(null===(xA=A.text)||void 0===xA?void 0:xA.inputFocusColor)||(null===(FA=A.panel)||void 0===FA?void 0:FA.inputFocusColor)||"#7C3AED",inputBackgroundColor:(null===(UA=A.text)||void 0===UA?void 0:UA.inputBackgroundColor)||(null===(SA=A.panel)||void 0===SA?void 0:SA.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(kA=A.text)||void 0===kA?void 0:kA.inputTextColor)||(null===(EA=A.panel)||void 0===EA?void 0:EA.inputTextColor)||"#1F2937",inputFontSize:(null===(IA=A.text)||void 0===IA?void 0:IA.inputFontSize)||(null===(HA=A.panel)||void 0===HA?void 0:HA.inputFontSize)||"14px",inputBorderRadius:(null===(TA=A.text)||void 0===TA?void 0:TA.inputBorderRadius)||(null===(DA=A.panel)||void 0===DA?void 0:DA.inputBorderRadius)||20,inputPadding:(null===(OA=A.text)||void 0===OA?void 0:OA.inputPadding)||(null===(PA=A.panel)||void 0===PA?void 0:PA.inputPadding)||"6px 14px"},A.text),landing:er({backgroundColor:(null===(KA=A.landing)||void 0===KA?void 0:KA.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:(null===(LA=A.landing)||void 0===LA?void 0:LA.logo)||"🤖",title:(null===(MA=A.landing)||void 0===MA?void 0:MA.title)||null,titleColor:(null===(RA=A.landing)||void 0===RA?void 0:RA.titleColor)||"#1e293b",modeCardBackgroundColor:(null===(_A=A.landing)||void 0===_A?void 0:_A.modeCardBackgroundColor)||"#FFFFFF",modeCardBorderColor:(null===(jA=A.landing)||void 0===jA?void 0:jA.modeCardBorderColor)||"#E2E8F0",modeCardHoverBorderColor:(null===(VA=A.landing)||void 0===VA?void 0:VA.modeCardHoverBorderColor)||Pe,modeCardIconBackgroundColor:(null===(NA=A.landing)||void 0===NA?void 0:NA.modeCardIconBackgroundColor)||Pe,modeCardTitleColor:(null===(GA=A.landing)||void 0===GA?void 0:GA.modeCardTitleColor)||"#111827",voiceCardIcon:(null===(WA=A.landing)||void 0===WA?void 0:WA.voiceCardIcon)||"🎤",textCardIcon:(null===(zA=A.landing)||void 0===zA?void 0:zA.textCardIcon)||"💬",voiceCardTitle:(null===(XA=A.landing)||void 0===XA?void 0:XA.voiceCardTitle)||null,textCardTitle:(null===(JA=A.landing)||void 0===JA?void 0:JA.textCardTitle)||null},A.landing),header:er({title:(null===(YA=A.header)||void 0===YA?void 0:YA.title)||"Chat Assistant",showTitle:!1!==(null===(qA=A.header)||void 0===qA?void 0:qA.showTitle),backgroundColor:(null===(ZA=A.header)||void 0===ZA?void 0:ZA.backgroundColor)||"#7C3AED",textColor:(null===($A=A.header)||void 0===$A?void 0:$A.textColor)||"#FFFFFF",showCloseButton:!1!==(null===(Ae=A.header)||void 0===Ae?void 0:Ae.showCloseButton)},A.header),footer:er({show:!1!==(null===(ee=A.footer)||void 0===ee?void 0:ee.show),backgroundColor:(null===(te=A.footer)||void 0===te?void 0:te.backgroundColor)||"#f9fafb",textColor:(null===(ne=A.footer)||void 0===ne?void 0:ne.textColor)||"#9ca3af",hoverColor:(null===(oe=A.footer)||void 0===oe?void 0:oe.hoverColor)||"#7C3AED"},A.footer),tooltips:er({newChat:(null===(re=A.tooltips)||void 0===re?void 0:re.newChat)||null,back:(null===(ie=A.tooltips)||void 0===ie?void 0:ie.back)||null,close:(null===(ae=A.tooltips)||void 0===ae?void 0:ae.close)||null,mute:(null===(se=A.tooltips)||void 0===se?void 0:se.mute)||null,speaker:(null===(ce=A.tooltips)||void 0===ce?void 0:ce.speaker)||null,endCall:(null===(le=A.tooltips)||void 0===le?void 0:le.endCall)||null},A.tooltips),messages:er({userBackgroundColor:(null===(ue=A.messages)||void 0===ue?void 0:ue.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(de=A.messages)||void 0===de?void 0:de.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(pe=A.messages)||void 0===pe?void 0:pe.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(ge=A.messages)||void 0===ge?void 0:ge.errorBackgroundColor)||"#FEE2E2",textColor:(null===(he=A.messages)||void 0===he?void 0:he.textColor)||"#1F2937",fontSize:(null===(fe=A.messages)||void 0===fe?void 0:fe.fontSize)||"14px",borderRadius:(null===(me=A.messages)||void 0===me?void 0:me.borderRadius)||8},A.messages),animation:er({enableHover:!1!==(null===(ve=A.animation)||void 0===ve?void 0:ve.enableHover),enablePulse:!1!==(null===(Be=A.animation)||void 0===Be?void 0:Be.enablePulse),enableSlide:!1!==(null===(we=A.animation)||void 0===we?void 0:we.enableSlide),duration:(null===(ye=A.animation)||void 0===ye?void 0:ye.duration)||.3},A.animation),behavior:er({autoOpen:(null===(be=A.behavior)||void 0===be?void 0:be.autoOpen)||!1,startOpen:(null===(Ce=A.behavior)||void 0===Ce?void 0:Ce.startOpen)||!1,hidden:(null===(Qe=A.behavior)||void 0===Qe?void 0:Qe.hidden)||!1,autoConnect:(null===(xe=A.behavior)||void 0===xe?void 0:xe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Fe=A.behavior)||void 0===Fe?void 0:Fe.showWelcomeMessage),welcomeMessage:(null===(Ue=A.behavior)||void 0===Ue?void 0:Ue.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(Se=A.behavior)||void 0===Se?void 0:Se.enableVoiceMode)||A.behavior.enableVoiceMode,mode:(null===(ke=A.behavior)||void 0===ke?void 0:ke.mode)||"unified"},A.behavior),accessibility:er({ariaLabel:(null===(Ee=A.accessibility)||void 0===Ee?void 0:Ee.ariaLabel)||"Chat Assistant",ariaDescription:(null===(Ie=A.accessibility)||void 0===Ie?void 0:Ie.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(He=A.accessibility)||void 0===He?void 0:He.keyboardNavigation)},A.accessibility),customStyles:A.customStyles||"",useShadowDOM:!1!==A.useShadowDOM,variables:A.variables||{},forceConversationId:A.forceConversationId,visualAssistant:A.visualAssistant,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay,primaryColor:Oe},"string"==typeof A.position?{positionString:A.position}:{})}},{key:"setupEventHandlers",value:function(){var A=this;this.sdk.on("domainError",function(e){A.textInterface.showError(e),A.textInterface.stopStreamingState()}),this.sdk.on("error",function(e){e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))||(A.textInterface.showError(e.message||e),A.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(e){A.textInterface.appendStreamingChunk(e)}),this.sdk.on("done",function(e){var t=e.text;A.textInterface.finalizeStreaming(t)})}},{key:"createShadowHost",value:function(){var A=document.getElementById("ttp-widget-shadow-host");A&&A.remove();var e=document.createElement("div");e.id="ttp-widget-shadow-host",e.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=e.attachShadow({mode:"open"}),document.body.appendChild(e)}},{key:"createRegularContainer",value:function(){var A=document.getElementById("ttp-widget-container");A&&A.remove();var e=document.createElement("div");e.id="ttp-widget-container",e.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(e),this.regularContainer=e}},{key:"createWidget",value:function(){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 e=this.generateWidgetHTML();if(this.config.useShadowDOM){var t="\n <style>".concat(A,"</style>\n ").concat(e,"\n ");this.shadowRoot.innerHTML=t}else this.injectStylesIntoHead(A),this.container.innerHTML=e;this.setupWidgetEvents();var n=this.shadowRoot.getElementById("text-chat-panel");n&&(this.config.behavior.startOpen||this.config.behavior.autoOpen)&&(this.isOpen=!0,n.classList.add("open"))}},{key:"injectStylesIntoHead",value:function(A){var e,t,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(e=this.config.button)||void 0===e?void 0:e.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=A+"\n"+a,this.config.customStyles&&(s.textContent+="\n"+this.config.customStyles),document.head.appendChild(s)}},{key:"generateWidgetHTML",value:function(){var A,e=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===(A=this.config.behavior)||void 0===A?void 0:A.mode)||"unified",l="unified"===c,u="unified"===c||"voice-only"===c,d="unified"===c||"text-only"===c,p=function(A){var t=e.config.language||"en";return(e.translations[t]||e.translations.en)[A]||A},g=function(A){var t,n=null===(t=e.config.tooltips)||void 0===t?void 0:t[A];return null!=n?n:{newChat:p("newChat"),back:p("back"),close:p("close"),mute:p("mute"),speaker:p("speaker"),endCall:p("endCall")}[A]||""},h=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(a,r,i),"\n ").concat(this.config.customStyles,"\n </style>\n "):"";return"\n ".concat(h,"\n \n ").concat(this.config.behavior.hidden?"":'\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 "),'\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: linear-gradient(135deg, #581c87, #7c3aed); color: ').concat(o.textColor,';">\n <div>\n ').concat(o.showTitle?'<div class="header-title">'.concat(o.title,"</div>"):"",'\n <div class="header-status">\n <span class="status-dot"></span>\n <span>').concat(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 A=encodeURIComponent(window.location.hostname||"widget"),e="https://talktopc.com?ref=widget&source=".concat(A);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(e,'" 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 A=this.config.position,e=A.offset||{x:20,y:20},t="";return"top"===A.vertical?t+="top: ".concat(e.y,"px;"):"bottom"===A.vertical?t+="bottom: ".concat(e.y,"px;"):"center"===A.vertical&&(t+="top: 50%; transform: translateY(-50%);"),"left"===A.horizontal?t+="left: ".concat(e.x,"px;"):"right"===A.horizontal?t+="right: ".concat(e.x,"px;"):"center"===A.horizontal&&(t+="left: 50%; transform: translateX(-50%);"),t}},{key:"generateIconHTML",value:function(A){var e=this.config.icon;switch(e.type){case"custom":return'<img src="'.concat(e.customImage,'" alt="Chat Assistant" style="width: ').concat(A,"px; height: ").concat(A,'px; object-fit: contain;" />');case"emoji":return'<span style="font-size: '.concat(A,'px; line-height: 1;">').concat(e.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*A),'px; font-weight: bold; color: white;">').concat(e.text,"</span>");case"microphone":default:return'<svg viewBox="0 0 24 24" style="width: '.concat(A,"px; height: ").concat(A,'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(A,"px; height: ").concat(A,'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:"generateCSS",value:function(A,e,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 u.backgroundColor,'\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(A,"\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: 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(e,"px;\n height: ").concat(e,"px;\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: 10001;\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 {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\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 {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\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 #text-chat-panel {\n display: none").concat(m,";\n position: fixed;\n bottom: calc(").concat(e,"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(e,"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 }\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; color: rgba(255,255,255,0.7); margin: 0; }\n #text-chat-panel .status-dot { width: 6px; height: 6px; background: #10b981; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\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 A,e=this;if(this.shadowRoot){var t=this.shadowRoot.getElementById("text-chat-button");t&&(t.onclick=function(){return e.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=function(){e._doTogglePanel()});var o,r=(null===(A=this.config.behavior)||void 0===A?void 0:A.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 A,t,n;if(null!==(A=e.voiceInterface)&&void 0!==A&&A.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),e.voiceInterface.isShowingDomainError=!1,null!==(n=e.voiceInterface)&&void 0!==n&&n.resetConnectingState&&e.voiceInterface.resetConnectingState(),void e.showLanding();null!==(t=e.voiceInterface)&&void 0!==t&&t.isActive?e.showBackButtonWarning():e.showLanding()}),i&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=Zo(Jo().m(function A(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f;return Jo().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!e.isStartingCall){A.n=1;break}return console.log("⚠️ Call already starting, ignoring duplicate click"),A.a(2);case 1:return e.isStartingCall=!0,A.p=2,e.showVoice(),null!==(t=e.voiceInterface)&&void 0!==t&&t.showConnectingState&&e.voiceInterface.showConnectingState(),A.n=3,e.startVoiceCall();case 3:if(null===(n=e.voiceInterface)||void 0===n||!n.isActive){A.n=4;break}console.log("✅ Voice call started successfully"),A.n=6;break;case 4:if(console.warn("⚠️ startVoiceCall() returned but call is not active"),a=null===(o=e.voiceInterface)||void 0===o||null===(o=o.shadowRoot)||void 0===o?void 0:o.getElementById("voiceIdleState"),s=!1,a&&"none"!==a.style.display&&(c=a.querySelector(".voice-status-title"))&&(u=c.textContent.trim(),d=null===(l=e.voiceInterface)||void 0===l?void 0:l.t("domainNotValidated"),console.log("🔍 Checking for domain error - titleText:",u,"domainErrorTitle:",d),(u===d||u.includes("Domain not")||u.includes("not whitelisted"))&&(s=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))),!s){A.n=5;break}return e.currentView="voice",e.showVoice(),console.log("✅ Staying on voice interface with domain error displayed"),A.a(2);case 5:console.log("⚠️ Not a domain error - returning to landing screen"),null!==(r=e.voiceInterface)&&void 0!==r&&r.resetConnectingState&&e.voiceInterface.resetConnectingState(),"unified"===((null===(i=e.config.behavior)||void 0===i?void 0:i.mode)||"unified")&&e.showLanding();case 6:A.n=9;break;case 7:if(A.p=7,!(f=A.v).isServerRejection&&"ServerRejected"!==f.name){A.n=8;break}return null!==(h=e.voiceInterface)&&void 0!==h&&h.resetConnectingState&&e.voiceInterface.resetConnectingState(),A.a(2);case 8:console.error("❌ Failed to start voice call:",f),null!==(p=e.voiceInterface)&&void 0!==p&&p.resetConnectingState&&e.voiceInterface.resetConnectingState(),"Call cancelled by user"!==f.message&&e.showErrorToast(f.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(g=e.config.behavior)||void 0===g?void 0:g.mode)||"unified")&&e.showLanding();case 9:return A.p=9,e.isStartingCall=!1,A.f(9);case 10:return A.a(2)}},A,null,[[2,7,9,10]])})),function(){return o.apply(this,arguments)}),onSelectText:function(){return e.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 e.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 A;if(this.shadowRoot){var e=null===(A=this.voiceInterface)||void 0===A||null===(A=A.shadowRoot)||void 0===A?void 0:A.getElementById("voiceIdleState");if(e&&"none"!==e.style.display){var t=e.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 A=this.shadowRoot.getElementById("landingScreen"),e=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");A&&A.classList.remove("active"),e&&e.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 A=this.shadowRoot.getElementById("landingScreen"),e=this.shadowRoot.getElementById("textInterface"),t=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");A&&A.classList.remove("active"),e&&e.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 A=this;document.addEventListener("keydown",function(e){"Escape"===e.key&&A.isOpen&&A.togglePanel()})}},{key:"togglePanel",value:function(){this.shadowRoot&&this._doTogglePanel()}},{key:"_doTogglePanel",value:function(){var A=this;if(this.shadowRoot){this.isOpen=!this.isOpen;var e=this.shadowRoot.getElementById("text-chat-panel");e&&e.classList.toggle("open"),this.isOpen&&setTimeout(function(){var e=A.shadowRoot.getElementById("messageInput");e&&e.focus()},100),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}},{key:"showErrorToast",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",t=document.createElement("div");t.className="widget-toast widget-toast-".concat(e),t.textContent=A;var n="error"===e?"#ef4444":"warning"===e?"#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(A){var e=A.title,t=void 0===e?"Confirm":e,n=A.message,o=void 0===n?"Are you sure?":n,r=A.confirmText,i=void 0===r?"Confirm":r,a=A.cancelText,s=void 0===a?"Cancel":a,c=A.confirmButtonClass,l=void 0===c?"primary":c,u=A.onConfirm,d=A.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(A){A.target===p&&(p.remove(),null==d||d())}}},{key:"startChat",value:(i=Zo(Jo().m(function A(){return Jo().w(function(A){for(;;)switch(A.n){case 0:this.isActive=!0,this.textInterface.setActive(!0);case 1:return A.a(2)}},A,this)})),function(){return i.apply(this,arguments)})},{key:"sendMessage",value:(r=Zo(Jo().m(function A(){return Jo().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,this.textInterface.sendMessage();case 1:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"showBackButtonWarning",value:function(){var A,e;null!==(A=this.voiceInterface)&&void 0!==A&&A.isActive&&null!==(e=this.voiceInterface.desktop)&&void 0!==e&&e.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}},{key:"getSignedUrl",value:(o=Zo(Jo().m(function A(){var e,t,n;return Jo().w(function(A){for(;;)switch(A.n){case 0:if(!this.config.signedUrl){A.n=1;break}return A.a(2,this.config.signedUrl);case 1:if(this.config.agentId){A.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return e=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(e,"?").concat(t.toString()),A.a(2,n)}},A,this)})),function(){return o.apply(this,arguments)})},{key:"addMessage",value:function(A,e){this.textInterface.addMessage(A,e)}},{key:"beginStreaming",value:function(){this.textInterface.beginStreaming()}},{key:"appendStreamingChunk",value:function(A){this.textInterface.appendStreamingChunk(A)}},{key:"finalizeStreaming",value:function(A){this.textInterface.finalizeStreaming(A)}},{key:"stopStreamingState",value:function(){this.textInterface.stopStreamingState()}},{key:"showError",value:function(A){this.textInterface.showError(A)}},{key:"updateStatus",value:function(A){}},{key:"updateConfig",value:function(A){var e,t,n,o,r,i,a,s,c,l,u=er({},this.config);A.panel&&(u.panel=er(er({},this.config.panel),A.panel)),A.voice&&(u.voice=er(er({},this.config.voice),A.voice),A.voice.micButtonHint&&(u.voice.micButtonHint=er(er({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),A.voice.micButtonHint))),A.text&&(u.text=er(er({},this.config.text),A.text),A.text.sendButtonHint&&(u.text.sendButtonHint=er(er({},null===(l=this.config.text)||void 0===l?void 0:l.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(u.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?u.direction="rtl":void 0===A.direction&&(u.direction="ltr")),A.translations&&(u.translations=A.translations,this.translations=A.translations),A.button&&(u.button=er(er({},this.config.button),A.button)),A.header&&(u.header=er(er({},this.config.header),A.header)),A.icon&&(u.icon=er(er({},this.config.icon),A.icon)),A.messages&&(u.messages=er(er({},this.config.messages),A.messages)),A.animation&&(u.animation=er(er({},this.config.animation),A.animation)),A.behavior&&(u.behavior=er(er({},this.config.behavior),A.behavior)),A.accessibility&&(u.accessibility=er(er({},this.config.accessibility),A.accessibility)),A.tooltips&&(u.tooltips=er(er({},this.config.tooltips),A.tooltips)),A.landing&&(u.landing=er(er({},this.config.landing),A.landing)),A.footer&&(u.footer=er(er({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===u.direction&&(u.direction=A.direction),void 0!==A.primaryColor&&(u.primaryColor=A.primaryColor),u.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,u.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,u.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,u.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,u.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,u.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,void 0!==A.useShadowDOM&&(u.useShadowDOM=A.useShadowDOM),Object.keys(A).forEach(function(e){["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay"].includes(e)||(u[e]=A[e])}),null===(e=this.config)||void 0===e||e.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 Oo(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 zo(C)}else this.landingScreen=null;this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}},{key:"destroy",value:function(){var A=document.getElementById("ttp-widget-shadow-host");A&&A.remove();var e=document.getElementById("ttp-widget-container");e&&e.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=Zo(Jo().m(function A(){return Jo().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,this.voiceInterface.startVoiceCall();case 1:this._flushPendingClientTools();case 2:return A.a(2)}},A,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=Zo(Jo().m(function A(e){var t,n,o,r,i=arguments;return Jo().w(function(A){for(;;)switch(A.p=A.n){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},e&&e.trim()){A.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){A.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()){A.n=3;break}throw console.warn("TTPChatWidget: VoiceSDK not available"),new Error("VoiceSDK not available");case 3:return A.p=3,A.n=4,o.injectData(e,er(er({},n),{},{source:n.source||"widget_programmatic"}));case 4:return r=A.v,A.a(2,r);case 5:throw A.p=5,A.v;case 6:return A.a(2)}},A,this,[[3,5]])})),function(A){return t.apply(this,arguments)})},{key:"registerToolHandler",value:function(A,e){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.registerToolHandler(A,e):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:A,handler:e}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}},{key:"unregisterToolHandler",value:function(A){var e;return null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk?this.voiceInterface.sdk.unregisterToolHandler(A):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(function(e){return e.name!==A})),this)}},{key:"hasToolHandler",value:function(A){var e;return!(null===(e=this.voiceInterface)||void 0===e||!e.sdk)&&this.voiceInterface.sdk.hasToolHandler(A)}},{key:"getRegisteredTools",value:function(){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(function(A){return A.name}):[]}},{key:"_flushPendingClientTools",value:function(){var A,e=this;this._pendingClientTools&&null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk&&(this._pendingClientTools.forEach(function(A){var t=A.name,n=A.handler;e.voiceInterface.sdk.registerToolHandler(t,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(A,e){return this.registerToolHandler(A,e)}},{key:"unregisterClientTool",value:function(A){return this.unregisterToolHandler(A)}},{key:"hasClientTool",value:function(A){return this.hasToolHandler(A)}},{key:"getRegisteredClientTools",value:function(){return this.getRegisteredTools()}}],e&&nr(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,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 ir="2.18.0";const ar={VoiceSDK_v2:rt,TextChatSDK:vt,WebSocketManager:jt,AudioRecorder:Z,AudioPlayer:$t,EventEmitter:K,VoiceButton:dn,VanillaVoiceButton:bn,AgentSDK:Dn,TTPChatWidget:rr,VERSION:ir}})(),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,j=39,V=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=[_,j,V,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!==[_,j,L,M].indexOf(l)||-1!==[j,L].indexOf(s)&&-1!==[j,V].indexOf(l)||-1!==[V,M].indexOf(s)&&l===V)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}(),je=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}(),Ve=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(Ve(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,je.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=jA[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,jA={"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}}},VA={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&&!jA[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 Ve(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"),jt={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}}},Vt={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(Ve).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 Ve(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,VA,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,Vt,A.position),this.textAlign=xn(e,jt,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 je(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="),jn="×",Vn=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 jn;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 jn;if(!(r!==Ln&&r!==Kn||i!==Kn&&10!==i))return jn;if((r===Mn||10===r)&&10===i)return jn;if(13===i||5===i)return jn;if(7===i)return jn;if(1===r)return jn;if(13===r&&14===i){for(;5===o;)o=A[--n];if(14===o)return jn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=A[--n];if(a%2==0)return jn}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(Vn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var e=jn;n<t&&(e=Nn(0,r,++n))===jn;);if(e!==jn||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):Vo(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):Vo(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},jo=function(e){return"STYLE"===e.tagName},Vo=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(jo(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)&&jo(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]),(Vo(e)||No(e))&&(Vo(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]},jr=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Vr=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 Vr(t,n,o))}if(0!==this.container.styles.overflowX){var r=_r(this.curves),i=jr(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=jr(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=Ve(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=jr(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 jr(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,_,j,V;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!==(j=A.height)&&void 0!==j?j: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===(V=A.removeContainer)||void 0===V||V)&&(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:()=>Dn,AudioPlayer:()=>$t,AudioRecorder:()=>Z,EventEmitter:()=>K,MicPermissionModals:()=>A,MicPermissionUtils:()=>e,TTPChatWidget:()=>rr,TextChatSDK:()=>vt,VERSION:()=>ir,VanillaVoiceButton:()=>bn,VoiceButton:()=>dn,VoiceSDK_v2:()=>rt,WebSocketManager:()=>jt,default:()=>ar});var e={};t.r(e),t.d(e,{checkPermissionState:()=>Mn,getDeviceInfo:()=>Ln,getPermissionInstructions:()=>_n,openSettings:()=>jn});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:()=>Yn,showNoMicrophoneModal:()=>qn,showPrePromptModal:()=>Jn});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){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 b(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)?b(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 b(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 C(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 x(){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 Q(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]())):(Q(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,Q(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Q(u,"constructor",c),Q(c,"constructor",s),s.displayName="GeneratorFunction",Q(c,o,"GeneratorFunction"),Q(u),Q(u,o,"Generator"),Q(u,n,function(){return this}),Q(u,"toString",function(){return"[object Generator]"}),(x=function(){return{w:r,m:d}})()}function Q(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Q=function(e,A,t,n){function r(A,t){Q(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))},Q(e,A,t,n)}function F(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 U(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){F(r,n,o,i,a,"next",e)}function a(e){F(r,n,o,i,a,"throw",e)}i(void 0)})}}function S(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,k(n.key),n)}}function k(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 E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function T(e,A){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},T(e,A)}const H=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=I(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,E()?Reflect.construct(A,t||[],I(e).constructor):A.apply(e,t))}(this,A)).config=t,e.audioContext=null,e.gainNode=null,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.isProcessingPcmQueue=!1,e.isSchedulingFrames=!1,e.MAX_LOOKAHEAD_SECONDS=.02,e.pendingSentenceText=null,e.sentenceTimings=[],e.isCheckingTranscripts=!1,e._isStopped=!1,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&&T(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:(c=U(x().m(function e(A){var t,n,o=this;return x().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.preparedBuffer.push(t),this.isSchedulingFrames?setTimeout(function(){o.preparedBuffer.length>0&&!o.isSchedulingFrames&&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 c.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:(s=U(x().m(function e(){var A,t,n,o,r,i,a,s,c,l=this;return x().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=x().m(function e(){var A,t,n,o,r,i,s;return x().w(function(e){for(;;)switch(e.n){case 0:if(A=l.preparedBuffer.shift()){e.n=1;break}return e.a(2,1);case 1:(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=o?.1:0,l.nextStartTime=n+r,console.log("🎵 [scheduleWAV] FIRST FRAME - state: ".concat(l.audioContext.state,", currentTime: ").concat(n,", nextStartTime: ").concat(l.nextStartTime),o?"(mobile)":"(desktop)")):(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.scheduledSources.delete(t),l.scheduledBuffers--,0===l.scheduledBuffers&&0===l.preparedBuffer.length&&0===l.pcmChunkQueue.length)l.isPlaying=!1,l.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),l.emit("playbackStopped");else if(l.preparedBuffer.length>0)setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.schedulePreparedFrames()},0);else if(l.scheduledBuffers>0){var e=function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0?l.schedulePreparedFrames():l.scheduledBuffers>0&&setTimeout(e,10)};setTimeout(e,10)}},l.isPlaying||(l.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),l.emit("playbackStarted"));case 2:return e.a(2)}},e)});case 5:if(!(this.preparedBuffer.length>0&&a<t)){e.n=8;break}return e.d(C(s()),6);case 6:if(!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&&requestAnimationFrame(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.schedulePreparedFrames()}),this.scheduledBuffers>0&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0?l.schedulePreparedFrames():l.scheduledBuffers>0&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0&&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 s.apply(this,arguments)})},{key:"processPcmQueue",value:(a=U(x().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 x().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=6;break}if(n=this.pcmChunkQueue.shift()){e.n=5;break}return e.a(3,4);case 5: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 6:this.isProcessingPcmQueue=!1,e.n=8;break;case 7:e.p=7,w=e.v,console.error("❌ AudioPlayer v2: Error playing chunk:",w),this.emit("playbackError",w),this.isProcessingPcmQueue=!1;case 8:return e.a(2)}},e,this,[[3,7]])})),function(){return a.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:(i=U(x().m(function e(){var A,t,n,o=this;return x().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 i.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")}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)")}}},{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}},{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=U(x().m(function e(){var A,t,n,o,r,i,a,s,c=this;return x().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.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,t=0,n=y(this.scheduledSources);try{for(n.s();!(A=n.n()).done;){var o=A.value;try{o.stop(),t++}catch(e){console.log(" Source already stopped or not started:",e.message)}}}catch(e){n.e(e)}finally{n.f()}console.log(" Stopped ".concat(t," sources")),this.scheduledSources.clear()}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._isStopped=!0,this.nextStartTime=0,this.scheduledBuffers=0,this.clearTranscriptState(),e&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}},{key:"markNewSentence",value:function(e){this._isStopped&&(console.log("🛑 AudioPlayer: Clearing stopped flag - new audio starting"),this._isStopped=!1),this.pendingSentenceText=e,console.log('📝 AudioPlayer: New sentence marked: "'.concat(e.substring(0,40),'..."'))}},{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=y(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=U(x().m(function e(){var A;return x().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&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c}(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,O(n.key),n)}}function O(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+""}var K=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&&P(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function L(e){return L="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},L(e)}function M(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 R(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?M(Object(t),!0).forEach(function(A){_(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function _(e,A,t){return(A=X(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function j(){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]"}),(j=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 N(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 G(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){N(r,n,o,i,a,"next",e)}function a(e){N(r,n,o,i,a,"throw",e)}i(void 0)})}}function W(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 z(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,X(n.key),n)}}function X(e){var A=function(e){if("object"!=L(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=L(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==L(A)?A:A+""}function J(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(J=function(){return!!e})()}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function q(e,A){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},q(e,A)}var Z=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=Y(A),function(e,A){if(A&&("object"==L(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,J()?Reflect.construct(A,t||[],Y(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&&q(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 W(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)?W(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=G(j().m(function e(){var A;return j().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=G(j().m(function e(){var A,t,n,o;return j().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?R(R({},t),this.config.audioConstraints):t,e.n=3,navigator.mediaDevices.getUserMedia({audio:R({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=G(j().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g=this;return j().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?R(R({},n),this.config.audioConstraints):n,e.n=2,navigator.mediaDevices.getUserMedia({audio:R({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=G(j().m(function e(){var A;return j().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=G(j().m(function e(){var A,t;return j().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&&z(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a}(K);function $(e){return $="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},$(e)}function ee(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,Ae(n.key),n)}}function Ae(e){var A=function(e){if("object"!=$(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=$(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$(A)?A:A+""}const te=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&&ee(A.prototype,null),t&&ee(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();function ne(e){return ne="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},ne(e)}function oe(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,re(n.key),n)}}function re(e){var A=function(e){if("object"!=ne(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ne(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ne(A)?A:A+""}const ie=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}}])&&oe(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function 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,ce(n.key),n)}}function ce(e){var A=function(e){if("object"!=ae(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ae(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ae(A)?A:A+""}const le=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&&se(A.prototype,null),t&&se(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();function ue(e){return ue="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},ue(e)}function de(){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 pe(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]())):(pe(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,pe(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,pe(u,"constructor",c),pe(c,"constructor",s),s.displayName="GeneratorFunction",pe(c,o,"GeneratorFunction"),pe(u),pe(u,o,"Generator"),pe(u,n,function(){return this}),pe(u,"toString",function(){return"[object Generator]"}),(de=function(){return{w:r,m:d}})()}function pe(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}pe=function(e,A,t,n){function r(A,t){pe(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))},pe(e,A,t,n)}function ge(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 he(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,fe(n.key),n)}}function fe(e){var A=function(e){if("object"!=ue(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ue(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ue(A)?A:A+""}const me=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=de().m(function e(A,t,n){var o,r,i,a,s,c,l,u,d,p,g,h,f;return de().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){ge(r,n,o,i,a,"next",e)}function a(e){ge(r,n,o,i,a,"throw",e)}i(void 0)})},function(e,A,t){return n.apply(this,arguments)})}],A&&he(e,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function ve(e){return ve="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},ve(e)}function Be(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,we(n.key),n)}}function we(e){var A=function(e){if("object"!=ve(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=ve(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ve(A)?A:A+""}const ye=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&&Be(A.prototype,null),t&&Be(A,t),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,t}();function be(e){return be="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},be(e)}function Ce(){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 xe(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]())):(xe(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,xe(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xe(u,"constructor",c),xe(c,"constructor",s),s.displayName="GeneratorFunction",xe(c,o,"GeneratorFunction"),xe(u),xe(u,o,"Generator"),xe(u,n,function(){return this}),xe(u,"toString",function(){return"[object Generator]"}),(Ce=function(){return{w:r,m:d}})()}function xe(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xe=function(e,A,t,n){function r(A,t){xe(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))},xe(e,A,t,n)}function Qe(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 Fe(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?Qe(Object(t),!0).forEach(function(A){Ue(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qe(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function Ue(e,A,t){return(A=Ee(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function Se(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 ke(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"!=be(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=be(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==be(A)?A:A+""}const Ie=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 ie,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=Ce().m(function e(A){var t,n,o,r;return Ce().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=Fe({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=te.extractPcmFromWav(t),t=o.pcmData,n=Fe(Fe({},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=le.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,me.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=ye.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=le.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=te.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){Se(r,n,o,i,a,"next",e)}function a(e){Se(r,n,o,i,a,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)})}],A&&ke(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();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 He(){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]"}),(He=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 Oe(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"!=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 Le=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=He().m(function e(A){var t,n,o,r,i,a,s,c,l,u,d,p,g,h;return He().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){Pe(r,n,o,i,a,"next",e)}function a(e){Pe(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&&Oe(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();var Me=t(354),Re=t.n(Me);function _e(e){return _e="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},_e(e)}function je(){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]"}),(je=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 Ne(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 Ge(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?Ne(Object(t),!0).forEach(function(A){We(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function We(e,A,t){return(A=function(e){var A=function(e){if("object"!=_e(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=_e(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_e(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function ze(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 Xe={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function Je(){return Ye.apply(this,arguments)}function Ye(){var e;return e=je().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 je().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=Ge(Ge({},Xe),{},{scale:c}),h&&!n&&(B.windowHeight=document.documentElement.scrollHeight,B.height=document.documentElement.scrollHeight,B.y=0),e.n=5,Re()(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=qe(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]])}),Ye=function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){ze(r,n,o,i,a,"next",e)}function a(e){ze(r,n,o,i,a,"throw",e)}i(void 0)})},Ye.apply(this,arguments)}function qe(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 Ze(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 $e(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)?$e(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 $e(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 eA={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 AA(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(eA.types.includes(A))return!0;if(eA.autocomplete.includes(r))return!0;var c,l=Ze(eA.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=Ze(eA.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 tA(e){return tA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tA(e)}function 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 oA(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]())):(oA(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,oA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,oA(u,"constructor",c),oA(c,"constructor",s),s.displayName="GeneratorFunction",oA(c,o,"GeneratorFunction"),oA(u),oA(u,o,"Generator"),oA(u,n,function(){return this}),oA(u,"toString",function(){return"[object Generator]"}),(nA=function(){return{w:r,m:d}})()}function oA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}oA=function(e,A,t,n){function r(A,t){oA(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))},oA(e,A,t,n)}function rA(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 iA(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?rA(Object(t),!0).forEach(function(A){aA(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rA(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function aA(e,A,t){return(A=function(e){var A=function(e){if("object"!=tA(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=tA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tA(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function sA(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 cA(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 lA(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)?lA(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 lA(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 uA={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function dA(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&&!pA(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&&!pA(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var i=gA(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 pA(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 gA(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 hA(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 fA(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 mA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uA,t=[],n=cA(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(fA(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&t.push({selector:dA(o),text:r.substring(0,A.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:hA(o,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function vA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uA,t=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=cA(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(t.length>=A.links)break;if(fA(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:dA(i),text:a.substring(0,A.maxTextLength),href:s,internal:c,inViewport:hA(i,0)})}}}}}catch(e){r.e(e)}finally{r.f()}return t}function BA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uA,t=[],n=0,o=cA(document.querySelectorAll("form"));try{for(o.s();!(e=o.n()).done;){var r=e.value;if(t.length>=A.forms)break;if(fA(r)){var i,a=[],s=cA(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(AA(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:dA(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:dA(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 wA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uA,t=[],n=cA(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(fA(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:dA(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,A.maxSummaryLength),inViewport:hA(a,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function yA(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uA,t=[],n=cA(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(fA(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&t.push({selector:dA(r),level:r.tagName.toLowerCase(),text:i.substring(0,A.maxTextLength),inViewport:hA(r,0)})}}}catch(e){n.e(e)}finally{n.f()}return t}function bA(){return CA.apply(this,arguments)}function CA(){return e=nA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f=arguments;return nA().w(function(e){for(;;)if(0===e.n)return t=f.length>0&&void 0!==f[0]?f[0]:{},n=iA(iA({},uA),t.limits),o=mA(n),r=vA(n),i=BA(n),a=i.forms,s=i.sensitiveCount,c=wA(n),l=yA(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)}),CA=function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){sA(r,n,o,i,a,"next",e)}function a(e){sA(r,n,o,i,a,"throw",e)}i(void 0)})},CA.apply(this,arguments);var e}function xA(){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 QA(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]())):(QA(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,QA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,QA(u,"constructor",c),QA(c,"constructor",s),s.displayName="GeneratorFunction",QA(c,o,"GeneratorFunction"),QA(u),QA(u,o,"Generator"),QA(u,n,function(){return this}),QA(u,"toString",function(){return"[object Generator]"}),(xA=function(){return{w:r,m:d}})()}function QA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}QA=function(e,A,t,n){function r(A,t){QA(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))},QA(e,A,t,n)}function FA(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 UA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){FA(r,n,o,i,a,"next",e)}function a(e){FA(r,n,o,i,a,"throw",e)}i(void 0)})}}function SA(){return kA.apply(this,arguments)}function kA(){return kA=UA(xA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u=arguments;return xA().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,MA(400);case 3:return c=s.getBoundingClientRect(),EA(),(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)})),kA.apply(this,arguments)}function EA(){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 IA(){return TA.apply(this,arguments)}function TA(){return TA=UA(xA().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 xA().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,MA("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,MA("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,MA("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)})),TA.apply(this,arguments)}function HA(){return DA.apply(this,arguments)}function DA(){return DA=UA(xA().m(function e(){var A,t,n,o,r=arguments;return xA().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]])})),DA.apply(this,arguments)}function PA(){return OA.apply(this,arguments)}function OA(){return OA=UA(xA().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p=arguments;return xA().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(!AA(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,MA(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})))),EA(),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)})),OA.apply(this,arguments)}function KA(){return LA.apply(this,arguments)}function LA(){return LA=UA(xA().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 xA().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,MA(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,MA(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]])})),LA.apply(this,arguments)}function MA(e){return new Promise(function(A){return setTimeout(A,e)})}function RA(){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 _A(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]())):(_A(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,_A(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,_A(u,"constructor",c),_A(c,"constructor",s),s.displayName="GeneratorFunction",_A(c,o,"GeneratorFunction"),_A(u),_A(u,o,"Generator"),_A(u,n,function(){return this}),_A(u,"toString",function(){return"[object Generator]"}),(RA=function(){return{w:r,m:d}})()}function _A(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_A=function(e,A,t,n){function r(A,t){_A(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))},_A(e,A,t,n)}function jA(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){jA(r,n,o,i,a,"next",e)}function a(e){jA(r,n,o,i,a,"throw",e)}i(void 0)})}}function NA(){return(NA=VA(RA().m(function e(){var A;return RA().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,bA();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 GA(){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 WA(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]())):(WA(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,WA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,WA(u,"constructor",c),WA(c,"constructor",s),s.displayName="GeneratorFunction",WA(c,o,"GeneratorFunction"),WA(u),WA(u,o,"Generator"),WA(u,n,function(){return this}),WA(u,"toString",function(){return"[object Generator]"}),(GA=function(){return{w:r,m:d}})()}function WA(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}WA=function(e,A,t,n){function r(A,t){WA(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))},WA(e,A,t,n)}function zA(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 XA(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){zA(r,n,o,i,a,"next",e)}function a(e){zA(r,n,o,i,a,"throw",e)}i(void 0)})}}function JA(e){return JA="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},JA(e)}function YA(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 qA(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?YA(Object(t),!0).forEach(function(A){tt(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):YA(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function ZA(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,nt(n.key),n)}}function $A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($A=function(){return!!e})()}function et(e){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},et(e)}function At(e,A){return At=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},At(e,A)}function tt(e,A,t){return(A=nt(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function nt(e){var A=function(e){if("object"!=JA(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=JA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==JA(A)?A:A+""}var ot=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=et(A),function(e,A){if(A&&("object"==JA(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,$A()?Reflect.construct(A,t||[],et(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.wakeLock=null,e._wakeLockRequesting=!1,e.pendingInjections=new Map,e.injectionCounter=0,e.audioPlayer=new H(e.config);var n=qA(qA({},e.config),{},{checkConnection:function(){return e.isConnected&&e.websocket&&e.websocket.readyState===WebSocket.OPEN}});return e.audioRecorder=new Z(n),e.setupAudioPlayerEvents(),e.setupAudioRecorderEvents(),e.clientToolsRegistry=new Le(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&&At(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!==Je);try{if(void 0===Je)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:",JA(Je)),this.clientToolsRegistry.registerHandler("capture_screen",XA(GA().m(function A(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m,v,B=arguments;return GA().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,Je({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(RA().m(function e(){var A,t,n=arguments;return RA().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,bA(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(RA().m(function e(){var A,t,n=arguments;return RA().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,SA(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(RA().m(function e(){var A,t,n,o,r=arguments;return RA().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,IA(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(RA().m(function e(){var A,t,n=arguments;return RA().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,HA(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(RA().m(function e(){var A,t,n=arguments;return RA().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,PA(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(RA().m(function e(){var A,t,n=arguments;return RA().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,KA(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=XA(GA().m(function e(){var A,t,n=this;return GA().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:"sendHelloMessage",value:(d=XA(GA().m(function e(){var A,t,n,o,r;return GA().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),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":this.emit("stopPlaying",n),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",n.text),this.audioPlayer&&(this.audioPlayer.isPlaying||(null===(A=this.audioPlayer.scheduledSources)||void 0===A?void 0:A.size)>0)&&(console.log("🛑 VoiceSDK v2: Stopping current audio playback - new sentence starting"),this.audioPlayer.stopImmediate()),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 NA.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{Je().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 r={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:",r),this.handleTranscript(r)}this.emit("message",n)}}catch(e){console.error("VoiceSDK v2: Error parsing message:",e)}}},{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 Ie(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=XA(GA().m(function e(A){var t,n,o,r,i,a,s,c,l,u=this,d=arguments;return GA().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=XA(GA().m(function e(A){var t,n,o,r,i,a,s,c,l;return GA().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=XA(GA().m(function e(){var A,t,n,o;return GA().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=XA(GA().m(function e(){var A;return GA().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=XA(GA().m(function e(){return GA().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=XA(GA().m(function e(){var A,t=this;return GA().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=XA(GA().m(function e(){var A;return GA().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=XA(GA().m(function e(){return GA().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=qA(qA({},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&&ZA(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c,l,u,d,p}(a);tt(ot,"RESUME_STORAGE_KEY","voice_resume_state"),tt(ot,"RESUME_TTL_MS",1e4),tt(ot,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),tt(ot,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tt(ot,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),tt(ot,"SUPPORTED_INPUT_CHANNELS",[1]),tt(ot,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),tt(ot,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tt(ot,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),tt(ot,"SUPPORTED_OUTPUT_CHANNELS",[1]),tt(ot,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const rt=ot;function it(e){return it="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},it(e)}function at(){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 st(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]())):(st(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,st(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,st(u,"constructor",c),st(c,"constructor",s),s.displayName="GeneratorFunction",st(c,o,"GeneratorFunction"),st(u),st(u,o,"Generator"),st(u,n,function(){return this}),st(u,"toString",function(){return"[object Generator]"}),(at=function(){return{w:r,m:d}})()}function st(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}st=function(e,A,t,n){function r(A,t){st(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))},st(e,A,t,n)}function ct(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 lt(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 ut(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?lt(Object(t),!0).forEach(function(A){dt(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lt(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function dt(e,A,t){return(A=gt(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function pt(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,gt(n.key),n)}}function gt(e){var A=function(e){if("object"!=it(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=it(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==it(A)?A:A+""}function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ht=function(){return!!e})()}function ft(e){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ft(e)}function mt(e,A){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},mt(e,A)}var vt=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=ft(A),function(e,A){if(A&&("object"==it(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,ht()?Reflect.construct(A,t||[],ft(e).constructor):A.apply(e,t))}(this,A)).readScriptTagConfig();return e.config=ut({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&&mt(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=at().m(function e(A){var t=this;return at().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){ct(r,t,n,i,a,"next",e)}function a(e){ct(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=ut(ut({},this.config),e)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&pt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(K);function Bt(e){return Bt="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},Bt(e)}function wt(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)||bt(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 yt(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=bt(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 bt(e,A){if(e){if("string"==typeof e)return Ct(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)?Ct(e,A):void 0}}function Ct(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 xt(){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 Qt(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]())):(Qt(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,Qt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Qt(u,"constructor",c),Qt(c,"constructor",s),s.displayName="GeneratorFunction",Qt(c,o,"GeneratorFunction"),Qt(u),Qt(u,o,"Generator"),Qt(u,n,function(){return this}),Qt(u,"toString",function(){return"[object Generator]"}),(xt=function(){return{w:r,m:d}})()}function Qt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Qt=function(e,A,t,n){function r(A,t){Qt(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))},Qt(e,A,t,n)}function Ft(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 Ut(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,St(n.key),n)}}function St(e){var A=function(e){if("object"!=Bt(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Bt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bt(A)?A:A+""}function kt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kt=function(){return!!e})()}function Et(e){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Et(e)}function It(e,A){return It=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},It(e,A)}const Tt=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=Et(A),function(e,A){if(A&&("object"==Bt(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,kt()?Reflect.construct(A,t||[],Et(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&&It(e,A)}(A,e),t=A,n=[{key:"getConnection",value:(o=xt().m(function e(A){var t,n,o=this;return xt().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){Ft(r,t,n,i,a,"next",e)}function a(e){Ft(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=yt(this.connections.entries());try{for(t.s();!(e=t.n()).done;){var n=wt(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=yt(this.connections.entries());try{for(A.s();!(e=A.n()).done;){var t=wt(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&&Ut(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(K));function Ht(e){return Ht="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},Ht(e)}function Dt(){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 Pt(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]())):(Pt(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,Pt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Pt(u,"constructor",c),Pt(c,"constructor",s),s.displayName="GeneratorFunction",Pt(c,o,"GeneratorFunction"),Pt(u),Pt(u,o,"Generator"),Pt(u,n,function(){return this}),Pt(u,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:r,m:d}})()}function Pt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Pt=function(e,A,t,n){function r(A,t){Pt(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))},Pt(e,A,t,n)}function Ot(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 Kt(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,Lt(n.key),n)}}function Lt(e){var A=function(e){if("object"!=Ht(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Ht(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ht(A)?A:A+""}function Mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Mt=function(){return!!e})()}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}function _t(e,A){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},_t(e,A)}var jt=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=Rt(A),function(e,A){if(A&&("object"==Ht(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,Mt()?Reflect.construct(A,t||[],Rt(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&&_t(e,A)}(A,e),t=A,n=[{key:"connect",value:(r=Dt().m(function e(){var A=this;return Dt().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;Tt.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){Ot(o,t,n,i,a,"next",e)}function a(e){Ot(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)};Tt.on("open",A),Tt.on("close",t),Tt.on("error",n),Tt.on("message",o),this.eventHandlers={open:A,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(Tt.off("open",this.eventHandlers.open),Tt.off("close",this.eventHandlers.close),Tt.off("error",this.eventHandlers.error),Tt.off("message",this.eventHandlers.message));var e=this.config.signedUrl||this.config.websocketUrl;e&&Tt.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 Tt.getAllConnections()}},{key:"clearAllConnections",value:function(){Tt.clearAll()}}],n&&Kt(t.prototype,n),o&&Kt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(K);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 Nt(){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 Gt(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]())):(Gt(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,Gt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Gt(u,"constructor",c),Gt(c,"constructor",s),s.displayName="GeneratorFunction",Gt(c,o,"GeneratorFunction"),Gt(u),Gt(u,o,"Generator"),Gt(u,n,function(){return this}),Gt(u,"toString",function(){return"[object Generator]"}),(Nt=function(){return{w:r,m:d}})()}function Gt(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Gt=function(e,A,t,n){function r(A,t){Gt(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))},Gt(e,A,t,n)}function Wt(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 zt(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Wt(r,n,o,i,a,"next",e)}function a(e){Wt(r,n,o,i,a,"throw",e)}i(void 0)})}}function Xt(e,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,Jt(n.key),n)}}function Jt(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 Yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Yt=function(){return!!e})()}function qt(e){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qt(e)}function Zt(e,A){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,A){return e.__proto__=A,e},Zt(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=qt(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,Yt()?Reflect.construct(A,t||[],qt(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&&Zt(e,A)}(A,e),t=A,n=[{key:"initializeAudioContext",value:(i=zt(Nt().m(function e(){var A,t,n,o,r,i;return Nt().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=zt(Nt().m(function e(){var A,t,n,o,r,i,a,s,c=this;return Nt().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=zt(Nt().m(function e(){var A;return Nt().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&&Xt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(K),en=t(540),An=t(848);function tn(e){return tn="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},tn(e)}function nn(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 on(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?nn(Object(t),!0).forEach(function(A){rn(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function rn(e,A,t){return(A=function(e){var A=function(e){if("object"!=tn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=tn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tn(A)?A:A+""}(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function an(){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 sn(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]())):(sn(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,sn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,sn(u,"constructor",c),sn(c,"constructor",s),s.displayName="GeneratorFunction",sn(c,o,"GeneratorFunction"),sn(u),sn(u,o,"Generator"),sn(u,n,function(){return this}),sn(u,"toString",function(){return"[object Generator]"}),(an=function(){return{w:r,m:d}})()}function sn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}sn=function(e,A,t,n){function r(A,t){sn(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))},sn(e,A,t,n)}function cn(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 ln(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 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}}(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 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}const dn=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=ln((0,en.useState)(!1),2),H=T[0],D=T[1],P=ln((0,en.useState)(!1),2),O=P[0],K=P[1],L=ln((0,en.useState)(!1),2),M=(L[0],L[1]),R=ln((0,en.useState)("Disconnected"),2),_=(R[0],R[1]),j=(0,en.useRef)(null);(0,en.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||A)),j.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),j.current.destroy(),j.current=null);var e=new rt({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)}),j.current=e,e.connect(),function(){var e=A||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(e)),j.current&&(j.current.destroy(),j.current=null)}},[A,t,n,o,i,s,d,g]);var V=function(){var e,A=(e=an().m(function e(){var A;return an().w(function(e){for(;;)switch(e.p=e.n){case 0:if(j.current){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,j.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){cn(r,n,o,i,a,"next",e)}function a(e){cn(r,n,o,i,a,"throw",e)}i(void 0)})});return function(){return A.apply(this,arguments)}}(),N=(0,An.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,An.jsx)("div",{style:{fontSize:"20px"},children:O?"🔴":"🎤"}),(0,An.jsx)("div",{children:O?"Stop Listening":"Start Listening"})]});return(0,An.jsx)("button",{className:"voice-button ".concat(O?"recording":""," ").concat(S),style:on({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:V,disabled:!H,children:I||N})};function pn(e){return pn="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},pn(e)}function gn(){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 hn(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]())):(hn(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,hn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,hn(u,"constructor",c),hn(c,"constructor",s),s.displayName="GeneratorFunction",hn(c,o,"GeneratorFunction"),hn(u),hn(u,o,"Generator"),hn(u,n,function(){return this}),hn(u,"toString",function(){return"[object Generator]"}),(gn=function(){return{w:r,m:d}})()}function hn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}hn=function(e,A,t,n){function r(A,t){hn(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))},hn(e,A,t,n)}function fn(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 mn(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){fn(r,n,o,i,a,"next",e)}function a(e){fn(r,n,o,i,a,"throw",e)}i(void 0)})}}function vn(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 Bn(e,A,t){return(A=yn(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function wn(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,yn(n.key),n)}}function yn(e){var A=function(e){if("object"!=pn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=pn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pn(A)?A:A+""}var bn=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?vn(Object(t),!0).forEach(function(A){Bn(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vn(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 rt({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=mn(gn().m(function e(){var A;return gn().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=mn(gn().m(function e(){var A;return gn().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&&wn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function Cn(){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 xn(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]())):(xn(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,xn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xn(u,"constructor",c),xn(c,"constructor",s),s.displayName="GeneratorFunction",xn(c,o,"GeneratorFunction"),xn(u),xn(u,o,"Generator"),xn(u,n,function(){return this}),xn(u,"toString",function(){return"[object Generator]"}),(Cn=function(){return{w:r,m:d}})()}function xn(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xn=function(e,A,t,n){function r(A,t){xn(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))},xn(e,A,t,n)}function Qn(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)||Un(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 Fn(e,A){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Un(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 Un(e,A){if(e){if("string"==typeof e)return Sn(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)?Sn(e,A):void 0}}function Sn(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 kn(e){return kn="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},kn(e)}function En(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 In(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){En(r,n,o,i,a,"next",e)}function a(e){En(r,n,o,i,a,"throw",e)}i(void 0)})}}function Tn(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,Hn(n.key),n)}}function Hn(e){var A=function(e){if("object"!=kn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=kn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kn(A)?A:A+""}var Dn=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 rt({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=In(Cn().m(function e(A){var t,n,o,r,i,a,s,c,l=this;return Cn().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 rt({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!",kn(l.onTranscript))),l.onSubtitleDisplay(e)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=Fn(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=Qn(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=In(Cn().m(function e(){var A;return Cn().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&&Tn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();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 On(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]())):(On(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,On(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,On(u,"constructor",c),On(c,"constructor",s),s.displayName="GeneratorFunction",On(c,o,"GeneratorFunction"),On(u),On(u,o,"Generator"),On(u,n,function(){return this}),On(u,"toString",function(){return"[object Generator]"}),(Pn=function(){return{w:r,m:d}})()}function On(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}On=function(e,A,t,n){function r(A,t){On(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))},On(e,A,t,n)}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 Ln(){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 Mn(){return Rn.apply(this,arguments)}function Rn(){var e;return e=Pn().m(function e(){var A;return Pn().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]])}),Rn=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)})},Rn.apply(this,arguments)}function _n(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 jn(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 Nn(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,Gn(n.key),n)}}function Gn(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 Wn(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 zn(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)?zn(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 zn(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 Xn=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)}}])&&Nn(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function Jn(e,A){var t=new Xn,n=t.createOverlay(),o=Ln(),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 Yn(e,A){var t,n,o,r=new Xn,i=r.createOverlay(),a=Ln(),s=_n(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=Wn(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=Wn(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(){jn(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(),Ln();var A,t=document.getElementsByTagName("script"),n="",o=Wn(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=Wn(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 qn(e){var A=new Xn,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 Zn(e){return Zn="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},Zn(e)}function $n(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,eo(n.key),n)}}function eo(e){var A=function(e){if("object"!=Zn(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Zn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zn(A)?A:A+""}var Ao=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>')}}])&&$n(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function to(e){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},to(e)}function 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,oo(n.key),n)}}function oo(e){var A=function(e){if("object"!=to(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=to(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==to(A)?A:A+""}var ro=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 /* Mobile microphone button background color */\n #mobileMuteBtn.mobile-control-btn {\n background: ").concat(this.config.micButtonColor||this.config.controlButtonColor||"#FFFFFF").concat(e,";\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 ")}}])&&no(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function io(e){return io="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},io(e)}function ao(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 so(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,co(n.key),n)}}function co(e){var A=function(e){if("object"!=io(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=io(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==io(A)?A:A+""}var lo=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 ao(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 ao(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)?ao(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")}}])&&so(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 po(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"!=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 ho=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&&po(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function fo(e){return fo="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},fo(e)}function mo(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,vo(n.key),n)}}function vo(e){var A=function(e){if("object"!=fo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=fo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fo(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},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&&mo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function wo(e){return wo="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},wo(e)}function yo(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,bo(n.key),n)}}function bo(e){var A=function(e){if("object"!=wo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=wo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wo(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.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()}}])&&yo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function xo(e){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xo(e)}function Qo(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,Fo(n.key),n)}}function Fo(e){var A=function(e){if("object"!=xo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=xo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xo(A)?A:A+""}var Uo=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"):"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=[]}}])&&Qo(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();function So(e){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},So(e)}function ko(){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 Eo(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]())):(Eo(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,Eo(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Eo(u,"constructor",c),Eo(c,"constructor",s),s.displayName="GeneratorFunction",Eo(c,o,"GeneratorFunction"),Eo(u),Eo(u,o,"Generator"),Eo(u,n,function(){return this}),Eo(u,"toString",function(){return"[object Generator]"}),(ko=function(){return{w:r,m:d}})()}function Eo(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Eo=function(e,A,t,n){function r(A,t){Eo(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))},Eo(e,A,t,n)}function Io(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 To(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Io(r,n,o,i,a,"next",e)}function a(e){Io(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ho(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,Do(n.key),n)}}function Do(e){var A=function(e){if("object"!=So(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=So(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==So(A)?A:A+""}var Po=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=Ln(),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 Dn({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 Ao(this),this.styles=new ro(this),this.transcript=new lo(this),this.textHandlers=new ho(this),this.handlers=new Bo(this),this.desktop=new Co(this),this.mobile=new Uo(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=To(ko().m(function A(t){return ko().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=To(ko().m(function A(t){return ko().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:"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=To(ko().m(function e(){var A,t=this;return ko().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,Mn();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(),Ln(),Yn(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){Jn(To(ko().m(function n(){var o;return ko().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=To(ko().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,_,j=this;return ko().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,K=e.v,console.error("❌ Mobile: Permission denied before connecting:",K),this.resetConnectingState(),(p=this.shadowRoot.getElementById("voiceIdleState"))&&(p.style.display="flex"),(g=this.shadowRoot.getElementById("text-chat-panel"))?g.style.display="":(h=document.getElementById("text-chat-panel"))&&(h.style.display=""),Ln(),Yn(function(){j.resetUIState()}),e.a(2);case 4:e.n=6;break;case 5:this.resetConnectingState(),f=this.shadowRoot.getElementById("voiceIdleState"),m=this.shadowRoot.getElementById("voiceActiveState"),f&&(f.style.display="none"),m&&(m.style.display="flex");case 6:if(v=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return j.adjustSizesForContainer()},50),v&&(v.scrollTop=0),B=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:",B),!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,L=e.v,console.warn("Warning: Error disconnecting existing connection:",L);case 11:return e.n=12,this.sdk.connect(B);case 12:w=e.v,console.log("✅ Connected to WebSocket, connected:",w),this.setupTextInjectAckHandler(),y=!1,b=this.sdk.onError,C=this.sdk.onDisconnected,this.sdk.onError=function(e){e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))&&(y=!0,console.log("🚫 Server rejected connection before starting audio capture")),b&&b.call(j.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"))&&(y=!0,console.log("🚫 Server disconnected due to domain error before starting audio capture")),C&&C.call(j.sdk,e)},x=0;case 13:if(!(x<50)){e.n=17;break}if(!y){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:x++,e.n=13;break;case 17:if(!y){e.n=18;break}throw this.sdk.onError=b,this.sdk.onDisconnected=C,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=b,this.sdk.onDisconnected=C,console.warn("⚠️ Connection lost before starting audio capture"),new Error("Connection lost before starting audio capture");case 19:if(this.sdk.onError=b,this.sdk.onDisconnected=C,!(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===(Q=this.sdk.voiceSDK)||void 0===Q||!Q.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(F=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",F.isServerRejection=!0,F;case 26:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(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,!(M=e.v).isServerRejection&&"ServerRejected"!==M.name){e.n=28;break}throw this.resetConnectingState(),M;case 28:throw console.error("❌ Failed to start listening - permission denied or error:",M),this.resetConnectingState(),this.isMobile&&((U=this.shadowRoot.getElementById("voiceIdleState"))&&(U.style.display="flex"),(S=this.shadowRoot.getElementById("text-chat-panel"))?S.style.display="":(k=document.getElementById("text-chat-panel"))&&(k.style.display=""),(E=this.shadowRoot.getElementById("text-chat-button"))?E.style.display="":(I=document.getElementById("text-chat-button"))&&(I.style.display="")),M;case 29:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var e=Date.now()-j.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")),o=j.shadowRoot.getElementById("voiceTimer");o&&(o.textContent=n);var r=j.shadowRoot.getElementById("compactTimerText"),i=j.shadowRoot.getElementById("desktopTimerText"),a=r||i;if(a&&(a.textContent=n),j.isMobile){var s=document.getElementById("mobileDurationText"),c=document.getElementById("mobileHeaderDuration");s&&(s.textContent=n),c&&(c.textContent=n)}},1e3),e.n=38;break;case 30:if(!y){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?(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,!(R=e.v).isServerRejection&&"ServerRejected"!==R.name){e.n=36;break}throw this.resetConnectingState(),R;case 36:throw console.error("❌ Failed to start listening - permission denied or error:",R),this.resetConnectingState(),this.isMobile&&((T=this.shadowRoot.getElementById("voiceIdleState"))&&(T.style.display="flex"),(H=this.shadowRoot.getElementById("text-chat-panel"))?H.style.display="":(D=document.getElementById("text-chat-panel"))&&(D.style.display=""),(P=this.shadowRoot.getElementById("text-chat-button"))?P.style.display="":(O=document.getElementById("text-chat-button"))&&(O.style.display="")),R;case 37:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var e=Date.now()-j.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")),o=j.shadowRoot.getElementById("voiceTimer");o&&(o.textContent=n);var r=j.shadowRoot.getElementById("compactTimerText"),i=j.shadowRoot.getElementById("desktopTimerText"),a=r||i;if(a&&(a.textContent=n),j.isMobile){var s=document.getElementById("mobileDurationText"),c=document.getElementById("mobileHeaderDuration");s&&(s.textContent=n),c&&(c.textContent=n)}},1e3);case 38:console.log("✅ Voice call started successfully"),e.n=44;break;case 39:if(e.p=39,(_=e.v).isServerRejection||"ServerRejected"===_.name||console.error("❌ Error starting voice call:",_),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"!==_.name&&"PermissionDeniedError"!==_.name){e.n=40;break}Ln(),Yn(function(){j.resetUIState()}),e.n=44;break;case 40:if("NotFoundError"!==_.name&&"DevicesNotFoundError"!==_.name){e.n=41;break}qn(function(){j.resetUIState()}),e.n=44;break;case 41:if(!_||!("DOMAIN_NOT_WHITELISTED"===_.message||_.message&&_.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(_.message||_),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=To(ko().m(function e(){var A,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,m;return ko().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"),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&&Ho(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n,o}();function Oo(e){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oo(e)}function Ko(){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 Lo(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]())):(Lo(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,Lo(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Lo(u,"constructor",c),Lo(c,"constructor",s),s.displayName="GeneratorFunction",Lo(c,o,"GeneratorFunction"),Lo(u),Lo(u,o,"Generator"),Lo(u,n,function(){return this}),Lo(u,"toString",function(){return"[object Generator]"}),(Ko=function(){return{w:r,m:d}})()}function Lo(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Lo=function(e,A,t,n){function r(A,t){Lo(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))},Lo(e,A,t,n)}function Mo(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 Ro(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){Mo(r,n,o,i,a,"next",e)}function a(e){Mo(r,n,o,i,a,"throw",e)}i(void 0)})}}function _o(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,jo(n.key),n)}}function jo(e){var A=function(e){if("object"!=Oo(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=Oo(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oo(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=Ro(Ko().m(function e(){return Ko().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=Ro(Ko().m(function e(){var A,t,n;return Ko().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&&_o(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A,t,n}();function No(e){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(e)}function Go(e,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,Wo(n.key),n)}}function Wo(e){var A=function(e){if("object"!=No(e)||!e)return e;var A=e[Symbol.toPrimitive];if(void 0!==A){var t=A.call(e,"string");if("object"!=No(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==No(A)?A:A+""}var zo=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&&Go(e.prototype,A),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,A}();const Xo={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 Jo(){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 Yo(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]())):(Yo(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,Yo(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Yo(u,"constructor",c),Yo(c,"constructor",s),s.displayName="GeneratorFunction",Yo(c,o,"GeneratorFunction"),Yo(u),Yo(u,o,"Generator"),Yo(u,n,function(){return this}),Yo(u,"toString",function(){return"[object Generator]"}),(Jo=function(){return{w:r,m:d}})()}function Yo(e,A,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Yo=function(e,A,t,n){function r(A,t){Yo(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))},Yo(e,A,t,n)}function qo(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 Zo(e){return function(){var A=this,t=arguments;return new Promise(function(n,o){var r=e.apply(A,t);function i(e){qo(r,n,o,i,a,"next",e)}function a(e){qo(r,n,o,i,a,"throw",e)}i(void 0)})}}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 er(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 Ar(e){for(var A=1;A<arguments.length;A++){var t=null!=arguments[A]?arguments[A]:{};A%2?er(Object(t),!0).forEach(function(A){tr(e,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):er(Object(t)).forEach(function(A){Object.defineProperty(e,A,Object.getOwnPropertyDescriptor(t,A))})}return e}function tr(e,A,t){return(A=or(A))in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}function nr(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,or(n.key),n)}}function or(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+""}var rr=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 vt(this.config),this.isOpen=!1,this.isActive=!1,this.translations=Xo,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=Ar(Ar(Ar({},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,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 Po(d);var p=Ar(Ar(Ar({},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=Ar(Ar({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new zo(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,_,j,V,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,je,Ve,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 Ar({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:Ar({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:Ar({vertical:TA.vertical||"bottom",horizontal:TA.horizontal||"right",offset:TA.offset||{x:20,y:20}},"object"===$o(e.position)?e.position:{}),button:Ar({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:Ar({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:Ar({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:Ar(Ar({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===(j=e.voice)||void 0===j?void 0:j.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(V=e.voice)||void 0===V?void 0:V.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:Ar({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:Ar(Ar({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)}),Ar({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)}),Ar({title:DA.title||"Chat Assistant",showTitle:!1!==DA.showTitle,backgroundColor:DA.backgroundColor||"#7C3AED",textColor:DA.textColor||"#FFFFFF",showCloseButton:!1!==DA.showCloseButton},DA)),footer:Ar({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:Ar({newChat:(null===(je=e.tooltips)||void 0===je?void 0:je.newChat)||null,back:(null===(Ve=e.tooltips)||void 0===Ve?void 0:Ve.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:Ar({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:Ar({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:Ar({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:Ar({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:Ar({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,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=Zo(Jo().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f;return Jo().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:return A.isStartingCall=!0,e.p=2,A.showVoice(),null!==(t=A.voiceInterface)&&void 0!==t&&t.showConnectingState&&A.voiceInterface.showConnectingState(),e.n=3,A.startVoiceCall();case 3:if(null===(n=A.voiceInterface)||void 0===n||!n.isActive){e.n=4;break}console.log("✅ Voice call started successfully"),e.n=6;break;case 4:if(console.warn("⚠️ startVoiceCall() returned but call is not active"),a=null===(o=A.voiceInterface)||void 0===o||null===(o=o.shadowRoot)||void 0===o?void 0:o.getElementById("voiceIdleState"),s=!1,a&&"none"!==a.style.display&&(c=a.querySelector(".voice-status-title"))&&(u=c.textContent.trim(),d=null===(l=A.voiceInterface)||void 0===l?void 0:l.t("domainNotValidated"),console.log("🔍 Checking for domain error - titleText:",u,"domainErrorTitle:",d),(u===d||u.includes("Domain not")||u.includes("not whitelisted"))&&(s=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))),!s){e.n=5;break}return A.currentView="voice",A.showVoice(),console.log("✅ Staying on voice interface with domain error displayed"),e.a(2);case 5:console.log("⚠️ Not a domain error - returning to landing screen"),null!==(r=A.voiceInterface)&&void 0!==r&&r.resetConnectingState&&A.voiceInterface.resetConnectingState(),"unified"===((null===(i=A.config.behavior)||void 0===i?void 0:i.mode)||"unified")&&A.showLanding();case 6:e.n=9;break;case 7:if(e.p=7,!(f=e.v).isServerRejection&&"ServerRejected"!==f.name){e.n=8;break}return null!==(h=A.voiceInterface)&&void 0!==h&&h.resetConnectingState&&A.voiceInterface.resetConnectingState(),e.a(2);case 8:console.error("❌ Failed to start voice call:",f),null!==(p=A.voiceInterface)&&void 0!==p&&p.resetConnectingState&&A.voiceInterface.resetConnectingState(),"Call cancelled by user"!==f.message&&A.showErrorToast(f.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(g=A.config.behavior)||void 0===g?void 0:g.mode)||"unified")&&A.showLanding();case 9:return e.p=9,A.isStartingCall=!1,e.f(9);case 10:return e.a(2)}},e,null,[[2,7,9,10]])})),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=Zo(Jo().m(function e(){return Jo().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=Zo(Jo().m(function e(){return Jo().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=Zo(Jo().m(function e(){var A,t,n;return Jo().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=Ar({},this.config);e.panel&&(u.panel=Ar(Ar({},this.config.panel),e.panel)),e.voice&&(u.voice=Ar(Ar({},this.config.voice),e.voice),e.voice.micButtonHint&&(u.voice.micButtonHint=Ar(Ar({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),e.voice.micButtonHint))),e.text&&(u.text=Ar(Ar({},this.config.text),e.text),e.text.sendButtonHint&&(u.text.sendButtonHint=Ar(Ar({},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=Ar(Ar({},this.config.button),e.button)),e.header&&(u.header=Ar(Ar({},this.config.header),e.header)),e.icon&&(u.icon=Ar(Ar({},this.config.icon),e.icon)),e.messages&&(u.messages=Ar(Ar({},this.config.messages),e.messages)),e.animation&&(u.animation=Ar(Ar({},this.config.animation),e.animation)),e.behavior&&(u.behavior=Ar(Ar({},this.config.behavior),e.behavior)),e.accessibility&&(u.accessibility=Ar(Ar({},this.config.accessibility),e.accessibility)),e.tooltips&&(u.tooltips=Ar(Ar({},this.config.tooltips),e.tooltips)),e.landing&&(u.landing=Ar(Ar({},this.config.landing),e.landing)),e.footer&&(u.footer=Ar(Ar({},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,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"].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=Ar(Ar(Ar({},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 Po(y);var b=Ar(Ar(Ar({},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=Ar(Ar({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new zo(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=Zo(Jo().m(function e(){return Jo().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=Zo(Jo().m(function e(A){var t,n,o,r,i=arguments;return Jo().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,Ar(Ar({},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&&nr(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 ir="2.18.0";const ar={VoiceSDK_v2:rt,TextChatSDK:vt,WebSocketManager:jt,AudioRecorder:Z,AudioPlayer:$t,EventEmitter:K,VoiceButton:dn,VanillaVoiceButton:bn,AgentSDK:Dn,TTPChatWidget:rr,VERSION:ir}})(),n})());
3
3
  //# sourceMappingURL=agent-widget.js.map