ttp-agent-sdk 2.32.0 → 2.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent-widget.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see agent-widget.js.LICENSE.txt */
|
|
2
|
-
!function(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 g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h=0;h<64;h++)p[g.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))},B=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}(),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w="undefined"==typeof Uint8Array?[]:new Uint8Array(256),v=0;v<64;v++)w[m.charCodeAt(v)]=v;var y=10,b=13,C=15,Q=17,F=18,U=19,x=20,S=21,E=22,I=24,k=25,H=26,T=27,D=28,O=30,P=32,K=33,L=34,M=35,R=37,_=38,V=39,j=40,G=42,N=[9001,65288],W="×",X="÷",J=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=p[A.charCodeAt(e)],n=p[A.charCodeAt(e+1)],o=p[A.charCodeAt(e+2)],r=p[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 B(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=="),z=[O,36],Y=[1,2,3,5],q=[y,8],Z=[T,H],$=Y.concat(q),AA=[_,V,j,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 X;if(11===J.get(A[r]))return W;if((s===P||s===K)&&11===J.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,F,U,I,D].indexOf(l))return W;if(nA(r,e)===E)return W;if(tA(23,E,r,e))return W;if(tA([Q,F],S,r,e))return W;if(tA(12,12,r,e))return W;if(s===y)return X;if(23===s||23===l)return W;if(16===l||16===s)return X;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===x)return W;if(-1!==z.indexOf(l)&&s===k||-1!==z.indexOf(s)&&l===k)return W;if(s===T&&-1!==[R,P,K].indexOf(l)||-1!==[R,P,K].indexOf(s)&&l===H)return W;if(-1!==z.indexOf(s)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(s)&&-1!==z.indexOf(l))return W;if(-1!==[T,H].indexOf(s)&&(l===k||-1!==[E,C].indexOf(l)&&e[a+1]===k)||-1!==[E,C].indexOf(s)&&l===k||s===k&&-1!==[k,D,I].indexOf(l))return W;if(-1!==[k,D,I,Q,F].indexOf(l))for(var u=r;u>=0;){if((d=e[u])===k)return W;if(-1===[D,I].indexOf(d))break;u--}if(-1!==[T,H].indexOf(l))for(u=-1!==[Q,F].indexOf(s)?i:r;u>=0;){var d;if((d=e[u])===k)return W;if(-1===[D,I].indexOf(d))break;u--}if(_===s&&-1!==[_,V,L,M].indexOf(l)||-1!==[V,L].indexOf(s)&&-1!==[V,j].indexOf(l)||-1!==[j,M].indexOf(s)&&l===j)return W;if(-1!==AA.indexOf(s)&&-1!==[x,H].indexOf(l)||-1!==AA.indexOf(l)&&s===T)return W;if(-1!==z.indexOf(s)&&-1!==z.indexOf(l))return W;if(s===I&&-1!==z.indexOf(l))return W;if(-1!==z.concat(k).indexOf(s)&&l===E&&-1===N.indexOf(A[a])||-1!==z.concat(k).indexOf(l)&&s===F)return W;if(41===s&&41===l){for(var g=t[r],p=1;g>0&&41===e[--g];)p++;if(p%2!=0)return W}return s===P&&l===K?W:X},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=J.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===G||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!==[k,O,G].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},gA=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},pA=function(A){return gA(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},BA=function(A,e,t){return A===aA?gA(e)||fA(e,t):!!gA(A)||!(92!==A||!fA(A,e))},mA=function(A,e,t){return A===sA||A===aA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},wA=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)},vA={type:2},yA={type:3},bA={type:4},CA={type:13},QA={type:8},FA={type:21},UA={type:9},xA={type:10},SA={type:11},EA={type:12},IA={type:14},kA={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(pA(e)||fA(t,n)){var o=BA(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 vA;case 41:return yA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case sA:if(mA(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(mA(r,i,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(BA(r,i,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(i===aA&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(mA(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(BA(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 EA;case 117:case 85:var g=this.peekCodePoint(0),p=this.peekCodePoint(1);return g!==sA||!uA(p)&&63!==p||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),UA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),FA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xA;break;case cA:return RA}return dA(A)?(this.consumeWhiteSpace(),MA):lA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):gA(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(),kA)}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(),kA);if(34===n||39===n||40===n||hA(n))return this.consumeBadUrlRemnants(),kA;if(92===n){if(!fA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),kA;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[wA(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 BA(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(pA(e))A+=c(e);else{if(!fA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=c(this.consumeEscapedCodePoint())}}},A}(),VA=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}(),jA=function(A){return 15===A.type},GA=function(A){return 17===A.type},NA=function(A){return 20===A.type},WA=function(A){return 0===A.type},XA=function(A,e){return NA(A)&&A.value===e},JA=function(A){return 31!==A.type},zA=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(jA(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(NA).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=ve[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},ge=function(A){return!(255&A)},pe=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},Be=function(A,e){var t=e.filter(zA);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 me(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 we=function(A,e){var t=e.filter(zA),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,g=me(d,u,a+1/3),p=me(d,u,a),h=me(d,u,a-1/3);return he(255*g,255*p,255*h,l)},ve={hsl:we,hsla:we,rgb:Be,rgba:Be},ye=function(A,e){return de(A,VA.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(NA(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"},Fe=function(A,e){var t=de(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},Ue=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),g=1;g<=u;g++)o[c+g-1]=d*g;c=null}}return A.map(function(A,t){return{color:A.color,stop:Math.max(Math.min(1,o[t]/e),0)}})},xe=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)},Ee=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},Ie=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=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},ke="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(NA(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(NA(e))switch(e.value){case Oe:return t=0,!1;case Pe:return t=1,!1;case Le:case ke: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=Fe(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=Ve[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,Ve={"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=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ie,"-ms-linear-gradient":Ie,"-o-linear-gradient":Ie,"-webkit-linear-gradient":Ie,"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(NA(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(NA(e))switch(e.value){case Oe:return t=0,!1;case Pe:return t=1,!1;case"at":return s=!0,!1;case ke: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=Fe(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(NA(r)&&"linear"===r.value)return void(o=1);if(NA(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(zA);if(2===a.length){i=de(A,a[1]);var s=a[0];GA(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}}},je={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 zA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Ve[A.name])}(A)}).map(function(e){return Re(A,e)})}},Ge={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(NA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Ne={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(NA).map(function(A){return A.value}).join(" ")}).map(Xe)}},Xe=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 Je,ze={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 NA(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 jA(e)?e.number:0}}},gt=dt("top"),pt=dt("right"),ht=dt("bottom"),ft=dt("left"),Bt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},mt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},wt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(NA).reduce(function(A,e){return A|vt(e.value)},0)}},vt=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"}(Je||(Je={}));var Ct,Qt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Je.STRICT:Je.NORMAL}},Ft={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ut=function(A,e){return NA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?re(A,e):e},xt={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}},Et={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}}},It=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},kt=It("top"),Ht=It("right"),Tt=It("bottom"),Dt=It("left"),Ot={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(NA).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"),Vt={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}}},jt={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}},Gt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&XA(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})}},Nt={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=Xt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},Xt={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}},Jt={type:16,number:50,flags:4},zt=[Jt,Jt],Yt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter($A);return 2!==t.length?zt:[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(GA(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 GA(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(NA).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 GA(e)?e.number:NA(e)&&"bold"===e.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(NA).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(JA),r=0;r<o.length;r++){var i=o[r],a=o[r+1];if(20===i.type){var s=a&&GA(a)?a.number:1;n.push({counter:i.value,increment:s})}}return n}},gn={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(JA),o=0;o<n.length;o++){var r=n[o],i=n[o+1];if(NA(r)&&"none"!==r.value){var a=i&&GA(i)?i.number:0;t.push({counter:r.value,reset:a})}}return t}},pn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(jA).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:""},Bn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&XA(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];XA(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})}},mn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(NA).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}},wn={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},vn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return jA(e)?e.number:0}},yn=function(){function A(A,e){var t,n;this.animationDuration=Qn(A,pn,e.animationDuration),this.backgroundClip=Qn(A,Ce,e.backgroundClip),this.backgroundColor=Qn(A,Qe,e.backgroundColor),this.backgroundImage=Qn(A,je,e.backgroundImage),this.backgroundOrigin=Qn(A,Ge,e.backgroundOrigin),this.backgroundPosition=Qn(A,Ne,e.backgroundPosition),this.backgroundRepeat=Qn(A,We,e.backgroundRepeat),this.backgroundSize=Qn(A,ze,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,gt,e.borderTopWidth),this.borderRightWidth=Qn(A,pt,e.borderRightWidth),this.borderBottomWidth=Qn(A,ht,e.borderBottomWidth),this.borderLeftWidth=Qn(A,ft,e.borderLeftWidth),this.boxShadow=Qn(A,Bn,e.boxShadow),this.color=Qn(A,Bt,e.color),this.direction=Qn(A,mt,e.direction),this.display=Qn(A,wt,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,Ft,e.lineHeight),this.listStyleImage=Qn(A,xt,e.listStyleImage),this.listStylePosition=Qn(A,St,e.listStylePosition),this.listStyleType=Qn(A,Et,e.listStyleType),this.marginTop=Qn(A,kt,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,mn,e.paintOrder),this.position=Qn(A,jt,e.position),this.textAlign=Qn(A,Vt,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,Gt,e.textShadow),this.textTransform=Qn(A,Nt,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,wn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Qn(A,vn,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 ge(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,gn,e.counterReset)},Qn=function(A,e,t){var n=new _A,o=null!=t?t.toString():e.initialValue;n.write(o);var r=new VA(n.read());switch(e.type){case 2:var i=r.parseComponentValue();return e.parse(A,NA(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())}}},Fn=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},Un=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Fn(e,3),this.styles=new yn(A,window.getComputedStyle(e,null)),ko(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),Fn(e,4)&&(this.flags|=16)},xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),En=0;En<64;En++)Sn[xn.charCodeAt(En)]=En;for(var In=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},kn=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=In(i,12,r[4]/2),s=2===r[5]?In(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 kn(r[0],r[1],r[2],r[3],a,s)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),Vn="×",jn=function(A){return _n.get(A)},Gn=function(A,e,t){var n=t-2,o=e[n],r=e[t-1],i=e[t];if(2===r&&3===i)return Vn;if(2===r||3===r||4===r)return"÷";if(2===i||3===i||4===i)return"÷";if(r===Pn&&-1!==[Pn,Kn,Ln,Mn].indexOf(i))return Vn;if(!(r!==Ln&&r!==Kn||i!==Kn&&10!==i))return Vn;if((r===Mn||10===r)&&10===i)return Vn;if(13===i||5===i)return Vn;if(7===i)return Vn;if(1===r)return Vn;if(13===r&&14===i){for(;5===o;)o=e[--n];if(14===o)return Vn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=e[--n];if(a%2==0)return Vn}return"÷"},Nn=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(jn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=Vn;n<t&&(A=Gn(0,r,++n))===Vn;);if(A!==Vn||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]},Xn=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},Jn=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))})},zn={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(zn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=zn.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?"👨".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(zn,"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(zn,"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=Xn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Jn(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)?Jn(Xn(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(zn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(zn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(zn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(zn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(zn,"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(zn.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=Nn(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(zn.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(zn.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 zn.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}(Un),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}(Un),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}(Un),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}(Un),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}(Un),go=[{type:15,flags:0,unit:"px",number:3}],po=[{type:16,flags:0,number:50}],ho="checkbox",fo="radio",Bo="password",mo=707406591,wo=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===Bo?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=go;break;case fo:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=po}return a}return e(t,A),t}(Un),vo=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}(Un),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}(Un),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=Uo(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=ge(o)?ge(r)?n.styles.backgroundColor:r:o}}catch(A){}return n}return e(t,A),t}(Un),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,Eo(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Io(o))if(No(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return Qo(A,e,t,n)});else{var i=Fo(A,o);i.styles.isVisible()&&(xo(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):jo(o)||Po(o)||Go(o)||Qo(A,o,i,n))}},Fo=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 wo(A,e):Go(e)?new vo(A,e):jo(e)?new yo(A,e):_o(e)?new bo(A,e):new Un(A,e)},Uo=function(A,e){var t=Fo(A,e);return t.flags|=4,Qo(A,e,t,t),t},xo=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()},Eo=function(A){return A.nodeType===Node.TEXT_NODE},Io=function(A){return A.nodeType===Node.ELEMENT_NODE},ko=function(A){return Io(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},Vo=function(A){return"STYLE"===A.tagName},jo=function(A){return"TEXTAREA"===A.tagName},Go=function(A){return"SELECT"===A.tagName},No=function(A){return"SLOT"===A.tagName},Wo=function(A){return A.tagName.indexOf("-")>0},Xo=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}(),Jo={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"]},zo={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,Jo,3,n).toLowerCase();case 7:return Zo(A,1,3999,Jo,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,zo,3,n);case 35:return Zo(A,1,9999,zo,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 Xo,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=pr(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(wr),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,gr(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(Br(document.doctype)+"<html></html>"),mr(this.referenceElement.ownerDocument,i,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},A.prototype.createElementClone=function(A){if(Fn(A,2),Lo(A))return this.createCanvasClone(A);if(Mo(A))return this.createVideoClone(A);if(Vo(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){Io(e)&&("SCRIPT"===e.tagName||e.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Io(e)&&Vo(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(Io(o)&&No(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(Eo(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Io(A)&&(ko(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&&ko(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]),(jo(A)||Go(A))&&(jo(n)||Go(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(NA);n.length&&s.appendChild(i.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var r=e.values.filter(zA),c=r[0],l=r[1];if(c&&NA(c)){var u=o.counters.getCounterValue(c.value),d=l&&NA(l)?Et.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===e.name){var g=e.values.filter(zA),p=(c=g[0],g[1]);if(l=g[2],c&&NA(c)){var h=o.counters.getCounterValues(c.value),f=l&&NA(l)?Et.parse(o.context,l.value):3,B=p&&0===p.type?p.value:"",m=h.map(function(A){return ar(A,f,!1)}).join(B);s.appendChild(i.createTextNode(m))}}}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=vr+" "+yr;var c=n===On.BEFORE?" "+vr:" "+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()})},gr=function(A){return Promise.all([].slice.call(A.images,0).map(dr))},pr=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},Br=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},mr=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},wr=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},vr="___html2canvas___pseudoelement_before",yr="___html2canvas___pseudoelement_after",br='{\n content: "" !important;\n display: none !important;\n}',Cr=function(A){Qr(A,"."+vr+":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)}},Fr=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}(),Ur=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)||Ir(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=Fr.isSameOrigin(A),t=!kr(A)&&!0===this._options.useCORS&&zn.SUPPORT_CORS_IMAGES&&!e,n=!kr(A)&&!e&&!Tr(A)&&"string"==typeof this._options.proxy&&zn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||kr(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=zn.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}(),xr=/^data:image\/svg\+xml/i,Sr=/^data:image\/.*;base64,/i,Er=/^data:image\/.*/i,Ir=function(A){return zn.SUPPORT_SVG_DRAWING||!Dr(A)},kr=function(A){return Er.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()||xr.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),g=d[0],p=d[1],h=[];h.push((o+a)/t.width),h.push((g+l)/t.width),h.push((r+p)/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,g/=f,p/=f);var B=t.width-a,m=t.height-u,w=t.width-l,v=t.height-p,y=e.borderTopWidth,b=e.borderRightWidth,C=e.borderBottomWidth,Q=e.borderLeftWidth,F=re(e.paddingTop,A.bounds.width),U=re(e.paddingRight,A.bounds.width),x=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+B,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+w,t.top+m,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=g>0||p>0?Rr(t.left+Q/3,t.top+v,g-Q/3,p-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+B,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+w,t.top+m,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=g>0||p>0?Rr(t.left+2*Q/3,t.top+v,g-2*Q/3,p-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+B,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+w,t.top+m,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=g>0||p>0?Rr(t.left+Q/2,t.top+v,g-Q/2,p-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+B,t.top,a,s,lr.TOP_RIGHT):new Or(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||u>0?Rr(t.left+w,t.top+m,l,u,lr.BOTTOM_RIGHT):new Or(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||p>0?Rr(t.left,t.top+v,g,p,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(B,t.width-b),t.top+y,B>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(w,t.width-Q),t.top+Math.min(m,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=g>0||p>0?Rr(t.left+Q,t.top+Math.min(v,t.height-C),Math.max(0,g-Q),Math.max(0,p-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+F,Math.max(0,o-(Q+S)),Math.max(0,r-(y+F)),lr.TOP_LEFT):new Or(t.left+Q+S,t.top+y+F),this.topRightContentBox=a>0||s>0?Rr(t.left+Math.min(B,t.width+Q+S),t.top+y+F,B>t.width+Q+S?0:a-Q+S,s-(y+F),lr.TOP_RIGHT):new Or(t.left+t.width-(b+U),t.top+y+F),this.bottomRightContentBox=l>0||u>0?Rr(t.left+Math.min(w,t.width-(Q+S)),t.top+Math.min(m,t.height+y+F),Math.max(0,l-(b+U)),u-(C+x),lr.BOTTOM_RIGHT):new Or(t.left+t.width-(b+U),t.top+t.height-(C+x)),this.bottomLeftContentBox=g>0||p>0?Rr(t.left+Q+S,t.top+v,Math.max(0,g-(Q+S)),p-(C+x),lr.BOTTOM_LEFT):new Or(t.left+Q+S,t.top+t.height-(C+x))};!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]},Vr=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},jr=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Gr=function(A,e){this.path=A,this.target=e,this.type=1},Nr=function(A){this.opacity=A,this.type=2,this.target=6},Wr=function(A){return 1===A.type},Xr=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Jr=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},zr=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 Nr(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new jr(t,n,o))}if(0!==this.container.styles.overflowX){var r=_r(this.curves),i=Vr(this.curves);Xr(r,i)?this.effects.push(new Gr(r,6)):(this.effects.push(new Gr(r,2)),this.effects.push(new Gr(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=Vr(t.curves);Xr(r,i)||n.unshift(new Gr(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 zr(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 Jr(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 g=0;c.positiveZIndex.some(function(A,e){return u>=A.element.container.styles.zIndex.order?(g=e+1,!1):g>0}),c.positiveZIndex.splice(g,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 NA(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(NA(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,g=0;return $A(i)?d=re(i,t.width):$A(a)&&(g=re(a,t.height)),oi(i)?d=g*r:a&&!oi(a)||(g=d/r),[d,g]}var p=null,h=null;if($A(i)?p=re(i,t.width):a&&$A(a)&&(h=re(a,t.height)),null===p||a&&!oi(a)||(h=c&&l?p/n*o:t.height),null!==h&&oi(i)&&(p=c&&l?h/o*n:t.width),null!==p&&null!==h)return[p,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=Bi(A.fontFamily).join(", "),n=jA(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=pe(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=pe(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=pe(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=pe(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=Vr(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,g,p,h,f,B,m,w,v,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 m=o.sent(),this.renderReplacedElement(e,n,m),[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 m=o.sent(),this.renderReplacedElement(e,n,m),[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 wo&&(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=pe(mo),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=pe(mo),this.ctx.fill(),this.ctx.restore())),gi(e)&&e.value.length){switch(d=this.createFontStyle(r),v=d[0],g=d[1],p=this.fontMetrics.getMetrics(v,g).baseline,this.ctx.font=v,this.ctx.fillStyle=pe(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,p),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!==(B=e.styles.listStyleImage).type)return[3,18];m=void 0,w=B.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(w)];case 16:return m=o.sent(),this.ctx.drawImage(m,e.bounds.left-(m.width+10),e.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+w),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(v=this.createFontStyle(r)[0],this.ctx.font=v,this.ctx.fillStyle=pe(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,Ut(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(A.listValue,y),r.letterSpacing,Ut(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,g,p,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,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return d<g.length?(f=g[d],[4,this.renderStack(f)]):[3,26];case 24:o.sent(),o.label=25;case 25:return d++,[3,23];case 26:p=0,h=A.positiveZIndex,o.label=27;case 27:return p<h.length?(f=h[p],[4,this.renderStack(f)]):[3,30];case 28:o.sent(),o.label=29;case 29:return p++,[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,g,p,h,f,B,m,w,v,y,b,C,Q,F,U,x,S,E,I,k,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]),v=a[0],U=a[1],x=a[2],C=a[3],Q=a[4],m=n.ctx.createPattern(n.resizeImage(r,C,Q),"repeat"),n.renderRepeat(v,m,U,x)),[3,6];case 5:1===t.type?(s=ni(A,e,[null,null,null]),v=s[0],U=s[1],x=s[2],C=s[3],Q=s[4],c=xe(t.angle,C,Q),l=c[0],u=c[1],d=c[2],g=c[3],p=c[4],(h=document.createElement("canvas")).width=C,h.height=Q,f=h.getContext("2d"),B=f.createLinearGradient(u,g,d,p),Ue(t.stops,l).forEach(function(A){return B.addColorStop(A.stop,pe(A.color))}),f.fillStyle=B,f.fillRect(0,0,C,Q),C>0&&Q>0&&(m=n.ctx.createPattern(h,"repeat"),n.renderRepeat(v,m,U,x))):function(A){return 2===A.type}(t)&&(w=ni(A,e,[null,null,null]),v=w[0],y=w[1],b=w[2],C=w[3],Q=w[4],F=0===t.position.length?[te]:t.position,U=re(F[0],C),x=re(F[F.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=Ee(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=Ee(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,U,x,C,Q),E=S[0],I=S[1],E>0&&I>0&&(k=n.ctx.createRadialGradient(y+U,b+x,0,y+U,b+x,E),Ue(t.stops,2*E).forEach(function(A){return k.addColorStop(A.stop,pe(A.color))}),n.path(v),n.ctx.fillStyle=k,E!==I?(H=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,O=1/(D=I/E),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=pe(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=pe(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=!ge(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=pi(ai(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),ge(e.backgroundColor)||(this.ctx.fillStyle=pe(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=pe(e.color),l.ctx.shadowBlur=e.blur.number,l.ctx.fillStyle=e.inset?pe(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&&!ge(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,g,p,h,f,B,m,w,v,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)),g=e<3?3*e:2*e,p=e<3?2*e:e,3===i&&(g=e,p=e),h=!0,d<=2*g?h=!1:d<=2*g+p?(g*=f=d/(2*g+p),p*=f):(B=Math.floor((d+p)/(g+p)),m=(d-B*g)/(B-1),p=(w=(d-(B+1)*g)/B)<=0||Math.abs(p-m)<Math.abs(p-w)?m:w),h&&(3===i?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=pe(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Lr(a[0])&&(v=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Or(v.end.x,v.end.y),new Or(y.start.x,y.start.y)]),this.ctx.stroke()),Lr(a[1])&&(v=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Or(v.end.x,v.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=pe(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new zr(A,null),o=new Jr(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),gi=function(A){return A instanceof yo||A instanceof vo||A instanceof wo&&A.type!==fo&&A.type!==ho},pi=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 Vr(e)}},hi=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],Bi=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===fi.indexOf(A)}):A},mi=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=Xn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,wi(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=pe(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),wi=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))})},vi=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 vi({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Ur(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Fr.setContext(window);var bi=function(A,e){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,g,p,h,f,B,m,w,v,y,b,C,Q,F,U,x,S,E,I,k,H,T,D,O,P,K,L,M,R,_,V,j;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!==(x=e.allowTaint)&&void 0!==x&&x,imageTimeout:null!==(S=e.imageTimeout)&&void 0!==S?S:15e3,proxy:e.proxy,useCORS:null!==(E=e.useCORS)&&void 0!==E&&E},c=t({logging:null===(I=e.logging)||void 0===I||I,cache:e.cache},s),l={windowWidth:null!==(k=e.windowWidth)&&void 0!==k?k: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),g=null!==(O=e.foreignObjectRendering)&&void 0!==O&&O,p={allowTaint:null!==(P=e.allowTaint)&&void 0!==P&&P,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),h=new cr(d,A,p),(f=h.clonedReferenceElement)?[4,h.toIFrame(n,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=o.sent(),m=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),w=m.width,v=m.height,y=m.left,b=m.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(w),height:null!==(V=e.height)&&void 0!==V?V:Math.ceil(v)},g?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new mi(d,Q).render(f)]):[3,3];case 2:return F=o.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+y+","+b+" with size "+w+"x"+v+" using computed rendering"),d.logger.debug("Starting DOM parsing"),U=Uo(d,f),C===U.styles.backgroundColor&&(U.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(U)];case 4:F=o.sent(),o.label=5;case 5:return(null===(j=e.removeContainer)||void 0===j||j)&&(cr.destroy(B)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,F]}})})},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?ge(o)?ge(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:()=>qn,AudioPlayer:()=>Bn,AudioRecorder:()=>rn,EventEmitter:()=>at,MicPermissionModals:()=>e,MicPermissionUtils:()=>A,TTPChatWidget:()=>jo,TextChatSDK:()=>vt,VERSION:()=>Go,VanillaVoiceButton:()=>Mn,VoiceButton:()=>En,VoiceSDK_v2:()=>nt,WebSocketManager:()=>Gt,default:()=>No});var A={};t.r(A),t.d(A,{checkPermissionState:()=>to,getDeviceInfo:()=>eo,getPermissionInstructions:()=>oo,openSettings:()=>ro});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:()=>po,showNoMicrophoneModal:()=>ho,showPrePromptModal:()=>go});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 g(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+""}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)}}])&&g(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 B(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,m(n.key),n)}}function m(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 w=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)}}])&&B(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function v(A){return v="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},v(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(v(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 F(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(F(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,F(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,F(u,"constructor",c),F(c,"constructor",s),s.displayName="GeneratorFunction",F(c,o,"GeneratorFunction"),F(u),F(u,o,"Generator"),F(u,n,function(){return this}),F(u,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:r,m:d}})()}function F(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}F=function(A,e,t,n){function r(e,t){F(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))},F(A,e,t,n)}function U(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 x(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){U(r,n,o,i,a,"next",A)}function a(A){U(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,E(n.key),n)}}function E(A){var e=function(A){if("object"!=v(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=v(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==v(e)?e:e+""}function I(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(I=function(){return!!A})()}function k(A){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},k(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=k(e),function(A,e){if(e&&("object"==v(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,I()?Reflect.construct(e,t||[],k(A).constructor):e.apply(A,t))}(this,e)).config=t,A.audioContext=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 w},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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate")),this.audioContext||(this.initializeAudioContext(),this.audioContext&&"suspended"===this.audioContext.state&&this.audioContext.resume().then(function(){console.log("✅ AudioPlayer v2: AudioContext resumed and ready")}).catch(function(A){console.warn("⚠️ AudioPlayer v2: Could not resume AudioContext:",A)}))}},{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:(s=x(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 s.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,g=r.length,p=d;return l!==c&&(p=g/l),{buffer:u,duration:p,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:(a=x(Q().m(function A(){var e,t,n,o,r,i,a=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:if(this.isSchedulingFrames=!0,e=this.preparedBuffer.length,0===(t=Math.min(e,5))&&e>0&&(t=1),A.p=2,this.audioContext||this.initializeAudioContext(),n=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!n){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!n){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:o=0,r=Q().m(function A(){var e,t,n,r,i;return Q().w(function(A){for(;;)switch(A.n){case 0:if(e=a.preparedBuffer.shift()){A.n=1;break}return A.a(2,1);case 1:(t=a.audioContext.createBufferSource()).buffer=e.buffer,t.connect(a.audioContext.destination),a.scheduledSources.add(t),n=a.audioContext.currentTime,0===a.scheduledBuffers?(a.nextStartTime<n&&(a.nextStartTime=n+a.MAX_LOOKAHEAD_SECONDS),console.log("🎵 Starting playback with minimal delay:",a.nextStartTime)):(r=n+a.MAX_LOOKAHEAD_SECONDS,a.nextStartTime<r&&(a.nextStartTime=r,console.warn("⚠️ AudioPlayer: Fell behind schedule, adjusting nextStartTime to ".concat(a.nextStartTime.toFixed(4),"s")))),a.pendingSentenceText&&(a.sentenceTimings.push({startTime:a.nextStartTime,text:a.pendingSentenceText,displayed:!1}),console.log("📝 AudioPlayer: Sentence scheduled at ".concat(a.nextStartTime.toFixed(3),'s: "').concat(a.pendingSentenceText.substring(0,40),'..."')),a.pendingSentenceText=null,a.isCheckingTranscripts||a.startTranscriptChecker()),t.start(a.nextStartTime),a.nextStartTime+=e.duration,a.nextStartTime=Math.round(1e6*a.nextStartTime)/1e6,i=a.nextStartTime-e.duration,a.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(a.scheduledBuffers+1," at ").concat(i.toFixed(4),"s, next at ").concat(a.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(e.duration.toFixed(4),"s (").concat((1e3*e.duration).toFixed(2),"ms), Queued: ").concat(a.preparedBuffer.length,", Scheduled: ").concat(a.scheduledBuffers))),a.scheduledBuffers++,o++,t.onended=function(){if(a.scheduledSources.delete(t),a.scheduledBuffers--,0===a.scheduledBuffers&&0===a.preparedBuffer.length&&0===a.pcmChunkQueue.length)a.isPlaying=!1,a.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),a.emit("playbackStopped");else if(a.preparedBuffer.length>0)setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()},0);else if(a.scheduledBuffers>0){var A=function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(A,10)};setTimeout(A,10)}},a.isPlaying||(a.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),a.emit("playbackStarted"));case 2:return A.a(2)}},A)});case 9:if(!(this.preparedBuffer.length>0&&o<t)){A.n=12;break}return A.d(C(r()),10);case 10:if(!A.v){A.n=11;break}return A.a(3,12);case 11:A.n=9;break;case 12:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&requestAnimationFrame(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()}),this.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0&&a.schedulePreparedFrames()},10)},10),A.n=14;break;case 13:A.p=13,i=A.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",i),this.emit("playbackError",i),this.isSchedulingFrames=!1;case 14:return A.a(2)}},A,this,[[2,13]])})),function(){return a.apply(this,arguments)})},{key:"processPcmQueue",value:(i=x(Q().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,m,w,v,y,b=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:if(this.isProcessingPcmQueue=!0,A.p=2,this.audioContext||this.initializeAudioContext(),e=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!e){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!e){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:if(!(this.pcmChunkQueue.length>0)){A.n=10;break}if(o=this.pcmChunkQueue.shift()){A.n=9;break}return A.a(3,8);case 9:for(r=o,o.byteLength%2!=0&&(console.warn("⚠️ Odd PCM chunk size, padding:",o.byteLength),(i=new Uint8Array(o.byteLength+1)).set(new Uint8Array(o),0),i[o.byteLength]=0,r=i.buffer),a=new Int16Array(r),s=new Float32Array(a.length),c=1/32768,l=a.length,u=0;u<l;u++)s[u]=a[u]*c;d=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,g=this.audioContext.sampleRate,null!==(n=this.outputFormat)&&void 0!==n&&n.sampleRate?this.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(d,"Hz (AudioContext: ").concat(g,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",g),(p=this.audioContext.createBuffer(1,s.length,d)).getChannelData(0).set(s),(h=this.audioContext.createBufferSource()).buffer=p,h.connect(this.audioContext.destination),f=this.audioContext.currentTime,this.nextStartTime<f&&(this.nextStartTime=f,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",f)),B=p.duration,m=s.length,w=B,g!==d&&(w=m/g,this.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(d,"Hz → ").concat(g,"Hz")),console.log(" Buffer duration: ".concat(B.toFixed(4),"s, Calculated: ").concat(w.toFixed(4),"s")))),h.start(this.nextStartTime),this.nextStartTime+=w,this.nextStartTime=Math.round(1e6*this.nextStartTime)/1e6,this.scheduledBuffers<3&&(v=this.nextStartTime-w,console.log("🎵 AudioPlayer: Scheduled chunk ".concat(this.scheduledBuffers+1," at ").concat(v.toFixed(4),"s, next at ").concat(this.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(w.toFixed(4),"s (").concat((1e3*w).toFixed(2),"ms)"))),this.scheduledBuffers++,h.onended=function(){b.scheduledBuffers--,0===b.scheduledBuffers&&0===b.pcmChunkQueue.length&&(b.isPlaying=!1,b.isProcessingPcmQueue=!1,b.emit("playbackStopped"))},this.isPlaying||(this.isPlaying=!0,this.emit("playbackStarted")),A.n=8;break;case 10:this.isProcessingPcmQueue=!1,A.n=12;break;case 11:A.p=11,y=A.v,console.error("❌ AudioPlayer v2: Error playing chunk:",y),this.emit("playbackError",y),this.isProcessingPcmQueue=!1;case 12:return A.a(2)}},A,this,[[2,11]])})),function(){return i.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:"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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null}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."))}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"))}}},{key:"processQueue",value:(r=x(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:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),"suspended"!==(n=this.audioContext).state){A.n=4;break}return A.n=3,n.resume();case 3:if(!t){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===n.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=8;break}return A.n=5,n.resume();case 5:if(!t){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:return A.n=9,e.arrayBuffer();case 9:return o=A.v,A.n=10,n.decodeAudioData(o);case 10: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()},50):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),A.n=12;break;case 11:A.p=11,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 12:return A.a(2)}},A,this,[[2,11]])})),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=x(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:"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.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.removeAllListeners()}}],n&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s}(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(){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 P(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(P(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,P(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,P(u,"constructor",c),P(c,"constructor",s),s.displayName="GeneratorFunction",P(c,o,"GeneratorFunction"),P(u),P(u,o,"Generator"),P(u,n,function(){return this}),P(u,"toString",function(){return"[object Generator]"}),(O=function(){return{w:r,m:d}})()}function P(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}P=function(A,e,t,n){function r(e,t){P(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))},P(A,e,t,n)}function K(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 L(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?K(Object(t),!0).forEach(function(e){M(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):K(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function M(A,e,t){return(e=G(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function R(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 _(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){R(r,n,o,i,a,"next",A)}function a(A){R(r,n,o,i,a,"throw",A)}i(void 0)})}}function V(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 j(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+""}function N(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(N=function(){return!!A})()}function W(A){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},W(A)}function X(A,e){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},X(A,e)}var J=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=W(e),function(A,e){if(e&&("object"==D(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,N()?Reflect.construct(e,t||[],W(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&&X(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 V(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)?V(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{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:"start",value:(i=_(O().m(function A(){var e,t,n,o,r,i,a,s,c=this;return O().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,"https:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname){A.n=1;break}throw e=new Error("Microphone access requires HTTPS. Please use https:// or test on localhost."),console.error("❌ AudioRecorder:",e.message),this.emit("error",e),e;case 1:if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){A.n=2;break}throw t=new Error("getUserMedia is not supported in this browser. Please use a modern browser."),console.error("❌ AudioRecorder:",t.message),this.emit("error",t),t;case 2:return console.log("🎤 AudioRecorder: Requesting microphone access..."),n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?L(L({},n),this.config.audioConstraints):n,A.n=3,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:this.config.sampleRate,channelCount:1},o)});case 3:if(this.mediaStream=A.v,console.log("✅ AudioRecorder: Microphone access granted"),this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:this.config.sampleRate}),"suspended"!==this.audioContext.state){A.n=4;break}return A.n=4,this.audioContext.resume();case 4:return r=this.getAudioProcessorPath(),A.n=5,this.audioContext.audioWorklet.addModule(r);case 5:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor"),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&c.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),this.isRecording=!0,this.emit("recordingStarted"),A.n=7;break;case 6:throw A.p=6,s=A.v,i=s.message,"NotAllowedError"===s.name||"PermissionDeniedError"===s.name?(i="Microphone permission denied. Please allow microphone access in your browser settings and try again.",console.error("❌ AudioRecorder: Permission denied. User needs to grant microphone access.")):"NotFoundError"===s.name||"DevicesNotFoundError"===s.name?(i="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===s.name||"TrackStartError"===s.name?(i="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.")):s.message&&s.message.includes("not allowed by the user agent")&&(i="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.")),(a=new Error(i)).name=s.name,a.originalError=s,console.error("❌ AudioRecorder: Failed to start recording:",a),this.emit("error",a),a;case 7:return A.a(2)}},A,this,[[0,6]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=_(O().m(function A(){var e;return O().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.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=_(O().m(function A(){var e,t;return O().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&&j(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(a);function z(A){return z="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},z(A)}function Y(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,q(n.key),n)}}function q(A){var e=function(A){if("object"!=z(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=z(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==z(e)?e:e+""}const Z=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&&Y(e.prototype,null),t&&Y(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();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(){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 w}},(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}}])&&AA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();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(){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&&oA(e.prototype,null),t&&oA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();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(){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 cA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(cA(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,cA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,cA(u,"constructor",c),cA(c,"constructor",s),s.displayName="GeneratorFunction",cA(c,o,"GeneratorFunction"),cA(u),cA(u,o,"Generator"),cA(u,n,function(){return this}),cA(u,"toString",function(){return"[object Generator]"}),(sA=function(){return{w:r,m:d}})()}function cA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}cA=function(A,e,t,n){function r(e,t){cA(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))},cA(A,e,t,n)}function lA(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 uA(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,dA(n.key),n)}}function dA(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 gA=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=sA().m(function A(e,t,n){var o,r,i,a,s,c,l,u,d,g,p,h,f;return sA().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,g=d.getChannelData(0),p=new Int16Array(g.length),h=0;h<g.length;h++)f=Math.max(-1,Math.min(1,g[h])),p[h]=Math.round(32767*f);return A.a(2,p.buffer)}},A)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){lA(r,n,o,i,a,"next",A)}function a(A){lA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A,e,t){return n.apply(this,arguments)})}],e&&uA(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function pA(A){return pA="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},pA(A)}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"!=pA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=pA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==pA(e)?e:e+""}const BA=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),g=a*t;i[g]=255&d,i[g+1]=d>>8&255}else for(var p=0;p<n;p++)for(var h=p*t*2,f=p*t,B=0;B<t;B++)i[f+B]=r[h+B];return o}}],null&&hA(e.prototype,null),t&&hA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function mA(A){return mA="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},mA(A)}function wA(){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:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]"}),(wA=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 yA(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 bA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?yA(Object(t),!0).forEach(function(e){CA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function CA(A,e,t){return(e=UA(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function QA(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 FA(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,UA(n.key),n)}}function UA(A){var e=function(A){if("object"!=mA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=mA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==mA(e)?e:e+""}const xA=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 tA,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=wA().m(function A(e){var t,n,o,r;return wA().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=bA({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=Z.extractPcmFromWav(t),t=o.pcmData,n=bA(bA({},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=iA.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,gA.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=BA.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=iA.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=Z.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){QA(r,n,o,i,a,"next",A)}function a(A){QA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})}],e&&FA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function SA(A){return SA="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},SA(A)}function EA(){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 IA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(IA(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,IA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,IA(u,"constructor",c),IA(c,"constructor",s),s.displayName="GeneratorFunction",IA(c,o,"GeneratorFunction"),IA(u),IA(u,o,"Generator"),IA(u,n,function(){return this}),IA(u,"toString",function(){return"[object Generator]"}),(EA=function(){return{w:r,m:d}})()}function IA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}IA=function(A,e,t,n){function r(e,t){IA(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))},IA(A,e,t,n)}function kA(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,TA(n.key),n)}}function TA(A){var e=function(A){if("object"!=SA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=SA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==SA(e)?e:e+""}const DA=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=EA().m(function A(e){var t,n,o,r,i,a,s,c,l,u,d,g,p;return EA().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 console.warn("🔧 ClientTools: No handler registered for '".concat(n,"'")),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:s=A.v,c=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(c,"ms")),this.sendResult(t,n,s,c),A.n=4;break;case 3:A.p=3,p=A.v,d=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),p),g="EXECUTION_ERROR","NotAllowedError"===p.name||null!==(l=p.message)&&void 0!==l&&l.includes("permission")?g="PERMISSION_DENIED":("NotSupportedError"===p.name||null!==(u=p.message)&&void 0!==u&&u.includes("not supported"))&&(g="API_UNAVAILABLE"),this.sendError(t,n,p.message||"Unknown error",g,d);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){kA(r,n,o,i,a,"next",A)}function a(A){kA(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&&HA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();var OA=t(354),PA=t.n(OA);function KA(A){return KA="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},KA(A)}function LA(){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 MA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(MA(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,MA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,MA(u,"constructor",c),MA(c,"constructor",s),s.displayName="GeneratorFunction",MA(c,o,"GeneratorFunction"),MA(u),MA(u,o,"Generator"),MA(u,n,function(){return this}),MA(u,"toString",function(){return"[object Generator]"}),(LA=function(){return{w:r,m:d}})()}function MA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}MA=function(A,e,t,n){function r(e,t){MA(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))},MA(A,e,t,n)}function RA(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 _A(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?RA(Object(t),!0).forEach(function(e){VA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):RA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function VA(A,e,t){return(e=function(A){var e=function(A){if("object"!=KA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=KA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==KA(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function jA(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 GA={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function NA(){return WA.apply(this,arguments)}function WA(){var A;return A=LA().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,m,w,v,y,b,C,Q,F,U,x=arguments;return LA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=(e=x.length>0&&void 0!==x[0]?x[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,g=void 0===d?1280:d,p=e.fullPage,h=void 0!==p&&p,console.log("📸 SDK Screenshot: Starting capture with options:",e),f=Date.now(),A.p=1,B=document.body,!n){A.n=3;break}if(m=document.querySelector(n)){A.n=2;break}throw new Error("Element not found: ".concat(n));case 2:B=m,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),A.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return w=_A(_A({},GA),{},{scale:c}),h&&!n&&(w.windowHeight=document.documentElement.scrollHeight,w.height=document.documentElement.scrollHeight,w.y=0),A.n=5,PA()(B,w);case 5:return v=A.v,console.log("📸 SDK Screenshot: Canvas created (".concat(v.width,"x").concat(v.height,")")),y=v,(u||g)&&(y=XA(v,u,g))!==v&&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],F=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(F,"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:F,selector:n||"body"});case 6:throw A.p=6,U=A.v,console.error("📸 SDK Screenshot: Capture failed:",U),new Error("Screenshot capture failed: ".concat(U.message));case 7:return A.a(2)}},A,null,[[1,6]])}),WA=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){jA(r,n,o,i,a,"next",A)}function a(A){jA(r,n,o,i,a,"throw",A)}i(void 0)})},WA.apply(this,arguments)}function XA(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 JA(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 zA(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)?zA(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 zA(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 YA={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 qA(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(YA.types.includes(e))return!0;if(YA.autocomplete.includes(r))return!0;var c,l=JA(YA.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,g=JA(YA.dataAttributes);try{for(g.s();!(d=g.n()).done;){var p=d.value;if(A.hasAttribute(p))return!0}}catch(A){g.e(A)}finally{g.f()}return"password"===(A.inputMode||"").toLowerCase()}function ZA(A){return ZA="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},ZA(A)}function $A(){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 Ae(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Ae(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,Ae(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Ae(u,"constructor",c),Ae(c,"constructor",s),s.displayName="GeneratorFunction",Ae(c,o,"GeneratorFunction"),Ae(u),Ae(u,o,"Generator"),Ae(u,n,function(){return this}),Ae(u,"toString",function(){return"[object Generator]"}),($A=function(){return{w:r,m:d}})()}function Ae(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Ae=function(A,e,t,n){function r(e,t){Ae(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))},Ae(A,e,t,n)}function ee(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 te(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ee(Object(t),!0).forEach(function(e){ne(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):ee(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function ne(A,e,t){return(e=function(A){var e=function(A){if("object"!=ZA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ZA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ZA(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function oe(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 re(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 ie(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)?ie(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 ie(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={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function se(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&&!ce(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&&!ce(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var i=le(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 ce(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 le(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 ue(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 de(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 ge(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=re(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(de(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&t.push({selector:se(o),text:r.substring(0,e.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:ue(o,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function pe(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=re(n);try{for(r.s();!(A=r.n()).done;){var i=A.value;if(t.length>=e.links)break;if(de(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:se(i),text:a.substring(0,e.maxTextLength),href:s,internal:c,inViewport:ue(i,0)})}}}}}catch(A){r.e(A)}finally{r.f()}return t}function he(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=0,o=re(document.querySelectorAll("form"));try{for(o.s();!(A=o.n()).done;){var r=A.value;if(t.length>=e.forms)break;if(de(r)){var i,a=[],s=re(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(qA(u))n++;else{var d=null;if(u.id){var g,p=document.querySelector('label[for="'.concat(u.id,'"]'));d=null==p||null===(g=p.innerText)||void 0===g?void 0:g.trim()}!d&&u.getAttribute("aria-label")&&(d=u.getAttribute("aria-label")),!d&&u.placeholder&&(d=u.placeholder),a.push({selector:se(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:se(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 fe(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=re(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(de(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:se(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,e.maxSummaryLength),inViewport:ue(a,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function Be(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=re(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(de(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&t.push({selector:se(r),level:r.tagName.toLowerCase(),text:i.substring(0,e.maxTextLength),inViewport:ue(r,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function me(){return we.apply(this,arguments)}function we(){return A=$A().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d=arguments;return $A().w(function(A){for(;;)if(0===A.n)return e=d.length>0&&void 0!==d[0]?d[0]:{},t=te(te({},ae),e.limits),n=ge(t),o=pe(t),r=he(t),i=r.forms,a=r.sensitiveCount,s=fe(t),c=Be(t),l=n.length+o.length+i.reduce(function(A,e){return A+e.fields.length},0)+s.length+c.length,u=n.filter(function(A){return A.inViewport}).length+o.filter(function(A){return A.inViewport}).length+s.filter(function(A){return A.inViewport}).length+c.filter(function(A){return A.inViewport}).length,A.a(2,{url:window.location.href,title:document.title,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,pageHeight:document.documentElement.scrollHeight},buttons:n,links:o,forms:i,sections:s,headings:c,metadata:{totalElements:l,visibleInViewport:u,formsCount:i.length,sensitiveFieldsFiltered:a}})},A)}),we=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){oe(r,n,o,i,a,"next",A)}function a(A){oe(r,n,o,i,a,"throw",A)}i(void 0)})},we.apply(this,arguments);var A}function ve(){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 ye(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(ye(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,ye(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,ye(u,"constructor",c),ye(c,"constructor",s),s.displayName="GeneratorFunction",ye(c,o,"GeneratorFunction"),ye(u),ye(u,o,"Generator"),ye(u,n,function(){return this}),ye(u,"toString",function(){return"[object Generator]"}),(ve=function(){return{w:r,m:d}})()}function ye(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}ye=function(A,e,t,n){function r(e,t){ye(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))},ye(A,e,t,n)}function be(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){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){be(r,n,o,i,a,"next",A)}function a(A){be(r,n,o,i,a,"throw",A)}i(void 0)})}}function Qe(){return Fe.apply(this,arguments)}function Fe(){return Fe=Ce(ve().m(function A(){var e,t,n,o,r,i,a,s,c,l,u=arguments;return ve().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,Oe(400);case 3:return c=s.getBoundingClientRect(),Ue(),(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)})),Fe.apply(this,arguments)}function Ue(){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 xe(){return Se.apply(this,arguments)}function Se(){return Se=Ce(ve().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d=arguments;return ve().w(function(A){for(;;)switch(A.n){case 0:if(t=(e=d.length>0&&void 0!==d[0]?d[0]:{}).selector,n=e.x,o=e.y,r=e.position,i=void 0===r?"center":r,a=e.behavior,s=void 0===a?"smooth":a,!t){A.n=3;break}if(c=document.querySelector(t)){A.n=1;break}return A.a(2,{success:!1,error:"Element not found: ".concat(t)});case 1:return l="top"===i?"start":"bottom"===i?"end":"center",c.scrollIntoView({behavior:s,block:l,inline:"nearest"}),A.n=2,Oe("smooth"===s?500:100);case 2:return u=c.getBoundingClientRect(),A.a(2,{success:!0,scrollType:"element",selector:t,elementPosition:{top:u.top,left:u.left}});case 3:if(void 0===n&&void 0===o){A.n=5;break}return window.scrollTo({top:null!=o?o:window.scrollY,left:null!=n?n:window.scrollX,behavior:s}),A.n=4,Oe("smooth"===s?500:100);case 4:return A.a(2,{success:!0,scrollType:"position",scrolledTo:{x:null!=n?n:window.scrollX,y:null!=o?o:window.scrollY}});case 5:return A.a(2,{success:!1,error:"Either selector or x/y position required"})}},A)})),Se.apply(this,arguments)}function Ee(){return Ie.apply(this,arguments)}function Ie(){return Ie=Ce(ve().m(function A(){var e,t,n,o=arguments;return ve().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=(o.length>0&&void 0!==o[0]?o[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(t.origin===window.location.origin){A.n=4;break}return A.a(2,{success:!1,error:"Cannot navigate to external site (different origin)",attempted:t.href,currentOrigin:window.location.origin});case 4:if(["http:","https:"].includes(t.protocol)){A.n=5;break}return A.a(2,{success:!1,error:"Invalid protocol: ".concat(t.protocol)});case 5:return n=window.location.href,window.location.href=t.href,A.a(2,{success:!0,navigatedTo:t.href,from:n})}},A,null,[[1,2]])})),Ie.apply(this,arguments)}function ke(){return He.apply(this,arguments)}function He(){return He=Ce(ve().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g=arguments;return ve().w(function(A){for(;;)switch(A.n){case 0:if(t=(e=g.length>0&&void 0!==g[0]?g[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(!qA(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,Oe(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})))),Ue(),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)})),He.apply(this,arguments)}function Te(){return De.apply(this,arguments)}function De(){return De=Ce(ve().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g=arguments;return ve().w(function(A){for(;;)switch(A.n){case 0:if(n=(t=g.length>0&&void 0!==g[0]?g[0]:{}).selector,o=t.waitForNavigation,r=void 0!==o&&o,n){A.n=1;break}return A.a(2,{success:!1,error:"Selector is required"});case 1:if(i=document.querySelector(n)){A.n=2;break}return A.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:if(0!==(a=i.getBoundingClientRect()).width&&0!==a.height){A.n=3;break}return A.a(2,{success:!1,error:"Element is not visible (zero size)"});case 3:if(!i.disabled){A.n=4;break}return A.a(2,{success:!1,error:"Element is disabled"});case 4:return i.scrollIntoView({behavior:"smooth",block:"center"}),A.n=5,Oe(300);case 5:return(s=document.createElement("div")).style.cssText="\n position: fixed;\n top: ".concat(a.top-2,"px;\n left: ").concat(a.left-2,"px;\n width: ").concat(a.width+4,"px;\n height: ").concat(a.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(s),A.n=6,Oe(200);case 6:if(s.remove(),!r){A.n=8;break}return l=window.location.href,u=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)}),i.click(),A.n=7,u;case 7:return d=A.v,A.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:i.tagName.toLowerCase(),text:(null===(c=i.innerText)||void 0===c?void 0:c.trim().substring(0,50))||null},navigated:d.navigated||window.location.href!==l});case 8:return i.click(),A.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:i.tagName.toLowerCase(),text:(null===(e=i.innerText)||void 0===e?void 0:e.trim().substring(0,50))||null}})}},A)})),De.apply(this,arguments)}function Oe(A){return new Promise(function(e){return setTimeout(e,A)})}function Pe(){document.querySelectorAll(".ttp-highlight-overlay").forEach(function(A){return A.remove()})}function Ke(){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 Le(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Le(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,Le(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Le(u,"constructor",c),Le(c,"constructor",s),s.displayName="GeneratorFunction",Le(c,o,"GeneratorFunction"),Le(u),Le(u,o,"Generator"),Le(u,n,function(){return this}),Le(u,"toString",function(){return"[object Generator]"}),(Ke=function(){return{w:r,m:d}})()}function Le(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Le=function(A,e,t,n){function r(e,t){Le(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))},Le(A,e,t,n)}function Me(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 Re(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Me(r,n,o,i,a,"next",A)}function a(A){Me(r,n,o,i,a,"throw",A)}i(void 0)})}}function _e(){return Ve.apply(this,arguments)}function Ve(){return(Ve=Re(Ke().m(function A(){var e;return Ke().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,me();case 1:return e=A.v,A.a(2,{url:e.url,title:e.title,timestamp:e.timestamp,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 je(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 Ge(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?je(Object(t),!0).forEach(function(e){At(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return 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 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:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]"}),(Ne=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 Xe(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 Je(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Xe(r,n,o,i,a,"next",A)}function a(A){Xe(r,n,o,i,a,"throw",A)}i(void 0)})}}function ze(A){return ze="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},ze(A)}function Ye(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,et(n.key),n)}}function qe(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(qe=function(){return!!A})()}function Ze(A){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Ze(A)}function $e(A,e){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},$e(A,e)}function At(A,e,t){return(e=et(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function et(A){var e=function(A){if("object"!=ze(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ze(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ze(e)?e:e+""}var tt=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=Ze(e),function(A,e){if(e&&("object"==ze(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,qe()?Reflect.construct(e,t||[],Ze(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.audioPlayer=new T(A.config),A.audioRecorder=new J(A.config),A.setupAudioPlayerEvents(),A.setupAudioRecorderEvents(),A.clientToolsRegistry=new DA(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&&$e(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!==NA);try{if(void 0===NA)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:",ze(NA)),this.clientToolsRegistry.registerHandler("capture_screen",Je(Ne().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,m,w=arguments;return Ne().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=w.length>0&&void 0!==w[0]?w[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,g=t.maxWidth,p=void 0===g?1280:g,h=t.maxHeight,f=void 0===h?1280:h,e.p=1,e.n=2,NA({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:p,maxHeight:f});case 2:return B=e.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(B.width,"x").concat(B.height,", ").concat(Math.round(B.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:B.width,height:B.height,sizeKB:Math.round(B.image.length/1024),selector:B.selector}),e.a(2,B);case 3:throw e.p=3,m=e.v,console.error("📸 VoiceSDK: Screenshot capture failed:",m),A.emit("screenshotError",{error:m.message}),m;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{var e,t=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant);null!=t&&t.enabled?(function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.allowHighlight,n=void 0===t||t,o=e.allowScroll,r=void 0===o||o,i=e.allowNavigate,a=void 0===i||i,s=e.allowFillForm,c=void 0!==s&&s,l=e.allowClick,u=void 0!==l&&l;A.registerHandler("get_dom_context",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Extracting DOM context..."),A.n=1,me(e);case 1:return t=A.v,console.log("[TTP] ✅ DOM context extracted:",{buttons:t.buttons.length,links:t.links.length,forms:t.forms.length,headings:t.headings.length}),A.a(2,t)}},A)}))),n&&A.registerHandler("highlight_element",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,Qe(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)}))),r&&A.registerHandler("scroll_to",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📜 Scrolling to:",e.selector||"(".concat(e.x,", ").concat(e.y,")")),A.n=1,xe(e);case 1:return(t=A.v).success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",t.error),A.a(2,t)}},A)}))),a&&A.registerHandler("navigate_to",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,Ee(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)}))),c&&A.registerHandler("fill_form",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,ke(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)}))),u&&A.registerHandler("click_element",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,Te(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)}))),A.registerHandler("clear_highlights",Re(Ke().m(function A(){return Ke().w(function(A){for(;;)if(0===A.n)return Pe(),A.a(2,{success:!0})},A)}))),console.log("[TTP] 👁️ Visual assistant tools registered:",{highlight:n,scroll:r,navigate:a,fill:c,click:u})}(this.clientToolsRegistry,t),console.log("[TTP] 👁️ Visual assistant enabled")):console.log("[TTP] 👁️ Visual assistant disabled (not configured)")}catch(A){console.error("❌ VoiceSDK: Error registering visual assistant tools:",A),console.error(" Error details:",A.message,A.stack)}}},{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){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:(d=Je(Ne().m(function A(){var e,t,n=this;return Ne().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(),console.log("🔌 VoiceSDK v2: Connecting to",e),A.n=3,new Promise(function(A,t){n.websocket=new WebSocket(e),n.websocket.onopen=function(){console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry&&n.clientToolsRegistry.setSendMessage(function(A){return n.sendMessage(A)}),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){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.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 d.apply(this,arguments)})},{key:"sendHelloMessage",value:(u=Je(Ne().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d;return Ne().w(function(A){for(;;)switch(A.p=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(t={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},n={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},!(o=this.validateInputFormat(t))){A.n=2;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",o),this.emit("error",new Error("Invalid input format: ".concat(o))),A.a(2);case 2:if(!(r=this.validateOutputFormat(n))){A.n=3;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",r),this.emit("error",new Error("Invalid output format: ".concat(r))),A.a(2);case 3:if(i={t:"hello",v:this.config.protocolVersion,inputFormat:t,requestedOutputFormat:n,outputFrameDurationMs:this.config.outputFrameDurationMs},this.config.agentSettingsOverride&&(i.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?(i.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"),null==(a=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant))||!a.enabled){A.n=7;break}return A.p=4,A.n=5,_e();case 5:i.pageContext=A.v,console.log("[TTP] 📋 Page context attached:",{url:i.pageContext.url,title:i.pageContext.title,elements:null===(s=i.pageContext.dom)||void 0===s||null===(s=s.metadata)||void 0===s?void 0:s.totalElements,buttons:null===(c=i.pageContext.dom)||void 0===c||null===(c=c.buttons)||void 0===c?void 0:c.length,links:null===(l=i.pageContext.dom)||void 0===l||null===(l=l.links)||void 0===l?void 0:l.length,forms:null===(u=i.pageContext.dom)||void 0===u||null===(u=u.forms)||void 0===u?void 0:u.length}),A.n=7;break;case 6:A.p=6,d=A.v,console.warn("[TTP] ⚠️ Failed to extract page context:",d);case 7:console.log("📤 VoiceSDK v2: Sending hello:",{version:i.v,requestedFormat:i.requestedOutputFormat,variables:i.variables?Object.keys(i.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:i.requestedOutputFormat.container,encoding:i.requestedOutputFormat.encoding,sampleRate:i.requestedOutputFormat.sampleRate,bitDepth:i.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(i,null,2));try{this.sendMessage(i)}catch(A){console.error("VoiceSDK v2: Failed to send hello:",A),this.emit("error",A)}case 8:return A.a(2)}},A,this,[[4,6]])})),function(){return u.apply(this,arguments)})},{key:"handleMessage",value:function(A){if(A.data instanceof ArrayBuffer||A.data instanceof Blob)this.handleBinaryMessage(A.data);else try{var e=JSON.parse(A.data);switch("audio"!==e.t&&console.log("📥 VoiceSDK v2: Received message type:",e.t,"Full message:",JSON.stringify(e).substring(0,200)),!this.conversationId&&e.conversationId&&(this.conversationId=e.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==e.t&&console.log("📨 VoiceSDK v2: Received message type:",e.t,e),e.t){case"hello_ack":this.handleHelloAck(e);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",e),this.handleTranscript(e);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",e),this.emit("message",e);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",e),(e.text||e.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",e.text||e.transcript),e.sentenceId&&(e.text||e.transcript))){var t={t:"transcript",sentenceId:e.sentenceId,text:e.text||e.transcript,role:e.role||"assistant",final:!1!==e.final,timestamp:e.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",t),this.handleTranscript(t)}this.emit("message",e);break;case"error":this.emit("message",e);break;case"barge_in":this.emit("bargeIn",e),this.stopAudioPlayback();break;case"stop_playing":this.emit("stopPlaying",e),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",e.text),e.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(e.text),this.emit("message",e);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(e);break;case"text_inject_ack":this.handleTextInjectAck(e);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;default:if(console.log("VoiceSDK v2: Unknown message type:",e.t,"Full message:",JSON.stringify(e).substring(0,300)),(e.text||e.transcript||e.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:e.text,transcript:e.transcript,transcription:e.transcription,sentenceId:e.sentenceId,role:e.role}),e.sentenceId&&(e.text||e.transcript||e.transcription))){var n={t:"transcript",sentenceId:e.sentenceId,text:e.text||e.transcript||e.transcription,role:e.role||"assistant",final:!1!==e.final,timestamp:e.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",n),this.handleTranscript(n)}this.emit("message",e)}}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 xA(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...")):console.log("✅ VoiceSDK v2: Connected (v1 legacy mode)");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:"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=Je(Ne().m(function A(e){var t,n,o,r,i,a,s,c,l;return Ne().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}}else console.warn("🔌 VoiceSDK v2: Cannot hangup - WebSocket not open")}},{key:"startRecording",value:(c=Je(Ne().m(function A(){var e,t,n;return Ne().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:return A.n=5,this.audioPlayer.resumeAudioContext();case 5:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),this._requestWakeLock(),A.a(2,!0);case 6:return A.p=6,n=A.v,console.error("❌ VoiceSDK v2: Failed to start recording:",n),"NotAllowedError"===n.name||"PermissionDeniedError"===n.name?((t=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.")).name=n.name,t.originalError=n,this.emit("error",t)):this.emit("error",n),A.a(2,!1)}},A,this,[[3,6]])})),function(){return c.apply(this,arguments)})},{key:"stopRecording",value:(s=Je(Ne().m(function A(){var e;return Ne().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=Je(Ne().m(function A(){return Ne().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=Je(Ne().m(function A(){var e,t=this;return Ne().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=Je(Ne().m(function A(){var e;return Ne().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=Je(Ne().m(function A(){return Ne().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=Ge(Ge({},this.config),A)}},{key:"generateTtpId",value:function(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}},{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;this.isDestroyed||(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.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&&Ye(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c,l,u,d}(a);At(tt,"RESUME_STORAGE_KEY","voice_resume_state"),At(tt,"RESUME_TTL_MS",1e4),At(tt,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(tt,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(tt,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),At(tt,"SUPPORTED_INPUT_CHANNELS",[1]),At(tt,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(tt,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(tt,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),At(tt,"SUPPORTED_OUTPUT_CHANNELS",[1]),At(tt,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const nt=tt;function ot(A){return ot="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},ot(A)}function rt(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,it(n.key),n)}}function it(A){var e=function(A){if("object"!=ot(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ot(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ot(e)?e:e+""}var at=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&&rt(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function st(A){return st="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},st(A)}function ct(){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 lt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(lt(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,lt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,lt(u,"constructor",c),lt(c,"constructor",s),s.displayName="GeneratorFunction",lt(c,o,"GeneratorFunction"),lt(u),lt(u,o,"Generator"),lt(u,n,function(){return this}),lt(u,"toString",function(){return"[object Generator]"}),(ct=function(){return{w:r,m:d}})()}function lt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}lt=function(A,e,t,n){function r(e,t){lt(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))},lt(A,e,t,n)}function ut(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 dt(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 gt(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(t),!0).forEach(function(e){pt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):dt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function pt(A,e,t){return(e=ft(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function ht(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,ft(n.key),n)}}function ft(A){var e=function(A){if("object"!=st(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=st(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==st(e)?e:e+""}function Bt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Bt=function(){return!!A})()}function mt(A){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},mt(A)}function wt(A,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},wt(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=mt(e),function(A,e){if(e&&("object"==st(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,Bt()?Reflect.construct(e,t||[],mt(A).constructor):e.apply(A,t))}(this,e)).readScriptTagConfig();return A.config=gt({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&&wt(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=ct().m(function A(e){var t=this;return ct().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){ut(r,t,n,i,a,"next",A)}function a(A){ut(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){}}},g=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()},p=new WebSocket(o);p.onopen=u(p),p.onmessage=d(p),p.onerror=(n=p,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=g)}e.emit("error",t),A.reject(t)}),p.onclose=g}},{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=gt(gt({},this.config),A)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&ht(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(at);function yt(A){return yt="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},yt(A)}function bt(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)||Qt(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 Ct(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Qt(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 Qt(A,e){if(A){if("string"==typeof A)return Ft(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)?Ft(A,e):void 0}}function Ft(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 Ut(){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:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]"}),(Ut=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 St(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 Et(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,It(n.key),n)}}function It(A){var e=function(A){if("object"!=yt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=yt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==yt(e)?e:e+""}function kt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(kt=function(){return!!A})()}function Ht(A){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Ht(A)}function Tt(A,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Tt(A,e)}const Dt=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=Ht(e),function(A,e){if(e&&("object"==yt(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||[],Ht(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&&Tt(A,e)}(e,A),t=e,n=[{key:"getConnection",value:(o=Ut().m(function A(e){var t,n,o=this;return Ut().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){St(r,t,n,i,a,"next",A)}function a(A){St(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=Ct(this.connections.entries());try{for(t.s();!(A=t.n()).done;){var n=bt(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=Ct(this.connections.entries());try{for(e.s();!(A=e.n()).done;){var t=bt(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&&Et(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(at));function Ot(A){return Ot="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},Ot(A)}function Pt(){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 Kt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Kt(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,Kt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Kt(u,"constructor",c),Kt(c,"constructor",s),s.displayName="GeneratorFunction",Kt(c,o,"GeneratorFunction"),Kt(u),Kt(u,o,"Generator"),Kt(u,n,function(){return this}),Kt(u,"toString",function(){return"[object Generator]"}),(Pt=function(){return{w:r,m:d}})()}function Kt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Kt=function(A,e,t,n){function r(e,t){Kt(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))},Kt(A,e,t,n)}function Lt(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 Mt(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,Rt(n.key),n)}}function Rt(A){var e=function(A){if("object"!=Ot(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ot(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ot(e)?e:e+""}function _t(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(_t=function(){return!!A})()}function Vt(A){return Vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Vt(A)}function jt(A,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},jt(A,e)}var Gt=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=Vt(e),function(A,e){if(e&&("object"==Ot(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,_t()?Reflect.construct(e,t||[],Vt(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&&jt(A,e)}(e,A),t=e,n=[{key:"connect",value:(r=Pt().m(function A(){var e=this;return Pt().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;Dt.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){Lt(o,t,n,i,a,"next",A)}function a(A){Lt(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)};Dt.on("open",e),Dt.on("close",t),Dt.on("error",n),Dt.on("message",o),this.eventHandlers={open:e,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(Dt.off("open",this.eventHandlers.open),Dt.off("close",this.eventHandlers.close),Dt.off("error",this.eventHandlers.error),Dt.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&Dt.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 Dt.getAllConnections()}},{key:"clearAllConnections",value:function(){Dt.clearAll()}}],n&&Mt(t.prototype,n),o&&Mt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(at);function Nt(A){return Nt="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},Nt(A)}function Wt(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 Xt(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(t),!0).forEach(function(e){Jt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Wt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Jt(A,e,t){return(e=en(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function zt(){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 Yt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Yt(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,Yt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Yt(u,"constructor",c),Yt(c,"constructor",s),s.displayName="GeneratorFunction",Yt(c,o,"GeneratorFunction"),Yt(u),Yt(u,o,"Generator"),Yt(u,n,function(){return this}),Yt(u,"toString",function(){return"[object Generator]"}),(zt=function(){return{w:r,m:d}})()}function Yt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Yt=function(A,e,t,n){function r(e,t){Yt(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))},Yt(A,e,t,n)}function qt(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){qt(r,n,o,i,a,"next",A)}function a(A){qt(r,n,o,i,a,"throw",A)}i(void 0)})}}function $t(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 An(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,en(n.key),n)}}function en(A){var e=function(A){if("object"!=Nt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Nt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Nt(e)?e:e+""}function tn(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(tn=function(){return!!A})()}function nn(A){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},nn(A)}function on(A,e){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},on(A,e)}var rn=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=nn(e),function(A,e){if(e&&("object"==Nt(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,tn()?Reflect.construct(e,t||[],nn(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&&on(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 $t(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)?$t(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=Zt(zt().m(function A(){var e;return zt().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=Zt(zt().m(function A(){var e,t,n,o;return zt().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?Xt(Xt({},t),this.config.audioConstraints):t,A.n=3,navigator.mediaDevices.getUserMedia({audio:Xt({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=Zt(zt().m(function A(){var e,t,n,o,r,i,a,s,c,l=this;return zt().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?Xt(Xt({},n),this.config.audioConstraints):n,A.n=2,navigator.mediaDevices.getUserMedia({audio:Xt({sampleRate:t,channelCount:1},o)});case 2:if(this.mediaStream=A.v,this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t}),"suspended"!==this.audioContext.state){A.n=3;break}return A.n=3,this.audioContext.resume();case 3:return r=this.getAudioProcessorPath(),A.n=4,this.audioContext.audioWorklet.addModule(r);case 4:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor",{processorOptions:{sampleRate:t,outputSampleRate:this.config.outputSampleRate}}),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&l.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=9;break;case 5:if(A.p=5,c=A.v,i=c.message,"NotAllowedError"!==c.name&&"PermissionDeniedError"!==c.name){A.n=7;break}return A.n=6,this.checkPermissionState();case 6:"denied"===(a=A.v)?(i='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"===a?(i='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.')):(i="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=8;break;case 7:"NotFoundError"===c.name||"DevicesNotFoundError"===c.name?(i="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===c.name||"TrackStartError"===c.name?(i="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"!==c.name&&"PermissionDeniedError"!==c.name||(i="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 8:throw(s=new Error(i)).name=c.name,s.originalError=c,this.emit("error",s),s;case 9:return A.a(2)}},A,this,[[0,5]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=Zt(zt().m(function A(){var e;return zt().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.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=Zt(zt().m(function A(){var e,t;return zt().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&&An(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a}(at);function an(A){return an="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},an(A)}function sn(){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 cn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(cn(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,cn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,cn(u,"constructor",c),cn(c,"constructor",s),s.displayName="GeneratorFunction",cn(c,o,"GeneratorFunction"),cn(u),cn(u,o,"Generator"),cn(u,n,function(){return this}),cn(u,"toString",function(){return"[object Generator]"}),(sn=function(){return{w:r,m:d}})()}function cn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}cn=function(A,e,t,n){function r(e,t){cn(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))},cn(A,e,t,n)}function ln(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 un(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){ln(r,n,o,i,a,"next",A)}function a(A){ln(r,n,o,i,a,"throw",A)}i(void 0)})}}function dn(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"!=an(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=an(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==an(e)?e:e+""}function pn(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(pn=function(){return!!A})()}function hn(A){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},hn(A)}function fn(A,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},fn(A,e)}var Bn=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=hn(e),function(A,e){if(e&&("object"==an(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,pn()?Reflect.construct(e,t||[],hn(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&&fn(A,e)}(e,A),t=e,n=[{key:"initializeAudioContext",value:(i=un(sn().m(function A(){var e,t,n,o,r,i;return sn().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=un(sn().m(function A(){var e,t,n,o,r,i,a,s,c=this;return sn().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=un(sn().m(function A(){var e;return sn().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&&dn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(at),mn=t(540),wn=t(848);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 yn(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){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?yn(Object(t),!0).forEach(function(e){Cn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yn(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Cn(A,e,t){return(e=function(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+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Qn(){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 Fn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Fn(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,Fn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Fn(u,"constructor",c),Fn(c,"constructor",s),s.displayName="GeneratorFunction",Fn(c,o,"GeneratorFunction"),Fn(u),Fn(u,o,"Generator"),Fn(u,n,function(){return this}),Fn(u,"toString",function(){return"[object Generator]"}),(Qn=function(){return{w:r,m:d}})()}function Fn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Fn=function(A,e,t,n){function r(e,t){Fn(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))},Fn(A,e,t,n)}function Un(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 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)||function(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}}(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 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}const En=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,g=A.visualAssistant,p=void 0===g?null:g,h=A.onConnected,f=A.onDisconnected,B=A.onRecordingStarted,m=A.onRecordingStopped,w=A.onPlaybackStarted,v=A.onPlaybackStopped,y=A.onError,b=A.onMessage,C=A.onBargeIn,Q=A.onStopPlaying,F=A.onStartConversation,U=A.onEndConversation,x=A.className,S=void 0===x?"":x,E=A.style,I=void 0===E?{}:E,k=A.children,H=xn((0,mn.useState)(!1),2),T=H[0],D=H[1],O=xn((0,mn.useState)(!1),2),P=O[0],K=O[1],L=xn((0,mn.useState)(!1),2),M=(L[0],L[1]),R=xn((0,mn.useState)("Disconnected"),2),_=(R[0],R[1]),V=(0,mn.useRef)(null);(0,mn.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||e)),V.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),V.current.destroy(),V.current=null);var A=new nt({signedUrl:t||e,websocketUrl:t||e,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,visualAssistant:p,onStartConversation:F,onEndConversation:U});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==B||B()}),A.on("recordingStopped",function(){K(!1),null==m||m()}),A.on("playbackStarted",function(){M(!0),null==w||w()}),A.on("playbackStopped",function(){M(!1),null==v||v()}),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)}),V.current=A,A.connect(),function(){var A=e||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),V.current&&(V.current.destroy(),V.current=null)}},[e,t,n,o,i,s,d,p]);var j=function(){var A,e=(A=Qn().m(function A(){var e;return Qn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(V.current){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,V.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){Un(r,n,o,i,a,"next",A)}function a(A){Un(r,n,o,i,a,"throw",A)}i(void 0)})});return function(){return e.apply(this,arguments)}}(),G=(0,wn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,wn.jsx)("div",{style:{fontSize:"20px"},children:P?"🔴":"🎤"}),(0,wn.jsx)("div",{children:P?"Stop Listening":"Start Listening"})]});return(0,wn.jsx)("button",{className:"voice-button ".concat(P?"recording":""," ").concat(S),style:bn({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:P?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},I),onClick:j,disabled:!T,children:k||G})};function In(A){return In="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},In(A)}function kn(){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:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]"}),(kn=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 Tn(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 Dn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Tn(r,n,o,i,a,"next",A)}function a(A){Tn(r,n,o,i,a,"throw",A)}i(void 0)})}}function On(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 Pn(A,e,t){return(e=Ln(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Kn(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,Ln(n.key),n)}}function Ln(A){var e=function(A){if("object"!=In(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=In(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==In(e)?e:e+""}var Mn=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?On(Object(t),!0).forEach(function(e){Pn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):On(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,this.voiceSDK=new nt({signedUrl:this.options.websocketUrl||this.options.signedUrl,websocketUrl:this.options.websocketUrl||this.options.signedUrl,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=Dn(kn().m(function A(){var e;return kn().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=Dn(kn().m(function A(){var e;return kn().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&&Kn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function Rn(){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 _n(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(_n(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,_n(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,_n(u,"constructor",c),_n(c,"constructor",s),s.displayName="GeneratorFunction",_n(c,o,"GeneratorFunction"),_n(u),_n(u,o,"Generator"),_n(u,n,function(){return this}),_n(u,"toString",function(){return"[object Generator]"}),(Rn=function(){return{w:r,m:d}})()}function _n(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}_n=function(A,e,t,n){function r(e,t){_n(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))},_n(A,e,t,n)}function Vn(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)||Gn(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 jn(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Gn(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 Gn(A,e){if(A){if("string"==typeof A)return Nn(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)?Nn(A,e):void 0}}function Nn(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 Wn(A){return Wn="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},Wn(A)}function Xn(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 Jn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Xn(r,n,o,i,a,"next",A)}function a(A){Xn(r,n,o,i,a,"throw",A)}i(void 0)})}}function zn(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"!=Wn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Wn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Wn(e)?e:e+""}var qn=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 nt({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=Jn(Rn().m(function A(e){var t,n,o,r,i,a,s,c,l=this;return Rn().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 nt({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!",Wn(l.onTranscript))),l.onSubtitleDisplay(A)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=jn(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=Vn(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=Jn(Rn().m(function A(){var e;return Rn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){A.n=5;break}return A.p=1,console.log("🎤 AgentSDK: Starting recording..."),A.n=2,this.voiceSDK.startRecording();case 2:console.log("✅ AgentSDK: Recording started successfully"),A.n=4;break;case 3:throw A.p=3,e=A.v,console.error("❌ AgentSDK: Failed to start recording:",e),e;case 4:A.n=6;break;case 5:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 6: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&&zn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function Zn(){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 $n(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):($n(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,$n(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,$n(u,"constructor",c),$n(c,"constructor",s),s.displayName="GeneratorFunction",$n(c,o,"GeneratorFunction"),$n(u),$n(u,o,"Generator"),$n(u,n,function(){return this}),$n(u,"toString",function(){return"[object Generator]"}),(Zn=function(){return{w:r,m:d}})()}function $n(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}$n=function(A,e,t,n){function r(e,t){$n(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))},$n(A,e,t,n)}function Ao(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 eo(){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 to(){return no.apply(this,arguments)}function no(){var A;return A=Zn().m(function A(){var e;return Zn().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]])}),no=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Ao(r,n,o,i,a,"next",A)}function a(A){Ao(r,n,o,i,a,"throw",A)}i(void 0)})},no.apply(this,arguments)}function oo(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 ro(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 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){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,so(n.key),n)}}function so(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+""}function co(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 lo(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)?lo(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 lo(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 uo=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)}}])&&ao(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function go(A,e){var t=new uo,n=t.createOverlay(),o=eo(),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 po(A,e){var t,n,o,r=new uo,i=r.createOverlay(),a=eo(),s=oo(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=co(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=co(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 g=d.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(g){r=g[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 p=window.location.pathname.split("/");p.pop(),(r=window.location.origin+p.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(){ro(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(),eo();var e,t=document.getElementsByTagName("script"),n="",o=co(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=co(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"),g=document.createElement("div");g.id="mic-address-bar-hint",g.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 p=document.createElement("div");p.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 B=document.createElement("div");B.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var m=document.createElement("div");m.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",m.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var w=document.createElement("button");if(w.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 ",w.textContent="✕",w.addEventListener("click",function(){g.remove()}),w.addEventListener("mouseenter",function(){w.style.background="rgba(255, 255, 255, 0.3)"}),w.addEventListener("mouseleave",function(){w.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var v=document.createElement("style");v.id="mic-address-bar-hint-styles",v.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(v)}B.appendChild(m),p.appendChild(h),p.appendChild(B),p.appendChild(w),g.appendChild(p),document.body.appendChild(g),setTimeout(function(){g.parentNode&&(g.style.opacity="0",g.style.transition="opacity 0.3s ease-out",setTimeout(function(){g.parentNode&&g.remove()},300))},1e4)}()});var g=c.querySelector(".mic-permission-modal__alt-toggle");if(g&&s.altSteps){var p=g.nextElementSibling;p&&(p.style.display="none",g.addEventListener("click",function(){"none"===p.style.display?(p.style.display="block",g.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(p.style.display="none",g.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(e){e.target===i&&(r.close(),A())}),r.show(),r}function ho(A){var e=new uo,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 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 Bo(){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 mo(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(mo(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,mo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,mo(u,"constructor",c),mo(c,"constructor",s),s.displayName="GeneratorFunction",mo(c,o,"GeneratorFunction"),mo(u),mo(u,o,"Generator"),mo(u,n,function(){return this}),mo(u,"toString",function(){return"[object Generator]"}),(Bo=function(){return{w:r,m:d}})()}function mo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}mo=function(A,e,t,n){function r(e,t){mo(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))},mo(A,e,t,n)}function wo(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 vo(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){wo(r,n,o,i,a,"next",A)}function a(A){wo(r,n,o,i,a,"throw",A)}i(void 0)})}}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"!=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 Co=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.shadowRoot=e.shadowRoot||document,this.textSDK=e.textSDK||null,this.deviceInfo=eo(),this.isMobile=this.deviceInfo.isMobile,this.messages=[],this.isTranscriptExpanded=!1,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=e.visualAssistant||(null===(t=e.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);this.sdk=new qn({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.setupSDKEventHandlers(),this.checkAndHandleResume()},e=[{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())):(t.classList.remove("speaking"),A.isMobile&&(A.updateMobileStatus("listening"),A.startWaveformAnimation())))},this.sdk.onDisconnected=function(){console.log("🔌 WebSocket disconnected, hanging up call..."),A.isActive&&(A.isActive=!1,A.endVoiceCall())},this.sdk.onError=function(e){console.error("❌ Voice SDK Error:",e),e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))?A.showDomainError():A.showError(e.message||e)}}},{key:"setupTextInjectAckHandler",value:function(){var A,e=this;null!==(A=this.sdk)&&void 0!==A&&A.voiceSDK&&(this._textInjectAckHandler&&this.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=function(A){e.handleTextInjectAck(A)},this.sdk.voiceSDK.on("textInjectAck",this._textInjectAckHandler),console.log("📝 VoiceInterface: textInjectAck handler registered"))}},{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.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 --\x3e\n <div id="voiceActiveState" style="display: none;">\n <div class="voice-avatar-active" id="voiceAvatarActive">\n <div class="voice-rings">\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n </div>\n 🤖\n </div>\n <div class="voice-status">\n <div class="voice-status-title" id="voiceStatusTitleActive">').concat(this.t("listening"),'</div>\n <div class="voice-status-subtitle" id="voiceStatusSubtitleActive">').concat(this.t("speakFreely"),'</div>\n </div>\n <div class="voice-transcript">\n <div class="transcript-label">').concat(this.t("liveTranscript"),'</div>\n <div class="transcript-text empty" id="transcriptText">\n ').concat(this.t("transcriptWillAppear"),'\n </div>\n </div>\n \n \x3c!-- Text Input (type while on voice call) --\x3e\n <div class="voice-text-input-area">\n <div class="voice-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="voiceTextInput"\n class="voice-text-input"\n />\n <button class="voice-send-btn" id="voiceSendBtn" 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="voice-input-hint">🎙️ Voice is still active • Type or speak</p>\n </div>\n \n <div class="voice-controls">\n <button class="voice-control-btn secondary" id="muteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mute-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 <line x1="8" y1="23" x2="16" y2="23"/>\n <line x1="2" y1="2" x2="22" y2="22" class="mute-cross" style="display: none; stroke: #ef4444; stroke-width: 3.5;"/>\n </svg>\n </button>\n <button class="voice-control-btn primary active" id="endCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg width="56" height="56" viewBox="0 0 24 24" fill="#ef4444">\n <rect x="6" y="6" width="12" height="12" rx="2"/>\n </svg>\n <div class="voice-timer" id="voiceTimer">00:00</div>\n </button>\n <button class="voice-control-btn secondary" id="speakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\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 0 1 0 14.14"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n </button>\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>')}},{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,!1===this.config.useShadowDOM?" !important":"");return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(u,"; \n flex: 1; \n flex-direction: column;\n align-items: center; \n justify-content: center; \n padding: 6px 10px 6px 10px; \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(u,'; }\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: center;\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: clamp(4px, 1vh, 8px);\n padding: clamp(6px, 1.2vh, 10px) 0 clamp(4px, 0.8vh, 8px) 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);\n height: clamp(48px, 8vh, 64px);\n border-radius: clamp(24px, 4vh, 32px);\n border: none;\n background: ").concat(o,";\n color: ").concat(r,";\n font-size: clamp(14px, 2.5vh, 18px);\n font-weight: 600;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\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 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 \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: min(360px, calc(100% - 40px));\n margin: clamp(6px, 1vh, 10px) 0 clamp(6px, 1vh, 10px) 0;\n flex-shrink: 0;\n }\n \n .voice-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 transition: border-color 0.2s ease;\n }\n \n .voice-input-wrapper:focus-within {\n border-color: #7c3aed;\n box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);\n }\n \n .voice-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-size: clamp(12px, 1.8vh, 14px);\n color: #374151;\n background: transparent;\n padding: clamp(8px, 1.2vh, 10px) 0;\n }\n \n .voice-text-input::placeholder {\n color: #9ca3af;\n }\n \n .voice-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: clamp(36px, 5vh, 40px);\n height: clamp(36px, 5vh, 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: opacity 0.2s ease, transform 0.1s ease;\n flex-shrink: 0;\n }\n \n .voice-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n opacity: 0.9;\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 }\n \n .voice-send-btn svg {\n width: clamp(16px, 2.2vh, 18px);\n height: clamp(16px, 2.2vh, 18px);\n }\n \n .voice-input-hint {\n margin: clamp(4px, 0.6vh, 6px) 0 0;\n font-size: clamp(9px, 1.2vh, 11px);\n color: #9ca3af;\n text-align: center;\n transition: color 0.2s ease;\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);\n height: clamp(48px, 9vh, 72px);\n aspect-ratio: 1;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s;\n position: relative;\n flex-shrink: 0;\n }\n \n .voice-control-btn svg {\n width: 48%;\n height: 48%;\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px);\n height: clamp(54px, 10vh, 80px);\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\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;\n animation: recordingPulse 1.5s ease-in-out infinite;\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,";\n color: ").concat(l,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc;\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6;\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\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 /* 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 Styles - Fixed at bottom of viewport */\n /* These styles are injected into document head when mobile bar is created */\n \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;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15);\n }\n \n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25);\n }\n \n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3);\n }\n \n .mobile-end-call-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n background-color: #ef4444;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\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 }\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-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: opacity 0.2s ease;\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:"setupEventHandlers",value:function(A){var e=this,t=this.shadowRoot.getElementById("startCallBtn"),n=this.shadowRoot.getElementById("endCallBtn"),o=this.shadowRoot.getElementById("muteBtn"),r=this.shadowRoot.getElementById("speakerBtn");if(t&&(t.onclick=function(){return e.startVoiceCall()}),n&&(n.onclick=function(){return e.endVoiceCall()}),o&&(o.onclick=function(){return e.toggleMute()}),r&&(r.onclick=function(){return e.toggleSpeaker()}),!this.isMobile){var i=this.shadowRoot.getElementById("voiceTextInput"),a=this.shadowRoot.getElementById("voiceSendBtn");i&&(i.addEventListener("input",function(){a&&(a.disabled=!i.value.trim())}),i.addEventListener("keypress",function(A){"Enter"===A.key&&i.value.trim()&&(A.preventDefault(),e.sendDesktopTextMessage())})),a&&(a.onclick=function(){return e.sendDesktopTextMessage()})}if(this.isMobile&&this.setupMobileEventHandlers(),!this.isMobile){var s=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.shadowRoot.getElementById("voiceInterface");t&&t.classList.contains("active")&&t.clientHeight>100?(console.log("✅ Interface is active and has proper dimensions, adjusting sizes (attempt",A+1,")"),e.adjustSizesForContainer(),0===A&&setTimeout(function(){return e.adjustSizesForContainer()},500)):A<15?(console.log("⏳ Interface not ready yet (height:",null==t?void 0:t.clientHeight,"), retrying... (attempt",A+1,")"),setTimeout(function(){return s(A+1)},250)):t&&0===t.clientHeight?console.log("ℹ️ Interface has zero height (likely hidden), skipping size adjustment"):(console.warn("⚠️ Interface never became fully ready, adjusting sizes anyway"),e.adjustSizesForContainer())};setTimeout(function(){return s()},200)}this.isMobile||window.addEventListener("resize",function(){console.log("🔄 Window resized, re-adjusting sizes"),e.adjustSizesForContainer()})}},{key:"setupMobileEventHandlers",value:function(){var A=this,e=this.isMobile?document:this.shadowRoot,t=e.getElementById("mobileMuteBtn"),n=e.getElementById("mobileSpeakerBtn"),o=e.getElementById("mobileEndCallBtn"),r=e.getElementById("mobileTranscriptRow"),i=e.getElementById("mobileCloseTranscriptBtn"),a=e.getElementById("mobileSendBtn"),s=e.getElementById("mobileTextInput"),c=e.getElementById("mobileTranscriptOverlay");t&&(t.onclick=function(e){e.stopPropagation(),A.toggleMute()}),n&&(n.onclick=function(e){e.stopPropagation(),A.toggleSpeaker()}),o&&(o.onclick=function(e){e.stopPropagation(),A.endVoiceCall()}),r&&(r.onclick=function(){A.expandMobileTranscript()}),i&&(i.onclick=function(){A.collapseMobileTranscript()}),c&&(c.onclick=function(e){e.target===c&&A.collapseMobileTranscript()}),a&&(a.onclick=function(){A.sendMobileTextMessage()}),s&&(s.onkeypress=function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),A.sendMobileTextMessage())},s.oninput=function(){var A=s.value.trim().length>0;a&&(a.disabled=!A)})}},{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:"_sendTextMessage",value:function(A,e,t,n){var o,r=n?this.showMobileTextInputStatus.bind(this):this.showTextInputStatus.bind(this),i=n?"_mobileTextInjectTimeout":"_textInjectTimeout",a=n?"Mobile":"Desktop";if(!this.isActive||null===(o=this.sdk)||void 0===o||null===(o=o.voiceSDK)||void 0===o||!o.isConnected)return console.warn("VoiceInterface: Cannot send text - no active voice call (".concat(a,")")),void r("error","Not connected");if(e&&t){var s=null==A?void 0:A.trim();if(s){if(s.length>5e3)r("error","Message too long (max 5000)");else if(!e.disabled){e.disabled=!0,t.disabled=!0,r("sending","Sending...");try{var c={t:"text_inject",text:s};if(!this.sdk.voiceSDK.sendMessage(c))throw new Error("Failed to send message");e.value="",console.log("VoiceInterface: ".concat(a," text message sent:"),s.substring(0,50)),this[i]=setTimeout(function(){e.disabled&&(console.warn("VoiceInterface: No ack received for ".concat(a.toLowerCase()," text inject")),e.disabled=!1,t.disabled=!0,r("error","No response"))},5e3)}catch(A){console.error("VoiceInterface: Error sending ".concat(a.toLowerCase()," text:"),A),r("error","Failed to send"),e.disabled=!1,t.disabled=!e.value.trim()}}}else r("error","Enter text first")}else console.warn("VoiceInterface: Missing UI elements (".concat(a,")"))}},{key:"sendMobileTextMessage",value:(i=vo(Bo().m(function A(){var e,t;return Bo().w(function(A){for(;;)switch(A.n){case 0:if(e=document.getElementById("mobileTextInput"),t=document.getElementById("mobileSendBtn"),e&&t){A.n=1;break}return A.a(2);case 1:this._sendTextMessage(e.value,e,t,!0);case 2:return A.a(2)}},A,this)})),function(){return i.apply(this,arguments)})},{key:"sendDesktopTextMessage",value:(r=vo(Bo().m(function A(){var e,t;return Bo().w(function(A){for(;;)switch(A.n){case 0:if(e=this.shadowRoot.getElementById("voiceTextInput"),t=this.shadowRoot.getElementById("voiceSendBtn"),e&&t){A.n=1;break}return A.a(2);case 1:this._sendTextMessage(e.value,e,t,!1);case 2:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"showTextInputStatus",value:function(A,e){var t=this.shadowRoot.querySelector(".voice-input-hint");if(t)switch(this._originalHintText||(this._originalHintText=t.textContent),A){case"sending":t.textContent="⏳ ".concat(e),t.className="voice-input-hint voice-input-hint--sending";break;case"success":t.textContent="✓ ".concat(e),t.className="voice-input-hint voice-input-hint--success",this.clearTextInputStatusAfterDelay();break;case"queued":t.textContent="⏳ ".concat(e),t.className="voice-input-hint voice-input-hint--queued",this.clearTextInputStatusAfterDelay();break;case"error":t.textContent="✗ ".concat(e),t.className="voice-input-hint voice-input-hint--error",this.clearTextInputStatusAfterDelay();break;default:t.textContent=this._originalHintText||"🎙️ Voice is still active • Type or speak",t.className="voice-input-hint"}}},{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.showTextInputStatus("clear")},e)}},{key:"showMobileTextInputStatus",value:function(A,e){var t=document.querySelector(".mobile-input-hint");if(t)switch(this._originalMobileHintText||(this._originalMobileHintText=t.textContent),A){case"sending":t.textContent="⏳ ".concat(e),t.className="mobile-input-hint mobile-input-hint--sending";break;case"success":t.textContent="✓ ".concat(e),t.className="mobile-input-hint mobile-input-hint--success",this.clearMobileTextInputStatusAfterDelay();break;case"queued":t.textContent="⏳ ".concat(e),t.className="mobile-input-hint mobile-input-hint--queued",this.clearMobileTextInputStatusAfterDelay();break;case"error":t.textContent="✗ ".concat(e),t.className="mobile-input-hint mobile-input-hint--error",this.clearMobileTextInputStatusAfterDelay();break;default:t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",t.className="mobile-input-hint"}}},{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")},e)}},{key:"handleTextInjectAck",value:function(A){var e,t;console.log("VoiceInterface: Text inject ack:",A),this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null);var n=this.shadowRoot.getElementById("voiceTextInput"),o=this.shadowRoot.getElementById("voiceSendBtn");n&&(n.disabled=!1),o&&(o.disabled=!(null!=n&&null!==(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.isMobile?this.showMobileTextInputStatus(c,l):this.showTextInputStatus(c,l)}else{var u=A.message||"Failed to send";this.isMobile?this.showMobileTextInputStatus("error",u):this.showTextInputStatus("error",u)}}},{key:"addMobileMessage",value:function(A,e){this.messages.push({type:A,text:e});var t=document.getElementById("mobileTranscriptText");t&&(t.textContent=e);var n=document.getElementById("mobileMessagesContainer");if(n){var o=document.createElement("div");o.className="mobile-message-bubble ".concat(A),o.textContent=e,n.appendChild(o),setTimeout(function(){n.scrollTop=n.scrollHeight},50)}}},{key:"startWaveformAnimation",value:function(){this.waveformInterval||(this.waveformInterval=setInterval(function(){var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(function(A,e){var t=.2+.8*Math.random();A.style.height="".concat(24*t,"px")})},150))}},{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="4px"})}},{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.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">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">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 '),document.body.appendChild(t),this.setupMobileEventHandlers(),console.log("✅ Mobile minimized bar created and appended to body")}},{key:"removeMobileMinimizedBar",value:function(){var A=document.getElementById("mobile-voice-call-bar-container");A&&A.remove()}},{key:"generateMobileCSS",value:function(){return"\n /* Mobile Voice Call UI Styles - Fixed at bottom of viewport */\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 .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;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15);\n position: relative;\n }\n \n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25);\n }\n \n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3);\n }\n \n .mobile-control-btn svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\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;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n background-color: #ef4444;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\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 }\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-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: opacity 0.2s ease;\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 }\n "}},{key:"getSignedUrl",value:(o=vo(Bo().m(function A(){var e,t;return Bo().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://speech.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"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return o.apply(this,arguments)})},{key:"adjustSizesForContainer",value:function(){if(!this.isMobile){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e=A.clientHeight,t=A.clientWidth;console.log("📏 Container size:",e,"x",t);var n=this.shadowRoot.getElementById("voiceIdleState"),o=this.shadowRoot.getElementById("voiceActiveState"),r=n&&"none"!==n.style.display,i=o&&"none"!==o.style.display;console.log("👁️ Visible state - Idle:",r,"Active:",i);var a,s,c,l,u,d,g,p,h,f=e-12-5*Math.max(4,Math.min(8,e/80)),B=Math.max(55,Math.min(75,.12*e)),m=Math.max(50,Math.min(70,.12*e)),w=Math.max(35,Math.min(50,.1*e)),v=Math.max(100,f-B-m-w);e<=350?(h=4,a=Math.max(50,Math.min(70,.35*v)),s=Math.floor(.5*a),c=10,l=8,u=28,d=Math.max(50,Math.floor(.4*v)),g=38,p=44):e<=450?(h=5,a=Math.max(70,Math.min(100,.4*v)),s=Math.floor(.5*a),c=13,l=10,u=34,d=Math.max(60,Math.floor(.45*v)),g=46,p=52):e<=550?(h=6,a=Math.max(90,Math.min(120,.42*v)),s=Math.floor(.5*a),c=14,l=11,u=38,d=Math.max(70,Math.floor(.48*v)),g=50,p=58):e<=700?(h=7,a=Math.max(110,Math.min(130,.44*v)),s=Math.floor(.5*a),c=16,l=12,u=42,d=Math.max(80,Math.floor(.5*v)),g=54,p=64):(h=8,a=Math.max(130,Math.min(150,.46*v)),s=Math.floor(.5*a),c=18,l=13,u=46,d=Math.max(90,Math.floor(.52*v)),g=60,p=70),this.shadowRoot.querySelectorAll("#voiceIdleState, #voiceActiveState").forEach(function(A){A.style.gap="".concat(h,"px")});var y=this.shadowRoot.querySelectorAll(".voice-avatar, .voice-avatar-active");console.log("🤖 Found",y.length,"avatars, setting size to",a,"px"),y.forEach(function(A){A.style.width="".concat(a,"px"),A.style.height="".concat(a,"px"),A.style.fontSize="".concat(s,"px")}),this.shadowRoot.querySelectorAll(".voice-status-title").forEach(function(A){return A.style.fontSize="".concat(c,"px")}),this.shadowRoot.querySelectorAll(".voice-status-subtitle").forEach(function(A){return A.style.fontSize="".concat(l,"px")});var b=this.shadowRoot.querySelector(".voice-transcript");b&&(b.style.minHeight="".concat(d,"px"),b.style.maxHeight="".concat(d,"px"),b.style.height="".concat(d,"px"),b.style.width="min(360px, ".concat(t-40,"px)"),b.style.boxSizing="border-box");var C=this.shadowRoot.querySelector(".transcript-label");C&&(C.style.fontSize="".concat(Math.max(8,c-4),"px"));var Q=this.shadowRoot.querySelector(".transcript-text");Q&&(Q.style.fontSize="".concat(Math.max(10,c-2),"px"));var F=this.shadowRoot.querySelector(".voice-text-input-area");if(F){var U=F.querySelector(".voice-input-wrapper"),x=F.querySelector(".voice-text-input"),S=F.querySelector(".voice-send-btn"),E=F.querySelector(".voice-input-hint");if(U&&S){var I=Math.max(32,Math.min(40,.7*g));S.style.width="".concat(I,"px"),S.style.height="".concat(I,"px");var k=S.querySelector("svg");if(k){var H=Math.max(14,Math.min(18,.45*I));k.style.width="".concat(H,"px"),k.style.height="".concat(H,"px")}}x&&(x.style.fontSize="".concat(Math.max(11,Math.min(14,c)),"px"),x.style.padding="".concat(Math.max(6,Math.min(10,Math.floor(.15*g))),"px 0")),E&&(E.style.fontSize="".concat(Math.max(8,Math.min(11,c-4)),"px"),E.style.marginTop="".concat(Math.max(3,Math.min(6,Math.floor(.6*h))),"px"))}this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(function(A){A.style.width="".concat(g,"px"),A.style.height="".concat(g,"px");var e=A.querySelector("svg");if(e){var t=.65*g;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 T=this.shadowRoot.querySelector(".voice-control-btn.primary");if(T){T.style.width="".concat(p,"px"),T.style.height="".concat(p,"px");var D=T.querySelector("svg");if(D){var O=.7*p;D.style.setProperty("width","".concat(O,"px"),"important"),D.style.setProperty("height","".concat(O,"px"),"important"),D.style.setProperty("min-width","".concat(O,"px"),"important"),D.style.setProperty("min-height","".concat(O,"px"),"important")}}var P=this.shadowRoot.querySelector(".start-call-btn");if(P){var K,L;e<=350?(K=48,L=14):e<=450?(K=52,L=15):e<=550?(K=58,L=17):e<=700?(K=62,L=18):(K=64,L=18),P.style.height="".concat(K,"px"),P.style.fontSize="".concat(L,"px");var M=P.querySelector("svg");if(M){var R=Math.max(22,.5*K);M.style.width="".concat(R,"px"),M.style.height="".concat(R,"px")}}console.log("✅ Sizes adjusted - Avatar:",a,"Status:",u,"Transcript:",d,"Buttons:",g)}else console.warn("⚠️ voiceInterface not found, skipping size adjustment")}}},{key:"startVoiceCall",value:(n=vo(Bo().m(function A(){var e,t=this;return Bo().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,to();case 2:if(e=A.v,console.log("📋 Current permission state: ".concat(e)),"denied"!==e){A.n=3;break}return console.log("🚫 Permission is denied, showing blocked modal..."),eo(),po(function(){console.log("Blocked modal closed")}),A.a(2);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){go(vo(Bo().m(function e(){return Bo().w(function(e){for(;;)switch(e.n){case 0:return console.log("✅ Pre-prompt accepted, proceeding with voice call..."),e.n=1,t.proceedWithVoiceCall();case 1:A();case 2:return e.a(2)}},e)})),function(){console.log("❌ Pre-prompt cancelled"),A()})}));case 4:return A.n=5,this.proceedWithVoiceCall();case 5:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(t=vo(Bo().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,m,w,v,y,b,C,Q,F,U,x,S,E,I,k=this;return Bo().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!this.isMobile){A.n=5;break}return(e=this.shadowRoot.getElementById("voiceIdleState"))&&(e.style.display="none"),(t=this.shadowRoot.getElementById("text-chat-panel"))?(t.classList.remove("open"),t.style.display="none",console.log("✅ Widget panel hidden (waiting for permission)")):(n=document.getElementById("text-chat-panel"))&&(n.classList.remove("open"),n.style.display="none",console.log("✅ Widget panel hidden (waiting for permission, fallback)")),console.log("📱 Mobile device - requesting mic permission before connecting..."),A.p=1,o=this.config.outputSampleRate||44100,A.n=2,navigator.mediaDevices.getUserMedia({audio:{sampleRate:o,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"),(r=this.shadowRoot.getElementById("text-chat-button"))?(r.style.display="none",console.log("✅ Floating button hidden (permission granted)")):(i=document.getElementById("text-chat-button"))&&(i.style.display="none",console.log("✅ Floating button hidden (permission granted, fallback)")),A.n=4;break;case 3:return A.p=3,U=A.v,console.error("❌ Mobile: Permission denied before connecting:",U),(a=this.shadowRoot.getElementById("voiceIdleState"))&&(a.style.display="flex"),(s=this.shadowRoot.getElementById("text-chat-panel"))?s.style.display="":(c=document.getElementById("text-chat-panel"))&&(c.style.display=""),eo(),po(function(){k.resetUIState()}),A.a(2);case 4:A.n=6;break;case 5:l=this.shadowRoot.getElementById("voiceIdleState"),u=this.shadowRoot.getElementById("voiceActiveState"),l&&(l.style.display="none"),u&&(u.style.display="flex");case 6:return d=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return k.adjustSizesForContainer()},50),d&&(d.scrollTop=0),A.n=7,this.getSignedUrl();case 7:if(g=A.v,console.log("🔗 Got signed URL:",g),!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,x=A.v,console.warn("Warning: Error disconnecting existing connection:",x);case 11:return A.n=12,this.sdk.connect(g);case 12:p=A.v,console.log("✅ Connected to WebSocket, connected:",p),this.setupTextInjectAckHandler(),h=0;case 13:if(!(h<50)){A.n=16;break}if(!this.sdk.isConnected){A.n=14;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=14;break}return A.a(3,16);case 14:return A.n=15,new Promise(function(A){return setTimeout(A,100)});case 15:h++,A.n=13;break;case 16:if(!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=21;break}return console.log("✅ WebSocket ready, starting listening..."),A.p=17,A.n=18,this.sdk.startListening();case 18: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")),A.n=20;break;case 19:throw A.p=19,S=A.v,console.error("❌ Failed to start listening - permission denied or error:",S),this.isMobile&&((f=this.shadowRoot.getElementById("voiceIdleState"))&&(f.style.display="flex"),(B=this.shadowRoot.getElementById("text-chat-panel"))?B.style.display="":(m=document.getElementById("text-chat-panel"))&&(m.style.display=""),(w=this.shadowRoot.getElementById("text-chat-button"))?w.style.display="":(v=document.getElementById("text-chat-button"))&&(v.style.display="")),S;case 20:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-k.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=k.shadowRoot.getElementById("voiceTimer");if(o&&(o.textContent=n),k.isMobile){var r=document.getElementById("mobileDurationText"),i=document.getElementById("mobileHeaderDuration");r&&(r.textContent=n),i&&(i.textContent=n)}},1e3),A.n=26;break;case 21:return console.warn("⚠️ Connection not fully ready, but trying to start listening anyway..."),A.p=22,A.n=23,this.sdk.startListening();case 23: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")),A.n=25;break;case 24:throw A.p=24,E=A.v,console.error("❌ Failed to start listening - permission denied or error:",E),this.isMobile&&((y=this.shadowRoot.getElementById("voiceIdleState"))&&(y.style.display="flex"),(b=this.shadowRoot.getElementById("text-chat-panel"))?b.style.display="":(C=document.getElementById("text-chat-panel"))&&(C.style.display=""),(Q=this.shadowRoot.getElementById("text-chat-button"))?Q.style.display="":(F=document.getElementById("text-chat-button"))&&(F.style.display="")),E;case 25:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-k.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=k.shadowRoot.getElementById("voiceTimer");if(o&&(o.textContent=n),k.isMobile){var r=document.getElementById("mobileDurationText"),i=document.getElementById("mobileHeaderDuration");r&&(r.textContent=n),i&&(i.textContent=n)}},1e3);case 26:console.log("✅ Voice call started successfully"),A.n=28;break;case 27:if(A.p=27,I=A.v,console.error("❌ Error starting voice call:",I),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)}"NotAllowedError"===I.name||"PermissionDeniedError"===I.name?(eo(),po(function(){k.resetUIState()})):"NotFoundError"===I.name||"DevicesNotFoundError"===I.name?ho(function(){k.resetUIState()}):(this.showError(I.message||I),this.resetUIState());case 28:return A.a(2)}},A,this,[[22,24],[17,19],[8,10],[1,3],[0,27]])})),function(){return t.apply(this,arguments)})},{key:"resetUIState",value:function(){if(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:"endVoiceCall",value:function(){var A,e=this;if(console.log("🔴 Ending voice call..."),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._textInjectAckHandler&&this.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=null,this._originalHintText=null,this._originalMobileHintText=null,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("voiceIdleState"),r=this.shadowRoot.getElementById("voiceActiveState");o&&(o.style.display="flex"),r&&(r.style.display="none"),setTimeout(function(){return e.adjustSizesForContainer()},50);var i=this.shadowRoot.getElementById("transcriptText");if(i&&(i.textContent=this.t("transcriptWillAppear"),i.classList.add("empty")),this.isMobile){var a=document.getElementById("mobileTranscriptText");a&&(a.textContent=this.t("transcriptWillAppear"))}var s=this.shadowRoot.getElementById("voiceAvatarActive");s&&s.classList.remove("speaking"),console.log("✅ Voice call ended")}},{key:"updateTranscript",value:function(A){if(console.log("📝 [VOICE INTERFACE] updateTranscript called with text:",A),this.isMobile){var e=document.getElementById("mobileTranscriptText");e&&(e.textContent=A),this.messages.length>0&&"assistant"===this.messages[this.messages.length-1].type?this.messages[this.messages.length-1].text=A:this.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.addMobileMessage("assistant",A)}}else{var o=this.shadowRoot.getElementById("transcriptText");o&&(console.log("📝 [VOICE INTERFACE] Found transcript element, updating text"),o.textContent=A,o.classList.remove("empty"))}}},{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.shadowRoot.getElementById("transcriptText");if(A){var e=this.t("domainNotValidated"),t=this.t("domainErrorMessage");A.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(e,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(t,"</div>"),A.classList.remove("empty")}}},{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("muteBtn"),t=null==e?void 0:e.querySelector(".mute-icon"),n=null==e?void 0:e.querySelector(".mute-cross");if(e&&t&&n&&(A.enabled?(t.style.stroke="",n.style.display="none",e.classList.remove("muted")):(t.style.stroke="#9ca3af",n.style.display="block",e.classList.add("muted"))),this.isMobile){var o=document.getElementById("mobileMuteBtn");null==o||o.querySelector(".mobile-mic-icon"),null==o||o.querySelector(".mobile-mic-off-icon"),o&&(A.enabled?o.classList.remove("muted"):o.classList.add("muted"))}console.log(A.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}},{key:"toggleSpeaker",value:function(){if(this.isSpeakerMuted=!this.isSpeakerMuted,console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted"),this.isMobile){var A=document.getElementById("mobileSpeakerBtn");null==A||A.querySelector(".mobile-speaker-icon"),null==A||A.querySelector(".mobile-speaker-off-icon"),A&&(this.isSpeakerMuted?A.classList.add("muted"):A.classList.remove("muted"))}}},{key:"updateMobileStatus",value:function(A){if(this.isMobile){var e=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot"),o="Paused",r="#facc15";"listening"===A||"recording"===A?(o="Listening...",r="#22c55e"):"speaking"===A&&(o="Speaking...",r="#a855f7"),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:"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&&yo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r,i}();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 Fo(){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 Uo(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Uo(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,Uo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Uo(u,"constructor",c),Uo(c,"constructor",s),s.displayName="GeneratorFunction",Uo(c,o,"GeneratorFunction"),Uo(u),Uo(u,o,"Generator"),Uo(u,n,function(){return this}),Uo(u,"toString",function(){return"[object Generator]"}),(Fo=function(){return{w:r,m:d}})()}function Uo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Uo=function(A,e,t,n){function r(e,t){Uo(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))},Uo(A,e,t,n)}function xo(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 So(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){xo(r,n,o,i,a,"next",A)}function a(A){xo(r,n,o,i,a,"throw",A)}i(void 0)})}}function Eo(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,Io(n.key),n)}}function Io(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 ko=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,g=this.config.messages,p=(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",B=(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"),m=this.config.inputFocusColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputFocusColor)||"#7C3AED",w=this.config.inputBackgroundColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputBackgroundColor)||"#FFFFFF",v=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(g.borderRadius,"px; \n max-width: 80%; \n font-size: ").concat(g.fontSize,"; \n color: ").concat(g.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(g.userBackgroundColor,"; \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n background: ").concat(g.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(g.systemBackgroundColor,";\n align-self: flex-start;\n }\n .message.error {\n background: ").concat(g.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(B,";\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(w,";\n color: ").concat(v,";\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(m,";\n background: ").concat("#FFFFFF"===w?"#FFFFFF":w,";\n box-shadow: 0 0 0 3px ").concat(m,"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(p,";\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(g.errorBackgroundColor,";\n border-radius: ").concat(g.borderRadius,"px;\n color: #991B1B;\n font-size: ").concat(g.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=So(Fo().m(function A(){return Fo().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=So(Fo().m(function A(){var e,t,n;return Fo().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&&Eo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();const Ho={en:{landingTitle:"How would you like to communicate?",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",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:"איך תרצה לתקשר?",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",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?",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",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?",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",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?",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",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 To(){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 Do(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(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]())):(Do(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,Do(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Do(u,"constructor",c),Do(c,"constructor",s),s.displayName="GeneratorFunction",Do(c,o,"GeneratorFunction"),Do(u),Do(u,o,"Generator"),Do(u,n,function(){return this}),Do(u,"toString",function(){return"[object Generator]"}),(To=function(){return{w:r,m:d}})()}function Do(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Do=function(A,e,t,n){function r(e,t){Do(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))},Do(A,e,t,n)}function Oo(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 Po(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Oo(r,n,o,i,a,"next",A)}function a(A){Oo(r,n,o,i,a,"throw",A)}i(void 0)})}}function Ko(A){return Ko="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},Ko(A)}function Lo(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 Mo(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(t),!0).forEach(function(e){Ro(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Lo(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Ro(A,e,t){return(e=Vo(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,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,Vo(n.key),n)}}function Vo(A){var e=function(A){if("object"!=Ko(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ko(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ko(e)?e:e+""}var jo=function(){return A=function A(){var e,t,n,o,r,i,a=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(a),this.sdk=new vt(this.config),this.isOpen=!1,this.isActive=!1,this.translations=Ho,this.currentView="landing",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 s=Mo(Mo(Mo({},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});this.voiceInterface=new Co(s);var c=Mo(Mo(Mo({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new ko(c,this.sdk),this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var l,u=null===(l=this.shadowRoot)||void 0===l?void 0:l.getElementById("text-chat-panel");u&&(this.isOpen=!0,u.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(),setTimeout(function(){A.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(A){console.error("❌ [WIDGET] Failed to auto-resume call:",A)})},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,g,p,h,f,B,m,w,v,y,b,C,Q,F,U,x,S,E,I,k,H,T,D,O,P,K,L,M,R,_,V,j,G,N,W,X,J,z,Y,q,Z,$,AA,eA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,gA,pA,hA,fA,BA,mA,wA,vA,yA,bA,CA,QA,FA,UA,xA,SA,EA,IA,kA,HA,TA,DA,OA,PA,KA,LA,MA,RA,_A,VA,jA,GA,NA,WA,XA,JA,zA,YA,qA,ZA,$A,Ae,ee,te,ne,oe,re,ie,ae,se,ce,le,ue,de,ge,pe,he,fe,Be,me,we,ve,ye,be,Ce,Qe,Fe,Ue,xe,Se,Ee,Ie,ke,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 Mo({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:Mo({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:Mo({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"===Ko(A.position)?A.position:{}),button:Mo({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===(g=A.icon)||void 0===g?void 0:g.backgroundColor)||"#FFFFFF",hoverColor:(null===(p=A.button)||void 0===p?void 0:p.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===(B=A.button)||void 0===B?void 0:B.backgroundColor)||(null===(m=A.icon)||void 0===m?void 0:m.backgroundColor)||"#FFFFFF"},A.button),panel:Mo({width:(null===(w=A.panel)||void 0===w?void 0:w.width)||350,height:(null===(v=A.panel)||void 0===v?void 0:v.height)||500,borderRadius:(null===(y=A.panel)||void 0===y?void 0:y.borderRadius)||12,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:Mo({micButtonColor:(null===(F=A.voice)||void 0===F?void 0:F.micButtonColor)||(null===(U=A.panel)||void 0===U?void 0:U.micButtonColor)||Oe,micButtonActiveColor:(null===(x=A.voice)||void 0===x?void 0:x.micButtonActiveColor)||(null===(S=A.panel)||void 0===S?void 0:S.micButtonActiveColor)||"#EF4444",micButtonHint:Mo(Mo({text:(null===(E=A.voice)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.text)||(null===(I=A.panel)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.text)||"Click the button to start voice conversation",color:(null===(k=A.voice)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.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===(V=A.voice)||void 0===V?void 0:V.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(j=A.voice)||void 0===j?void 0:j.startCallTitle)||null,startCallSubtitle:(null===(G=A.voice)||void 0===G?void 0:G.startCallSubtitle)||null,startCallButtonText:(null===(N=A.voice)||void 0===N?void 0:N.startCallButtonText)||null,transcriptBackgroundColor:(null===(W=A.voice)||void 0===W?void 0:W.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(X=A.voice)||void 0===X?void 0:X.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(J=A.voice)||void 0===J?void 0:J.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(z=A.voice)||void 0===z?void 0:z.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:Mo({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:Mo(Mo({text:(null===(gA=A.text)||void 0===gA||null===(gA=gA.sendButtonHint)||void 0===gA?void 0:gA.text)||(null===(pA=A.panel)||void 0===pA||null===(pA=pA.sendButtonHint)||void 0===pA?void 0:pA.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===(BA=A.text)||void 0===BA||null===(BA=BA.sendButtonHint)||void 0===BA?void 0:BA.fontSize)||(null===(mA=A.panel)||void 0===mA||null===(mA=mA.sendButtonHint)||void 0===mA?void 0:mA.fontSize)||"12px"},null===(wA=A.text)||void 0===wA?void 0:wA.sendButtonHint),null===(vA=A.panel)||void 0===vA?void 0:vA.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===(FA=A.text)||void 0===FA?void 0:FA.inputFocusColor)||(null===(UA=A.panel)||void 0===UA?void 0:UA.inputFocusColor)||"#7C3AED",inputBackgroundColor:(null===(xA=A.text)||void 0===xA?void 0:xA.inputBackgroundColor)||(null===(SA=A.panel)||void 0===SA?void 0:SA.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(EA=A.text)||void 0===EA?void 0:EA.inputTextColor)||(null===(IA=A.panel)||void 0===IA?void 0:IA.inputTextColor)||"#1F2937",inputFontSize:(null===(kA=A.text)||void 0===kA?void 0:kA.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:Mo({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===(VA=A.landing)||void 0===VA?void 0:VA.modeCardBorderColor)||"#E2E8F0",modeCardHoverBorderColor:(null===(jA=A.landing)||void 0===jA?void 0:jA.modeCardHoverBorderColor)||Pe,modeCardIconBackgroundColor:(null===(GA=A.landing)||void 0===GA?void 0:GA.modeCardIconBackgroundColor)||Pe,modeCardTitleColor:(null===(NA=A.landing)||void 0===NA?void 0:NA.modeCardTitleColor)||"#111827",voiceCardIcon:(null===(WA=A.landing)||void 0===WA?void 0:WA.voiceCardIcon)||"🎤",textCardIcon:(null===(XA=A.landing)||void 0===XA?void 0:XA.textCardIcon)||"💬",voiceCardTitle:(null===(JA=A.landing)||void 0===JA?void 0:JA.voiceCardTitle)||null,textCardTitle:(null===(zA=A.landing)||void 0===zA?void 0:zA.textCardTitle)||null},A.landing),header:Mo({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:Mo({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:Mo({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:Mo({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===(ge=A.messages)||void 0===ge?void 0:ge.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(pe=A.messages)||void 0===pe?void 0:pe.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===(Be=A.messages)||void 0===Be?void 0:Be.borderRadius)||8},A.messages),animation:Mo({enableHover:!1!==(null===(me=A.animation)||void 0===me?void 0:me.enableHover),enablePulse:!1!==(null===(we=A.animation)||void 0===we?void 0:we.enablePulse),enableSlide:!1!==(null===(ve=A.animation)||void 0===ve?void 0:ve.enableSlide),duration:(null===(ye=A.animation)||void 0===ye?void 0:ye.duration)||.3},A.animation),behavior:Mo({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===(Fe=A.behavior)||void 0===Fe?void 0:Fe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Ue=A.behavior)||void 0===Ue?void 0:Ue.showWelcomeMessage),welcomeMessage:(null===(xe=A.behavior)||void 0===xe?void 0:xe.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===(Ee=A.behavior)||void 0===Ee?void 0:Ee.mode)||"unified"},A.behavior),accessibility:Mo({ariaLabel:(null===(Ie=A.accessibility)||void 0===Ie?void 0:Ie.ariaLabel)||"Chat Assistant",ariaDescription:(null===(ke=A.accessibility)||void 0===ke?void 0:ke.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,t,n,o=this,r=(this.config.position,this.config.button),i=this.config.icon,a=(this.config.panel,this.config.header),s=(this.config.animation,{small:50,medium:60,large:70,xl:80}[r.size]||60),c={small:20,medium:28,large:36,xl:44}[i.size]||28,l=this.generatePositionStyles(),u=this.generateIconHTML(c),d=this.config.behavior.mode||"unified",g="unified"===d,p="unified"===d||"voice-only"===d,h="unified"===d||"text-only"===d,f=function(A){var e=o.config.language||"en";return(o.translations[e]||o.translations.en)[A]||A},B=function(A){var e,t=null===(e=o.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{newChat:f("newChat"),back:f("back"),close:f("close"),mute:f("mute"),speaker:f("speaker"),endCall:f("endCall")}[A]||""},m=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(l,s,c),"\n ").concat(this.config.customStyles,"\n </style>\n "):"";return"\n ".concat(m,"\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(u,"\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: ').concat(a.backgroundColor,"; color: ").concat(a.textColor,';">\n <div>\n ').concat(a.showTitle?'<div class="header-title">'.concat(a.title,"</div>"):"",'\n <div class="header-status">\n <span class="status-dot"></span>\n <span>').concat(f("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 12px; align-items: center;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(B("newChat"),'" style="').concat(g?"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"===d?'<button class="header-icon back-btn" id="backBtn" title="'.concat(B("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(a.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+B("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(g?'\n <div class="landing-screen" id="landingScreen">\n <div class="landing-logo">'.concat((null===(A=this.config.landing)||void 0===A?void 0:A.logo)||"🤖",'</div>\n <div class="landing-title">').concat((null===(e=this.config.landing)||void 0===e?void 0:e.title)||f("landingTitle"),'</div>\n <div class="mode-selection">\n ').concat(p?'<div class="mode-card voice" id="mode-card-voice">\n <div class="mode-card-icon">🎤</div>\n <div class="mode-card-title">'.concat((null===(t=this.config.landing)||void 0===t?void 0:t.voiceCardTitle)||f("voiceCall"),"</div>\n </div>"):"","\n ").concat(h?'<div class="mode-card text" id="mode-card-text">\n <div class="mode-card-icon">💬</div>\n <div class="mode-card-title">'.concat((null===(n=this.config.landing)||void 0===n?void 0:n.textCardTitle)||f("textChat"),"</div>\n </div>"):"","\n </div>\n </div>"):"","\n\n ").concat(p?this.voiceInterface.generateHTML():"","\n ").concat(h?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}},{key:"generateFooterHTML",value:function(){var A=this.config.footer;if(!A.show)return"";var e=encodeURIComponent(window.location.hostname||"widget"),t="https://talktopc.com?ref=widget&source=".concat(e);return'\n <div class="widget-footer" style="\n height: 36px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: '.concat(A.backgroundColor,';\n border-top: 1px solid #e5e7eb;\n flex-shrink: 0;\n ">\n <a \n href="').concat(t,'" \n target="_blank" \n rel="noopener noreferrer"\n aria-label="Visit TalkToPC website"\n class="footer-brand-link"\n style="\n display: flex;\n flex-direction: column;\n align-items: center;\n text-decoration: none;\n color: ').concat(A.textColor,';\n transition: color 0.2s ease;\n "\n onmouseover="this.style.color=\'').concat(A.hoverColor,"'\"\n onmouseout=\"this.style.color='").concat(A.textColor,'\'"\n >\n <span style="font-size: 11px; line-height: 1.3;">\n ⚡ Powered by <strong>TalkToPC</strong>\n </span>\n <span style="font-size: 9px; opacity: 0.7; line-height: 1.2;">\n https://talktopc.com\n </span>\n </a>\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,c,l,u,d,g,p=this.config.button,h=this.config.icon,f=this.config.panel,B=this.config.header,m=(this.config.messages,this.config.animation),w=this.config.behavior.mode||"unified",v="unified"===w||"voice-only"===w,y="unified"===w||"text-only"===w,b=!1===this.config.useShadowDOM?" !important":"",C=B.backgroundColor;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(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===(n=this.config.position.offset)||void 0===n?void 0:n.y)||20,"px;"):"top: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.y)||20,"px;"),"\n ").concat("right"===this.config.position.horizontal?"right: ".concat((null===(r=this.config.position.offset)||void 0===r?void 0:r.x)||20,"px;"):"left: ".concat((null===(i=this.config.position.offset)||void 0===i?void 0:i.x)||20,"px;"),"\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n border-radius: ").concat("circle"===p.shape?"50%":"square"===p.shape?"0":"12px",";\n background: ").concat(p.backgroundColor||h.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(m.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(m.enableHover?"\n #text-chat-button:hover {\n ".concat(p.hoverColor?"background: ".concat(p.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(b,";\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(f.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(f.height,"px;\n max-height: calc(100vh - ").concat(e,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(f.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(f.backdropFilter?"backdrop-filter: ".concat(f.backdropFilter,";"):"","\n ").concat(m.enableSlide?"transition: all ".concat(m.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(b,";\n ").concat(m.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(f.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(f.borderRadius,"px; border: ").concat(f.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%; min-height: 0; background: #FFFFFF; overflow: hidden; display: flex; flex-direction: column; border-radius: ").concat(f.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 min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 12px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(f.borderRadius,"px;\n border-top-right-radius: ").concat(f.borderRadius,"px;\n flex-shrink: 0;\n min-height: 60px;\n box-sizing: border-box;\n }\n #text-chat-panel .header-title { font-size: 16px; font-weight: 600; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.9; }\n #text-chat-panel .status-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\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 }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.3);\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 /* Landing and mode selection (shown only if voice enabled) */\n .landing-screen { \n display: none").concat(b,"; \n flex: 1; \n padding: 20px; \n background: ").concat((null===(a=this.config.landing)||void 0===a?void 0:a.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 16px; \n overflow-y: auto; \n min-height: 0; \n }\n .landing-screen.active { display: flex").concat(b,"; }\n .landing-logo { font-size: 48px; }\n .landing-title { \n font-size: 20px; \n color: ").concat((null===(s=this.config.landing)||void 0===s?void 0:s.titleColor)||"#1e293b","; \n font-weight: 700; \n margin-bottom: 20px; \n text-align: center;\n width: 100%;\n }\n .mode-selection { display: flex; gap: 16px; width: 100%; justify-content: center; }\n .mode-card { \n flex: 1; \n max-width: 180px; \n background: ").concat((null===(c=this.config.landing)||void 0===c?void 0:c.modeCardBackgroundColor)||"#FFFFFF","; \n border: 2px solid ").concat((null===(l=this.config.landing)||void 0===l?void 0:l.modeCardBorderColor)||"#E2E8F0","; \n border-radius: 20px; \n padding: 20px 12px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 8px; \n transition: transform ").concat(m.duration,"s ease, box-shadow ").concat(m.duration,"s ease, border-color ").concat(m.duration,"s ease; \n box-shadow: 0 4px 12px rgba(0,0,0,0.05); \n }\n .mode-card:hover { \n transform: translateY(-6px); \n box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2); \n border-color: ").concat((null===(u=this.config.landing)||void 0===u?void 0:u.modeCardHoverBorderColor)||C,"; \n }\n .mode-card-icon { \n width: 60px; \n height: 60px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 50%; \n background: ").concat((null===(d=this.config.landing)||void 0===d?void 0:d.modeCardIconBackgroundColor)||C,"; \n color: #fff; \n font-size: 32px; \n }\n .mode-card-title { \n color: ").concat((null===(g=this.config.landing)||void 0===g?void 0:g.modeCardTitleColor)||"#111827","; \n font-weight: 600; \n text-align: center;\n width: 100%;\n }\n\n ").concat(v?this.voiceInterface.generateCSS():"","\n ").concat(y?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=this;if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-button");e&&(e.onclick=function(){return A.togglePanel()});var t=this.shadowRoot.getElementById("closeBtn");t&&(t.onclick=function(){return A.togglePanel()});var n=this.config.behavior.mode||"unified",o="unified"===n,r="unified"===n||"voice-only"===n,i="unified"===n||"text-only"===n,a=this.shadowRoot.getElementById("backBtn"),s=this.shadowRoot.getElementById("landingScreen"),c=this.shadowRoot.getElementById("mode-card-voice"),l=this.shadowRoot.getElementById("mode-card-text"),u=this.shadowRoot.getElementById("textInterface"),d=this.shadowRoot.getElementById("voiceInterface");a&&(a.onclick=function(){return A.showLanding()}),o?(c&&(c.onclick=function(){return A.showVoice()}),l&&(l.onclick=function(){return A.showText()}),"text"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.add("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.add("visible"),g&&(g.style.display="")):"voice"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.remove("active"),d&&d.classList.add("active"),a&&"unified"===n&&a.classList.add("visible"),g&&(g.style.display="none")):(this.currentView="landing",s&&s.classList.add("active"),u&&u.classList.remove("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.remove("visible"))):"voice-only"===n?(d&&d.classList.add("active"),u&&u.classList.remove("active"),s&&s.classList.remove("active")):"text-only"===n&&(u&&u.classList.add("active"),d&&d.classList.remove("active"),s&&s.classList.remove("active")),r&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),i&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var g=this.shadowRoot.getElementById("newChatBtn");g&&(g.onclick=function(){return A.textInterface.startNewChat()},o&&(g.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}},{key:"startNewChat",value:function(){this.textInterface.startNewChat()}},{key:"showLanding",value:function(){if(this.shadowRoot&&"unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";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.add("active"),e&&e.classList.remove("active"),t&&t.classList.remove("active"),n&&n.classList.remove("visible"),o&&(o.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(){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:"startChat",value:(r=Po(To().m(function A(){return To().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 r.apply(this,arguments)})},{key:"sendMessage",value:(o=Po(To().m(function A(){return To().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 o.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"getSignedUrl",value:(n=Po(To().m(function A(){var e,t;return To().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"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return n.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=Mo({},this.config);A.panel&&(l.panel=Mo(Mo({},this.config.panel),A.panel)),A.voice&&(l.voice=Mo(Mo({},this.config.voice),A.voice),A.voice.micButtonHint&&(l.voice.micButtonHint=Mo(Mo({},null===(s=this.config.voice)||void 0===s?void 0:s.micButtonHint),A.voice.micButtonHint))),A.text&&(l.text=Mo(Mo({},this.config.text),A.text),A.text.sendButtonHint&&(l.text.sendButtonHint=Mo(Mo({},null===(c=this.config.text)||void 0===c?void 0:c.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(l.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?l.direction="rtl":void 0===A.direction&&(l.direction="ltr")),A.translations&&(l.translations=A.translations,this.translations=A.translations),A.button&&(l.button=Mo(Mo({},this.config.button),A.button)),A.header&&(l.header=Mo(Mo({},this.config.header),A.header)),A.icon&&(l.icon=Mo(Mo({},this.config.icon),A.icon)),A.messages&&(l.messages=Mo(Mo({},this.config.messages),A.messages)),A.animation&&(l.animation=Mo(Mo({},this.config.animation),A.animation)),A.behavior&&(l.behavior=Mo(Mo({},this.config.behavior),A.behavior)),A.accessibility&&(l.accessibility=Mo(Mo({},this.config.accessibility),A.accessibility)),A.tooltips&&(l.tooltips=Mo(Mo({},this.config.tooltips),A.tooltips)),A.landing&&(l.landing=Mo(Mo({},this.config.landing),A.landing)),A.footer&&(l.footer=Mo(Mo({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===l.direction&&(l.direction=A.direction),void 0!==A.primaryColor&&(l.primaryColor=A.primaryColor),l.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,l.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,l.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,l.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,l.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,l.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,void 0!==A.useShadowDOM&&(l.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)||(l[e]=A[e])}),null===(e=this.config)||void 0===e||e.language;var u=!1!==(null===(t=this.config)||void 0===t?void 0:t.useShadowDOM);if(this.config=this.mergeWithDefaults(l),!1!==this.config.useShadowDOM===u&&this.container){var d=document.getElementById("ttp-widget-shadow-host");d&&!this.config.useShadowDOM&&d.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 p=document.getElementById("ttp-widget-shadow-host");p?(this.shadowRoot=p.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var h=document.getElementById("ttp-widget-container");h?(this.regularContainer=h,this.container=h):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var f=document.getElementById("ttp-widget-shadow-host");f&&f.remove();var B=document.getElementById("ttp-widget-container");if(B&&B.remove(),!1===u){var m=document.getElementById("ttp-widget-styles");m&&m.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",v=Mo(Mo(Mo({},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 Co(v);var y=Mo(Mo(Mo({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});this.textInterface=new ko(y,this.sdk),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:(t=Po(To().m(function A(){return To().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 t.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:"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&&_o(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r}(),Go="2.18.0";const No={VoiceSDK_v2:nt,TextChatSDK:vt,WebSocketManager:Gt,AudioRecorder:rn,AudioPlayer:Bn,EventEmitter:at,VoiceButton:En,VanillaVoiceButton:Mn,AgentSDK:qn,TTPChatWidget:jo,VERSION:Go}})(),n})());
|
|
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))},B=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}(),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<64;w++)v[m.charCodeAt(w)]=w;var y=10,b=13,C=15,Q=17,F=18,x=19,U=20,S=21,E=22,I=24,k=25,H=26,T=27,D=28,O=30,P=32,K=33,L=34,M=35,R=37,_=38,V=39,j=40,N=42,G=[9001,65288],W="×",X="÷",J=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 B(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=="),z=[O,36],Y=[1,2,3,5],q=[y,8],Z=[T,H],$=Y.concat(q),AA=[_,V,j,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 X;if(11===J.get(A[r]))return W;if((s===P||s===K)&&11===J.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,F,x,I,D].indexOf(l))return W;if(nA(r,e)===E)return W;if(tA(23,E,r,e))return W;if(tA([Q,F],S,r,e))return W;if(tA(12,12,r,e))return W;if(s===y)return X;if(23===s||23===l)return W;if(16===l||16===s)return X;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!==z.indexOf(l)&&s===k||-1!==z.indexOf(s)&&l===k)return W;if(s===T&&-1!==[R,P,K].indexOf(l)||-1!==[R,P,K].indexOf(s)&&l===H)return W;if(-1!==z.indexOf(s)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(s)&&-1!==z.indexOf(l))return W;if(-1!==[T,H].indexOf(s)&&(l===k||-1!==[E,C].indexOf(l)&&e[a+1]===k)||-1!==[E,C].indexOf(s)&&l===k||s===k&&-1!==[k,D,I].indexOf(l))return W;if(-1!==[k,D,I,Q,F].indexOf(l))for(var u=r;u>=0;){if((d=e[u])===k)return W;if(-1===[D,I].indexOf(d))break;u--}if(-1!==[T,H].indexOf(l))for(u=-1!==[Q,F].indexOf(s)?i:r;u>=0;){var d;if((d=e[u])===k)return W;if(-1===[D,I].indexOf(d))break;u--}if(_===s&&-1!==[_,V,L,M].indexOf(l)||-1!==[V,L].indexOf(s)&&-1!==[V,j].indexOf(l)||-1!==[j,M].indexOf(s)&&l===j)return W;if(-1!==AA.indexOf(s)&&-1!==[U,H].indexOf(l)||-1!==AA.indexOf(l)&&s===T)return W;if(-1!==z.indexOf(s)&&-1!==z.indexOf(l))return W;if(s===I&&-1!==z.indexOf(l))return W;if(-1!==z.concat(k).indexOf(s)&&l===E&&-1===G.indexOf(A[a])||-1!==z.concat(k).indexOf(l)&&s===F)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:X},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=J.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!==[k,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},BA=function(A,e,t){return A===aA?pA(e)||fA(e,t):!!pA(A)||!(92!==A||!fA(A,e))},mA=function(A,e,t){return A===sA||A===aA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},vA=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},FA={type:21},xA={type:9},UA={type:10},SA={type:11},EA={type:12},IA={type:14},kA={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=BA(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(),IA;break;case sA:if(mA(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(mA(r,i,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(BA(r,i,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(i===aA&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(mA(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(BA(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 EA;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(),xA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),FA;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(),kA)}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(),kA);if(34===n||39===n||40===n||hA(n))return this.consumeBadUrlRemnants(),kA;if(92===n){if(!fA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),kA;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[vA(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 BA(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}(),VA=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}(),jA=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},XA=function(A,e){return GA(A)&&A.value===e},JA=function(A){return 31!==A.type},zA=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(jA(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},Be=function(A,e){var t=e.filter(zA);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 me(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 ve=function(A,e){var t=e.filter(zA),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=me(d,u,a+1/3),g=me(d,u,a),h=me(d,u,a-1/3);return he(255*p,255*g,255*h,l)},we={hsl:ve,hsla:ve,rgb:Be,rgba:Be},ye=function(A,e){return de(A,VA.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"},Fe=function(A,e){var t=de(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},xe=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)},Ee=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},Ie=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=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},ke="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 ke: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=Fe(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=Ve[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,Ve={"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=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ie,"-ms-linear-gradient":Ie,"-o-linear-gradient":Ie,"-webkit-linear-gradient":Ie,"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 ke: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=Fe(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(zA);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}}},je={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 zA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Ve[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(Xe)}},Xe=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 Je,ze={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 jA(e)?e.number:0}}},pt=dt("top"),gt=dt("right"),ht=dt("bottom"),ft=dt("left"),Bt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},mt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},vt={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"}(Je||(Je={}));var Ct,Qt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Je.STRICT:Je.NORMAL}},Ft={name:"line-height",initialValue:"normal",prefix:!1,type:4},xt=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}},Et={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}}},It=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},kt=It("top"),Ht=It("right"),Tt=It("bottom"),Dt=It("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"),Vt={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}}},jt={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&&XA(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=Xt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},Xt={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}},Jt={type:16,number:50,flags:4},zt=[Jt,Jt],Yt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter($A);return 2!==t.length?zt:[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(JA),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(JA),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(jA).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:""},Bn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&XA(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];XA(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})}},mn={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}},vn={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 jA(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,je,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,ze,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,Bn,e.boxShadow),this.color=Qn(A,Bt,e.color),this.direction=Qn(A,mt,e.direction),this.display=Qn(A,vt,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,Ft,e.lineHeight),this.listStyleImage=Qn(A,Ut,e.listStyleImage),this.listStylePosition=Qn(A,St,e.listStylePosition),this.listStyleType=Qn(A,Et,e.listStyleType),this.marginTop=Qn(A,kt,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,mn,e.paintOrder),this.position=Qn(A,jt,e.position),this.textAlign=Qn(A,Vt,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,vn,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 VA(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())}}},Fn=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},xn=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Fn(e,3),this.styles=new yn(A,window.getComputedStyle(e,null)),ko(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),Fn(e,4)&&(this.flags|=16)},Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),En=0;En<64;En++)Sn[Un.charCodeAt(En)]=En;for(var In=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},kn=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=In(i,12,r[4]/2),s=2===r[5]?In(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 kn(r[0],r[1],r[2],r[3],a,s)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),Vn="×",jn=function(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 Vn;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 Vn;if(!(r!==Ln&&r!==Kn||i!==Kn&&10!==i))return Vn;if((r===Mn||10===r)&&10===i)return Vn;if(13===i||5===i)return Vn;if(7===i)return Vn;if(1===r)return Vn;if(13===r&&14===i){for(;5===o;)o=e[--n];if(14===o)return Vn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=e[--n];if(a%2==0)return Vn}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(jn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=Vn;n<t&&(A=Nn(0,r,++n))===Vn;);if(A!==Vn||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]},Xn=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},Jn=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))})},zn={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(zn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=zn.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?"👨".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(zn,"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(zn,"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=Xn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Jn(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)?Jn(Xn(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(zn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(zn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(zn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(zn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(zn,"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(zn.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(zn.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(zn.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 zn.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}(xn),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}(xn),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}(xn),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}(xn),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}(xn),po=[{type:15,flags:0,unit:"px",number:3}],go=[{type:16,flags:0,number:50}],ho="checkbox",fo="radio",Bo="password",mo=707406591,vo=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===Bo?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}(xn),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}(xn),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}(xn),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=xo(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}(xn),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,Eo(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Io(o))if(Go(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return Qo(A,e,t,n)});else{var i=Fo(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):jo(o)||Po(o)||No(o)||Qo(A,o,i,n))}},Fo=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 vo(A,e):No(e)?new wo(A,e):jo(e)?new yo(A,e):_o(e)?new bo(A,e):new xn(A,e)},xo=function(A,e){var t=Fo(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()},Eo=function(A){return A.nodeType===Node.TEXT_NODE},Io=function(A){return A.nodeType===Node.ELEMENT_NODE},ko=function(A){return Io(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},Vo=function(A){return"STYLE"===A.tagName},jo=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},Xo=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}(),Jo={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"]},zo={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,Jo,3,n).toLowerCase();case 7:return Zo(A,1,3999,Jo,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,zo,3,n);case 35:return Zo(A,1,9999,zo,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 Xo,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(vr),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(Br(document.doctype)+"<html></html>"),mr(this.referenceElement.ownerDocument,i,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},A.prototype.createElementClone=function(A){if(Fn(A,2),Lo(A))return this.createCanvasClone(A);if(Mo(A))return this.createVideoClone(A);if(Vo(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){Io(e)&&("SCRIPT"===e.tagName||e.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Io(e)&&Vo(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(Io(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(Eo(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Io(A)&&(ko(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&&ko(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]),(jo(A)||No(A))&&(jo(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(zA),c=r[0],l=r[1];if(c&&GA(c)){var u=o.counters.getCounterValue(c.value),d=l&&GA(l)?Et.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===e.name){var p=e.values.filter(zA),g=(c=p[0],p[1]);if(l=p[2],c&&GA(c)){var h=o.counters.getCounterValues(c.value),f=l&&GA(l)?Et.parse(o.context,l.value):3,B=g&&0===g.type?g.value:"",m=h.map(function(A){return ar(A,f,!1)}).join(B);s.appendChild(i.createTextNode(m))}}}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},Br=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},mr=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},vr=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)}},Fr=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}(),xr=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)||Ir(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=Fr.isSameOrigin(A),t=!kr(A)&&!0===this._options.useCORS&&zn.SUPPORT_CORS_IMAGES&&!e,n=!kr(A)&&!e&&!Tr(A)&&"string"==typeof this._options.proxy&&zn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||kr(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=zn.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,Er=/^data:image\/.*/i,Ir=function(A){return zn.SUPPORT_SVG_DRAWING||!Dr(A)},kr=function(A){return Er.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 B=t.width-a,m=t.height-u,v=t.width-l,w=t.height-g,y=e.borderTopWidth,b=e.borderRightWidth,C=e.borderBottomWidth,Q=e.borderLeftWidth,F=re(e.paddingTop,A.bounds.width),x=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+B,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+v,t.top+m,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+B,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+v,t.top+m,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+B,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+v,t.top+m,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+B,t.top,a,s,lr.TOP_RIGHT):new Or(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||u>0?Rr(t.left+v,t.top+m,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(B,t.width-b),t.top+y,B>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(v,t.width-Q),t.top+Math.min(m,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+F,Math.max(0,o-(Q+S)),Math.max(0,r-(y+F)),lr.TOP_LEFT):new Or(t.left+Q+S,t.top+y+F),this.topRightContentBox=a>0||s>0?Rr(t.left+Math.min(B,t.width+Q+S),t.top+y+F,B>t.width+Q+S?0:a-Q+S,s-(y+F),lr.TOP_RIGHT):new Or(t.left+t.width-(b+x),t.top+y+F),this.bottomRightContentBox=l>0||u>0?Rr(t.left+Math.min(v,t.width-(Q+S)),t.top+Math.min(m,t.height+y+F),Math.max(0,l-(b+x)),u-(C+U),lr.BOTTOM_RIGHT):new Or(t.left+t.width-(b+x),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]},Vr=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},jr=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},Xr=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Jr=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},zr=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 jr(t,n,o))}if(0!==this.container.styles.overflowX){var r=_r(this.curves),i=Vr(this.curves);Xr(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=Vr(t.curves);Xr(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 zr(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 Jr(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=Bi(A.fontFamily).join(", "),n=jA(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=Vr(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,B,m,v,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 m=o.sent(),this.renderReplacedElement(e,n,m),[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 m=o.sent(),this.renderReplacedElement(e,n,m),[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 vo&&(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(mo),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(mo),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!==(B=e.styles.listStyleImage).type)return[3,18];m=void 0,v=B.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(v)];case 16:return m=o.sent(),this.ctx.drawImage(m,e.bounds.left-(m.width+10),e.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+v),[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,xt(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(A.listValue,y),r.letterSpacing,xt(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,B,m,v,w,y,b,C,Q,F,x,U,S,E,I,k,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],x=a[1],U=a[2],C=a[3],Q=a[4],m=n.ctx.createPattern(n.resizeImage(r,C,Q),"repeat"),n.renderRepeat(w,m,x,U)),[3,6];case 5:1===t.type?(s=ni(A,e,[null,null,null]),w=s[0],x=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"),B=f.createLinearGradient(u,p,d,g),xe(t.stops,l).forEach(function(A){return B.addColorStop(A.stop,ge(A.color))}),f.fillStyle=B,f.fillRect(0,0,C,Q),C>0&&Q>0&&(m=n.ctx.createPattern(h,"repeat"),n.renderRepeat(w,m,x,U))):function(A){return 2===A.type}(t)&&(v=ni(A,e,[null,null,null]),w=v[0],y=v[1],b=v[2],C=v[3],Q=v[4],F=0===t.position.length?[te]:t.position,x=re(F[0],C),U=re(F[F.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=Ee(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=Ee(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,x,U,C,Q),E=S[0],I=S[1],E>0&&I>0&&(k=n.ctx.createRadialGradient(y+x,b+U,0,y+x,b+U,E),xe(t.stops,2*E).forEach(function(A){return k.addColorStop(A.stop,ge(A.color))}),n.path(w),n.ctx.fillStyle=k,E!==I?(H=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,O=1/(D=I/E),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,B,m,v,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):(B=Math.floor((d+g)/(p+g)),m=(d-B*p)/(B-1),g=(v=(d-(B+1)*p)/B)<=0||Math.abs(g-m)<Math.abs(g-v)?m:v),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 zr(A,null),o=new Jr(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 vo&&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 Vr(e)}},hi=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],Bi=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===fi.indexOf(A)}):A},mi=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=Xn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,vi(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),vi=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 xr(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Fr.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,B,m,v,w,y,b,C,Q,F,x,U,S,E,I,k,H,T,D,O,P,K,L,M,R,_,V,j;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!==(E=e.useCORS)&&void 0!==E&&E},c=t({logging:null===(I=e.logging)||void 0===I||I,cache:e.cache},s),l={windowWidth:null!==(k=e.windowWidth)&&void 0!==k?k: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 B=o.sent(),m=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),v=m.width,w=m.height,y=m.left,b=m.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(v),height:null!==(V=e.height)&&void 0!==V?V:Math.ceil(w)},p?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new mi(d,Q).render(f)]):[3,3];case 2:return F=o.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+y+","+b+" with size "+v+"x"+w+" using computed rendering"),d.logger.debug("Starting DOM parsing"),x=xo(d,f),C===x.styles.backgroundColor&&(x.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(x)];case 4:F=o.sent(),o.label=5;case 5:return(null===(j=e.removeContainer)||void 0===j||j)&&(cr.destroy(B)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,F]}})})},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:()=>qn,AudioPlayer:()=>Bn,AudioRecorder:()=>rn,EventEmitter:()=>at,MicPermissionModals:()=>e,MicPermissionUtils:()=>A,TTPChatWidget:()=>jo,TextChatSDK:()=>wt,VERSION:()=>No,VanillaVoiceButton:()=>Mn,VoiceButton:()=>En,VoiceSDK_v2:()=>nt,WebSocketManager:()=>Nt,default:()=>Go});var A={};t.r(A),t.d(A,{checkPermissionState:()=>to,getDeviceInfo:()=>eo,getPermissionInstructions:()=>oo,openSettings:()=>ro});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:()=>go,showNoMicrophoneModal:()=>ho,showPrePromptModal:()=>po});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 B(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,m(n.key),n)}}function m(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 v=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)}}])&&B(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 F(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]())):(F(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,F(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,F(u,"constructor",c),F(c,"constructor",s),s.displayName="GeneratorFunction",F(c,o,"GeneratorFunction"),F(u),F(u,o,"Generator"),F(u,n,function(){return this}),F(u,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:r,m:d}})()}function F(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}F=function(A,e,t,n){function r(e,t){F(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))},F(A,e,t,n)}function x(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){x(r,n,o,i,a,"next",A)}function a(A){x(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,E(n.key),n)}}function E(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 I(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(I=function(){return!!A})()}function k(A){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},k(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=k(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,I()?Reflect.construct(e,t||[],k(A).constructor):e.apply(A,t))}(this,e)).config=t,A.audioContext=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 v},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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate")),this.audioContext||(this.initializeAudioContext(),this.audioContext&&"suspended"===this.audioContext.state&&this.audioContext.resume().then(function(){console.log("✅ AudioPlayer v2: AudioContext resumed and ready")}).catch(function(A){console.warn("⚠️ AudioPlayer v2: Could not resume AudioContext:",A)}))}},{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:(s=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 s.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:(a=U(Q().m(function A(){var e,t,n,o,r,i,a=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:if(this.isSchedulingFrames=!0,e=this.preparedBuffer.length,0===(t=Math.min(e,5))&&e>0&&(t=1),A.p=2,this.audioContext||this.initializeAudioContext(),n=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!n){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!n){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:o=0,r=Q().m(function A(){var e,t,n,r,i;return Q().w(function(A){for(;;)switch(A.n){case 0:if(e=a.preparedBuffer.shift()){A.n=1;break}return A.a(2,1);case 1:(t=a.audioContext.createBufferSource()).buffer=e.buffer,t.connect(a.audioContext.destination),a.scheduledSources.add(t),n=a.audioContext.currentTime,0===a.scheduledBuffers?(a.nextStartTime<n&&(a.nextStartTime=n+a.MAX_LOOKAHEAD_SECONDS),console.log("🎵 Starting playback with minimal delay:",a.nextStartTime)):(r=n+a.MAX_LOOKAHEAD_SECONDS,a.nextStartTime<r&&(a.nextStartTime=r,console.warn("⚠️ AudioPlayer: Fell behind schedule, adjusting nextStartTime to ".concat(a.nextStartTime.toFixed(4),"s")))),a.pendingSentenceText&&(a.sentenceTimings.push({startTime:a.nextStartTime,text:a.pendingSentenceText,displayed:!1}),console.log("📝 AudioPlayer: Sentence scheduled at ".concat(a.nextStartTime.toFixed(3),'s: "').concat(a.pendingSentenceText.substring(0,40),'..."')),a.pendingSentenceText=null,a.isCheckingTranscripts||a.startTranscriptChecker()),t.start(a.nextStartTime),a.nextStartTime+=e.duration,a.nextStartTime=Math.round(1e6*a.nextStartTime)/1e6,i=a.nextStartTime-e.duration,a.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(a.scheduledBuffers+1," at ").concat(i.toFixed(4),"s, next at ").concat(a.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(e.duration.toFixed(4),"s (").concat((1e3*e.duration).toFixed(2),"ms), Queued: ").concat(a.preparedBuffer.length,", Scheduled: ").concat(a.scheduledBuffers))),a.scheduledBuffers++,o++,t.onended=function(){if(a.scheduledSources.delete(t),a.scheduledBuffers--,0===a.scheduledBuffers&&0===a.preparedBuffer.length&&0===a.pcmChunkQueue.length)a.isPlaying=!1,a.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),a.emit("playbackStopped");else if(a.preparedBuffer.length>0)setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()},0);else if(a.scheduledBuffers>0){var A=function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(A,10)};setTimeout(A,10)}},a.isPlaying||(a.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),a.emit("playbackStarted"));case 2:return A.a(2)}},A)});case 9:if(!(this.preparedBuffer.length>0&&o<t)){A.n=12;break}return A.d(C(r()),10);case 10:if(!A.v){A.n=11;break}return A.a(3,12);case 11:A.n=9;break;case 12:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&requestAnimationFrame(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()}),this.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0&&a.schedulePreparedFrames()},10)},10),A.n=14;break;case 13:A.p=13,i=A.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",i),this.emit("playbackError",i),this.isSchedulingFrames=!1;case 14:return A.a(2)}},A,this,[[2,13]])})),function(){return a.apply(this,arguments)})},{key:"processPcmQueue",value:(i=U(Q().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,B,m,v,w,y,b=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:if(this.isProcessingPcmQueue=!0,A.p=2,this.audioContext||this.initializeAudioContext(),e=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!e){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!e){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:if(!(this.pcmChunkQueue.length>0)){A.n=10;break}if(o=this.pcmChunkQueue.shift()){A.n=9;break}return A.a(3,8);case 9:for(r=o,o.byteLength%2!=0&&(console.warn("⚠️ Odd PCM chunk size, padding:",o.byteLength),(i=new Uint8Array(o.byteLength+1)).set(new Uint8Array(o),0),i[o.byteLength]=0,r=i.buffer),a=new Int16Array(r),s=new Float32Array(a.length),c=1/32768,l=a.length,u=0;u<l;u++)s[u]=a[u]*c;d=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,p=this.audioContext.sampleRate,null!==(n=this.outputFormat)&&void 0!==n&&n.sampleRate?this.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(d,"Hz (AudioContext: ").concat(p,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",p),(g=this.audioContext.createBuffer(1,s.length,d)).getChannelData(0).set(s),(h=this.audioContext.createBufferSource()).buffer=g,h.connect(this.audioContext.destination),f=this.audioContext.currentTime,this.nextStartTime<f&&(this.nextStartTime=f,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",f)),B=g.duration,m=s.length,v=B,p!==d&&(v=m/p,this.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(d,"Hz → ").concat(p,"Hz")),console.log(" Buffer duration: ".concat(B.toFixed(4),"s, Calculated: ").concat(v.toFixed(4),"s")))),h.start(this.nextStartTime),this.nextStartTime+=v,this.nextStartTime=Math.round(1e6*this.nextStartTime)/1e6,this.scheduledBuffers<3&&(w=this.nextStartTime-v,console.log("🎵 AudioPlayer: Scheduled chunk ".concat(this.scheduledBuffers+1," at ").concat(w.toFixed(4),"s, next at ").concat(this.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(v.toFixed(4),"s (").concat((1e3*v).toFixed(2),"ms)"))),this.scheduledBuffers++,h.onended=function(){b.scheduledBuffers--,0===b.scheduledBuffers&&0===b.pcmChunkQueue.length&&(b.isPlaying=!1,b.isProcessingPcmQueue=!1,b.emit("playbackStopped"))},this.isPlaying||(this.isPlaying=!0,this.emit("playbackStarted")),A.n=8;break;case 10:this.isProcessingPcmQueue=!1,A.n=12;break;case 11:A.p=11,y=A.v,console.error("❌ AudioPlayer v2: Error playing chunk:",y),this.emit("playbackError",y),this.isProcessingPcmQueue=!1;case 12:return A.a(2)}},A,this,[[2,11]])})),function(){return i.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:"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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null}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."))}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"))}}},{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:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),"suspended"!==(n=this.audioContext).state){A.n=4;break}return A.n=3,n.resume();case 3:if(!t){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===n.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=8;break}return A.n=5,n.resume();case 5:if(!t){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:return A.n=9,e.arrayBuffer();case 9:return o=A.v,A.n=10,n.decodeAudioData(o);case 10: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()},50):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),A.n=12;break;case 11:A.p=11,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 12:return A.a(2)}},A,this,[[2,11]])})),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:"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.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.removeAllListeners()}}],n&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s}(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(){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 P(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]())):(P(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,P(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,P(u,"constructor",c),P(c,"constructor",s),s.displayName="GeneratorFunction",P(c,o,"GeneratorFunction"),P(u),P(u,o,"Generator"),P(u,n,function(){return this}),P(u,"toString",function(){return"[object Generator]"}),(O=function(){return{w:r,m:d}})()}function P(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}P=function(A,e,t,n){function r(e,t){P(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))},P(A,e,t,n)}function K(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 L(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?K(Object(t),!0).forEach(function(e){M(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):K(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function M(A,e,t){return(e=N(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function R(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 _(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){R(r,n,o,i,a,"next",A)}function a(A){R(r,n,o,i,a,"throw",A)}i(void 0)})}}function V(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 j(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,N(n.key),n)}}function N(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+""}function G(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(G=function(){return!!A})()}function W(A){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},W(A)}function X(A,e){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},X(A,e)}var J=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=W(e),function(A,e){if(e&&("object"==D(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,G()?Reflect.construct(e,t||[],W(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&&X(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 V(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)?V(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{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:"start",value:(i=_(O().m(function A(){var e,t,n,o,r,i,a,s,c=this;return O().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,"https:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname){A.n=1;break}throw e=new Error("Microphone access requires HTTPS. Please use https:// or test on localhost."),console.error("❌ AudioRecorder:",e.message),this.emit("error",e),e;case 1:if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){A.n=2;break}throw t=new Error("getUserMedia is not supported in this browser. Please use a modern browser."),console.error("❌ AudioRecorder:",t.message),this.emit("error",t),t;case 2:return console.log("🎤 AudioRecorder: Requesting microphone access..."),n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?L(L({},n),this.config.audioConstraints):n,A.n=3,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:this.config.sampleRate,channelCount:1},o)});case 3:if(this.mediaStream=A.v,console.log("✅ AudioRecorder: Microphone access granted"),this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:this.config.sampleRate}),"suspended"!==this.audioContext.state){A.n=4;break}return A.n=4,this.audioContext.resume();case 4:return r=this.getAudioProcessorPath(),A.n=5,this.audioContext.audioWorklet.addModule(r);case 5:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor"),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&c.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),this.isRecording=!0,this.emit("recordingStarted"),A.n=7;break;case 6:throw A.p=6,s=A.v,i=s.message,"NotAllowedError"===s.name||"PermissionDeniedError"===s.name?(i="Microphone permission denied. Please allow microphone access in your browser settings and try again.",console.error("❌ AudioRecorder: Permission denied. User needs to grant microphone access.")):"NotFoundError"===s.name||"DevicesNotFoundError"===s.name?(i="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===s.name||"TrackStartError"===s.name?(i="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.")):s.message&&s.message.includes("not allowed by the user agent")&&(i="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.")),(a=new Error(i)).name=s.name,a.originalError=s,console.error("❌ AudioRecorder: Failed to start recording:",a),this.emit("error",a),a;case 7:return A.a(2)}},A,this,[[0,6]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=_(O().m(function A(){var e;return O().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.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=_(O().m(function A(){var e,t;return O().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&&j(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(a);function z(A){return z="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},z(A)}function Y(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,q(n.key),n)}}function q(A){var e=function(A){if("object"!=z(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=z(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==z(e)?e:e+""}const Z=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&&Y(e.prototype,null),t&&Y(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();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(){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 v}},(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}}])&&AA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();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(){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&&oA(e.prototype,null),t&&oA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();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(){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 cA(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]())):(cA(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,cA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,cA(u,"constructor",c),cA(c,"constructor",s),s.displayName="GeneratorFunction",cA(c,o,"GeneratorFunction"),cA(u),cA(u,o,"Generator"),cA(u,n,function(){return this}),cA(u,"toString",function(){return"[object Generator]"}),(sA=function(){return{w:r,m:d}})()}function cA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}cA=function(A,e,t,n){function r(e,t){cA(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))},cA(A,e,t,n)}function lA(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 uA(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,dA(n.key),n)}}function dA(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 pA=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=sA().m(function A(e,t,n){var o,r,i,a,s,c,l,u,d,p,g,h,f;return sA().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){lA(r,n,o,i,a,"next",A)}function a(A){lA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A,e,t){return n.apply(this,arguments)})}],e&&uA(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function gA(A){return gA="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},gA(A)}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"!=gA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=gA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==gA(e)?e:e+""}const BA=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,B=0;B<t;B++)i[f+B]=r[h+B];return o}}],null&&hA(e.prototype,null),t&&hA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function mA(A){return mA="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},mA(A)}function vA(){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 wA(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]())):(wA(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,wA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}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]"}),(vA=function(){return{w:r,m:d}})()}function wA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}wA=function(A,e,t,n){function r(e,t){wA(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))},wA(A,e,t,n)}function yA(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 bA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?yA(Object(t),!0).forEach(function(e){CA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function CA(A,e,t){return(e=xA(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function QA(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 FA(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,xA(n.key),n)}}function xA(A){var e=function(A){if("object"!=mA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=mA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==mA(e)?e:e+""}const UA=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 tA,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=vA().m(function A(e){var t,n,o,r;return vA().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=bA({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=Z.extractPcmFromWav(t),t=o.pcmData,n=bA(bA({},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=iA.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,pA.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=BA.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=iA.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=Z.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){QA(r,n,o,i,a,"next",A)}function a(A){QA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})}],e&&FA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function SA(A){return SA="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},SA(A)}function EA(){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 IA(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]())):(IA(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,IA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,IA(u,"constructor",c),IA(c,"constructor",s),s.displayName="GeneratorFunction",IA(c,o,"GeneratorFunction"),IA(u),IA(u,o,"Generator"),IA(u,n,function(){return this}),IA(u,"toString",function(){return"[object Generator]"}),(EA=function(){return{w:r,m:d}})()}function IA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}IA=function(A,e,t,n){function r(e,t){IA(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))},IA(A,e,t,n)}function kA(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,TA(n.key),n)}}function TA(A){var e=function(A){if("object"!=SA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=SA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==SA(e)?e:e+""}const DA=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=EA().m(function A(e){var t,n,o,r,i,a,s,c,l,u,d,p,g;return EA().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 console.warn("🔧 ClientTools: No handler registered for '".concat(n,"'")),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:s=A.v,c=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(c,"ms")),this.sendResult(t,n,s,c),A.n=4;break;case 3:A.p=3,g=A.v,d=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),g),p="EXECUTION_ERROR","NotAllowedError"===g.name||null!==(l=g.message)&&void 0!==l&&l.includes("permission")?p="PERMISSION_DENIED":("NotSupportedError"===g.name||null!==(u=g.message)&&void 0!==u&&u.includes("not supported"))&&(p="API_UNAVAILABLE"),this.sendError(t,n,g.message||"Unknown error",p,d);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){kA(r,n,o,i,a,"next",A)}function a(A){kA(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&&HA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();var OA=t(354),PA=t.n(OA);function KA(A){return KA="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},KA(A)}function LA(){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 MA(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]())):(MA(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,MA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,MA(u,"constructor",c),MA(c,"constructor",s),s.displayName="GeneratorFunction",MA(c,o,"GeneratorFunction"),MA(u),MA(u,o,"Generator"),MA(u,n,function(){return this}),MA(u,"toString",function(){return"[object Generator]"}),(LA=function(){return{w:r,m:d}})()}function MA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}MA=function(A,e,t,n){function r(e,t){MA(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))},MA(A,e,t,n)}function RA(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 _A(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?RA(Object(t),!0).forEach(function(e){VA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):RA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function VA(A,e,t){return(e=function(A){var e=function(A){if("object"!=KA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=KA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==KA(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function jA(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 NA={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function GA(){return WA.apply(this,arguments)}function WA(){var A;return A=LA().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,B,m,v,w,y,b,C,Q,F,x,U=arguments;return LA().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,B=document.body,!n){A.n=3;break}if(m=document.querySelector(n)){A.n=2;break}throw new Error("Element not found: ".concat(n));case 2:B=m,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),A.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return v=_A(_A({},NA),{},{scale:c}),h&&!n&&(v.windowHeight=document.documentElement.scrollHeight,v.height=document.documentElement.scrollHeight,v.y=0),A.n=5,PA()(B,v);case 5:return w=A.v,console.log("📸 SDK Screenshot: Canvas created (".concat(w.width,"x").concat(w.height,")")),y=w,(u||p)&&(y=XA(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],F=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(F,"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:F,selector:n||"body"});case 6:throw A.p=6,x=A.v,console.error("📸 SDK Screenshot: Capture failed:",x),new Error("Screenshot capture failed: ".concat(x.message));case 7:return A.a(2)}},A,null,[[1,6]])}),WA=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){jA(r,n,o,i,a,"next",A)}function a(A){jA(r,n,o,i,a,"throw",A)}i(void 0)})},WA.apply(this,arguments)}function XA(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 JA(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 zA(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)?zA(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 zA(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 YA={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 qA(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(YA.types.includes(e))return!0;if(YA.autocomplete.includes(r))return!0;var c,l=JA(YA.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=JA(YA.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 ZA(A){return ZA="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},ZA(A)}function $A(){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 Ae(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]())):(Ae(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,Ae(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Ae(u,"constructor",c),Ae(c,"constructor",s),s.displayName="GeneratorFunction",Ae(c,o,"GeneratorFunction"),Ae(u),Ae(u,o,"Generator"),Ae(u,n,function(){return this}),Ae(u,"toString",function(){return"[object Generator]"}),($A=function(){return{w:r,m:d}})()}function Ae(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Ae=function(A,e,t,n){function r(e,t){Ae(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))},Ae(A,e,t,n)}function ee(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 te(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ee(Object(t),!0).forEach(function(e){ne(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):ee(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function ne(A,e,t){return(e=function(A){var e=function(A){if("object"!=ZA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ZA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ZA(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function oe(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 re(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 ie(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)?ie(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 ie(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={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function se(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&&!ce(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&&!ce(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var i=le(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 ce(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 le(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 ue(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 de(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 pe(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=re(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(de(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&t.push({selector:se(o),text:r.substring(0,e.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:ue(o,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function ge(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=re(n);try{for(r.s();!(A=r.n()).done;){var i=A.value;if(t.length>=e.links)break;if(de(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:se(i),text:a.substring(0,e.maxTextLength),href:s,internal:c,inViewport:ue(i,0)})}}}}}catch(A){r.e(A)}finally{r.f()}return t}function he(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=0,o=re(document.querySelectorAll("form"));try{for(o.s();!(A=o.n()).done;){var r=A.value;if(t.length>=e.forms)break;if(de(r)){var i,a=[],s=re(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(qA(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:se(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:se(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 fe(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=re(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(de(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:se(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,e.maxSummaryLength),inViewport:ue(a,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function Be(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=[],n=re(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(de(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&t.push({selector:se(r),level:r.tagName.toLowerCase(),text:i.substring(0,e.maxTextLength),inViewport:ue(r,0)})}}}catch(A){n.e(A)}finally{n.f()}return t}function me(){return ve.apply(this,arguments)}function ve(){return A=$A().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d=arguments;return $A().w(function(A){for(;;)if(0===A.n)return e=d.length>0&&void 0!==d[0]?d[0]:{},t=te(te({},ae),e.limits),n=pe(t),o=ge(t),r=he(t),i=r.forms,a=r.sensitiveCount,s=fe(t),c=Be(t),l=n.length+o.length+i.reduce(function(A,e){return A+e.fields.length},0)+s.length+c.length,u=n.filter(function(A){return A.inViewport}).length+o.filter(function(A){return A.inViewport}).length+s.filter(function(A){return A.inViewport}).length+c.filter(function(A){return A.inViewport}).length,A.a(2,{url:window.location.href,title:document.title,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,pageHeight:document.documentElement.scrollHeight},buttons:n,links:o,forms:i,sections:s,headings:c,metadata:{totalElements:l,visibleInViewport:u,formsCount:i.length,sensitiveFieldsFiltered:a}})},A)}),ve=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){oe(r,n,o,i,a,"next",A)}function a(A){oe(r,n,o,i,a,"throw",A)}i(void 0)})},ve.apply(this,arguments);var A}function we(){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 ye(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]())):(ye(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,ye(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,ye(u,"constructor",c),ye(c,"constructor",s),s.displayName="GeneratorFunction",ye(c,o,"GeneratorFunction"),ye(u),ye(u,o,"Generator"),ye(u,n,function(){return this}),ye(u,"toString",function(){return"[object Generator]"}),(we=function(){return{w:r,m:d}})()}function ye(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}ye=function(A,e,t,n){function r(e,t){ye(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))},ye(A,e,t,n)}function be(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){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){be(r,n,o,i,a,"next",A)}function a(A){be(r,n,o,i,a,"throw",A)}i(void 0)})}}function Qe(){return Fe.apply(this,arguments)}function Fe(){return Fe=Ce(we().m(function A(){var e,t,n,o,r,i,a,s,c,l,u=arguments;return we().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,Oe(400);case 3:return c=s.getBoundingClientRect(),xe(),(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)})),Fe.apply(this,arguments)}function xe(){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 Ue(){return Se.apply(this,arguments)}function Se(){return Se=Ce(we().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d=arguments;return we().w(function(A){for(;;)switch(A.n){case 0:if(t=(e=d.length>0&&void 0!==d[0]?d[0]:{}).selector,n=e.x,o=e.y,r=e.position,i=void 0===r?"center":r,a=e.behavior,s=void 0===a?"smooth":a,!t){A.n=3;break}if(c=document.querySelector(t)){A.n=1;break}return A.a(2,{success:!1,error:"Element not found: ".concat(t)});case 1:return l="top"===i?"start":"bottom"===i?"end":"center",c.scrollIntoView({behavior:s,block:l,inline:"nearest"}),A.n=2,Oe("smooth"===s?500:100);case 2:return u=c.getBoundingClientRect(),A.a(2,{success:!0,scrollType:"element",selector:t,elementPosition:{top:u.top,left:u.left}});case 3:if(void 0===n&&void 0===o){A.n=5;break}return window.scrollTo({top:null!=o?o:window.scrollY,left:null!=n?n:window.scrollX,behavior:s}),A.n=4,Oe("smooth"===s?500:100);case 4:return A.a(2,{success:!0,scrollType:"position",scrolledTo:{x:null!=n?n:window.scrollX,y:null!=o?o:window.scrollY}});case 5:return A.a(2,{success:!1,error:"Either selector or x/y position required"})}},A)})),Se.apply(this,arguments)}function Ee(){return Ie.apply(this,arguments)}function Ie(){return Ie=Ce(we().m(function A(){var e,t,n,o=arguments;return we().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=(o.length>0&&void 0!==o[0]?o[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(t.origin===window.location.origin){A.n=4;break}return A.a(2,{success:!1,error:"Cannot navigate to external site (different origin)",attempted:t.href,currentOrigin:window.location.origin});case 4:if(["http:","https:"].includes(t.protocol)){A.n=5;break}return A.a(2,{success:!1,error:"Invalid protocol: ".concat(t.protocol)});case 5:return n=window.location.href,window.location.href=t.href,A.a(2,{success:!0,navigatedTo:t.href,from:n})}},A,null,[[1,2]])})),Ie.apply(this,arguments)}function ke(){return He.apply(this,arguments)}function He(){return He=Ce(we().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p=arguments;return we().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(!qA(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,Oe(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})))),xe(),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)})),He.apply(this,arguments)}function Te(){return De.apply(this,arguments)}function De(){return De=Ce(we().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p=arguments;return we().w(function(A){for(;;)switch(A.n){case 0:if(n=(t=p.length>0&&void 0!==p[0]?p[0]:{}).selector,o=t.waitForNavigation,r=void 0!==o&&o,n){A.n=1;break}return A.a(2,{success:!1,error:"Selector is required"});case 1:if(i=document.querySelector(n)){A.n=2;break}return A.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:if(0!==(a=i.getBoundingClientRect()).width&&0!==a.height){A.n=3;break}return A.a(2,{success:!1,error:"Element is not visible (zero size)"});case 3:if(!i.disabled){A.n=4;break}return A.a(2,{success:!1,error:"Element is disabled"});case 4:return i.scrollIntoView({behavior:"smooth",block:"center"}),A.n=5,Oe(300);case 5:return(s=document.createElement("div")).style.cssText="\n position: fixed;\n top: ".concat(a.top-2,"px;\n left: ").concat(a.left-2,"px;\n width: ").concat(a.width+4,"px;\n height: ").concat(a.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(s),A.n=6,Oe(200);case 6:if(s.remove(),!r){A.n=8;break}return l=window.location.href,u=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)}),i.click(),A.n=7,u;case 7:return d=A.v,A.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:i.tagName.toLowerCase(),text:(null===(c=i.innerText)||void 0===c?void 0:c.trim().substring(0,50))||null},navigated:d.navigated||window.location.href!==l});case 8:return i.click(),A.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:i.tagName.toLowerCase(),text:(null===(e=i.innerText)||void 0===e?void 0:e.trim().substring(0,50))||null}})}},A)})),De.apply(this,arguments)}function Oe(A){return new Promise(function(e){return setTimeout(e,A)})}function Pe(){document.querySelectorAll(".ttp-highlight-overlay").forEach(function(A){return A.remove()})}function Ke(){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 Le(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]())):(Le(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,Le(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Le(u,"constructor",c),Le(c,"constructor",s),s.displayName="GeneratorFunction",Le(c,o,"GeneratorFunction"),Le(u),Le(u,o,"Generator"),Le(u,n,function(){return this}),Le(u,"toString",function(){return"[object Generator]"}),(Ke=function(){return{w:r,m:d}})()}function Le(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Le=function(A,e,t,n){function r(e,t){Le(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))},Le(A,e,t,n)}function Me(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 Re(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Me(r,n,o,i,a,"next",A)}function a(A){Me(r,n,o,i,a,"throw",A)}i(void 0)})}}function _e(){return Ve.apply(this,arguments)}function Ve(){return(Ve=Re(Ke().m(function A(){var e;return Ke().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,me();case 1:return e=A.v,A.a(2,{url:e.url,title:e.title,timestamp:e.timestamp,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 je(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 Ne(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?je(Object(t),!0).forEach(function(e){At(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}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 Xe(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 Je(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Xe(r,n,o,i,a,"next",A)}function a(A){Xe(r,n,o,i,a,"throw",A)}i(void 0)})}}function ze(A){return ze="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},ze(A)}function Ye(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,et(n.key),n)}}function qe(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(qe=function(){return!!A})()}function Ze(A){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Ze(A)}function $e(A,e){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},$e(A,e)}function At(A,e,t){return(e=et(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function et(A){var e=function(A){if("object"!=ze(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ze(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ze(e)?e:e+""}var tt=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=Ze(e),function(A,e){if(e&&("object"==ze(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,qe()?Reflect.construct(e,t||[],Ze(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.audioPlayer=new T(A.config),A.audioRecorder=new J(A.config),A.setupAudioPlayerEvents(),A.setupAudioRecorderEvents(),A.clientToolsRegistry=new DA(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&&$e(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!==GA);try{if(void 0===GA)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:",ze(GA)),this.clientToolsRegistry.registerHandler("capture_screen",Je(Ge().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,B,m,v=arguments;return Ge().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=v.length>0&&void 0!==v[0]?v[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,GA({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:g,maxHeight:f});case 2:return B=e.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(B.width,"x").concat(B.height,", ").concat(Math.round(B.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:B.width,height:B.height,sizeKB:Math.round(B.image.length/1024),selector:B.selector}),e.a(2,B);case 3:throw e.p=3,m=e.v,console.error("📸 VoiceSDK: Screenshot capture failed:",m),A.emit("screenshotError",{error:m.message}),m;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{var e,t=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant);null!=t&&t.enabled?(function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.allowHighlight,n=void 0===t||t,o=e.allowScroll,r=void 0===o||o,i=e.allowNavigate,a=void 0===i||i,s=e.allowFillForm,c=void 0!==s&&s,l=e.allowClick,u=void 0!==l&&l;A.registerHandler("get_dom_context",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Extracting DOM context..."),A.n=1,me(e);case 1:return t=A.v,console.log("[TTP] ✅ DOM context extracted:",{buttons:t.buttons.length,links:t.links.length,forms:t.forms.length,headings:t.headings.length}),A.a(2,t)}},A)}))),n&&A.registerHandler("highlight_element",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,Qe(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)}))),r&&A.registerHandler("scroll_to",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().w(function(A){for(;;)switch(A.n){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📜 Scrolling to:",e.selector||"(".concat(e.x,", ").concat(e.y,")")),A.n=1,Ue(e);case 1:return(t=A.v).success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",t.error),A.a(2,t)}},A)}))),a&&A.registerHandler("navigate_to",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,Ee(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)}))),c&&A.registerHandler("fill_form",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,ke(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)}))),u&&A.registerHandler("click_element",Re(Ke().m(function A(){var e,t,n=arguments;return Ke().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,Te(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)}))),A.registerHandler("clear_highlights",Re(Ke().m(function A(){return Ke().w(function(A){for(;;)if(0===A.n)return Pe(),A.a(2,{success:!0})},A)}))),console.log("[TTP] 👁️ Visual assistant tools registered:",{highlight:n,scroll:r,navigate:a,fill:c,click:u})}(this.clientToolsRegistry,t),console.log("[TTP] 👁️ Visual assistant enabled")):console.log("[TTP] 👁️ Visual assistant disabled (not configured)")}catch(A){console.error("❌ VoiceSDK: Error registering visual assistant tools:",A),console.error(" Error details:",A.message,A.stack)}}},{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){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:(d=Je(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(),console.log("🔌 VoiceSDK v2: Connecting to",e),A.n=3,new Promise(function(A,t){n.websocket=new WebSocket(e),n.websocket.onopen=function(){console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry&&n.clientToolsRegistry.setSendMessage(function(A){return n.sendMessage(A)}),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){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.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 d.apply(this,arguments)})},{key:"sendHelloMessage",value:(u=Je(Ge().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d;return Ge().w(function(A){for(;;)switch(A.p=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(t={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},n={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},!(o=this.validateInputFormat(t))){A.n=2;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",o),this.emit("error",new Error("Invalid input format: ".concat(o))),A.a(2);case 2:if(!(r=this.validateOutputFormat(n))){A.n=3;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",r),this.emit("error",new Error("Invalid output format: ".concat(r))),A.a(2);case 3:if(i={t:"hello",v:this.config.protocolVersion,inputFormat:t,requestedOutputFormat:n,outputFrameDurationMs:this.config.outputFrameDurationMs},this.config.agentSettingsOverride&&(i.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?(i.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"),null==(a=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant))||!a.enabled){A.n=7;break}return A.p=4,A.n=5,_e();case 5:i.pageContext=A.v,console.log("[TTP] 📋 Page context attached:",{url:i.pageContext.url,title:i.pageContext.title,elements:null===(s=i.pageContext.dom)||void 0===s||null===(s=s.metadata)||void 0===s?void 0:s.totalElements,buttons:null===(c=i.pageContext.dom)||void 0===c||null===(c=c.buttons)||void 0===c?void 0:c.length,links:null===(l=i.pageContext.dom)||void 0===l||null===(l=l.links)||void 0===l?void 0:l.length,forms:null===(u=i.pageContext.dom)||void 0===u||null===(u=u.forms)||void 0===u?void 0:u.length}),A.n=7;break;case 6:A.p=6,d=A.v,console.warn("[TTP] ⚠️ Failed to extract page context:",d);case 7:console.log("📤 VoiceSDK v2: Sending hello:",{version:i.v,requestedFormat:i.requestedOutputFormat,variables:i.variables?Object.keys(i.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:i.requestedOutputFormat.container,encoding:i.requestedOutputFormat.encoding,sampleRate:i.requestedOutputFormat.sampleRate,bitDepth:i.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(i,null,2));try{this.sendMessage(i)}catch(A){console.error("VoiceSDK v2: Failed to send hello:",A),this.emit("error",A)}case 8:return A.a(2)}},A,this,[[4,6]])})),function(){return u.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"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"),_e().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{GA().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 UA(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...")):console.log("✅ VoiceSDK v2: Connected (v1 legacy mode)");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:"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=Je(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}}else console.warn("🔌 VoiceSDK v2: Cannot hangup - WebSocket not open")}},{key:"startRecording",value:(c=Je(Ge().m(function A(){var e,t,n;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:return A.n=5,this.audioPlayer.resumeAudioContext();case 5:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),this._requestWakeLock(),A.a(2,!0);case 6:return A.p=6,n=A.v,console.error("❌ VoiceSDK v2: Failed to start recording:",n),"NotAllowedError"===n.name||"PermissionDeniedError"===n.name?((t=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.")).name=n.name,t.originalError=n,this.emit("error",t)):this.emit("error",n),A.a(2,!1)}},A,this,[[3,6]])})),function(){return c.apply(this,arguments)})},{key:"stopRecording",value:(s=Je(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=Je(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=Je(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=Je(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=Je(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=Ne(Ne({},this.config),A)}},{key:"generateTtpId",value:function(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}},{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;this.isDestroyed||(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.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&&Ye(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c,l,u,d}(a);At(tt,"RESUME_STORAGE_KEY","voice_resume_state"),At(tt,"RESUME_TTL_MS",1e4),At(tt,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(tt,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(tt,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),At(tt,"SUPPORTED_INPUT_CHANNELS",[1]),At(tt,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),At(tt,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),At(tt,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),At(tt,"SUPPORTED_OUTPUT_CHANNELS",[1]),At(tt,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const nt=tt;function ot(A){return ot="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},ot(A)}function rt(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,it(n.key),n)}}function it(A){var e=function(A){if("object"!=ot(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ot(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ot(e)?e:e+""}var at=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&&rt(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function st(A){return st="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},st(A)}function ct(){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 lt(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]())):(lt(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,lt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,lt(u,"constructor",c),lt(c,"constructor",s),s.displayName="GeneratorFunction",lt(c,o,"GeneratorFunction"),lt(u),lt(u,o,"Generator"),lt(u,n,function(){return this}),lt(u,"toString",function(){return"[object Generator]"}),(ct=function(){return{w:r,m:d}})()}function lt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}lt=function(A,e,t,n){function r(e,t){lt(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))},lt(A,e,t,n)}function ut(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 dt(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 pt(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(t),!0).forEach(function(e){gt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):dt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function gt(A,e,t){return(e=ft(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function ht(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,ft(n.key),n)}}function ft(A){var e=function(A){if("object"!=st(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=st(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==st(e)?e:e+""}function Bt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Bt=function(){return!!A})()}function mt(A){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},mt(A)}function vt(A,e){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},vt(A,e)}var wt=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=mt(e),function(A,e){if(e&&("object"==st(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,Bt()?Reflect.construct(e,t||[],mt(A).constructor):e.apply(A,t))}(this,e)).readScriptTagConfig();return A.config=pt({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&&vt(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=ct().m(function A(e){var t=this;return ct().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){ut(r,t,n,i,a,"next",A)}function a(A){ut(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=pt(pt({},this.config),A)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&ht(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(at);function yt(A){return yt="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},yt(A)}function bt(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)||Qt(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 Ct(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Qt(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 Qt(A,e){if(A){if("string"==typeof A)return Ft(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)?Ft(A,e):void 0}}function Ft(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 xt(){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 Ut(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]())):(Ut(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,Ut(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Ut(u,"constructor",c),Ut(c,"constructor",s),s.displayName="GeneratorFunction",Ut(c,o,"GeneratorFunction"),Ut(u),Ut(u,o,"Generator"),Ut(u,n,function(){return this}),Ut(u,"toString",function(){return"[object Generator]"}),(xt=function(){return{w:r,m:d}})()}function Ut(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Ut=function(A,e,t,n){function r(e,t){Ut(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))},Ut(A,e,t,n)}function St(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 Et(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,It(n.key),n)}}function It(A){var e=function(A){if("object"!=yt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=yt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==yt(e)?e:e+""}function kt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(kt=function(){return!!A})()}function Ht(A){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Ht(A)}function Tt(A,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Tt(A,e)}const Dt=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=Ht(e),function(A,e){if(e&&("object"==yt(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||[],Ht(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&&Tt(A,e)}(e,A),t=e,n=[{key:"getConnection",value:(o=xt().m(function A(e){var t,n,o=this;return xt().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){St(r,t,n,i,a,"next",A)}function a(A){St(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=Ct(this.connections.entries());try{for(t.s();!(A=t.n()).done;){var n=bt(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=Ct(this.connections.entries());try{for(e.s();!(A=e.n()).done;){var t=bt(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&&Et(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(at));function Ot(A){return Ot="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},Ot(A)}function Pt(){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 Kt(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]())):(Kt(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,Kt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Kt(u,"constructor",c),Kt(c,"constructor",s),s.displayName="GeneratorFunction",Kt(c,o,"GeneratorFunction"),Kt(u),Kt(u,o,"Generator"),Kt(u,n,function(){return this}),Kt(u,"toString",function(){return"[object Generator]"}),(Pt=function(){return{w:r,m:d}})()}function Kt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Kt=function(A,e,t,n){function r(e,t){Kt(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))},Kt(A,e,t,n)}function Lt(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 Mt(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,Rt(n.key),n)}}function Rt(A){var e=function(A){if("object"!=Ot(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ot(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ot(e)?e:e+""}function _t(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(_t=function(){return!!A})()}function Vt(A){return Vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Vt(A)}function jt(A,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},jt(A,e)}var Nt=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=Vt(e),function(A,e){if(e&&("object"==Ot(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,_t()?Reflect.construct(e,t||[],Vt(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&&jt(A,e)}(e,A),t=e,n=[{key:"connect",value:(r=Pt().m(function A(){var e=this;return Pt().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;Dt.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){Lt(o,t,n,i,a,"next",A)}function a(A){Lt(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)};Dt.on("open",e),Dt.on("close",t),Dt.on("error",n),Dt.on("message",o),this.eventHandlers={open:e,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(Dt.off("open",this.eventHandlers.open),Dt.off("close",this.eventHandlers.close),Dt.off("error",this.eventHandlers.error),Dt.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&Dt.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 Dt.getAllConnections()}},{key:"clearAllConnections",value:function(){Dt.clearAll()}}],n&&Mt(t.prototype,n),o&&Mt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(at);function Gt(A){return Gt="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},Gt(A)}function Wt(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 Xt(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(t),!0).forEach(function(e){Jt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Wt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Jt(A,e,t){return(e=en(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function zt(){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 Yt(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]())):(Yt(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,Yt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Yt(u,"constructor",c),Yt(c,"constructor",s),s.displayName="GeneratorFunction",Yt(c,o,"GeneratorFunction"),Yt(u),Yt(u,o,"Generator"),Yt(u,n,function(){return this}),Yt(u,"toString",function(){return"[object Generator]"}),(zt=function(){return{w:r,m:d}})()}function Yt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Yt=function(A,e,t,n){function r(e,t){Yt(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))},Yt(A,e,t,n)}function qt(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){qt(r,n,o,i,a,"next",A)}function a(A){qt(r,n,o,i,a,"throw",A)}i(void 0)})}}function $t(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 An(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,en(n.key),n)}}function en(A){var e=function(A){if("object"!=Gt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Gt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Gt(e)?e:e+""}function tn(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(tn=function(){return!!A})()}function nn(A){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},nn(A)}function on(A,e){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},on(A,e)}var rn=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=nn(e),function(A,e){if(e&&("object"==Gt(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,tn()?Reflect.construct(e,t||[],nn(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&&on(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 $t(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)?$t(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=Zt(zt().m(function A(){var e;return zt().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=Zt(zt().m(function A(){var e,t,n,o;return zt().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?Xt(Xt({},t),this.config.audioConstraints):t,A.n=3,navigator.mediaDevices.getUserMedia({audio:Xt({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=Zt(zt().m(function A(){var e,t,n,o,r,i,a,s,c,l=this;return zt().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?Xt(Xt({},n),this.config.audioConstraints):n,A.n=2,navigator.mediaDevices.getUserMedia({audio:Xt({sampleRate:t,channelCount:1},o)});case 2:if(this.mediaStream=A.v,this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t}),"suspended"!==this.audioContext.state){A.n=3;break}return A.n=3,this.audioContext.resume();case 3:return r=this.getAudioProcessorPath(),A.n=4,this.audioContext.audioWorklet.addModule(r);case 4:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor",{processorOptions:{sampleRate:t,outputSampleRate:this.config.outputSampleRate}}),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&l.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=9;break;case 5:if(A.p=5,c=A.v,i=c.message,"NotAllowedError"!==c.name&&"PermissionDeniedError"!==c.name){A.n=7;break}return A.n=6,this.checkPermissionState();case 6:"denied"===(a=A.v)?(i='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"===a?(i='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.')):(i="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=8;break;case 7:"NotFoundError"===c.name||"DevicesNotFoundError"===c.name?(i="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===c.name||"TrackStartError"===c.name?(i="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"!==c.name&&"PermissionDeniedError"!==c.name||(i="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 8:throw(s=new Error(i)).name=c.name,s.originalError=c,this.emit("error",s),s;case 9:return A.a(2)}},A,this,[[0,5]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=Zt(zt().m(function A(){var e;return zt().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.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=Zt(zt().m(function A(){var e,t;return zt().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&&An(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a}(at);function an(A){return an="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},an(A)}function sn(){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 cn(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]())):(cn(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,cn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,cn(u,"constructor",c),cn(c,"constructor",s),s.displayName="GeneratorFunction",cn(c,o,"GeneratorFunction"),cn(u),cn(u,o,"Generator"),cn(u,n,function(){return this}),cn(u,"toString",function(){return"[object Generator]"}),(sn=function(){return{w:r,m:d}})()}function cn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}cn=function(A,e,t,n){function r(e,t){cn(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))},cn(A,e,t,n)}function ln(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 un(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){ln(r,n,o,i,a,"next",A)}function a(A){ln(r,n,o,i,a,"throw",A)}i(void 0)})}}function dn(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,pn(n.key),n)}}function pn(A){var e=function(A){if("object"!=an(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=an(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==an(e)?e:e+""}function gn(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(gn=function(){return!!A})()}function hn(A){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},hn(A)}function fn(A,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},fn(A,e)}var Bn=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=hn(e),function(A,e){if(e&&("object"==an(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,gn()?Reflect.construct(e,t||[],hn(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&&fn(A,e)}(e,A),t=e,n=[{key:"initializeAudioContext",value:(i=un(sn().m(function A(){var e,t,n,o,r,i;return sn().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=un(sn().m(function A(){var e,t,n,o,r,i,a,s,c=this;return sn().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=un(sn().m(function A(){var e;return sn().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&&dn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(at),mn=t(540),vn=t(848);function wn(A){return wn="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},wn(A)}function yn(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){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?yn(Object(t),!0).forEach(function(e){Cn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yn(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Cn(A,e,t){return(e=function(A){var e=function(A){if("object"!=wn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=wn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==wn(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Qn(){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 Fn(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]())):(Fn(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,Fn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Fn(u,"constructor",c),Fn(c,"constructor",s),s.displayName="GeneratorFunction",Fn(c,o,"GeneratorFunction"),Fn(u),Fn(u,o,"Generator"),Fn(u,n,function(){return this}),Fn(u,"toString",function(){return"[object Generator]"}),(Qn=function(){return{w:r,m:d}})()}function Fn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Fn=function(A,e,t,n){function r(e,t){Fn(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))},Fn(A,e,t,n)}function xn(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 Un(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 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}}(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 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}const En=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,B=A.onRecordingStarted,m=A.onRecordingStopped,v=A.onPlaybackStarted,w=A.onPlaybackStopped,y=A.onError,b=A.onMessage,C=A.onBargeIn,Q=A.onStopPlaying,F=A.onStartConversation,x=A.onEndConversation,U=A.className,S=void 0===U?"":U,E=A.style,I=void 0===E?{}:E,k=A.children,H=Un((0,mn.useState)(!1),2),T=H[0],D=H[1],O=Un((0,mn.useState)(!1),2),P=O[0],K=O[1],L=Un((0,mn.useState)(!1),2),M=(L[0],L[1]),R=Un((0,mn.useState)("Disconnected"),2),_=(R[0],R[1]),V=(0,mn.useRef)(null);(0,mn.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||e)),V.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),V.current.destroy(),V.current=null);var A=new nt({signedUrl:t||e,websocketUrl:t||e,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,visualAssistant:g,onStartConversation:F,onEndConversation:x});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==B||B()}),A.on("recordingStopped",function(){K(!1),null==m||m()}),A.on("playbackStarted",function(){M(!0),null==v||v()}),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)}),V.current=A,A.connect(),function(){var A=e||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),V.current&&(V.current.destroy(),V.current=null)}},[e,t,n,o,i,s,d,g]);var j=function(){var A,e=(A=Qn().m(function A(){var e;return Qn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(V.current){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,V.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){xn(r,n,o,i,a,"next",A)}function a(A){xn(r,n,o,i,a,"throw",A)}i(void 0)})});return function(){return e.apply(this,arguments)}}(),N=(0,vn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,vn.jsx)("div",{style:{fontSize:"20px"},children:P?"🔴":"🎤"}),(0,vn.jsx)("div",{children:P?"Stop Listening":"Start Listening"})]});return(0,vn.jsx)("button",{className:"voice-button ".concat(P?"recording":""," ").concat(S),style:bn({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:P?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},I),onClick:j,disabled:!T,children:k||N})};function In(A){return In="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},In(A)}function kn(){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]"}),(kn=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 Tn(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 Dn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Tn(r,n,o,i,a,"next",A)}function a(A){Tn(r,n,o,i,a,"throw",A)}i(void 0)})}}function On(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 Pn(A,e,t){return(e=Ln(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Kn(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,Ln(n.key),n)}}function Ln(A){var e=function(A){if("object"!=In(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=In(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==In(e)?e:e+""}var Mn=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?On(Object(t),!0).forEach(function(e){Pn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):On(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,this.voiceSDK=new nt({signedUrl:this.options.websocketUrl||this.options.signedUrl,websocketUrl:this.options.websocketUrl||this.options.signedUrl,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=Dn(kn().m(function A(){var e;return kn().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=Dn(kn().m(function A(){var e;return kn().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&&Kn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function Rn(){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 _n(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]())):(_n(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,_n(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,_n(u,"constructor",c),_n(c,"constructor",s),s.displayName="GeneratorFunction",_n(c,o,"GeneratorFunction"),_n(u),_n(u,o,"Generator"),_n(u,n,function(){return this}),_n(u,"toString",function(){return"[object Generator]"}),(Rn=function(){return{w:r,m:d}})()}function _n(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}_n=function(A,e,t,n){function r(e,t){_n(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))},_n(A,e,t,n)}function Vn(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)||Nn(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 jn(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Nn(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 Nn(A,e){if(A){if("string"==typeof A)return Gn(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)?Gn(A,e):void 0}}function Gn(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 Wn(A){return Wn="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},Wn(A)}function Xn(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 Jn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Xn(r,n,o,i,a,"next",A)}function a(A){Xn(r,n,o,i,a,"throw",A)}i(void 0)})}}function zn(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"!=Wn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Wn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Wn(e)?e:e+""}var qn=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 nt({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=Jn(Rn().m(function A(e){var t,n,o,r,i,a,s,c,l=this;return Rn().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 nt({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!",Wn(l.onTranscript))),l.onSubtitleDisplay(A)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=jn(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=Vn(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=Jn(Rn().m(function A(){var e;return Rn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){A.n=5;break}return A.p=1,console.log("🎤 AgentSDK: Starting recording..."),A.n=2,this.voiceSDK.startRecording();case 2:console.log("✅ AgentSDK: Recording started successfully"),A.n=4;break;case 3:throw A.p=3,e=A.v,console.error("❌ AgentSDK: Failed to start recording:",e),e;case 4:A.n=6;break;case 5:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 6: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&&zn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function Zn(){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 $n(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]())):($n(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,$n(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,$n(u,"constructor",c),$n(c,"constructor",s),s.displayName="GeneratorFunction",$n(c,o,"GeneratorFunction"),$n(u),$n(u,o,"Generator"),$n(u,n,function(){return this}),$n(u,"toString",function(){return"[object Generator]"}),(Zn=function(){return{w:r,m:d}})()}function $n(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}$n=function(A,e,t,n){function r(e,t){$n(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))},$n(A,e,t,n)}function Ao(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 eo(){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 to(){return no.apply(this,arguments)}function no(){var A;return A=Zn().m(function A(){var e;return Zn().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]])}),no=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Ao(r,n,o,i,a,"next",A)}function a(A){Ao(r,n,o,i,a,"throw",A)}i(void 0)})},no.apply(this,arguments)}function oo(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 ro(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 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){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,so(n.key),n)}}function so(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+""}function co(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 lo(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)?lo(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 lo(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 uo=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)}}])&&ao(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function po(A,e){var t=new uo,n=t.createOverlay(),o=eo(),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 go(A,e){var t,n,o,r=new uo,i=r.createOverlay(),a=eo(),s=oo(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=co(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=co(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(){ro(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(),eo();var e,t=document.getElementsByTagName("script"),n="",o=co(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=co(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 B=document.createElement("div");B.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var m=document.createElement("div");m.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",m.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var v=document.createElement("button");if(v.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 ",v.textContent="✕",v.addEventListener("click",function(){p.remove()}),v.addEventListener("mouseenter",function(){v.style.background="rgba(255, 255, 255, 0.3)"}),v.addEventListener("mouseleave",function(){v.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)}B.appendChild(m),g.appendChild(h),g.appendChild(B),g.appendChild(v),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 ho(A){var e=new uo,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 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 Bo(){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 mo(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]())):(mo(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,mo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,mo(u,"constructor",c),mo(c,"constructor",s),s.displayName="GeneratorFunction",mo(c,o,"GeneratorFunction"),mo(u),mo(u,o,"Generator"),mo(u,n,function(){return this}),mo(u,"toString",function(){return"[object Generator]"}),(Bo=function(){return{w:r,m:d}})()}function mo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}mo=function(A,e,t,n){function r(e,t){mo(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))},mo(A,e,t,n)}function vo(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 wo(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){vo(r,n,o,i,a,"next",A)}function a(A){vo(r,n,o,i,a,"throw",A)}i(void 0)})}}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"!=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 Co=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.shadowRoot=e.shadowRoot||document,this.textSDK=e.textSDK||null,this.deviceInfo=eo(),this.isMobile=this.deviceInfo.isMobile,this.messages=[],this.isTranscriptExpanded=!1,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=e.visualAssistant||(null===(t=e.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);this.sdk=new qn({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.setupSDKEventHandlers(),this.checkAndHandleResume()},e=[{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())):(t.classList.remove("speaking"),A.isMobile&&(A.updateMobileStatus("listening"),A.startWaveformAnimation())))},this.sdk.onDisconnected=function(){console.log("🔌 WebSocket disconnected, hanging up call..."),A.isActive&&(A.isActive=!1,A.endVoiceCall())},this.sdk.onError=function(e){console.error("❌ Voice SDK Error:",e),e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))?A.showDomainError():A.showError(e.message||e)}}},{key:"setupTextInjectAckHandler",value:function(){var A,e=this;null!==(A=this.sdk)&&void 0!==A&&A.voiceSDK&&(this._textInjectAckHandler&&this.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=function(A){e.handleTextInjectAck(A)},this.sdk.voiceSDK.on("textInjectAck",this._textInjectAckHandler),console.log("📝 VoiceInterface: textInjectAck handler registered"))}},{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.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 --\x3e\n <div id="voiceActiveState" style="display: none;">\n <div class="voice-avatar-active" id="voiceAvatarActive">\n <div class="voice-rings">\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n </div>\n 🤖\n </div>\n <div class="voice-status">\n <div class="voice-status-title" id="voiceStatusTitleActive">').concat(this.t("listening"),'</div>\n <div class="voice-status-subtitle" id="voiceStatusSubtitleActive">').concat(this.t("speakFreely"),'</div>\n </div>\n <div class="voice-transcript">\n <div class="transcript-label">').concat(this.t("liveTranscript"),'</div>\n <div class="transcript-text empty" id="transcriptText">\n ').concat(this.t("transcriptWillAppear"),'\n </div>\n </div>\n \n \x3c!-- Text Input (type while on voice call) --\x3e\n <div class="voice-text-input-area">\n <div class="voice-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="voiceTextInput"\n class="voice-text-input"\n />\n <button class="voice-send-btn" id="voiceSendBtn" 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="voice-input-hint">🎙️ Voice is still active • Type or speak</p>\n </div>\n \n <div class="voice-controls">\n <button class="voice-control-btn secondary" id="muteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mute-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 <line x1="8" y1="23" x2="16" y2="23"/>\n <line x1="2" y1="2" x2="22" y2="22" class="mute-cross" style="display: none; stroke: #ef4444; stroke-width: 3.5;"/>\n </svg>\n </button>\n <button class="voice-control-btn primary active" id="endCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg width="56" height="56" viewBox="0 0 24 24" fill="#ef4444">\n <rect x="6" y="6" width="12" height="12" rx="2"/>\n </svg>\n <div class="voice-timer" id="voiceTimer">00:00</div>\n </button>\n <button class="voice-control-btn secondary" id="speakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\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 0 1 0 14.14"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n </button>\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>')}},{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: center; \n justify-content: center; \n padding: 6px 10px 6px 10px; \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: center;\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: clamp(4px, 1vh, 8px);\n padding: clamp(6px, 1.2vh, 10px) 0 clamp(4px, 0.8vh, 8px) 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 \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: min(360px, calc(100% - 40px));\n margin: clamp(6px, 1vh, 10px) 0 clamp(6px, 1vh, 10px) 0;\n flex-shrink: 0;\n }\n \n .voice-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 transition: border-color 0.2s ease;\n }\n \n .voice-input-wrapper:focus-within {\n border-color: #7c3aed;\n box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);\n }\n \n .voice-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-size: clamp(12px, 1.8vh, 14px);\n color: #374151;\n background: transparent;\n padding: clamp(8px, 1.2vh, 10px) 0;\n }\n \n .voice-text-input::placeholder {\n color: #9ca3af;\n }\n \n .voice-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: clamp(36px, 5vh, 40px);\n height: clamp(36px, 5vh, 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: opacity 0.2s ease, transform 0.1s ease;\n flex-shrink: 0;\n }\n \n .voice-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n opacity: 0.9;\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 }\n \n .voice-send-btn svg {\n width: clamp(16px, 2.2vh, 18px);\n height: clamp(16px, 2.2vh, 18px);\n }\n \n .voice-input-hint {\n margin: clamp(4px, 0.6vh, 6px) 0 0;\n font-size: clamp(9px, 1.2vh, 11px);\n color: #9ca3af;\n text-align: center;\n transition: color 0.2s ease;\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 /* 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 Styles - Fixed at bottom of viewport */\n /* These styles are injected into document head when mobile bar is created */\n \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(d,";\n align-items: center").concat(d,";\n justify-content: center").concat(d,";\n width: 32px").concat(d,";\n height: 32px").concat(d,";\n min-width: 32px").concat(d,";\n min-height: 32px").concat(d,";\n max-width: 32px").concat(d,";\n max-height: 32px").concat(d,";\n border-radius: 50%").concat(d,";\n border: none").concat(d,";\n cursor: pointer").concat(d,";\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15)").concat(d,";\n position: relative").concat(d,";\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 .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25)").concat(d,";\n }\n \n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3)").concat(d,";\n }\n \n .mobile-control-btn svg {\n position: absolute").concat(d,";\n top: 50%").concat(d,";\n left: 50%").concat(d,";\n transform: translate(-50%, -50%)").concat(d,";\n display: block").concat(d,";\n visibility: visible").concat(d,";\n opacity: 1").concat(d,";\n width: 15px").concat(d,";\n height: 15px").concat(d,";\n margin: 0").concat(d,";\n padding: 0").concat(d,";\n }\n \n .mobile-end-call-btn {\n display: flex").concat(d,";\n align-items: center").concat(d,";\n justify-content: center").concat(d,";\n width: 36px").concat(d,";\n height: 36px").concat(d,";\n min-width: 36px").concat(d,";\n min-height: 36px").concat(d,";\n max-width: 36px").concat(d,";\n max-height: 36px").concat(d,";\n border-radius: 50%").concat(d,";\n border: none").concat(d,";\n cursor: pointer").concat(d,";\n background-color: #ef4444").concat(d,";\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\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 .mobile-end-call-btn svg {\n display: block").concat(d,";\n visibility: visible").concat(d,";\n opacity: 1").concat(d,";\n width: 15px").concat(d,";\n height: 15px").concat(d,";\n margin: 0").concat(d,";\n padding: 0").concat(d,";\n position: relative").concat(d,";\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 }\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-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: opacity 0.2s ease;\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:"setupEventHandlers",value:function(A){var e=this,t=this.shadowRoot.getElementById("startCallBtn"),n=this.shadowRoot.getElementById("endCallBtn"),o=this.shadowRoot.getElementById("muteBtn"),r=this.shadowRoot.getElementById("speakerBtn");if(t&&(t.onclick=function(){return e.startVoiceCall()}),n&&(n.onclick=function(){return e.endVoiceCall()}),o&&(o.onclick=function(){return e.toggleMute()}),r&&(r.onclick=function(){return e.toggleSpeaker()}),!this.isMobile){var i=this.shadowRoot.getElementById("voiceTextInput"),a=this.shadowRoot.getElementById("voiceSendBtn");i&&(i.addEventListener("input",function(){a&&(a.disabled=!i.value.trim())}),i.addEventListener("keypress",function(A){"Enter"===A.key&&i.value.trim()&&(A.preventDefault(),e.sendDesktopTextMessage())})),a&&(a.onclick=function(){return e.sendDesktopTextMessage()})}if(this.isMobile&&this.setupMobileEventHandlers(),!this.isMobile){var s=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.shadowRoot.getElementById("voiceInterface");t&&t.classList.contains("active")&&t.clientHeight>100?(console.log("✅ Interface is active and has proper dimensions, adjusting sizes (attempt",A+1,")"),e.adjustSizesForContainer(),0===A&&setTimeout(function(){return e.adjustSizesForContainer()},500)):A<15?(console.log("⏳ Interface not ready yet (height:",null==t?void 0:t.clientHeight,"), retrying... (attempt",A+1,")"),setTimeout(function(){return s(A+1)},250)):t&&0===t.clientHeight?console.log("ℹ️ Interface has zero height (likely hidden), skipping size adjustment"):(console.warn("⚠️ Interface never became fully ready, adjusting sizes anyway"),e.adjustSizesForContainer())};setTimeout(function(){return s()},200)}this.isMobile||window.addEventListener("resize",function(){console.log("🔄 Window resized, re-adjusting sizes"),e.adjustSizesForContainer()})}},{key:"setupMobileEventHandlers",value:function(){var A=this,e=this.isMobile?document:this.shadowRoot,t=e.getElementById("mobileMuteBtn"),n=e.getElementById("mobileSpeakerBtn"),o=e.getElementById("mobileEndCallBtn"),r=e.getElementById("mobileTranscriptRow"),i=e.getElementById("mobileCloseTranscriptBtn"),a=e.getElementById("mobileSendBtn"),s=e.getElementById("mobileTextInput"),c=e.getElementById("mobileTranscriptOverlay");t&&(t.onclick=function(e){e.stopPropagation(),A.toggleMute()}),n&&(n.onclick=function(e){e.stopPropagation(),A.toggleSpeaker()}),o&&(o.onclick=function(e){e.stopPropagation(),A.endVoiceCall()}),r&&(r.onclick=function(){A.expandMobileTranscript()}),i&&(i.onclick=function(){A.collapseMobileTranscript()}),c&&(c.onclick=function(e){e.target===c&&A.collapseMobileTranscript()}),a&&(a.onclick=function(){A.sendMobileTextMessage()}),s&&(s.onkeypress=function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),A.sendMobileTextMessage())},s.oninput=function(){var A=s.value.trim().length>0;a&&(a.disabled=!A)})}},{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:"_sendTextMessage",value:function(A,e,t,n){var o,r=n?this.showMobileTextInputStatus.bind(this):this.showTextInputStatus.bind(this),i=n?"_mobileTextInjectTimeout":"_textInjectTimeout",a=n?"Mobile":"Desktop";if(!this.isActive||null===(o=this.sdk)||void 0===o||null===(o=o.voiceSDK)||void 0===o||!o.isConnected)return console.warn("VoiceInterface: Cannot send text - no active voice call (".concat(a,")")),void r("error","Not connected");if(e&&t){var s=null==A?void 0:A.trim();if(s){if(s.length>5e3)r("error","Message too long (max 5000)");else if(!e.disabled){e.disabled=!0,t.disabled=!0,r("sending","Sending...");try{var c={t:"text_inject",text:s};if(!this.sdk.voiceSDK.sendMessage(c))throw new Error("Failed to send message");e.value="",console.log("VoiceInterface: ".concat(a," text message sent:"),s.substring(0,50)),this[i]=setTimeout(function(){e.disabled&&(console.warn("VoiceInterface: No ack received for ".concat(a.toLowerCase()," text inject")),e.disabled=!1,t.disabled=!0,r("error","No response"))},5e3)}catch(A){console.error("VoiceInterface: Error sending ".concat(a.toLowerCase()," text:"),A),r("error","Failed to send"),e.disabled=!1,t.disabled=!e.value.trim()}}}else r("error","Enter text first")}else console.warn("VoiceInterface: Missing UI elements (".concat(a,")"))}},{key:"sendMobileTextMessage",value:(i=wo(Bo().m(function A(){var e,t;return Bo().w(function(A){for(;;)switch(A.n){case 0:if(e=document.getElementById("mobileTextInput"),t=document.getElementById("mobileSendBtn"),e&&t){A.n=1;break}return A.a(2);case 1:this._sendTextMessage(e.value,e,t,!0);case 2:return A.a(2)}},A,this)})),function(){return i.apply(this,arguments)})},{key:"sendDesktopTextMessage",value:(r=wo(Bo().m(function A(){var e,t;return Bo().w(function(A){for(;;)switch(A.n){case 0:if(e=this.shadowRoot.getElementById("voiceTextInput"),t=this.shadowRoot.getElementById("voiceSendBtn"),e&&t){A.n=1;break}return A.a(2);case 1:this._sendTextMessage(e.value,e,t,!1);case 2:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"showTextInputStatus",value:function(A,e){var t=this.shadowRoot.querySelector(".voice-input-hint");if(t)switch(this._originalHintText||(this._originalHintText=t.textContent),A){case"sending":t.textContent="⏳ ".concat(e),t.className="voice-input-hint voice-input-hint--sending";break;case"success":t.textContent="✓ ".concat(e),t.className="voice-input-hint voice-input-hint--success",this.clearTextInputStatusAfterDelay();break;case"queued":t.textContent="⏳ ".concat(e),t.className="voice-input-hint voice-input-hint--queued",this.clearTextInputStatusAfterDelay();break;case"error":t.textContent="✗ ".concat(e),t.className="voice-input-hint voice-input-hint--error",this.clearTextInputStatusAfterDelay();break;default:t.textContent=this._originalHintText||"🎙️ Voice is still active • Type or speak",t.className="voice-input-hint"}}},{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.showTextInputStatus("clear")},e)}},{key:"showMobileTextInputStatus",value:function(A,e){var t=document.querySelector(".mobile-input-hint");if(t)switch(this._originalMobileHintText||(this._originalMobileHintText=t.textContent),A){case"sending":t.textContent="⏳ ".concat(e),t.className="mobile-input-hint mobile-input-hint--sending";break;case"success":t.textContent="✓ ".concat(e),t.className="mobile-input-hint mobile-input-hint--success",this.clearMobileTextInputStatusAfterDelay();break;case"queued":t.textContent="⏳ ".concat(e),t.className="mobile-input-hint mobile-input-hint--queued",this.clearMobileTextInputStatusAfterDelay();break;case"error":t.textContent="✗ ".concat(e),t.className="mobile-input-hint mobile-input-hint--error",this.clearMobileTextInputStatusAfterDelay();break;default:t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",t.className="mobile-input-hint"}}},{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")},e)}},{key:"handleTextInjectAck",value:function(A){var e,t;console.log("VoiceInterface: Text inject ack:",A),this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null);var n=this.shadowRoot.getElementById("voiceTextInput"),o=this.shadowRoot.getElementById("voiceSendBtn");n&&(n.disabled=!1),o&&(o.disabled=!(null!=n&&null!==(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.isMobile?this.showMobileTextInputStatus(c,l):this.showTextInputStatus(c,l)}else{var u=A.message||"Failed to send";this.isMobile?this.showMobileTextInputStatus("error",u):this.showTextInputStatus("error",u)}}},{key:"addMobileMessage",value:function(A,e){this.messages.push({type:A,text:e});var t=document.getElementById("mobileTranscriptText");t&&(t.textContent=e);var n=document.getElementById("mobileMessagesContainer");if(n){var o=document.createElement("div");o.className="mobile-message-bubble ".concat(A),o.textContent=e,n.appendChild(o),setTimeout(function(){n.scrollTop=n.scrollHeight},50)}}},{key:"startWaveformAnimation",value:function(){this.waveformInterval||(this.waveformInterval=setInterval(function(){var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(function(A,e){var t=.2+.8*Math.random();A.style.height="".concat(24*t,"px")})},150))}},{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="4px"})}},{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.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">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">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 '),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.setupMobileEventHandlers(),console.log("✅ Mobile minimized bar created and appended to body")}},{key:"removeMobileMinimizedBar",value:function(){var A=document.getElementById("mobile-voice-call-bar-container");A&&A.remove()}},{key:"generateMobileCSS",value:function(){var A=!1===this.config.useShadowDOM?" !important":"";return"\n /* Mobile Voice Call UI Styles - Fixed at bottom of viewport */\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 .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 }\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-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: opacity 0.2s ease;\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 }\n ")}},{key:"getSignedUrl",value:(o=wo(Bo().m(function A(){var e,t;return Bo().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://speech.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"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return o.apply(this,arguments)})},{key:"adjustSizesForContainer",value:function(){if(!this.isMobile){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e=A.clientHeight,t=A.clientWidth;console.log("📏 Container size:",e,"x",t);var n=this.shadowRoot.getElementById("voiceIdleState"),o=this.shadowRoot.getElementById("voiceActiveState"),r=n&&"none"!==n.style.display,i=o&&"none"!==o.style.display;console.log("👁️ Visible state - Idle:",r,"Active:",i);var a,s,c,l,u,d,p,g,h,f=e-12-5*Math.max(4,Math.min(8,e/80)),B=Math.max(55,Math.min(75,.12*e)),m=Math.max(50,Math.min(70,.12*e)),v=Math.max(35,Math.min(50,.1*e)),w=Math.max(100,f-B-m-v);e<=350?(h=4,a=Math.max(50,Math.min(70,.35*w)),s=Math.floor(.5*a),c=10,l=8,u=28,d=Math.max(50,Math.floor(.4*w)),p=38,g=44):e<=450?(h=5,a=Math.max(70,Math.min(100,.4*w)),s=Math.floor(.5*a),c=13,l=10,u=34,d=Math.max(60,Math.floor(.45*w)),p=46,g=52):e<=550?(h=6,a=Math.max(90,Math.min(120,.42*w)),s=Math.floor(.5*a),c=14,l=11,u=38,d=Math.max(70,Math.floor(.48*w)),p=50,g=58):e<=700?(h=7,a=Math.max(110,Math.min(130,.44*w)),s=Math.floor(.5*a),c=16,l=12,u=42,d=Math.max(80,Math.floor(.5*w)),p=54,g=64):(h=8,a=Math.max(130,Math.min(150,.46*w)),s=Math.floor(.5*a),c=18,l=13,u=46,d=Math.max(90,Math.floor(.52*w)),p=60,g=70),this.shadowRoot.querySelectorAll("#voiceIdleState, #voiceActiveState").forEach(function(A){A.style.gap="".concat(h,"px")});var y=this.shadowRoot.querySelectorAll(".voice-avatar, .voice-avatar-active");console.log("🤖 Found",y.length,"avatars, setting size to",a,"px"),y.forEach(function(A){A.style.width="".concat(a,"px"),A.style.height="".concat(a,"px"),A.style.fontSize="".concat(s,"px")}),this.shadowRoot.querySelectorAll(".voice-status-title").forEach(function(A){return A.style.fontSize="".concat(c,"px")}),this.shadowRoot.querySelectorAll(".voice-status-subtitle").forEach(function(A){return A.style.fontSize="".concat(l,"px")});var b=this.shadowRoot.querySelector(".voice-transcript");b&&(b.style.minHeight="".concat(d,"px"),b.style.maxHeight="".concat(d,"px"),b.style.height="".concat(d,"px"),b.style.width="min(360px, ".concat(t-40,"px)"),b.style.boxSizing="border-box");var C=this.shadowRoot.querySelector(".transcript-label");C&&(C.style.fontSize="".concat(Math.max(8,c-4),"px"));var Q=this.shadowRoot.querySelector(".transcript-text");Q&&(Q.style.fontSize="".concat(Math.max(10,c-2),"px"));var F=this.shadowRoot.querySelector(".voice-text-input-area");if(F){var x=F.querySelector(".voice-input-wrapper"),U=F.querySelector(".voice-text-input"),S=F.querySelector(".voice-send-btn"),E=F.querySelector(".voice-input-hint");if(x&&S){var I=Math.max(32,Math.min(40,.7*p));S.style.width="".concat(I,"px"),S.style.height="".concat(I,"px");var k=S.querySelector("svg");if(k){var H=Math.max(14,Math.min(18,.45*I));k.style.width="".concat(H,"px"),k.style.height="".concat(H,"px")}}U&&(U.style.fontSize="".concat(Math.max(11,Math.min(14,c)),"px"),U.style.padding="".concat(Math.max(6,Math.min(10,Math.floor(.15*p))),"px 0")),E&&(E.style.fontSize="".concat(Math.max(8,Math.min(11,c-4)),"px"),E.style.marginTop="".concat(Math.max(3,Math.min(6,Math.floor(.6*h))),"px"))}this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(function(A){A.style.width="".concat(p,"px"),A.style.height="".concat(p,"px");var e=A.querySelector("svg");if(e){var t=.65*p;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 T=this.shadowRoot.querySelector(".voice-control-btn.primary");if(T){T.style.width="".concat(g,"px"),T.style.height="".concat(g,"px");var D=T.querySelector("svg");if(D){var O=.7*g;D.style.setProperty("width","".concat(O,"px"),"important"),D.style.setProperty("height","".concat(O,"px"),"important"),D.style.setProperty("min-width","".concat(O,"px"),"important"),D.style.setProperty("min-height","".concat(O,"px"),"important")}}var P=this.shadowRoot.querySelector(".start-call-btn");if(P){var K,L;e<=350?(K=48,L=14):e<=450?(K=52,L=15):e<=550?(K=58,L=17):e<=700?(K=62,L=18):(K=64,L=18),P.style.height="".concat(K,"px"),P.style.fontSize="".concat(L,"px");var M=P.querySelector("svg");if(M){var R=Math.max(22,.5*K);M.style.width="".concat(R,"px"),M.style.height="".concat(R,"px")}}console.log("✅ Sizes adjusted - Avatar:",a,"Status:",u,"Transcript:",d,"Buttons:",p)}else console.warn("⚠️ voiceInterface not found, skipping size adjustment")}}},{key:"startVoiceCall",value:(n=wo(Bo().m(function A(){var e,t=this;return Bo().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,to();case 2:if(e=A.v,console.log("📋 Current permission state: ".concat(e)),"denied"!==e){A.n=3;break}return console.log("🚫 Permission is denied, showing blocked modal..."),eo(),go(function(){console.log("Blocked modal closed")}),A.a(2);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){po(wo(Bo().m(function e(){return Bo().w(function(e){for(;;)switch(e.n){case 0:return console.log("✅ Pre-prompt accepted, proceeding with voice call..."),e.n=1,t.proceedWithVoiceCall();case 1:A();case 2:return e.a(2)}},e)})),function(){console.log("❌ Pre-prompt cancelled"),A()})}));case 4:return A.n=5,this.proceedWithVoiceCall();case 5:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(t=wo(Bo().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,p,g,h,f,B,m,v,w,y,b,C,Q,F,x,U,S,E,I,k=this;return Bo().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!this.isMobile){A.n=5;break}return(e=this.shadowRoot.getElementById("voiceIdleState"))&&(e.style.display="none"),(t=this.shadowRoot.getElementById("text-chat-panel"))?(t.classList.remove("open"),t.style.display="none",console.log("✅ Widget panel hidden (waiting for permission)")):(n=document.getElementById("text-chat-panel"))&&(n.classList.remove("open"),n.style.display="none",console.log("✅ Widget panel hidden (waiting for permission, fallback)")),console.log("📱 Mobile device - requesting mic permission before connecting..."),A.p=1,o=this.config.outputSampleRate||44100,A.n=2,navigator.mediaDevices.getUserMedia({audio:{sampleRate:o,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"),(r=this.shadowRoot.getElementById("text-chat-button"))?(r.style.display="none",console.log("✅ Floating button hidden (permission granted)")):(i=document.getElementById("text-chat-button"))&&(i.style.display="none",console.log("✅ Floating button hidden (permission granted, fallback)")),A.n=4;break;case 3:return A.p=3,x=A.v,console.error("❌ Mobile: Permission denied before connecting:",x),(a=this.shadowRoot.getElementById("voiceIdleState"))&&(a.style.display="flex"),(s=this.shadowRoot.getElementById("text-chat-panel"))?s.style.display="":(c=document.getElementById("text-chat-panel"))&&(c.style.display=""),eo(),go(function(){k.resetUIState()}),A.a(2);case 4:A.n=6;break;case 5:l=this.shadowRoot.getElementById("voiceIdleState"),u=this.shadowRoot.getElementById("voiceActiveState"),l&&(l.style.display="none"),u&&(u.style.display="flex");case 6:return d=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return k.adjustSizesForContainer()},50),d&&(d.scrollTop=0),A.n=7,this.getSignedUrl();case 7:if(p=A.v,console.log("🔗 Got signed URL:",p),!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,U=A.v,console.warn("Warning: Error disconnecting existing connection:",U);case 11:return A.n=12,this.sdk.connect(p);case 12:g=A.v,console.log("✅ Connected to WebSocket, connected:",g),this.setupTextInjectAckHandler(),h=0;case 13:if(!(h<50)){A.n=16;break}if(!this.sdk.isConnected){A.n=14;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=14;break}return A.a(3,16);case 14:return A.n=15,new Promise(function(A){return setTimeout(A,100)});case 15:h++,A.n=13;break;case 16:if(!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=21;break}return console.log("✅ WebSocket ready, starting listening..."),A.p=17,A.n=18,this.sdk.startListening();case 18: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")),A.n=20;break;case 19:throw A.p=19,S=A.v,console.error("❌ Failed to start listening - permission denied or error:",S),this.isMobile&&((f=this.shadowRoot.getElementById("voiceIdleState"))&&(f.style.display="flex"),(B=this.shadowRoot.getElementById("text-chat-panel"))?B.style.display="":(m=document.getElementById("text-chat-panel"))&&(m.style.display=""),(v=this.shadowRoot.getElementById("text-chat-button"))?v.style.display="":(w=document.getElementById("text-chat-button"))&&(w.style.display="")),S;case 20:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-k.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=k.shadowRoot.getElementById("voiceTimer");if(o&&(o.textContent=n),k.isMobile){var r=document.getElementById("mobileDurationText"),i=document.getElementById("mobileHeaderDuration");r&&(r.textContent=n),i&&(i.textContent=n)}},1e3),A.n=26;break;case 21:return console.warn("⚠️ Connection not fully ready, but trying to start listening anyway..."),A.p=22,A.n=23,this.sdk.startListening();case 23: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")),A.n=25;break;case 24:throw A.p=24,E=A.v,console.error("❌ Failed to start listening - permission denied or error:",E),this.isMobile&&((y=this.shadowRoot.getElementById("voiceIdleState"))&&(y.style.display="flex"),(b=this.shadowRoot.getElementById("text-chat-panel"))?b.style.display="":(C=document.getElementById("text-chat-panel"))&&(C.style.display=""),(Q=this.shadowRoot.getElementById("text-chat-button"))?Q.style.display="":(F=document.getElementById("text-chat-button"))&&(F.style.display="")),E;case 25:this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-k.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=k.shadowRoot.getElementById("voiceTimer");if(o&&(o.textContent=n),k.isMobile){var r=document.getElementById("mobileDurationText"),i=document.getElementById("mobileHeaderDuration");r&&(r.textContent=n),i&&(i.textContent=n)}},1e3);case 26:console.log("✅ Voice call started successfully"),A.n=28;break;case 27:if(A.p=27,I=A.v,console.error("❌ Error starting voice call:",I),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)}"NotAllowedError"===I.name||"PermissionDeniedError"===I.name?(eo(),go(function(){k.resetUIState()})):"NotFoundError"===I.name||"DevicesNotFoundError"===I.name?ho(function(){k.resetUIState()}):(this.showError(I.message||I),this.resetUIState());case 28:return A.a(2)}},A,this,[[22,24],[17,19],[8,10],[1,3],[0,27]])})),function(){return t.apply(this,arguments)})},{key:"resetUIState",value:function(){if(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:"endVoiceCall",value:function(){var A,e=this;if(console.log("🔴 Ending voice call..."),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._textInjectAckHandler&&this.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=null,this._originalHintText=null,this._originalMobileHintText=null,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("voiceIdleState"),a=this.shadowRoot.getElementById("voiceActiveState");i&&(i.style.display="flex"),a&&(a.style.display="none"),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:"updateTranscript",value:function(A){if(console.log("📝 [VOICE INTERFACE] updateTranscript called with text:",A),this.isMobile){var e=document.getElementById("mobileTranscriptText");e&&(e.textContent=A),this.messages.length>0&&"assistant"===this.messages[this.messages.length-1].type?this.messages[this.messages.length-1].text=A:this.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.addMobileMessage("assistant",A)}}else{var o=this.shadowRoot.getElementById("transcriptText");o&&(console.log("📝 [VOICE INTERFACE] Found transcript element, updating text"),o.textContent=A,o.classList.remove("empty"))}}},{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.shadowRoot.getElementById("transcriptText");if(A){var e=this.t("domainNotValidated"),t=this.t("domainErrorMessage");A.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(e,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(t,"</div>"),A.classList.remove("empty")}}},{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("muteBtn"),t=null==e?void 0:e.querySelector(".mute-icon"),n=null==e?void 0:e.querySelector(".mute-cross");if(e&&t&&n&&(A.enabled?(t.style.stroke="",n.style.display="none",e.classList.remove("muted")):(t.style.stroke="#9ca3af",n.style.display="block",e.classList.add("muted"))),this.isMobile){var o=document.getElementById("mobileMuteBtn"),r=null==o?void 0:o.querySelector(".mobile-mic-icon"),i=null==o?void 0:o.querySelector(".mobile-mic-off-icon");o&&r&&i&&(A.enabled?(o.classList.remove("muted"),r.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",i.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"):(o.classList.add("muted"),r.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",i.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.isSpeakerMuted=!this.isSpeakerMuted,console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted"),this.isMobile){var A=document.getElementById("mobileSpeakerBtn"),e=null==A?void 0:A.querySelector(".mobile-speaker-icon"),t=null==A?void 0:A.querySelector(".mobile-speaker-off-icon");A&&e&&t&&(this.isSpeakerMuted?(A.classList.add("muted"),e.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",t.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"):(A.classList.remove("muted"),e.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",t.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"))}}},{key:"updateMobileStatus",value:function(A){if(this.isMobile){var e=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot"),o="Paused",r="#facc15";"listening"===A||"recording"===A?(o="Listening...",r="#22c55e"):"speaking"===A&&(o="Speaking...",r="#a855f7"),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:"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&&yo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r,i}();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 Fo(){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 xo(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]())):(xo(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,xo(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,xo(u,"constructor",c),xo(c,"constructor",s),s.displayName="GeneratorFunction",xo(c,o,"GeneratorFunction"),xo(u),xo(u,o,"Generator"),xo(u,n,function(){return this}),xo(u,"toString",function(){return"[object Generator]"}),(Fo=function(){return{w:r,m:d}})()}function xo(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}xo=function(A,e,t,n){function r(e,t){xo(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))},xo(A,e,t,n)}function Uo(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 So(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Uo(r,n,o,i,a,"next",A)}function a(A){Uo(r,n,o,i,a,"throw",A)}i(void 0)})}}function Eo(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,Io(n.key),n)}}function Io(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 ko=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",B=(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"),m=this.config.inputFocusColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputFocusColor)||"#7C3AED",v=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(B,";\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(v,";\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(m,";\n background: ").concat("#FFFFFF"===v?"#FFFFFF":v,";\n box-shadow: 0 0 0 3px ").concat(m,"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=So(Fo().m(function A(){return Fo().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=So(Fo().m(function A(){var e,t,n;return Fo().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&&Eo(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();const Ho={en:{landingTitle:"How would you like to communicate?",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",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:"איך תרצה לתקשר?",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",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?",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",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?",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",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?",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",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 To(){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 Do(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]())):(Do(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,Do(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Do(u,"constructor",c),Do(c,"constructor",s),s.displayName="GeneratorFunction",Do(c,o,"GeneratorFunction"),Do(u),Do(u,o,"Generator"),Do(u,n,function(){return this}),Do(u,"toString",function(){return"[object Generator]"}),(To=function(){return{w:r,m:d}})()}function Do(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Do=function(A,e,t,n){function r(e,t){Do(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))},Do(A,e,t,n)}function Oo(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 Po(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Oo(r,n,o,i,a,"next",A)}function a(A){Oo(r,n,o,i,a,"throw",A)}i(void 0)})}}function Ko(A){return Ko="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},Ko(A)}function Lo(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 Mo(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(t),!0).forEach(function(e){Ro(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Lo(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Ro(A,e,t){return(e=Vo(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,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,Vo(n.key),n)}}function Vo(A){var e=function(A){if("object"!=Ko(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ko(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ko(e)?e:e+""}var jo=function(){return A=function A(){var e,t,n,o,r,i,a=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(a),this.sdk=new wt(this.config),this.isOpen=!1,this.isActive=!1,this.translations=Ho,this.currentView="landing",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 s=Mo(Mo(Mo({},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});this.voiceInterface=new Co(s);var c=Mo(Mo(Mo({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new ko(c,this.sdk),this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var l,u=null===(l=this.shadowRoot)||void 0===l?void 0:l.getElementById("text-chat-panel");u&&(this.isOpen=!0,u.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(),setTimeout(function(){A.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(A){console.error("❌ [WIDGET] Failed to auto-resume call:",A)})},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,B,m,v,w,y,b,C,Q,F,x,U,S,E,I,k,H,T,D,O,P,K,L,M,R,_,V,j,N,G,W,X,J,z,Y,q,Z,$,AA,eA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,pA,gA,hA,fA,BA,mA,vA,wA,yA,bA,CA,QA,FA,xA,UA,SA,EA,IA,kA,HA,TA,DA,OA,PA,KA,LA,MA,RA,_A,VA,jA,NA,GA,WA,XA,JA,zA,YA,qA,ZA,$A,Ae,ee,te,ne,oe,re,ie,ae,se,ce,le,ue,de,pe,ge,he,fe,Be,me,ve,we,ye,be,Ce,Qe,Fe,xe,Ue,Se,Ee,Ie,ke,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 Mo({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:Mo({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:Mo({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"===Ko(A.position)?A.position:{}),button:Mo({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===(B=A.button)||void 0===B?void 0:B.backgroundColor)||(null===(m=A.icon)||void 0===m?void 0:m.backgroundColor)||"#FFFFFF"},A.button),panel:Mo({width:(null===(v=A.panel)||void 0===v?void 0:v.width)||350,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)||12,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:Mo({micButtonColor:(null===(F=A.voice)||void 0===F?void 0:F.micButtonColor)||(null===(x=A.panel)||void 0===x?void 0:x.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:Mo(Mo({text:(null===(E=A.voice)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.text)||(null===(I=A.panel)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.text)||"Click the button to start voice conversation",color:(null===(k=A.voice)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.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===(V=A.voice)||void 0===V?void 0:V.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(j=A.voice)||void 0===j?void 0:j.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===(X=A.voice)||void 0===X?void 0:X.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(J=A.voice)||void 0===J?void 0:J.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(z=A.voice)||void 0===z?void 0:z.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:Mo({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:Mo(Mo({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===(BA=A.text)||void 0===BA||null===(BA=BA.sendButtonHint)||void 0===BA?void 0:BA.fontSize)||(null===(mA=A.panel)||void 0===mA||null===(mA=mA.sendButtonHint)||void 0===mA?void 0:mA.fontSize)||"12px"},null===(vA=A.text)||void 0===vA?void 0:vA.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===(FA=A.text)||void 0===FA?void 0:FA.inputFocusColor)||(null===(xA=A.panel)||void 0===xA?void 0:xA.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===(EA=A.text)||void 0===EA?void 0:EA.inputTextColor)||(null===(IA=A.panel)||void 0===IA?void 0:IA.inputTextColor)||"#1F2937",inputFontSize:(null===(kA=A.text)||void 0===kA?void 0:kA.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:Mo({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===(VA=A.landing)||void 0===VA?void 0:VA.modeCardBorderColor)||"#E2E8F0",modeCardHoverBorderColor:(null===(jA=A.landing)||void 0===jA?void 0:jA.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===(XA=A.landing)||void 0===XA?void 0:XA.textCardIcon)||"💬",voiceCardTitle:(null===(JA=A.landing)||void 0===JA?void 0:JA.voiceCardTitle)||null,textCardTitle:(null===(zA=A.landing)||void 0===zA?void 0:zA.textCardTitle)||null},A.landing),header:Mo({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:Mo({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:Mo({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:Mo({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===(Be=A.messages)||void 0===Be?void 0:Be.borderRadius)||8},A.messages),animation:Mo({enableHover:!1!==(null===(me=A.animation)||void 0===me?void 0:me.enableHover),enablePulse:!1!==(null===(ve=A.animation)||void 0===ve?void 0:ve.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:Mo({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===(Fe=A.behavior)||void 0===Fe?void 0:Fe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(xe=A.behavior)||void 0===xe?void 0:xe.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===(Ee=A.behavior)||void 0===Ee?void 0:Ee.mode)||"unified"},A.behavior),accessibility:Mo({ariaLabel:(null===(Ie=A.accessibility)||void 0===Ie?void 0:Ie.ariaLabel)||"Chat Assistant",ariaDescription:(null===(ke=A.accessibility)||void 0===ke?void 0:ke.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,t,n,o=this,r=(this.config.position,this.config.button),i=this.config.icon,a=(this.config.panel,this.config.header),s=(this.config.animation,{small:50,medium:60,large:70,xl:80}[r.size]||60),c={small:20,medium:28,large:36,xl:44}[i.size]||28,l=this.generatePositionStyles(),u=this.generateIconHTML(c),d=this.config.behavior.mode||"unified",p="unified"===d,g="unified"===d||"voice-only"===d,h="unified"===d||"text-only"===d,f=function(A){var e=o.config.language||"en";return(o.translations[e]||o.translations.en)[A]||A},B=function(A){var e,t=null===(e=o.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{newChat:f("newChat"),back:f("back"),close:f("close"),mute:f("mute"),speaker:f("speaker"),endCall:f("endCall")}[A]||""},m=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(l,s,c),"\n ").concat(this.config.customStyles,"\n </style>\n "):"";return"\n ".concat(m,"\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(u,"\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: ').concat(a.backgroundColor,"; color: ").concat(a.textColor,';">\n <div>\n ').concat(a.showTitle?'<div class="header-title">'.concat(a.title,"</div>"):"",'\n <div class="header-status">\n <span class="status-dot"></span>\n <span>').concat(f("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 12px; align-items: center;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(B("newChat"),'" style="').concat(p?"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"===d?'<button class="header-icon back-btn" id="backBtn" title="'.concat(B("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(a.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+B("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(p?'\n <div class="landing-screen" id="landingScreen">\n <div class="landing-logo">'.concat((null===(A=this.config.landing)||void 0===A?void 0:A.logo)||"🤖",'</div>\n <div class="landing-title">').concat((null===(e=this.config.landing)||void 0===e?void 0:e.title)||f("landingTitle"),'</div>\n <div class="mode-selection">\n ').concat(g?'<div class="mode-card voice" id="mode-card-voice">\n <div class="mode-card-icon">🎤</div>\n <div class="mode-card-title">'.concat((null===(t=this.config.landing)||void 0===t?void 0:t.voiceCardTitle)||f("voiceCall"),"</div>\n </div>"):"","\n ").concat(h?'<div class="mode-card text" id="mode-card-text">\n <div class="mode-card-icon">💬</div>\n <div class="mode-card-title">'.concat((null===(n=this.config.landing)||void 0===n?void 0:n.textCardTitle)||f("textChat"),"</div>\n </div>"):"","\n </div>\n </div>"):"","\n\n ").concat(g?this.voiceInterface.generateHTML():"","\n ").concat(h?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}},{key:"generateFooterHTML",value:function(){var A=this.config.footer;if(!A.show)return"";var e=encodeURIComponent(window.location.hostname||"widget"),t="https://talktopc.com?ref=widget&source=".concat(e);return'\n <div class="widget-footer" style="\n height: 36px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: '.concat(A.backgroundColor,';\n border-top: 1px solid #e5e7eb;\n flex-shrink: 0;\n ">\n <a \n href="').concat(t,'" \n target="_blank" \n rel="noopener noreferrer"\n aria-label="Visit TalkToPC website"\n class="footer-brand-link"\n style="\n display: flex;\n flex-direction: column;\n align-items: center;\n text-decoration: none;\n color: ').concat(A.textColor,';\n transition: color 0.2s ease;\n "\n onmouseover="this.style.color=\'').concat(A.hoverColor,"'\"\n onmouseout=\"this.style.color='").concat(A.textColor,'\'"\n >\n <span style="font-size: 11px; line-height: 1.3;">\n ⚡ Powered by <strong>TalkToPC</strong>\n </span>\n <span style="font-size: 9px; opacity: 0.7; line-height: 1.2;">\n https://talktopc.com\n </span>\n </a>\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,c,l,u,d,p,g=this.config.button,h=this.config.icon,f=this.config.panel,B=this.config.header,m=(this.config.messages,this.config.animation),v=this.config.behavior.mode||"unified",w="unified"===v||"voice-only"===v,y="unified"===v||"text-only"===v,b=!1===this.config.useShadowDOM?" !important":"",C=B.backgroundColor;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(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===(n=this.config.position.offset)||void 0===n?void 0:n.y)||20,"px;"):"top: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.y)||20,"px;"),"\n ").concat("right"===this.config.position.horizontal?"right: ".concat((null===(r=this.config.position.offset)||void 0===r?void 0:r.x)||20,"px;"):"left: ".concat((null===(i=this.config.position.offset)||void 0===i?void 0:i.x)||20,"px;"),"\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n border-radius: ").concat("circle"===g.shape?"50%":"square"===g.shape?"0":"12px",";\n background: ").concat(g.backgroundColor||h.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(m.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(m.enableHover?"\n #text-chat-button:hover {\n ".concat(g.hoverColor?"background: ".concat(g.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(b,";\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(f.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(f.height,"px;\n max-height: calc(100vh - ").concat(e,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(f.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(f.backdropFilter?"backdrop-filter: ".concat(f.backdropFilter,";"):"","\n ").concat(m.enableSlide?"transition: all ".concat(m.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(b,";\n ").concat(m.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(f.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(f.borderRadius,"px; border: ").concat(f.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%; min-height: 0; background: #FFFFFF; overflow: hidden; display: flex; flex-direction: column; border-radius: ").concat(f.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 min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 12px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(f.borderRadius,"px;\n border-top-right-radius: ").concat(f.borderRadius,"px;\n flex-shrink: 0;\n min-height: 60px;\n box-sizing: border-box;\n }\n #text-chat-panel .header-title { font-size: 16px; font-weight: 600; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.9; }\n #text-chat-panel .status-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\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 }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.3);\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 /* Landing and mode selection (shown only if voice enabled) */\n .landing-screen { \n display: none").concat(b,"; \n flex: 1; \n padding: 20px; \n background: ").concat((null===(a=this.config.landing)||void 0===a?void 0:a.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 16px; \n overflow-y: auto; \n min-height: 0; \n }\n .landing-screen.active { display: flex").concat(b,"; }\n .landing-logo { font-size: 48px; }\n .landing-title { \n font-size: 20px; \n color: ").concat((null===(s=this.config.landing)||void 0===s?void 0:s.titleColor)||"#1e293b","; \n font-weight: 700; \n margin-bottom: 20px; \n text-align: center;\n width: 100%;\n }\n .mode-selection { display: flex; gap: 16px; width: 100%; justify-content: center; }\n .mode-card { \n flex: 1; \n max-width: 180px; \n background: ").concat((null===(c=this.config.landing)||void 0===c?void 0:c.modeCardBackgroundColor)||"#FFFFFF","; \n border: 2px solid ").concat((null===(l=this.config.landing)||void 0===l?void 0:l.modeCardBorderColor)||"#E2E8F0","; \n border-radius: 20px; \n padding: 20px 12px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 8px; \n transition: transform ").concat(m.duration,"s ease, box-shadow ").concat(m.duration,"s ease, border-color ").concat(m.duration,"s ease; \n box-shadow: 0 4px 12px rgba(0,0,0,0.05); \n }\n .mode-card:hover { \n transform: translateY(-6px); \n box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2); \n border-color: ").concat((null===(u=this.config.landing)||void 0===u?void 0:u.modeCardHoverBorderColor)||C,"; \n }\n .mode-card-icon { \n width: 60px; \n height: 60px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 50%; \n background: ").concat((null===(d=this.config.landing)||void 0===d?void 0:d.modeCardIconBackgroundColor)||C,"; \n color: #fff; \n font-size: 32px; \n }\n .mode-card-title { \n color: ").concat((null===(p=this.config.landing)||void 0===p?void 0:p.modeCardTitleColor)||"#111827","; \n font-weight: 600; \n text-align: center;\n width: 100%;\n }\n\n ").concat(w?this.voiceInterface.generateCSS():"","\n ").concat(y?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=this;if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-button");e&&(e.onclick=function(){return A.togglePanel()});var t=this.shadowRoot.getElementById("closeBtn");t&&(t.onclick=function(){return A.togglePanel()});var n=this.config.behavior.mode||"unified",o="unified"===n,r="unified"===n||"voice-only"===n,i="unified"===n||"text-only"===n,a=this.shadowRoot.getElementById("backBtn"),s=this.shadowRoot.getElementById("landingScreen"),c=this.shadowRoot.getElementById("mode-card-voice"),l=this.shadowRoot.getElementById("mode-card-text"),u=this.shadowRoot.getElementById("textInterface"),d=this.shadowRoot.getElementById("voiceInterface");a&&(a.onclick=function(){return A.showLanding()}),o?(c&&(c.onclick=function(){return A.showVoice()}),l&&(l.onclick=function(){return A.showText()}),"text"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.add("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.add("visible"),p&&(p.style.display="")):"voice"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.remove("active"),d&&d.classList.add("active"),a&&"unified"===n&&a.classList.add("visible"),p&&(p.style.display="none")):(this.currentView="landing",s&&s.classList.add("active"),u&&u.classList.remove("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.remove("visible"))):"voice-only"===n?(d&&d.classList.add("active"),u&&u.classList.remove("active"),s&&s.classList.remove("active")):"text-only"===n&&(u&&u.classList.add("active"),d&&d.classList.remove("active"),s&&s.classList.remove("active")),r&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),i&&(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()},o&&(p.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}},{key:"startNewChat",value:function(){this.textInterface.startNewChat()}},{key:"showLanding",value:function(){if(this.shadowRoot&&"unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";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.add("active"),e&&e.classList.remove("active"),t&&t.classList.remove("active"),n&&n.classList.remove("visible"),o&&(o.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(){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:"startChat",value:(r=Po(To().m(function A(){return To().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 r.apply(this,arguments)})},{key:"sendMessage",value:(o=Po(To().m(function A(){return To().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 o.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"getSignedUrl",value:(n=Po(To().m(function A(){var e,t;return To().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"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return n.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=Mo({},this.config);A.panel&&(l.panel=Mo(Mo({},this.config.panel),A.panel)),A.voice&&(l.voice=Mo(Mo({},this.config.voice),A.voice),A.voice.micButtonHint&&(l.voice.micButtonHint=Mo(Mo({},null===(s=this.config.voice)||void 0===s?void 0:s.micButtonHint),A.voice.micButtonHint))),A.text&&(l.text=Mo(Mo({},this.config.text),A.text),A.text.sendButtonHint&&(l.text.sendButtonHint=Mo(Mo({},null===(c=this.config.text)||void 0===c?void 0:c.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(l.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?l.direction="rtl":void 0===A.direction&&(l.direction="ltr")),A.translations&&(l.translations=A.translations,this.translations=A.translations),A.button&&(l.button=Mo(Mo({},this.config.button),A.button)),A.header&&(l.header=Mo(Mo({},this.config.header),A.header)),A.icon&&(l.icon=Mo(Mo({},this.config.icon),A.icon)),A.messages&&(l.messages=Mo(Mo({},this.config.messages),A.messages)),A.animation&&(l.animation=Mo(Mo({},this.config.animation),A.animation)),A.behavior&&(l.behavior=Mo(Mo({},this.config.behavior),A.behavior)),A.accessibility&&(l.accessibility=Mo(Mo({},this.config.accessibility),A.accessibility)),A.tooltips&&(l.tooltips=Mo(Mo({},this.config.tooltips),A.tooltips)),A.landing&&(l.landing=Mo(Mo({},this.config.landing),A.landing)),A.footer&&(l.footer=Mo(Mo({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===l.direction&&(l.direction=A.direction),void 0!==A.primaryColor&&(l.primaryColor=A.primaryColor),l.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,l.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,l.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,l.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,l.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,l.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,void 0!==A.useShadowDOM&&(l.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)||(l[e]=A[e])}),null===(e=this.config)||void 0===e||e.language;var u=!1!==(null===(t=this.config)||void 0===t?void 0:t.useShadowDOM);if(this.config=this.mergeWithDefaults(l),!1!==this.config.useShadowDOM===u&&this.container){var d=document.getElementById("ttp-widget-shadow-host");d&&!this.config.useShadowDOM&&d.remove();var p=document.getElementById("ttp-widget-container");if(p&&this.config.useShadowDOM&&p.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var g=document.getElementById("ttp-widget-shadow-host");g?(this.shadowRoot=g.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var h=document.getElementById("ttp-widget-container");h?(this.regularContainer=h,this.container=h):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var f=document.getElementById("ttp-widget-shadow-host");f&&f.remove();var B=document.getElementById("ttp-widget-container");if(B&&B.remove(),!1===u){var m=document.getElementById("ttp-widget-styles");m&&m.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var v=this.config.language||"en",w=Mo(Mo(Mo({},this.config),this.config.voice),{},{language:v,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 Co(w);var y=Mo(Mo(Mo({},this.config),this.config.text),{},{language:v,translations:this.translations,shadowRoot:this.shadowRoot});this.textInterface=new ko(y,this.sdk),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:(t=Po(To().m(function A(){return To().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 t.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:"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&&_o(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r}(),No="2.18.0";const Go={VoiceSDK_v2:nt,TextChatSDK:wt,WebSocketManager:Nt,AudioRecorder:rn,AudioPlayer:Bn,EventEmitter:at,VoiceButton:En,VanillaVoiceButton:Mn,AgentSDK:qn,TTPChatWidget:jo,VERSION:No}})(),n})());
|
|
3
3
|
//# sourceMappingURL=agent-widget.js.map
|