@wizai/agent-sip-sdk 0.1.10-alpha → 0.1.11-alpha
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/lib/agent-sip-sdk-cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}"function"==typeof SuppressedError&&SuppressedError;let r=(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var a={name:"jssip",title:"JsSIP",description:"the Javascript SIP library",version:"3.10.1",homepage:"https://jssip.net",contributors:["José Luis Millán <jmillan@aliax.net> (https://github.com/jmillan)","Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)"],types:"lib/JsSIP.d.ts",main:"lib-es5/JsSIP.js",keywords:["sip","websocket","webrtc","node","browser","library"],license:"MIT",repository:{type:"git",url:"https://github.com/versatica/JsSIP.git"},bugs:{url:"https://github.com/versatica/JsSIP/issues"},dependencies:{"@types/events":"^3.0.0","@types/debug":"^4.1.7",debug:"^4.3.1",events:"^3.3.0","sdp-transform":"^2.14.1"},devDependencies:{"@babel/core":"^7.19.6","@babel/preset-env":"^7.19.4","ansi-colors":"^3.2.4",browserify:"^16.5.1",eslint:"^5.16.0","fancy-log":"^1.3.3",gulp:"^4.0.2","gulp-babel":"^8.0.0","gulp-eslint":"^5.0.0","gulp-expect-file":"^1.0.2","gulp-header":"^2.0.9","gulp-nodeunit-runner":"^0.2.2","gulp-plumber":"^1.2.1","gulp-rename":"^1.4.0","gulp-uglify-es":"^1.0.4",pegjs:"^0.7.0","vinyl-buffer":"^1.0.1","vinyl-source-stream":"^2.0.0"},scripts:{lint:"node npm-scripts.js lint",test:"node npm-scripts.js test",prepublish:"node npm-scripts.js prepublish",release:"node npm-scripts.js release"}},u=a,l={USER_AGENT:"".concat(u.title," ").concat(u.version),SIP:"sip",SIPS:"sips",causes:{CONNECTION_ERROR:"Connection Error",REQUEST_TIMEOUT:"Request Timeout",SIP_FAILURE_CODE:"SIP Failure Code",INTERNAL_ERROR:"Internal Error",BUSY:"Busy",REJECTED:"Rejected",REDIRECTED:"Redirected",UNAVAILABLE:"Unavailable",NOT_FOUND:"Not Found",ADDRESS_INCOMPLETE:"Address Incomplete",INCOMPATIBLE_SDP:"Incompatible SDP",MISSING_SDP:"Missing SDP",AUTHENTICATION_ERROR:"Authentication Error",BYE:"Terminated",WEBRTC_ERROR:"WebRTC Error",CANCELED:"Canceled",NO_ANSWER:"No Answer",EXPIRES:"Expires",NO_ACK:"No ACK",DIALOG_ERROR:"Dialog Error",USER_DENIED_MEDIA_ACCESS:"User Denied Media Access",BAD_MEDIA_DESCRIPTION:"Bad Media Description",RTP_TIMEOUT:"RTP Timeout"},SIP_ERROR_CAUSES:{REDIRECTED:[300,301,302,305,380],BUSY:[486,600],REJECTED:[403,603],NOT_FOUND:[404,604],UNAVAILABLE:[480,410,408,430],ADDRESS_INCOMPLETE:[484,424],INCOMPATIBLE_SDP:[488,606],AUTHENTICATION_ERROR:[401,407]},ACK:"ACK",BYE:"BYE",CANCEL:"CANCEL",INFO:"INFO",INVITE:"INVITE",MESSAGE:"MESSAGE",NOTIFY:"NOTIFY",OPTIONS:"OPTIONS",REGISTER:"REGISTER",REFER:"REFER",UPDATE:"UPDATE",SUBSCRIBE:"SUBSCRIBE",DTMF_TRANSPORT:{INFO:"INFO",RFC2833:"RFC2833"},REASON_PHRASE:{100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",424:"Bad Location Information",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"JsSIP Internal Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"},ALLOWED_METHODS:"INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60,CONNECTION_RECOVERY_MAX_INTERVAL:30,CONNECTION_RECOVERY_MIN_INTERVAL:2};function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}function d(e){var t=m();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function p(e){var t="function"==typeof Map?new Map:void 0;return p=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return g(e,arguments,A(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_(r,e)},p(e)}function g(e,t,n){return g=m()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&_(i,n.prototype),i},g.apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var v=function(){f(t,p(Error));var e=d(t);function t(n,r){var i;return h(this,t),(i=e.call(this)).code=1,i.name="CONFIGURATION_ERROR",i.parameter=n,i.value=r,i.message=i.value?"Invalid value ".concat(JSON.stringify(i.value),' for parameter "').concat(i.parameter,'"'):"Missing parameter: ".concat(i.parameter),i}return t}(),y=function(){f(t,p(Error));var e=d(t);function t(n){var r;return h(this,t),(r=e.call(this)).code=2,r.name="INVALID_STATE_ERROR",r.status=n,r.message="Invalid status: ".concat(n),r}return t}(),T=function(){f(t,p(Error));var e=d(t);function t(n){var r;return h(this,t),(r=e.call(this)).code=3,r.name="NOT_SUPPORTED_ERROR",r.message=n,r}return t}(),S=function(){f(t,p(Error));var e=d(t);function t(n){var r;return h(this,t),(r=e.call(this)).code=4,r.name="NOT_READY_ERROR",r.message=n,r}return t}(),E={ConfigurationError:v,InvalidStateError:y,NotSupportedError:T,NotReadyError:S},C={};function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t&&w(e.prototype,t),n&&w(e,n),e}var I,R,O,D,k,M=x(),q=U(),N=function(){function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!(t&&t instanceof M))throw new TypeError('missing or invalid "uri" parameter');for(var i in this._uri=t,this._parameters={},this.display_name=n,r)Object.prototype.hasOwnProperty.call(r,i)&&this.setParam(i,r[i])}return b(e,null,[{key:"parse",value:function(e){return-1!==(e=q.parse(e,"Name_Addr_Header"))?e:void 0}}]),b(e,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]=null==t?null:t.toString())}},{key:"getParam",value:function(e){if(e)return this._parameters[e.toLowerCase()]}},{key:"hasParam",value:function(e){if(e)return!!this._parameters.hasOwnProperty(e.toLowerCase())}},{key:"deleteParam",value:function(e){if(e=e.toLowerCase(),this._parameters.hasOwnProperty(e)){var t=this._parameters[e];return delete this._parameters[e],t}}},{key:"clearParams",value:function(){this._parameters={}}},{key:"clone",value:function(){return new e(this._uri.clone(),this._display_name,JSON.parse(JSON.stringify(this._parameters)))}},{key:"_quote",value:function(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}},{key:"toString",value:function(){var e=this._display_name?'"'.concat(this._quote(this._display_name),'" '):"";for(var t in e+="<".concat(this._uri.toString(),">"),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,t)&&(e+=";".concat(t),null!==this._parameters[t]&&(e+="=".concat(this._parameters[t])));return e}},{key:"uri",get:function(){return this._uri}},{key:"display_name",get:function(){return this._display_name},set:function(e){this._display_name=0===e?"0":e}}]),e}();function U(){return R||(R=1,I=function(){function e(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var t={parse:function(t,n){var r={CRLF:u,DIGIT:l,ALPHA:c,HEXDIG:h,WSP:f,OCTET:d,DQUOTE:p,SP:g,HTAB:m,alphanum:_,reserved:A,unreserved:v,mark:y,escaped:T,LWS:S,SWS:E,HCOLON:C,TEXT_UTF8_TRIM:w,TEXT_UTF8char:b,UTF8_NONASCII:I,UTF8_CONT:R,LHEX:function(){var e;null===(e=l())&&(/^[a-f]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[a-f]")));return e},token:O,token_nodot:D,separators:function(){var e;40===t.charCodeAt(i)?(e="(",i++):(e=null,a('"("'));null===e&&(41===t.charCodeAt(i)?(e=")",i++):(e=null,a('")"')),null===e&&(60===t.charCodeAt(i)?(e="<",i++):(e=null,a('"<"')),null===e&&(62===t.charCodeAt(i)?(e=">",i++):(e=null,a('">"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","')),null===e&&(59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(92===t.charCodeAt(i)?(e="\\",i++):(e=null,a('"\\\\"')),null===e&&null===(e=p())&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null===e&&(93===t.charCodeAt(i)?(e="]",i++):(e=null,a('"]"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(123===t.charCodeAt(i)?(e="{",i++):(e=null,a('"{"')),null===e&&(125===t.charCodeAt(i)?(e="}",i++):(e=null,a('"}"')),null===e&&null===(e=g())&&(e=m()))))))))))))))));return e},word:k,STAR:M,SLASH:q,EQUAL:U,LPAREN:P,RPAREN:L,RAQUOT:B,LAQUOT:F,COMMA:H,SEMI:G,COLON:Y,LDQUOT:j,RDQUOT:Q,comment:function e(){var t,n,r,o;if(o=i,null!==(t=P())){for(n=[],null===(r=W())&&null===(r=V())&&(r=e());null!==r;)n.push(r),null===(r=W())&&null===(r=V())&&(r=e());null!==n&&null!==(r=L())?t=[t,n,r]:(t=null,i=o)}else t=null,i=o;return t},ctext:W,quoted_string:K,quoted_string_clean:z,qdtext:J,quoted_pair:V,SIP_URI_noparams:Z,SIP_URI:X,uri_scheme:$,uri_scheme_sips:ee,uri_scheme_sip:te,userinfo:ne,user:re,user_unreserved:ie,password:oe,hostport:se,host:ae,hostname:ue,domainlabel:le,toplabel:ce,IPv6reference:he,IPv6address:fe,h16:de,ls32:pe,IPv4address:ge,dec_octet:me,port:_e,uri_parameters:Ae,uri_parameter:ve,transport_param:ye,user_param:Te,method_param:Se,ttl_param:Ee,maddr_param:Ce,lr_param:we,other_param:be,pname:Ie,pvalue:Re,paramchar:Oe,param_unreserved:De,headers:ke,header:Me,hname:qe,hvalue:Ne,hnv_unreserved:Ue,Request_Response:function(){var e;null===(e=ht())&&(e=xe());return e},Request_Line:xe,Request_URI:Pe,absoluteURI:Le,hier_part:Be,net_path:Fe,abs_path:He,opaque_part:Ge,uric:Ye,uric_no_slash:je,path_segments:Qe,segment:We,param:Ke,pchar:ze,scheme:Je,authority:Ve,srvr:Ze,reg_name:Xe,query:$e,SIP_Version:et,INVITEm:tt,ACKm:nt,OPTIONSm:rt,BYEm:it,CANCELm:ot,REGISTERm:st,SUBSCRIBEm:at,NOTIFYm:ut,REFERm:lt,Method:ct,Status_Line:ht,Status_Code:ft,extension_code:dt,Reason_Phrase:pt,Allow_Events:function(){var e,t,n,r,o,s;if(o=i,null!==(e=Lt())){for(t=[],s=i,null!==(n=H())&&null!==(r=Lt())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=Lt())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Call_ID:function(){var e,n,r,o,s,u;o=i,s=i,null!==(e=k())?(u=i,64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null!==n&&null!==(r=k())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s);null!==e&&(e=function(e){Hn=t.substring(i,e)}(o));null===e&&(i=o);return e},Contact:function(){var e,t,n,r,o,s,a;if(o=i,null===(e=M()))if(s=i,null!==(e=gt())){for(t=[],a=i,null!==(n=H())&&null!==(r=gt())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=H())&&null!==(r=gt())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e,t;for(t=Hn.multi_header.length,e=0;e<t;e++)if(null===Hn.multi_header[e].parsed){Hn=null;break}Hn=null!==Hn?Hn.multi_header:-1}());null===e&&(i=o);return e},contact_param:gt,name_addr:mt,display_name:_t,contact_params:At,c_p_q:vt,c_p_expires:yt,delta_seconds:Tt,qvalue:St,generic_param:Et,gen_value:Ct,Content_Disposition:function(){var e,t,n,r,o,s;if(o=i,null!==(e=wt())){for(t=[],s=i,null!==(n=G())&&null!==(r=bt())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=bt())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},disp_type:wt,disp_param:bt,handling_param:It,Content_Encoding:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Content_Length:function(){var e,t,n;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;null!==e&&(e=void(Hn=parseInt(e.join(""))));null===e&&(i=n);return e},Content_Type:function(){var e,n;n=i,null!==(e=Rt())&&(e=function(e){Hn=t.substring(i,e)}(n));null===e&&(i=n);return e},media_type:Rt,m_type:Ot,discrete_type:Dt,composite_type:kt,extension_token:Mt,x_token:qt,m_subtype:Nt,m_parameter:Ut,m_value:xt,CSeq:function(){var e,t,n,r;r=i,null!==(e=Pt())&&null!==(t=S())&&null!==(n=ct())?e=[e,t,n]:(e=null,i=r);return e},CSeq_value:Pt,Expires:function(){var e,t;t=i,null!==(e=Tt())&&(e=void(Hn=e));null===e&&(i=t);return e},Event:function(){var e,t,n,r,o,s,a;if(o=i,s=i,null!==(e=Lt())){for(t=[],a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(u=e[0],e=void(Hn.event=u.join("").toLowerCase()));var u;null===e&&(i=o);return e},event_type:Lt,From:function(){var e,t,n,r,o,s,a;o=i,s=i,null===(e=Z())&&(e=mt());if(null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=Bt())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Bt())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e=Hn.tag;try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params),e&&Hn.setParam("tag",e)}catch(e){Hn=-1}}());null===e&&(i=o);return e},from_param:Bt,tag_param:Ft,Max_Forwards:function(){var e,t,n;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;null!==e&&(e=void(Hn=parseInt(e.join(""))));null===e&&(i=n);return e},Min_Expires:function(){var e,t;t=i,null!==(e=Tt())&&(e=void(Hn=e));null===e&&(i=t);return e},Name_Addr_Header:function(){var e,t,n,r,o,s,a,u,l,c;u=i,l=i,e=[],t=_t();for(;null!==t;)e.push(t),t=_t();if(null!==e)if(null!==(t=F()))if(null!==(n=X()))if(null!==(r=B())){for(o=[],c=i,null!==(s=G())&&null!==(a=Et())?s=[s,a]:(s=null,i=c);null!==s;)o.push(s),c=i,null!==(s=G())&&null!==(a=Et())?s=[s,a]:(s=null,i=c);null!==o?e=[e,t,n,r,o]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;else e=null,i=l;null!==e&&(e=function(){try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params)}catch(e){Hn=-1}}());null===e&&(i=u);return e},Proxy_Authenticate:function(){return Ht()},challenge:Ht,other_challenge:Gt,auth_param:Yt,digest_cln:jt,realm:Qt,realm_value:Wt,domain:Kt,URI:zt,nonce:Jt,nonce_value:Vt,opaque:Zt,stale:Xt,algorithm:$t,qop_options:en,qop_value:tn,Proxy_Require:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Record_Route:function(){var e,t,n,r,o,s,a;if(o=i,s=i,null!==(e=nn())){for(t=[],a=i,null!==(n=H())&&null!==(r=nn())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=H())&&null!==(r=nn())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e,t;for(t=Hn.multi_header.length,e=0;e<t;e++)if(null===Hn.multi_header[e].parsed){Hn=null;break}Hn=null!==Hn?Hn.multi_header:-1}());null===e&&(i=o);return e},rec_route:nn,Reason:function(){var e,n,r,o,s,u,l;s=i,u=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"SIP"'));null===e&&(e=O());if(null!==e){for(n=[],l=i,null!==(r=G())&&null!==(o=rn())?r=[r,o]:(r=null,i=l);null!==r;)n.push(r),l=i,null!==(r=G())&&null!==(o=rn())?r=[r,o]:(r=null,i=l);null!==n?e=[e,n]:(e=null,i=u)}else e=null,i=u;null!==e&&(e=function(e,t){if(Hn.protocol=t.toLowerCase(),Hn.params||(Hn.params={}),Hn.params.text&&'"'===Hn.params.text[0]){var n=Hn.params.text;Hn.text=n.substring(1,n.length-1),delete Hn.params.text}}(0,e[0]));null===e&&(i=s);return e},reason_param:rn,reason_cause:on,Require:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Route:function(){var e,t,n,r,o,s;if(o=i,null!==(e=sn())){for(t=[],s=i,null!==(n=H())&&null!==(r=sn())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=sn())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},route_param:sn,Subscription_State:function(){var e,t,n,r,o,s;if(o=i,null!==(e=an())){for(t=[],s=i,null!==(n=G())&&null!==(r=un())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=un())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},substate_value:an,subexp_params:un,event_reason_value:ln,Subject:function(){var e;return e=null!==(e=w())?e:""},Supported:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e=null!==e?e:""},To:function(){var e,t,n,r,o,s,a;o=i,s=i,null===(e=Z())&&(e=mt());if(null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=cn())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=cn())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e=Hn.tag;try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params),e&&Hn.setParam("tag",e)}catch(e){Hn=-1}}());null===e&&(i=o);return e},to_param:cn,Via:function(){var e,t,n,r,o,s;if(o=i,null!==(e=hn())){for(t=[],s=i,null!==(n=H())&&null!==(r=hn())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=hn())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},via_param:hn,via_params:fn,via_ttl:dn,via_maddr:pn,via_received:gn,via_branch:mn,response_port:_n,rport:An,sent_protocol:vn,protocol_name:yn,transport:Tn,sent_by:Sn,via_host:En,via_port:Cn,ttl:wn,WWW_Authenticate:function(){return Ht()},Session_Expires:function(){var e,t,n,r,o,s;if(o=i,null!==(e=bn())){for(t=[],s=i,null!==(n=G())&&null!==(r=In())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=In())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},s_e_expires:bn,s_e_params:In,s_e_refresher:Rn,extension_header:function(){var e,t,n,r;r=i,null!==(e=O())&&null!==(t=C())&&null!==(n=On())?e=[e,t,n]:(e=null,i=r);return e},header_value:On,message_body:function(){var e,t;e=[],t=d();for(;null!==t;)e.push(t),t=d();return e},uuid_URI:function(){var e,n,r;r=i,"uuid:"===t.substr(i,5)?(e="uuid:",i+=5):(e=null,a('"uuid:"'));null!==e&&null!==(n=Dn())?e=[e,n]:(e=null,i=r);return e},uuid:Dn,hex4:kn,hex8:Mn,hex12:qn,Refer_To:function(){var e,t,n,r,o,s,a;o=i,s=i,null===(e=Z())&&(e=mt());if(null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params)}catch(e){Hn=-1}}());null===e&&(i=o);return e},Replaces:function(){var e,t,n,r,o,s;if(o=i,null!==(e=Nn())){for(t=[],s=i,null!==(n=G())&&null!==(r=Un())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=Un())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},call_id:Nn,replaces_param:Un,to_tag:xn,from_tag:Pn,early_flag:Ln};if(void 0!==n){if(void 0===r[n])throw new Error("Invalid rule name: "+e(n)+".")}else n="CRLF";var i=0,o=0,s=[];function a(e){i<o||(i>o&&(o=i,s=[]),s.push(e))}function u(){var e;return"\r\n"===t.substr(i,2)?(e="\r\n",i+=2):(e=null,a('"\\r\\n"')),e}function l(){var e;return/^[0-9]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[0-9]")),e}function c(){var e;return/^[a-zA-Z]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[a-zA-Z]")),e}function h(){var e;return/^[0-9a-fA-F]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[0-9a-fA-F]")),e}function f(){var e;return null===(e=g())&&(e=m()),e}function d(){var e;return/^[\0-\xFF]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\0-\\xFF]")),e}function p(){var e;return/^["]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a('["]')),e}function g(){var e;return 32===t.charCodeAt(i)?(e=" ",i++):(e=null,a('" "')),e}function m(){var e;return 9===t.charCodeAt(i)?(e="\t",i++):(e=null,a('"\\t"')),e}function _(){var e;return/^[a-zA-Z0-9]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[a-zA-Z0-9]")),e}function A(){var e;return 59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","'))))))))))),e}function v(){var e;return null===(e=_())&&(e=y()),e}function y(){var e;return 45===t.charCodeAt(i)?(e="-",i++):(e=null,a('"-"')),null===e&&(95===t.charCodeAt(i)?(e="_",i++):(e=null,a('"_"')),null===e&&(46===t.charCodeAt(i)?(e=".",i++):(e=null,a('"."')),null===e&&(33===t.charCodeAt(i)?(e="!",i++):(e=null,a('"!"')),null===e&&(126===t.charCodeAt(i)?(e="~",i++):(e=null,a('"~"')),null===e&&(42===t.charCodeAt(i)?(e="*",i++):(e=null,a('"*"')),null===e&&(39===t.charCodeAt(i)?(e="'",i++):(e=null,a('"\'"')),null===e&&(40===t.charCodeAt(i)?(e="(",i++):(e=null,a('"("')),null===e&&(41===t.charCodeAt(i)?(e=")",i++):(e=null,a('")"')))))))))),e}function T(){var e,n,r,o,s;return o=i,s=i,37===t.charCodeAt(i)?(e="%",i++):(e=null,a('"%"')),null!==e&&null!==(n=h())&&null!==(r=h())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=e.join("")),null===e&&(i=o),e}function S(){var e,t,n,r,o,s;for(r=i,o=i,s=i,e=[],t=f();null!==t;)e.push(t),t=f();if(null!==e&&null!==(t=u())?e=[e,t]:(e=null,i=s),null!==(e=null!==e?e:"")){if(null!==(n=f()))for(t=[];null!==n;)t.push(n),n=f();else t=null;null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null!==e&&(e=" "),null===e&&(i=r),e}function E(){var e;return e=null!==(e=S())?e:""}function C(){var e,n,r,o,s;for(o=i,s=i,e=[],null===(n=g())&&(n=m());null!==n;)e.push(n),null===(n=g())&&(n=m());return null!==e?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=":"),null===e&&(i=o),e}function w(){var e,n,r,o,s,a,u;if(s=i,a=i,null!==(n=b()))for(e=[];null!==n;)e.push(n),n=b();else e=null;if(null!==e){for(n=[],u=i,r=[],o=S();null!==o;)r.push(o),o=S();for(null!==r&&null!==(o=b())?r=[r,o]:(r=null,i=u);null!==r;){for(n.push(r),u=i,r=[],o=S();null!==o;)r.push(o),o=S();null!==r&&null!==(o=b())?r=[r,o]:(r=null,i=u)}null!==n?e=[e,n]:(e=null,i=a)}else e=null,i=a;return null!==e&&(e=function(e){return t.substring(i,e)}(s)),null===e&&(i=s),e}function b(){var e;return/^[!-~]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[!-~]")),null===e&&(e=I()),e}function I(){var e;return/^[\x80-\uFFFF]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\x80-\\uFFFF]")),e}function R(){var e;return/^[\x80-\xBF]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\x80-\\xBF]")),e}function O(){var e,n,r;if(r=i,null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"'))))))))))));else e=null;return null!==e&&(e=function(e){return t.substring(i,e)}(r)),null===e&&(i=r),e}function D(){var e,n,r;if(r=i,null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"'))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')))))))))));else e=null;return null!==e&&(e=function(e){return t.substring(i,e)}(r)),null===e&&(i=r),e}function k(){var e,n,r;if(r=i,null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')),null===n&&(40===t.charCodeAt(i)?(n="(",i++):(n=null,a('"("')),null===n&&(41===t.charCodeAt(i)?(n=")",i++):(n=null,a('")"')),null===n&&(60===t.charCodeAt(i)?(n="<",i++):(n=null,a('"<"')),null===n&&(62===t.charCodeAt(i)?(n=">",i++):(n=null,a('">"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(92===t.charCodeAt(i)?(n="\\",i++):(n=null,a('"\\\\"')),null===n&&null===(n=p())&&(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null===n&&(91===t.charCodeAt(i)?(n="[",i++):(n=null,a('"["')),null===n&&(93===t.charCodeAt(i)?(n="]",i++):(n=null,a('"]"')),null===n&&(63===t.charCodeAt(i)?(n="?",i++):(n=null,a('"?"')),null===n&&(123===t.charCodeAt(i)?(n="{",i++):(n=null,a('"{"')),null===n&&(125===t.charCodeAt(i)?(n="}",i++):(n=null,a('"}"')))))))))))))))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')),null===n&&(40===t.charCodeAt(i)?(n="(",i++):(n=null,a('"("')),null===n&&(41===t.charCodeAt(i)?(n=")",i++):(n=null,a('")"')),null===n&&(60===t.charCodeAt(i)?(n="<",i++):(n=null,a('"<"')),null===n&&(62===t.charCodeAt(i)?(n=">",i++):(n=null,a('">"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(92===t.charCodeAt(i)?(n="\\",i++):(n=null,a('"\\\\"')),null===n&&null===(n=p())&&(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null===n&&(91===t.charCodeAt(i)?(n="[",i++):(n=null,a('"["')),null===n&&(93===t.charCodeAt(i)?(n="]",i++):(n=null,a('"]"')),null===n&&(63===t.charCodeAt(i)?(n="?",i++):(n=null,a('"?"')),null===n&&(123===t.charCodeAt(i)?(n="{",i++):(n=null,a('"{"')),null===n&&(125===t.charCodeAt(i)?(n="}",i++):(n=null,a('"}"'))))))))))))))))))))))));else e=null;return null!==e&&(e=function(e){return t.substring(i,e)}(r)),null===e&&(i=r),e}function M(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="*"),null===e&&(i=o),e}function q(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="/"),null===e&&(i=o),e}function U(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="="),null===e&&(i=o),e}function P(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(40===t.charCodeAt(i)?(n="(",i++):(n=null,a('"("')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="("),null===e&&(i=o),e}function L(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(41===t.charCodeAt(i)?(n=")",i++):(n=null,a('")"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=")"),null===e&&(i=o),e}function B(){var e,n,r,o;return r=i,o=i,62===t.charCodeAt(i)?(e=">",i++):(e=null,a('">"')),null!==e&&null!==(n=E())?e=[e,n]:(e=null,i=o),null!==e&&(e=">"),null===e&&(i=r),e}function F(){var e,n,r,o;return r=i,o=i,null!==(e=E())?(60===t.charCodeAt(i)?(n="<",i++):(n=null,a('"<"')),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==e&&(e="<"),null===e&&(i=r),e}function H(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=","),null===e&&(i=o),e}function G(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=";"),null===e&&(i=o),e}function Y(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=":"),null===e&&(i=o),e}function j(){var e,t,n,r;return n=i,r=i,null!==(e=E())&&null!==(t=p())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function Q(){var e,t,n,r;return n=i,r=i,null!==(e=p())&&null!==(t=E())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function W(){var e;return/^[!-']/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[!-']")),null===e&&(/^[*-[]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[*-[]")),null===e&&(/^[\]-~]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\]-~]")),null===e&&null===(e=I())&&(e=S()))),e}function K(){var e,n,r,o,s,a;if(s=i,a=i,null!==(e=E()))if(null!==(n=p())){for(r=[],null===(o=J())&&(o=V());null!==o;)r.push(o),null===(o=J())&&(o=V());null!==r&&null!==(o=p())?e=[e,n,r,o]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;return null!==e&&(e=function(e){return t.substring(i,e)}(s)),null===e&&(i=s),e}function z(){var e,n,r,o,s,a;if(s=i,a=i,null!==(e=E()))if(null!==(n=p())){for(r=[],null===(o=J())&&(o=V());null!==o;)r.push(o),null===(o=J())&&(o=V());null!==r&&null!==(o=p())?e=[e,n,r,o]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;return null!==e&&(e=function(e){var n=t.substring(i,e).trim();return n.substring(1,n.length-1).replace(/\\([\x00-\x09\x0b-\x0c\x0e-\x7f])/g,"$1")}(s)),null===e&&(i=s),e}function J(){var e;return null===(e=S())&&(33===t.charCodeAt(i)?(e="!",i++):(e=null,a('"!"')),null===e&&(/^[#-[]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[#-[]")),null===e&&(/^[\]-~]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\]-~]")),null===e&&(e=I())))),e}function V(){var e,n,r;return r=i,92===t.charCodeAt(i)?(e="\\",i++):(e=null,a('"\\\\"')),null!==e?(/^[\0-\t]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[\\0-\\t]")),null===n&&(/^[\x0B-\f]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[\\x0B-\\f]")),null===n&&(/^[\x0E-]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[\\x0E-]")))),null!==n?e=[e,n]:(e=null,i=r)):(e=null,i=r),e}function Z(){var e,n,r,o,s,u;return s=i,u=i,null!==(e=$())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=null!==(r=ne())?r:"")&&null!==(o=se())?e=[e,n,r,o]:(e=null,i=u)):(e=null,i=u),null!==e&&(e=function(){try{Hn.uri=new Bn(Hn.scheme,Hn.user,Hn.host,Hn.port),delete Hn.scheme,delete Hn.user,delete Hn.host,delete Hn.host_type,delete Hn.port}catch(e){Hn=-1}}()),null===e&&(i=s),e}function X(){var e,r,o,s,u,l,c,h;return c=i,h=i,null!==(e=$())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=null!==(o=ne())?o:"")&&null!==(s=se())&&null!==(u=Ae())&&null!==(l=null!==(l=ke())?l:"")?e=[e,r,o,s,u,l]:(e=null,i=h)):(e=null,i=h),null!==e&&(e=function(){try{Hn.uri=new Bn(Hn.scheme,Hn.user,Hn.host,Hn.port,Hn.uri_params,Hn.uri_headers),delete Hn.scheme,delete Hn.user,delete Hn.host,delete Hn.host_type,delete Hn.port,delete Hn.uri_params,"SIP_URI"===n&&(Hn=Hn.uri)}catch(e){Hn=-1}}()),null===e&&(i=c),e}function $(){var e;return null===(e=ee())&&(e=te()),e}function ee(){var e,n,r;return n=i,"sips"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"sips"')),null!==e&&(r=e,e=void(Hn.scheme=r.toLowerCase())),null===e&&(i=n),e}function te(){var e,n,r;return n=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"sip"')),null!==e&&(r=e,e=void(Hn.scheme=r.toLowerCase())),null===e&&(i=n),e}function ne(){var e,n,r,o,s,u;return o=i,s=i,null!==(e=re())?(u=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=oe())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?(64===t.charCodeAt(i)?(r="@",i++):(r=null,a('"@"')),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){Hn.user=decodeURIComponent(t.substring(i-1,e))}(o)),null===e&&(i=o),e}function re(){var e,t;if(null===(t=v())&&null===(t=T())&&(t=ie()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=v())&&null===(t=T())&&(t=ie());else e=null;return e}function ie(){var e;return 38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","')),null===e&&(59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"'))))))))),e}function oe(){var e,n,r;for(r=i,e=[],null===(n=v())&&null===(n=T())&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')))))));null!==n;)e.push(n),null===(n=v())&&null===(n=T())&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')))))));return null!==e&&(e=function(e){Hn.password=t.substring(i,e)}(r)),null===e&&(i=r),e}function se(){var e,n,r,o,s;return o=i,null!==(e=ae())?(s=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=_e())?n=[n,r]:(n=null,i=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=o)):(e=null,i=o),e}function ae(){var e,n;return n=i,null===(e=ue())&&null===(e=ge())&&(e=he()),null!==e&&(e=function(e){return Hn.host=t.substring(i,e).toLowerCase(),Hn.host}(n)),null===e&&(i=n),e}function ue(){var e,n,r,o,s,u;for(o=i,s=i,e=[],u=i,null!==(n=le())?(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r?n=[n,r]:(n=null,i=u)):(n=null,i=u);null!==n;)e.push(n),u=i,null!==(n=le())?(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r?n=[n,r]:(n=null,i=u)):(n=null,i=u);return null!==e&&null!==(n=ce())?(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==(r=null!==r?r:"")?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){return Hn.host_type="domain",t.substring(i,e)}(o)),null===e&&(i=o),e}function le(){var e,n,r,o;if(o=i,null!==(e=_())){for(n=[],null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==r;)n.push(r),null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==n?e=[e,n]:(e=null,i=o)}else e=null,i=o;return e}function ce(){var e,n,r,o;if(o=i,null!==(e=c())){for(n=[],null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==r;)n.push(r),null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==n?e=[e,n]:(e=null,i=o)}else e=null,i=o;return e}function he(){var e,n,r,o,s;return o=i,s=i,91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null!==e&&null!==(n=fe())?(93===t.charCodeAt(i)?(r="]",i++):(r=null,a('"]"')),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){return Hn.host_type="IPv6",t.substring(i,e)}(o)),null===e&&(i=o),e}function fe(){var e,n,r,o,s,u,l,c,h,f,d,p,g,m,_,A;return m=i,_=i,null!==(e=de())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?(58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?(58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?(58===t.charCodeAt(i)?(c=":",i++):(c=null,a('":"')),null!==c&&null!==(h=de())?(58===t.charCodeAt(i)?(f=":",i++):(f=null,a('":"')),null!==f&&null!==(d=de())?(58===t.charCodeAt(i)?(p=":",i++):(p=null,a('":"')),null!==p&&null!==(g=pe())?e=[e,n,r,o,s,u,l,c,h,f,d,p,g]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?(58===t.charCodeAt(i)?(h=":",i++):(h=null,a('":"')),null!==h&&null!==(f=de())?(58===t.charCodeAt(i)?(d=":",i++):(d=null,a('":"')),null!==d&&null!==(p=pe())?e=[e,n,r,o,s,u,l,c,h,f,d,p]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?(58===t.charCodeAt(i)?(h=":",i++):(h=null,a('":"')),null!==h&&null!==(f=pe())?e=[e,n,r,o,s,u,l,c,h,f]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=pe())?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=pe())?e=[e,n,r,o,s,u]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=pe())?e=[e,n,r,o]:(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=pe())?e=[e,n]:(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?e=[e,n]:(e=null,i=_),null===e&&(_=i,null!==(e=de())?("::"===t.substr(i,2)?(n="::",i+=2):(n=null,a('"::"')),null!==n&&null!==(r=de())?(58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?(58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?(58===t.charCodeAt(i)?(c=":",i++):(c=null,a('":"')),null!==c&&null!==(h=de())?(58===t.charCodeAt(i)?(f=":",i++):(f=null,a('":"')),null!==f&&null!==(d=pe())?e=[e,n,r,o,s,u,l,c,h,f,d]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?("::"===t.substr(i,2)?(r="::",i+=2):(r=null,a('"::"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?(58===t.charCodeAt(i)?(h=":",i++):(h=null,a('":"')),null!==h&&null!==(f=pe())?e=[e,n,r,o,s,u,l,c,h,f]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?("::"===t.substr(i,2)?(o="::",i+=2):(o=null,a('"::"')),null!==o&&null!==(s=de())?(58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?(58===t.charCodeAt(i)?(c=":",i++):(c=null,a('":"')),null!==c&&null!==(h=pe())?e=[e,n,r,o,s,u,l,c,h]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?("::"===t.substr(i,2)?(s="::",i+=2):(s=null,a('"::"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=pe())?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?(A=i,58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?s=[s,u]:(s=null,i=A),null!==(s=null!==s?s:"")?("::"===t.substr(i,2)?(u="::",i+=2):(u=null,a('"::"')),null!==u&&null!==(l=pe())?e=[e,n,r,o,s,u,l]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?(A=i,58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?s=[s,u]:(s=null,i=A),null!==(s=null!==s?s:"")?(A=i,58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?u=[u,l]:(u=null,i=A),null!==(u=null!==u?u:"")?("::"===t.substr(i,2)?(l="::",i+=2):(l=null,a('"::"')),null!==l&&null!==(c=de())?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?(A=i,58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?s=[s,u]:(s=null,i=A),null!==(s=null!==s?s:"")?(A=i,58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?u=[u,l]:(u=null,i=A),null!==(u=null!==u?u:"")?(A=i,58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?l=[l,c]:(l=null,i=A),null!==(l=null!==l?l:"")?("::"===t.substr(i,2)?(c="::",i+=2):(c=null,a('"::"')),null!==c?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_))))))))))))))),null!==e&&(e=function(e){return Hn.host_type="IPv6",t.substring(i,e)}(m)),null===e&&(i=m),e}function de(){var e,t,n,r,o;return o=i,null!==(e=h())&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")?e=[e,t,n,r]:(e=null,i=o),e}function pe(){var e,n,r,o;return o=i,null!==(e=de())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),null===e&&(e=ge()),e}function ge(){var e,n,r,o,s,u,l,c,h;return c=i,h=i,null!==(e=me())?(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null!==n&&null!==(r=me())?(46===t.charCodeAt(i)?(o=".",i++):(o=null,a('"."')),null!==o&&null!==(s=me())?(46===t.charCodeAt(i)?(u=".",i++):(u=null,a('"."')),null!==u&&null!==(l=me())?e=[e,n,r,o,s,u,l]:(e=null,i=h)):(e=null,i=h)):(e=null,i=h)):(e=null,i=h),null!==e&&(e=function(e){return Hn.host_type="IPv4",t.substring(i,e)}(c)),null===e&&(i=c),e}function me(){var e,n,r,o;return o=i,"25"===t.substr(i,2)?(e="25",i+=2):(e=null,a('"25"')),null!==e?(/^[0-5]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[0-5]")),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null===e&&(o=i,50===t.charCodeAt(i)?(e="2",i++):(e=null,a('"2"')),null!==e?(/^[0-4]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[0-4]")),null!==n&&null!==(r=l())?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),null===e&&(o=i,49===t.charCodeAt(i)?(e="1",i++):(e=null,a('"1"')),null!==e&&null!==(n=l())&&null!==(r=l())?e=[e,n,r]:(e=null,i=o),null===e&&(o=i,/^[1-9]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[1-9]")),null!==e&&null!==(n=l())?e=[e,n]:(e=null,i=o),null===e&&(e=l())))),e}function _e(){var e,t,n,r,o,s,a,u;return s=i,a=i,null!==(e=null!==(e=l())?e:"")&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")?e=[e,t,n,r,o]:(e=null,i=a),null!==e&&(u=e,u=parseInt(u.join("")),Hn.port=u,e=u),null===e&&(i=s),e}function Ae(){var e,n,r,o;for(e=[],o=i,59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null!==n&&null!==(r=ve())?n=[n,r]:(n=null,i=o);null!==n;)e.push(n),o=i,59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null!==n&&null!==(r=ve())?n=[n,r]:(n=null,i=o);return e}function ve(){var e;return null===(e=ye())&&null===(e=Te())&&null===(e=Se())&&null===(e=Ee())&&null===(e=Ce())&&null===(e=we())&&(e=be()),e}function ye(){var e,n,r,o;return r=i,o=i,"transport="===t.substr(i,10).toLowerCase()?(e=t.substr(i,10),i+=10):(e=null,a('"transport="')),null!==e?("udp"===t.substr(i,3).toLowerCase()?(n=t.substr(i,3),i+=3):(n=null,a('"udp"')),null===n&&("tcp"===t.substr(i,3).toLowerCase()?(n=t.substr(i,3),i+=3):(n=null,a('"tcp"')),null===n&&("sctp"===t.substr(i,4).toLowerCase()?(n=t.substr(i,4),i+=4):(n=null,a('"sctp"')),null===n&&("tls"===t.substr(i,3).toLowerCase()?(n=t.substr(i,3),i+=3):(n=null,a('"tls"')),null===n&&(n=O())))),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==e&&(e=function(e,t){Hn.uri_params||(Hn.uri_params={}),Hn.uri_params.transport=t.toLowerCase()}(0,e[1])),null===e&&(i=r),e}function Te(){var e,n,r,o,s;return r=i,o=i,"user="===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"user="')),null!==e?("phone"===t.substr(i,5).toLowerCase()?(n=t.substr(i,5),i+=5):(n=null,a('"phone"')),null===n&&("ip"===t.substr(i,2).toLowerCase()?(n=t.substr(i,2),i+=2):(n=null,a('"ip"')),null===n&&(n=O())),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.user=s.toLowerCase())),null===e&&(i=r),e}function Se(){var e,n,r,o,s;return r=i,o=i,"method="===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"method="')),null!==e&&null!==(n=ct())?e=[e,n]:(e=null,i=o),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.method=s)),null===e&&(i=r),e}function Ee(){var e,n,r,o,s;return r=i,o=i,"ttl="===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"ttl="')),null!==e&&null!==(n=wn())?e=[e,n]:(e=null,i=o),null!==e&&(s=e[1],Hn.params||(Hn.params={}),e=void(Hn.params.ttl=s)),null===e&&(i=r),e}function Ce(){var e,n,r,o,s;return r=i,o=i,"maddr="===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"maddr="')),null!==e&&null!==(n=ae())?e=[e,n]:(e=null,i=o),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.maddr=s)),null===e&&(i=r),e}function we(){var e,n,r,o,s,u;return o=i,s=i,"lr"===t.substr(i,2).toLowerCase()?(e=t.substr(i,2),i+=2):(e=null,a('"lr"')),null!==e?(u=i,61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=O())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s),null!==e&&(Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.lr=void 0)),null===e&&(i=o),e}function be(){var e,n,r,o,s,u,l,c;return o=i,s=i,null!==(e=Ie())?(u=i,61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=Re())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[0],c=e[1],Hn.uri_params||(Hn.uri_params={}),c=void 0===c?void 0:c[1],e=void(Hn.uri_params[l.toLowerCase()]=c)),null===e&&(i=o),e}function Ie(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Re(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Oe(){var e;return null===(e=De())&&null===(e=v())&&(e=T()),e}function De(){var e;return 91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null===e&&(93===t.charCodeAt(i)?(e="]",i++):(e=null,a('"]"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')))))))),e}function ke(){var e,n,r,o,s,u,l;if(u=i,63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null!==e)if(null!==(n=Me())){for(r=[],l=i,38===t.charCodeAt(i)?(o="&",i++):(o=null,a('"&"')),null!==o&&null!==(s=Me())?o=[o,s]:(o=null,i=l);null!==o;)r.push(o),l=i,38===t.charCodeAt(i)?(o="&",i++):(o=null,a('"&"')),null!==o&&null!==(s=Me())?o=[o,s]:(o=null,i=l);null!==r?e=[e,n,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return e}function Me(){var e,n,r,o,s,u,l;return o=i,s=i,null!==(e=qe())?(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=Ne())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[0],l=e[2],u=u.join("").toLowerCase(),l=l.join(""),Hn.uri_headers||(Hn.uri_headers={}),e=void(Hn.uri_headers[u]?Hn.uri_headers[u].push(l):Hn.uri_headers[u]=[l])),null===e&&(i=o),e}function qe(){var e,t;if(null===(t=Ue())&&null===(t=v())&&(t=T()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=Ue())&&null===(t=v())&&(t=T());else e=null;return e}function Ne(){var e,t;for(e=[],null===(t=Ue())&&null===(t=v())&&(t=T());null!==t;)e.push(t),null===(t=Ue())&&null===(t=v())&&(t=T());return e}function Ue(){var e;return 91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null===e&&(93===t.charCodeAt(i)?(e="]",i++):(e=null,a('"]"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')))))))),e}function xe(){var e,t,n,r,o,s;return s=i,null!==(e=ct())&&null!==(t=g())&&null!==(n=Pe())&&null!==(r=g())&&null!==(o=et())?e=[e,t,n,r,o]:(e=null,i=s),e}function Pe(){var e;return null===(e=X())&&(e=Le()),e}function Le(){var e,n,r,o;return o=i,null!==(e=Je())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n?(null===(r=Be())&&(r=Ge()),null!==r?e=[e,n,r]:(e=null,i=o)):(e=null,i=o)):(e=null,i=o),e}function Be(){var e,n,r,o,s;return o=i,null===(e=Fe())&&(e=He()),null!==e?(s=i,63===t.charCodeAt(i)?(n="?",i++):(n=null,a('"?"')),null!==n&&null!==(r=$e())?n=[n,r]:(n=null,i=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=o)):(e=null,i=o),e}function Fe(){var e,n,r,o;return o=i,"//"===t.substr(i,2)?(e="//",i+=2):(e=null,a('"//"')),null!==e&&null!==(n=Ve())&&null!==(r=null!==(r=He())?r:"")?e=[e,n,r]:(e=null,i=o),e}function He(){var e,n,r;return r=i,47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null!==e&&null!==(n=Qe())?e=[e,n]:(e=null,i=r),e}function Ge(){var e,t,n,r;if(r=i,null!==(e=je())){for(t=[],n=Ye();null!==n;)t.push(n),n=Ye();null!==t?e=[e,t]:(e=null,i=r)}else e=null,i=r;return e}function Ye(){var e;return null===(e=A())&&null===(e=v())&&(e=T()),e}function je(){var e;return null===(e=v())&&null===(e=T())&&(59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","'))))))))))),e}function Qe(){var e,n,r,o,s,u;if(s=i,null!==(e=We())){for(n=[],u=i,47===t.charCodeAt(i)?(r="/",i++):(r=null,a('"/"')),null!==r&&null!==(o=We())?r=[r,o]:(r=null,i=u);null!==r;)n.push(r),u=i,47===t.charCodeAt(i)?(r="/",i++):(r=null,a('"/"')),null!==r&&null!==(o=We())?r=[r,o]:(r=null,i=u);null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return e}function We(){var e,n,r,o,s,u;for(s=i,e=[],n=ze();null!==n;)e.push(n),n=ze();if(null!==e){for(n=[],u=i,59===t.charCodeAt(i)?(r=";",i++):(r=null,a('";"')),null!==r&&null!==(o=Ke())?r=[r,o]:(r=null,i=u);null!==r;)n.push(r),u=i,59===t.charCodeAt(i)?(r=";",i++):(r=null,a('";"')),null!==r&&null!==(o=Ke())?r=[r,o]:(r=null,i=u);null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return e}function Ke(){var e,t;for(e=[],t=ze();null!==t;)e.push(t),t=ze();return e}function ze(){var e;return null===(e=v())&&null===(e=T())&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","'))))))))),e}function Je(){var e,n,r,o,s;if(o=i,s=i,null!==(e=c())){for(n=[],null===(r=c())&&null===(r=l())&&(43===t.charCodeAt(i)?(r="+",i++):(r=null,a('"+"')),null===r&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')))));null!==r;)n.push(r),null===(r=c())&&null===(r=l())&&(43===t.charCodeAt(i)?(r="+",i++):(r=null,a('"+"')),null===r&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')))));null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=function(e){Hn.scheme=t.substring(i,e)}(o)),null===e&&(i=o),e}function Ve(){var e;return null===(e=Ze())&&(e=Xe()),e}function Ze(){var e,n,r,o;return r=i,o=i,null!==(e=ne())?(64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==(e=null!==e?e:"")&&null!==(n=se())?e=[e,n]:(e=null,i=r),e=null!==e?e:""}function Xe(){var e,n;if(null===(n=v())&&null===(n=T())&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')),null===n&&(59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null===n&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=v())&&null===(n=T())&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')),null===n&&(59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null===n&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"'))))))))));else e=null;return e}function $e(){var e,t;for(e=[],t=Ye();null!==t;)e.push(t),t=Ye();return e}function et(){var e,n,r,o,s,u,c,h;if(c=i,h=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"SIP"')),null!==e)if(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null!==n){if(null!==(o=l()))for(r=[];null!==o;)r.push(o),o=l();else r=null;if(null!==r)if(46===t.charCodeAt(i)?(o=".",i++):(o=null,a('"."')),null!==o){if(null!==(u=l()))for(s=[];null!==u;)s.push(u),u=l();else s=null;null!==s?e=[e,n,r,o,s]:(e=null,i=h)}else e=null,i=h;else e=null,i=h}else e=null,i=h;else e=null,i=h;return null!==e&&(e=function(e){Hn.sip_version=t.substring(i,e)}(c)),null===e&&(i=c),e}function tt(){var e;return"INVITE"===t.substr(i,6)?(e="INVITE",i+=6):(e=null,a('"INVITE"')),e}function nt(){var e;return"ACK"===t.substr(i,3)?(e="ACK",i+=3):(e=null,a('"ACK"')),e}function rt(){var e;return"OPTIONS"===t.substr(i,7)?(e="OPTIONS",i+=7):(e=null,a('"OPTIONS"')),e}function it(){var e;return"BYE"===t.substr(i,3)?(e="BYE",i+=3):(e=null,a('"BYE"')),e}function ot(){var e;return"CANCEL"===t.substr(i,6)?(e="CANCEL",i+=6):(e=null,a('"CANCEL"')),e}function st(){var e;return"REGISTER"===t.substr(i,8)?(e="REGISTER",i+=8):(e=null,a('"REGISTER"')),e}function at(){var e;return"SUBSCRIBE"===t.substr(i,9)?(e="SUBSCRIBE",i+=9):(e=null,a('"SUBSCRIBE"')),e}function ut(){var e;return"NOTIFY"===t.substr(i,6)?(e="NOTIFY",i+=6):(e=null,a('"NOTIFY"')),e}function lt(){var e;return"REFER"===t.substr(i,5)?(e="REFER",i+=5):(e=null,a('"REFER"')),e}function ct(){var e,n;return n=i,null===(e=tt())&&null===(e=nt())&&null===(e=rt())&&null===(e=it())&&null===(e=ot())&&null===(e=st())&&null===(e=at())&&null===(e=ut())&&null===(e=lt())&&(e=O()),null!==e&&(e=function(e){return Hn.method=t.substring(i,e),Hn.method}(n)),null===e&&(i=n),e}function ht(){var e,t,n,r,o,s;return s=i,null!==(e=et())&&null!==(t=g())&&null!==(n=ft())&&null!==(r=g())&&null!==(o=pt())?e=[e,t,n,r,o]:(e=null,i=s),e}function ft(){var e,t,n;return t=i,null!==(e=dt())&&(n=e,e=void(Hn.status_code=parseInt(n.join("")))),null===e&&(i=t),e}function dt(){var e,t,n,r;return r=i,null!==(e=l())&&null!==(t=l())&&null!==(n=l())?e=[e,t,n]:(e=null,i=r),e}function pt(){var e,n,r;for(r=i,e=[],null===(n=A())&&null===(n=v())&&null===(n=T())&&null===(n=I())&&null===(n=R())&&null===(n=g())&&(n=m());null!==n;)e.push(n),null===(n=A())&&null===(n=v())&&null===(n=T())&&null===(n=I())&&null===(n=R())&&null===(n=g())&&(n=m());return null!==e&&(e=function(e){Hn.reason_phrase=t.substring(i,e)}(r)),null===e&&(i=r),e}function gt(){var e,t,n,r,o,s,a;if(o=i,s=i,null===(e=Z())&&(e=mt()),null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=At())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=At())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=function(e){var t;Hn.multi_header||(Hn.multi_header=[]);try{t=new Fn(Hn.uri,Hn.display_name,Hn.params),delete Hn.uri,delete Hn.display_name,delete Hn.params}catch(e){t=null}Hn.multi_header.push({possition:i,offset:e,parsed:t})}(o)),null===e&&(i=o),e}function mt(){var e,t,n,r,o;return o=i,null!==(e=null!==(e=_t())?e:"")&&null!==(t=F())&&null!==(n=X())&&null!==(r=B())?e=[e,t,n,r]:(e=null,i=o),e}function _t(){var e,t,n,r,o,s,a,u;if(o=i,s=i,null!==(e=O())){for(t=[],a=i,null!==(n=S())&&null!==(r=O())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=S())&&null!==(r=O())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null===e&&(e=z()),null!==e&&(u=e,e=void(Hn.display_name="string"==typeof u?u:u[1].reduce((function(e,t){return e+t[0]+t[1]}),u[0]))),null===e&&(i=o),e}function At(){var e;return null===(e=vt())&&null===(e=yt())&&(e=Et()),e}function vt(){var e,n,r,o,s,u;return o=i,s=i,"q"===t.substr(i,1).toLowerCase()?(e=t.substr(i,1),i++):(e=null,a('"q"')),null!==e&&null!==(n=U())&&null!==(r=St())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],Hn.params||(Hn.params={}),e=void(Hn.params.q=u)),null===e&&(i=o),e}function yt(){var e,n,r,o,s,u;return o=i,s=i,"expires"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"expires"')),null!==e&&null!==(n=U())&&null!==(r=Tt())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],Hn.params||(Hn.params={}),e=void(Hn.params.expires=u)),null===e&&(i=o),e}function Tt(){var e,t,n;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;return null!==e&&(e=parseInt(e.join(""))),null===e&&(i=n),e}function St(){var e,n,r,o,s,u,c,h;return u=i,c=i,48===t.charCodeAt(i)?(e="0",i++):(e=null,a('"0"')),null!==e?(h=i,46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null!==n&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")&&null!==(s=null!==(s=l())?s:"")?n=[n,r,o,s]:(n=null,i=h),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=c)):(e=null,i=c),null!==e&&(e=function(e){return parseFloat(t.substring(i,e))}(u)),null===e&&(i=u),e}function Et(){var e,t,n,r,o,s,a,u;return r=i,o=i,null!==(e=O())?(s=i,null!==(t=U())&&null!==(n=Ct())?t=[t,n]:(t=null,i=s),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=o)):(e=null,i=o),null!==e&&(a=e[0],u=e[1],Hn.params||(Hn.params={}),u=void 0===u?void 0:u[1],e=void(Hn.params[a.toLowerCase()]=u)),null===e&&(i=r),e}function Ct(){var e;return null===(e=O())&&null===(e=ae())&&(e=K()),e}function wt(){var e;return"render"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"render"')),null===e&&("session"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"session"')),null===e&&("icon"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"icon"')),null===e&&("alert"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"alert"')),null===e&&(e=O())))),e}function bt(){var e;return null===(e=It())&&(e=Et()),e}function It(){var e,n,r,o;return o=i,"handling"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"handling"')),null!==e&&null!==(n=U())?("optional"===t.substr(i,8).toLowerCase()?(r=t.substr(i,8),i+=8):(r=null,a('"optional"')),null===r&&("required"===t.substr(i,8).toLowerCase()?(r=t.substr(i,8),i+=8):(r=null,a('"required"')),null===r&&(r=O())),null!==r?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),e}function Rt(){var e,t,n,r,o,s,a,u;if(a=i,null!==(e=Ot()))if(null!==(t=q()))if(null!==(n=Nt())){for(r=[],u=i,null!==(o=G())&&null!==(s=Ut())?o=[o,s]:(o=null,i=u);null!==o;)r.push(o),u=i,null!==(o=G())&&null!==(s=Ut())?o=[o,s]:(o=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;else e=null,i=a;return e}function Ot(){var e;return null===(e=Dt())&&(e=kt()),e}function Dt(){var e;return"text"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"text"')),null===e&&("image"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"image"')),null===e&&("audio"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"audio"')),null===e&&("video"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"video"')),null===e&&("application"===t.substr(i,11).toLowerCase()?(e=t.substr(i,11),i+=11):(e=null,a('"application"')),null===e&&(e=Mt()))))),e}function kt(){var e;return"message"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"message"')),null===e&&("multipart"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"multipart"')),null===e&&(e=Mt())),e}function Mt(){var e;return null===(e=O())&&(e=qt()),e}function qt(){var e,n,r;return r=i,"x-"===t.substr(i,2).toLowerCase()?(e=t.substr(i,2),i+=2):(e=null,a('"x-"')),null!==e&&null!==(n=O())?e=[e,n]:(e=null,i=r),e}function Nt(){var e;return null===(e=Mt())&&(e=O()),e}function Ut(){var e,t,n,r;return r=i,null!==(e=O())&&null!==(t=U())&&null!==(n=xt())?e=[e,t,n]:(e=null,i=r),e}function xt(){var e;return null===(e=O())&&(e=K()),e}function Pt(){var e,t,n,r;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;return null!==e&&(r=e,e=void(Hn.value=parseInt(r.join("")))),null===e&&(i=n),e}function Lt(){var e,n,r,o,s,u;if(s=i,null!==(e=D())){for(n=[],u=i,46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r&&null!==(o=D())?r=[r,o]:(r=null,i=u);null!==r;)n.push(r),u=i,46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r&&null!==(o=D())?r=[r,o]:(r=null,i=u);null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return e}function Bt(){var e;return null===(e=Ft())&&(e=Et()),e}function Ft(){var e,n,r,o,s,u;return o=i,s=i,"tag"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"tag"')),null!==e&&null!==(n=U())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.tag=u)),null===e&&(i=o),e}function Ht(){var e,n,r,o,s,u,l,c;if(l=i,"digest"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"Digest"')),null!==e)if(null!==(n=S()))if(null!==(r=jt())){for(o=[],c=i,null!==(s=H())&&null!==(u=jt())?s=[s,u]:(s=null,i=c);null!==s;)o.push(s),c=i,null!==(s=H())&&null!==(u=jt())?s=[s,u]:(s=null,i=c);null!==o?e=[e,n,r,o]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return null===e&&(e=Gt()),e}function Gt(){var e,t,n,r,o,s,a,u;if(a=i,null!==(e=O()))if(null!==(t=S()))if(null!==(n=Yt())){for(r=[],u=i,null!==(o=H())&&null!==(s=Yt())?o=[o,s]:(o=null,i=u);null!==o;)r.push(o),u=i,null!==(o=H())&&null!==(s=Yt())?o=[o,s]:(o=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;else e=null,i=a;return e}function Yt(){var e,t,n,r;return r=i,null!==(e=O())&&null!==(t=U())?(null===(n=O())&&(n=K()),null!==n?e=[e,t,n]:(e=null,i=r)):(e=null,i=r),e}function jt(){var e;return null===(e=Qt())&&null===(e=Kt())&&null===(e=Jt())&&null===(e=Zt())&&null===(e=Xt())&&null===(e=$t())&&null===(e=en())&&(e=Yt()),e}function Qt(){var e,n,r,o;return o=i,"realm"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"realm"')),null!==e&&null!==(n=U())&&null!==(r=Wt())?e=[e,n,r]:(e=null,i=o),e}function Wt(){var e,t,n;return t=i,null!==(e=z())&&(n=e,e=void(Hn.realm=n)),null===e&&(i=t),e}function Kt(){var e,n,r,o,s,u,l,c,h;if(c=i,"domain"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"domain"')),null!==e)if(null!==(n=U()))if(null!==(r=j()))if(null!==(o=zt())){if(s=[],h=i,null!==(l=g()))for(u=[];null!==l;)u.push(l),l=g();else u=null;for(null!==u&&null!==(l=zt())?u=[u,l]:(u=null,i=h);null!==u;){if(s.push(u),h=i,null!==(l=g()))for(u=[];null!==l;)u.push(l),l=g();else u=null;null!==u&&null!==(l=zt())?u=[u,l]:(u=null,i=h)}null!==s&&null!==(u=Q())?e=[e,n,r,o,s,u]:(e=null,i=c)}else e=null,i=c;else e=null,i=c;else e=null,i=c;else e=null,i=c;return e}function zt(){var e;return null===(e=Le())&&(e=He()),e}function Jt(){var e,n,r,o;return o=i,"nonce"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"nonce"')),null!==e&&null!==(n=U())&&null!==(r=Vt())?e=[e,n,r]:(e=null,i=o),e}function Vt(){var e,t,n;return t=i,null!==(e=z())&&(n=e,e=void(Hn.nonce=n)),null===e&&(i=t),e}function Zt(){var e,n,r,o,s,u;return o=i,s=i,"opaque"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"opaque"')),null!==e&&null!==(n=U())&&null!==(r=z())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.opaque=u)),null===e&&(i=o),e}function Xt(){var e,n,r,o,s;return o=i,"stale"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"stale"')),null!==e&&null!==(n=U())?(s=i,"true"===t.substr(i,4).toLowerCase()?(r=t.substr(i,4),i+=4):(r=null,a('"true"')),null!==r&&(r=void(Hn.stale=!0)),null===r&&(i=s),null===r&&(s=i,"false"===t.substr(i,5).toLowerCase()?(r=t.substr(i,5),i+=5):(r=null,a('"false"')),null!==r&&(r=void(Hn.stale=!1)),null===r&&(i=s)),null!==r?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),e}function $t(){var e,n,r,o,s,u;return o=i,s=i,"algorithm"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"algorithm"')),null!==e&&null!==(n=U())?("md5"===t.substr(i,3).toLowerCase()?(r=t.substr(i,3),i+=3):(r=null,a('"MD5"')),null===r&&("md5-sess"===t.substr(i,8).toLowerCase()?(r=t.substr(i,8),i+=8):(r=null,a('"MD5-sess"')),null===r&&(r=O())),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.algorithm=u.toUpperCase())),null===e&&(i=o),e}function en(){var e,n,r,o,s,u,l,c,h,f;if(c=i,"qop"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"qop"')),null!==e)if(null!==(n=U()))if(null!==(r=j())){if(h=i,null!==(o=tn())){for(s=[],f=i,44===t.charCodeAt(i)?(u=",",i++):(u=null,a('","')),null!==u&&null!==(l=tn())?u=[u,l]:(u=null,i=f);null!==u;)s.push(u),f=i,44===t.charCodeAt(i)?(u=",",i++):(u=null,a('","')),null!==u&&null!==(l=tn())?u=[u,l]:(u=null,i=f);null!==s?o=[o,s]:(o=null,i=h)}else o=null,i=h;null!==o&&null!==(s=Q())?e=[e,n,r,o,s]:(e=null,i=c)}else e=null,i=c;else e=null,i=c;else e=null,i=c;return e}function tn(){var e,n,r;return n=i,"auth-int"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"auth-int"')),null===e&&("auth"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"auth"')),null===e&&(e=O())),null!==e&&(r=e,Hn.qop||(Hn.qop=[]),e=void Hn.qop.push(r.toLowerCase())),null===e&&(i=n),e}function nn(){var e,t,n,r,o,s,a;if(o=i,s=i,null!==(e=mt())){for(t=[],a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=function(e){var t;Hn.multi_header||(Hn.multi_header=[]);try{t=new Fn(Hn.uri,Hn.display_name,Hn.params),delete Hn.uri,delete Hn.display_name,delete Hn.params}catch(e){t=null}Hn.multi_header.push({possition:i,offset:e,parsed:t})}(o)),null===e&&(i=o),e}function rn(){var e;return null===(e=on())&&(e=Et()),e}function on(){var e,n,r,o,s,u,c;if(s=i,u=i,"cause"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"cause"')),null!==e)if(null!==(n=U())){if(null!==(o=l()))for(r=[];null!==o;)r.push(o),o=l();else r=null;null!==r?e=[e,n,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return null!==e&&(c=e[2],e=void(Hn.cause=parseInt(c.join("")))),null===e&&(i=s),e}function sn(){var e,t,n,r,o,s;if(o=i,null!==(e=mt())){for(t=[],s=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e}function an(){var e,n;return n=i,"active"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"active"')),null===e&&("pending"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"pending"')),null===e&&("terminated"===t.substr(i,10).toLowerCase()?(e=t.substr(i,10),i+=10):(e=null,a('"terminated"')),null===e&&(e=O()))),null!==e&&(e=function(e){Hn.state=t.substring(i,e)}(n)),null===e&&(i=n),e}function un(){var e,n,r,o,s,u,l,c;return o=i,s=i,"reason"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"reason"')),null!==e&&null!==(n=U())&&null!==(r=ln())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=void(void 0!==(u=e[2])&&(Hn.reason=u))),null===e&&(i=o),null===e&&(o=i,s=i,"expires"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"expires"')),null!==e&&null!==(n=U())&&null!==(r=Tt())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=void(void 0!==(c=e[2])&&(Hn.expires=c))),null===e&&(i=o),null===e&&(o=i,s=i,"retry_after"===t.substr(i,11).toLowerCase()?(e=t.substr(i,11),i+=11):(e=null,a('"retry_after"')),null!==e&&null!==(n=U())&&null!==(r=Tt())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=void(void 0!==(l=e[2])&&(Hn.retry_after=l))),null===e&&(i=o),null===e&&(e=Et()))),e}function ln(){var e;return"deactivated"===t.substr(i,11).toLowerCase()?(e=t.substr(i,11),i+=11):(e=null,a('"deactivated"')),null===e&&("probation"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"probation"')),null===e&&("rejected"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"rejected"')),null===e&&("timeout"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"timeout"')),null===e&&("giveup"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"giveup"')),null===e&&("noresource"===t.substr(i,10).toLowerCase()?(e=t.substr(i,10),i+=10):(e=null,a('"noresource"')),null===e&&("invariant"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"invariant"')),null===e&&(e=O()))))))),e}function cn(){var e;return null===(e=Ft())&&(e=Et()),e}function hn(){var e,t,n,r,o,s,a,u;if(a=i,null!==(e=vn()))if(null!==(t=S()))if(null!==(n=Sn())){for(r=[],u=i,null!==(o=G())&&null!==(s=fn())?o=[o,s]:(o=null,i=u);null!==o;)r.push(o),u=i,null!==(o=G())&&null!==(s=fn())?o=[o,s]:(o=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;else e=null,i=a;return e}function fn(){var e;return null===(e=dn())&&null===(e=pn())&&null===(e=gn())&&null===(e=mn())&&null===(e=_n())&&(e=Et()),e}function dn(){var e,n,r,o,s,u;return o=i,s=i,"ttl"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"ttl"')),null!==e&&null!==(n=U())&&null!==(r=wn())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.ttl=u)),null===e&&(i=o),e}function pn(){var e,n,r,o,s,u;return o=i,s=i,"maddr"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"maddr"')),null!==e&&null!==(n=U())&&null!==(r=ae())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.maddr=u)),null===e&&(i=o),e}function gn(){var e,n,r,o,s,u;return o=i,s=i,"received"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"received"')),null!==e&&null!==(n=U())?(null===(r=ge())&&(r=fe()),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.received=u)),null===e&&(i=o),e}function mn(){var e,n,r,o,s,u;return o=i,s=i,"branch"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"branch"')),null!==e&&null!==(n=U())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.branch=u)),null===e&&(i=o),e}function _n(){var e,n,r,o,s;return o=i,"rport"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"rport"')),null!==e?(s=i,null!==(n=U())&&null!==(r=An())?n=[n,r]:(n=null,i=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=o)):(e=null,i=o),e}function An(){var e,t,n,r,o,s,a,u;return s=i,a=i,null!==(e=null!==(e=l())?e:"")&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")?e=[e,t,n,r,o]:(e=null,i=a),null!==e&&(u=e,e=void(Hn.rport=parseInt(u.join("")))),null===e&&(i=s),e}function vn(){var e,t,n,r,o,s;return s=i,null!==(e=yn())&&null!==(t=q())&&null!==(n=O())&&null!==(r=q())&&null!==(o=Tn())?e=[e,t,n,r,o]:(e=null,i=s),e}function yn(){var e,n,r;return n=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"SIP"')),null===e&&(e=O()),null!==e&&(r=e,e=void(Hn.protocol=r)),null===e&&(i=n),e}function Tn(){var e,n,r;return n=i,"udp"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"UDP"')),null===e&&("tcp"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"TCP"')),null===e&&("tls"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"TLS"')),null===e&&("sctp"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"SCTP"')),null===e&&(e=O())))),null!==e&&(r=e,e=void(Hn.transport=r)),null===e&&(i=n),e}function Sn(){var e,t,n,r,o;return r=i,null!==(e=En())?(o=i,null!==(t=Y())&&null!==(n=Cn())?t=[t,n]:(t=null,i=o),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=r)):(e=null,i=r),e}function En(){var e,n;return n=i,null===(e=ge())&&null===(e=he())&&(e=ue()),null!==e&&(e=function(e){Hn.host=t.substring(i,e)}(n)),null===e&&(i=n),e}function Cn(){var e,t,n,r,o,s,a,u;return s=i,a=i,null!==(e=null!==(e=l())?e:"")&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")?e=[e,t,n,r,o]:(e=null,i=a),null!==e&&(u=e,e=void(Hn.port=parseInt(u.join("")))),null===e&&(i=s),e}function wn(){var e,t,n,r,o;return r=i,o=i,null!==(e=l())&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")?e=[e,t,n]:(e=null,i=o),null!==e&&(e=parseInt(e.join(""))),null===e&&(i=r),e}function bn(){var e,t,n;return t=i,null!==(e=Tt())&&(n=e,e=void(Hn.expires=n)),null===e&&(i=t),e}function In(){var e;return null===(e=Rn())&&(e=Et()),e}function Rn(){var e,n,r,o,s,u;return o=i,s=i,"refresher"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"refresher"')),null!==e&&null!==(n=U())?("uac"===t.substr(i,3).toLowerCase()?(r=t.substr(i,3),i+=3):(r=null,a('"uac"')),null===r&&("uas"===t.substr(i,3).toLowerCase()?(r=t.substr(i,3),i+=3):(r=null,a('"uas"'))),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.refresher=u.toLowerCase())),null===e&&(i=o),e}function On(){var e,t;for(e=[],null===(t=b())&&null===(t=R())&&(t=S());null!==t;)e.push(t),null===(t=b())&&null===(t=R())&&(t=S());return e}function Dn(){var e,n,r,o,s,u,l,c,h,f,d;return f=i,d=i,null!==(e=Mn())?(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null!==n&&null!==(r=kn())?(45===t.charCodeAt(i)?(o="-",i++):(o=null,a('"-"')),null!==o&&null!==(s=kn())?(45===t.charCodeAt(i)?(u="-",i++):(u=null,a('"-"')),null!==u&&null!==(l=kn())?(45===t.charCodeAt(i)?(c="-",i++):(c=null,a('"-"')),null!==c&&null!==(h=qn())?e=[e,n,r,o,s,u,l,c,h]:(e=null,i=d)):(e=null,i=d)):(e=null,i=d)):(e=null,i=d)):(e=null,i=d),null!==e&&(e=function(e){Hn=t.substring(i+5,e)}(f,e[0])),null===e&&(i=f),e}function kn(){var e,t,n,r,o;return o=i,null!==(e=h())&&null!==(t=h())&&null!==(n=h())&&null!==(r=h())?e=[e,t,n,r]:(e=null,i=o),e}function Mn(){var e,t,n;return n=i,null!==(e=kn())&&null!==(t=kn())?e=[e,t]:(e=null,i=n),e}function qn(){var e,t,n,r;return r=i,null!==(e=kn())&&null!==(t=kn())&&null!==(n=kn())?e=[e,t,n]:(e=null,i=r),e}function Nn(){var e,n,r,o,s,u;return o=i,s=i,null!==(e=k())?(u=i,64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null!==n&&null!==(r=k())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){Hn.call_id=t.substring(i,e)}(o)),null===e&&(i=o),e}function Un(){var e;return null===(e=xn())&&null===(e=Pn())&&null===(e=Ln())&&(e=Et()),e}function xn(){var e,n,r,o,s,u;return o=i,s=i,"to-tag"===t.substr(i,6)?(e="to-tag",i+=6):(e=null,a('"to-tag"')),null!==e&&null!==(n=U())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.to_tag=u)),null===e&&(i=o),e}function Pn(){var e,n,r,o,s,u;return o=i,s=i,"from-tag"===t.substr(i,8)?(e="from-tag",i+=8):(e=null,a('"from-tag"')),null!==e&&null!==(n=U())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.from_tag=u)),null===e&&(i=o),e}function Ln(){var e,n;return n=i,"early-only"===t.substr(i,10)?(e="early-only",i+=10):(e=null,a('"early-only"')),null!==e&&(e=void(Hn.early_only=!0)),null===e&&(i=n),e}var Bn=x(),Fn=N,Hn={};if(null===r[n]()||i!==t.length){var Gn=Math.max(i,o),Yn=Gn<t.length?t.charAt(Gn):null,jn=function(){for(var e=1,n=1,r=!1,s=0;s<Math.max(i,o);s++){var a=t.charAt(s);"\n"===a?(r||e++,n=1,r=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e++,n=1,r=!0):(n++,r=!1)}return{line:e,column:n}}();return new this.SyntaxError(function(e){e.sort();for(var t=null,n=[],r=0;r<e.length;r++)e[r]!==t&&(n.push(e[r]),t=e[r]);return n}(s),Yn,Gn,jn.line,jn.column),-1}return Hn},toSource:function(){return this._source},SyntaxError:function(t,n,r,i,o){this.name="SyntaxError",this.expected=t,this.found=n,this.message=function(t,n){var r;switch(t.length){case 0:r="end of input";break;case 1:r=t[0];break;default:r=t.slice(0,t.length-1).join(", ")+" or "+t[t.length-1]}return"Expected "+r+" but "+(n?e(n):"end of input")+" found."}(t,n),this.offset=r,this.line=i,this.column=o}};return t.SyntaxError.prototype=Error.prototype,t}()),I}function x(){if(D)return O;function e(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e))||n){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}D=1;var i=l,o=P(),s=U();return O=function(){function t(e,n,r,o){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw new TypeError('missing or invalid "host" parameter');for(var u in this._parameters={},this._headers={},this._scheme=e||i.SIP,this._user=n,this._host=r,this._port=o,s)Object.prototype.hasOwnProperty.call(s,u)&&this.setParam(u,s[u]);for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&this.setHeader(l,a[l])}return r(t,null,[{key:"parse",value:function(e){return-1!==(e=s.parse(e,"SIP_URI"))?e:void 0}}]),r(t,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]=null==t?null:t.toString())}},{key:"getParam",value:function(e){if(e)return this._parameters[e.toLowerCase()]}},{key:"hasParam",value:function(e){if(e)return!!this._parameters.hasOwnProperty(e.toLowerCase())}},{key:"deleteParam",value:function(e){if(e=e.toLowerCase(),this._parameters.hasOwnProperty(e)){var t=this._parameters[e];return delete this._parameters[e],t}}},{key:"clearParams",value:function(){this._parameters={}}},{key:"setHeader",value:function(e,t){this._headers[o.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){if(e)return this._headers[o.headerize(e)]}},{key:"hasHeader",value:function(e){if(e)return!!this._headers.hasOwnProperty(o.headerize(e))}},{key:"deleteHeader",value:function(e){if(e=o.headerize(e),this._headers.hasOwnProperty(e)){var t=this._headers[e];return delete this._headers[e],t}}},{key:"clearHeaders",value:function(){this._headers={}}},{key:"clone",value:function(){return new t(this._scheme,this._user,this._host,this._port,JSON.parse(JSON.stringify(this._parameters)),JSON.parse(JSON.stringify(this._headers)))}},{key:"toString",value:function(){var t=[],n="".concat(this._scheme,":");for(var r in this._user&&(n+="".concat(o.escapeUser(this._user),"@")),n+=this._host,(this._port||0===this._port)&&(n+=":".concat(this._port)),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,r)&&(n+=";".concat(r),null!==this._parameters[r]&&(n+="=".concat(this._parameters[r])));for(var i in this._headers)if(Object.prototype.hasOwnProperty.call(this._headers,i)){var s,a=e(this._headers[i]);try{for(a.s();!(s=a.n()).done;){var u=s.value;t.push("".concat(i,"=").concat(u))}}catch(e){a.e(e)}finally{a.f()}}return t.length>0&&(n+="?".concat(t.join("&"))),n}},{key:"toAor",value:function(e){var t="".concat(this._scheme,":");return this._user&&(t+="".concat(o.escapeUser(this._user),"@")),t+=this._host,e&&(this._port||0===this._port)&&(t+=":".concat(this._port)),t}},{key:"scheme",get:function(){return this._scheme},set:function(e){this._scheme=e.toLowerCase()}},{key:"user",get:function(){return this._user},set:function(e){this._user=e}},{key:"host",get:function(){return this._host},set:function(e){this._host=e.toLowerCase()}},{key:"port",get:function(){return this._port},set:function(e){this._port=0===e?e:parseInt(e,10)||null}}]),t}(),O}function P(){if(k)return C;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}k=1;var r=l,i=x(),o=U();C.str_utf8_length=function(e){return unescape(encodeURIComponent(e)).length};var s=C.isFunction=function(e){return void 0!==e&&"[object Function]"===Object.prototype.toString.call(e)};C.isString=function(e){return void 0!==e&&"[object String]"===Object.prototype.toString.call(e)},C.isDecimal=function(e){return!isNaN(e)&&parseFloat(e)===parseInt(e,10)},C.isEmpty=function(e){return null===e||""===e||void 0===e||Array.isArray(e)&&0===e.length||"number"==typeof e&&isNaN(e)},C.hasMethods=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];if(s(e[a]))return!1}return!0};var a=C.createRandomToken=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,r="";for(t=0;t<e;t++)r+=(Math.random()*n|0).toString(n);return r};C.newTag=function(){return a(10)},C.newUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},C.hostType=function(e){if(e)return-1!==(e=o.parse(e,"host"))?e.host_type:void 0};var u=C.escapeUser=function(e){return encodeURIComponent(decodeURIComponent(e)).replace(/%3A/gi,":").replace(/%2B/gi,"+").replace(/%3F/gi,"?").replace(/%2F/gi,"/")};return C.normalizeTarget=function(e,t){if(e){if(e instanceof i)return e;if("string"==typeof e){var n,o,s,a=e.split("@");switch(a.length){case 1:if(!t)return;n=e,o=t;break;case 2:n=a[0],o=a[1];break;default:n=a.slice(0,a.length-1).join("@"),o=a[a.length-1]}return n=n.replace(/^(sips?|tel):/i,""),/^[-.()]*\+?[0-9\-.()]+$/.test(n)&&(n=n.replace(/[-.()]/g,"")),e="".concat(r.SIP,":").concat(u(n),"@").concat(o),(s=i.parse(e))?s:void 0}}else;},C.headerize=function(e){var t,n={"Call-Id":"Call-ID",Cseq:"CSeq","Www-Authenticate":"WWW-Authenticate"},r=e.toLowerCase().replace(/_/g,"-").split("-"),i="",o=r.length;for(t=0;t<o;t++)0!==t&&(i+="-"),i+=r[t].charAt(0).toUpperCase()+r[t].substring(1);return n[i]&&(i=n[i]),i},C.sipErrorCause=function(e){for(var t in r.SIP_ERROR_CAUSES)if(-1!==r.SIP_ERROR_CAUSES[t].indexOf(e))return r.causes[t];return r.causes.SIP_FAILURE_CODE},C.getRandomTestNetIP=function(){return"192.0.2.".concat(function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}(1,254))},C.calculateMD5=function(e){function t(e,t){return e<<t|e>>>32-t}function n(e,t){var n=2147483648&e,r=2147483648&t,i=1073741824&e,o=1073741824&t,s=(1073741823&e)+(1073741823&t);return i&o?2147483648^s^n^r:i|o?1073741824&s?3221225472^s^n^r:1073741824^s^n^r:s^n^r}function r(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return e&t|~e&n}(r,i,o),s),u)),n(t(e,a),r)}function i(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return e&n|t&~n}(r,i,o),s),u)),n(t(e,a),r)}function o(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return e^t^n}(r,i,o),s),u)),n(t(e,a),r)}function s(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return t^(e|~n)}(r,i,o),s),u)),n(t(e,a),r)}function a(e){var t,n="",r="";for(t=0;t<=3;t++)n+=(r="0".concat((e>>>8*t&255).toString(16))).substr(r.length-2,2);return n}var u,l,c,h,f,d,p,g,m,_;for(u=function(e){for(var t,n=e.length,r=n+8,i=16*((r-r%64)/64+1),o=new Array(i-1),s=0,a=0;a<n;)s=a%4*8,o[t=(a-a%4)/4]=o[t]|e.charCodeAt(a)<<s,a++;return s=a%4*8,o[t=(a-a%4)/4]=o[t]|128<<s,o[i-2]=n<<3,o[i-1]=n>>>29,o}(e=function(e){for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(e)),p=1732584193,g=4023233417,m=2562383102,_=271733878,l=0;l<u.length;l+=16)c=p,h=g,f=m,d=_,p=r(p,g,m,_,u[l+0],7,3614090360),_=r(_,p,g,m,u[l+1],12,3905402710),m=r(m,_,p,g,u[l+2],17,606105819),g=r(g,m,_,p,u[l+3],22,3250441966),p=r(p,g,m,_,u[l+4],7,4118548399),_=r(_,p,g,m,u[l+5],12,1200080426),m=r(m,_,p,g,u[l+6],17,2821735955),g=r(g,m,_,p,u[l+7],22,4249261313),p=r(p,g,m,_,u[l+8],7,1770035416),_=r(_,p,g,m,u[l+9],12,2336552879),m=r(m,_,p,g,u[l+10],17,4294925233),g=r(g,m,_,p,u[l+11],22,2304563134),p=r(p,g,m,_,u[l+12],7,1804603682),_=r(_,p,g,m,u[l+13],12,4254626195),m=r(m,_,p,g,u[l+14],17,2792965006),p=i(p,g=r(g,m,_,p,u[l+15],22,1236535329),m,_,u[l+1],5,4129170786),_=i(_,p,g,m,u[l+6],9,3225465664),m=i(m,_,p,g,u[l+11],14,643717713),g=i(g,m,_,p,u[l+0],20,3921069994),p=i(p,g,m,_,u[l+5],5,3593408605),_=i(_,p,g,m,u[l+10],9,38016083),m=i(m,_,p,g,u[l+15],14,3634488961),g=i(g,m,_,p,u[l+4],20,3889429448),p=i(p,g,m,_,u[l+9],5,568446438),_=i(_,p,g,m,u[l+14],9,3275163606),m=i(m,_,p,g,u[l+3],14,4107603335),g=i(g,m,_,p,u[l+8],20,1163531501),p=i(p,g,m,_,u[l+13],5,2850285829),_=i(_,p,g,m,u[l+2],9,4243563512),m=i(m,_,p,g,u[l+7],14,1735328473),p=o(p,g=i(g,m,_,p,u[l+12],20,2368359562),m,_,u[l+5],4,4294588738),_=o(_,p,g,m,u[l+8],11,2272392833),m=o(m,_,p,g,u[l+11],16,1839030562),g=o(g,m,_,p,u[l+14],23,4259657740),p=o(p,g,m,_,u[l+1],4,2763975236),_=o(_,p,g,m,u[l+4],11,1272893353),m=o(m,_,p,g,u[l+7],16,4139469664),g=o(g,m,_,p,u[l+10],23,3200236656),p=o(p,g,m,_,u[l+13],4,681279174),_=o(_,p,g,m,u[l+0],11,3936430074),m=o(m,_,p,g,u[l+3],16,3572445317),g=o(g,m,_,p,u[l+6],23,76029189),p=o(p,g,m,_,u[l+9],4,3654602809),_=o(_,p,g,m,u[l+12],11,3873151461),m=o(m,_,p,g,u[l+15],16,530742520),p=s(p,g=o(g,m,_,p,u[l+2],23,3299628645),m,_,u[l+0],6,4096336452),_=s(_,p,g,m,u[l+7],10,1126891415),m=s(m,_,p,g,u[l+14],15,2878612391),g=s(g,m,_,p,u[l+5],21,4237533241),p=s(p,g,m,_,u[l+12],6,1700485571),_=s(_,p,g,m,u[l+3],10,2399980690),m=s(m,_,p,g,u[l+10],15,4293915773),g=s(g,m,_,p,u[l+1],21,2240044497),p=s(p,g,m,_,u[l+8],6,1873313359),_=s(_,p,g,m,u[l+15],10,4264355552),m=s(m,_,p,g,u[l+6],15,2734768916),g=s(g,m,_,p,u[l+13],21,1309151649),p=s(p,g,m,_,u[l+4],6,4149444226),_=s(_,p,g,m,u[l+11],10,3174756917),m=s(m,_,p,g,u[l+2],15,718787259),g=s(g,m,_,p,u[l+9],21,3951481745),p=n(p,c),g=n(g,h),m=n(m,f),_=n(_,d);return(a(p)+a(g)+a(m)+a(_)).toLowerCase()},C.closeMediaStream=function(n){if(n)try{if(n.getTracks){var r,i=t(n.getTracks());try{for(i.s();!(r=i.n()).done;){r.value.stop()}}catch(e){i.e(e)}finally{i.f()}}else{var o,s=t(n.getAudioTracks());try{for(s.s();!(o=s.n()).done;){o.value.stop()}}catch(e){s.e(e)}finally{s.f()}var a,u=t(n.getVideoTracks());try{for(u.s();!(a=u.n()).done;){a.value.stop()}}catch(e){u.e(e)}finally{u.f()}}}catch(t){"function"!=typeof n.stop&&"object"!==e(n.stop)||n.stop()}},C.cloneArray=function(e){return e&&e.slice()||[]},C.cloneObject=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e&&Object.assign({},e)||t},C}function L(){}function B(){B.init.call(this)}function F(e){return void 0===e._maxListeners?B.defaultMaxListeners:e._maxListeners}function H(e,t,n,r){var i,o,s,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]):(o=e._events=new L,e._eventsCount=0),s){if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),!s.warned&&(i=F(e))&&i>0&&s.length>i){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=o[t]=n,++e._eventsCount;return e}function G(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function Y(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function j(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}L.prototype=Object.create(null),B.EventEmitter=B,B.usingDomains=!1,B.prototype.domain=void 0,B.prototype._events=void 0,B.prototype._maxListeners=void 0,B.defaultMaxListeners=10,B.init=function(){this.domain=null,B.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new L,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},B.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},B.prototype.getMaxListeners=function(){return F(this)},B.prototype.emit=function(e){var t,n,r,i,o,s,a,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(n=s[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=j(e,r),o=0;o<r;++o)i[o].call(n)}(n,c,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=j(e,i),s=0;s<i;++s)o[s].call(n,r)}(n,c,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,s=j(e,o),a=0;a<o;++a)s[a].call(n,r,i)}(n,c,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var s=e.length,a=j(e,s),u=0;u<s;++u)a[u].call(n,r,i,o)}(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=j(e,i),s=0;s<i;++s)o[s].apply(n,r)}(n,c,this,i)}return!0},B.prototype.addListener=function(e,t){return H(this,e,t,!1)},B.prototype.on=B.prototype.addListener,B.prototype.prependListener=function(e,t){return H(this,e,t,!0)},B.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,G(this,e,t)),this},B.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,G(this,e,t)),this},B.prototype.removeListener=function(e,t){var n,r,i,o,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new L:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new L,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,s||t)}return this},B.prototype.off=function(e,t){return this.removeListener(e,t)},B.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new L,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new L:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new L,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},B.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},B.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Y.call(e,t)},B.prototype.listenerCount=Y,B.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Q=s(Object.freeze({__proto__:null,EventEmitter:B,default:B})),W="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var J=K,V=z;function Z(e){if(J===setTimeout)return setTimeout(e,0);if((J===K||!J)&&setTimeout)return J=setTimeout,setTimeout(e,0);try{return J(e,0)}catch(t){try{return J.call(null,e,0)}catch(t){return J.call(this,e,0)}}}"function"==typeof W.setTimeout&&(J=setTimeout),"function"==typeof W.clearTimeout&&(V=clearTimeout);var X,$=[],ee=!1,te=-1;function ne(){ee&&X&&(ee=!1,X.length?$=X.concat($):te=-1,$.length&&re())}function re(){if(!ee){var e=Z(ne);ee=!0;for(var t=$.length;t;){for(X=$,$=[];++te<t;)X&&X[te].run();te=-1,t=$.length}X=null,ee=!1,function(e){if(V===clearTimeout)return clearTimeout(e);if((V===z||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(e);try{return V(e)}catch(t){try{return V.call(null,e)}catch(t){return V.call(this,e)}}}(e)}}function ie(e,t){this.fun=e,this.array=t}ie.prototype.run=function(){this.fun.apply(null,this.array)};function oe(){}var se=oe,ae=oe,ue=oe,le=oe,ce=oe,he=oe,fe=oe;var de=W.performance||{},pe=de.now||de.mozNow||de.msNow||de.oNow||de.webkitNow||function(){return(new Date).getTime()};var ge=new Date;var me,_e,Ae,ve,ye,Te={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];$.push(new ie(e,t)),1!==$.length||ee||Z(re)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:se,addListener:ae,once:ue,off:le,removeListener:ce,removeAllListeners:he,emit:fe,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*pe.call(de),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ge)/1e3}},Se={exports:{}},Ee={exports:{}};function Ce(){if(_e)return me;_e=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return me=function(a,u){u=u||{};var l=typeof a;if("string"===l&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*r;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*t;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(a);if("number"===l&&isFinite(a))return u.long?function(i){var o=Math.abs(i);if(o>=r)return s(i,o,r,"day");if(o>=n)return s(i,o,n,"hour");if(o>=t)return s(i,o,t,"minute");if(o>=e)return s(i,o,e,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},me}function we(){if(ve)return Ae;return ve=1,Ae=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Ce(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},Ae}var be={exports:{}};function Ie(){return!1}function Re(){throw new Error("tty.ReadStream is not implemented")}function Oe(){throw new Error("tty.ReadStream is not implemented")}var De={isatty:Ie,ReadStream:Re,WriteStream:Oe},ke=s(Object.freeze({__proto__:null,ReadStream:Re,WriteStream:Oe,default:De,isatty:Ie})),Me=[],qe=[],Ne="undefined"!=typeof Uint8Array?Uint8Array:Array,Ue=!1;function xe(){Ue=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Me[t]=e[t],qe[e.charCodeAt(t)]=t;qe["-".charCodeAt(0)]=62,qe["_".charCodeAt(0)]=63}function Pe(e,t,n){for(var r,i,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(Me[(i=r)>>18&63]+Me[i>>12&63]+Me[i>>6&63]+Me[63&i]);return o.join("")}function Le(e){var t;Ue||xe();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(Pe(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=Me[t>>2],i+=Me[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Me[t>>10],i+=Me[t>>4&63],i+=Me[t<<2&63],i+="="),o.push(i),o.join("")}function Be(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,l=u>>1,c=-7,h=n?i-1:0,f=n?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=l}return(d?-1:1)*s*Math.pow(2,o-r)}function Fe(e,t,n,r,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[n+d]=255&s,d+=p,s/=256,l-=8);e[n+d-p]|=128*g}var He={}.toString,Ge=Array.isArray||function(e){return"[object Array]"==He.call(e)};function Ye(){return Qe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function je(e,t){if(Ye()<t)throw new RangeError("Invalid typed array length");return Qe.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Qe.prototype:(null===e&&(e=new Qe(t)),e.length=t),e}function Qe(e,t,n){if(!(Qe.TYPED_ARRAY_SUPPORT||this instanceof Qe))return new Qe(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return ze(this,e)}return We(this,e,t,n)}function We(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Qe.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Qe.prototype:e=Je(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Qe.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Xe(t,n);e=je(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(Ze(t)){var n=0|Ve(t.length);return 0===(e=je(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?je(e,0):Je(e,t);if("Buffer"===t.type&&Ge(t.data))return Je(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Ke(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function ze(e,t){if(Ke(t),e=je(e,t<0?0:0|Ve(t)),!Qe.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Je(e,t){var n=t.length<0?0:0|Ve(t.length);e=je(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Ve(e){if(e>=Ye())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ye().toString(16)+" bytes");return 0|e}function Ze(e){return!(null==e||!e._isBuffer)}function Xe(e,t){if(Ze(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return wt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return bt(e).length;default:if(r)return wt(e).length;t=(""+t).toLowerCase(),r=!0}}function $e(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return pt(this,t,n);case"utf8":case"utf-8":return ct(this,t,n);case"ascii":return ft(this,t,n);case"latin1":case"binary":return dt(this,t,n);case"base64":return lt(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gt(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function et(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function tt(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Qe.from(t,r)),Ze(t))return 0===t.length?-1:nt(e,t,n,r,i);if("number"==typeof t)return t&=255,Qe.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):nt(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function nt(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=n;o<a;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(l(e,o+f)!==l(t,f)){h=!1;break}if(h)return o}return-1}function rt(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function it(e,t,n,r){return It(wt(t,e.length-n),e,n,r)}function ot(e,t,n,r){return It(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function st(e,t,n,r){return ot(e,t,n,r)}function at(e,t,n,r){return It(bt(t),e,n,r)}function ut(e,t,n,r){return It(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function lt(e,t,n){return 0===t&&n===e.length?Le(e):Le(e.slice(t,n))}function ct(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=ht)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ht));return n}(r)}Qe.TYPED_ARRAY_SUPPORT=void 0===W.TYPED_ARRAY_SUPPORT||W.TYPED_ARRAY_SUPPORT,Ye(),Qe.poolSize=8192,Qe._augment=function(e){return e.__proto__=Qe.prototype,e},Qe.from=function(e,t,n){return We(null,e,t,n)},Qe.TYPED_ARRAY_SUPPORT&&(Qe.prototype.__proto__=Uint8Array.prototype,Qe.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Qe[Symbol.species]),Qe.alloc=function(e,t,n){return function(e,t,n,r){return Ke(t),t<=0?je(e,t):void 0!==n?"string"==typeof r?je(e,t).fill(n,r):je(e,t).fill(n):je(e,t)}(null,e,t,n)},Qe.allocUnsafe=function(e){return ze(null,e)},Qe.allocUnsafeSlow=function(e){return ze(null,e)},Qe.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Rt(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Rt(e.slice(0,0))}(e))},Qe.compare=function(e,t){if(!Ze(e)||!Ze(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},Qe.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Qe.concat=function(e,t){if(!Ge(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Qe.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Qe.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!Ze(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Qe.byteLength=Xe,Qe.prototype._isBuffer=!0,Qe.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)et(this,t,t+1);return this},Qe.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)et(this,t,t+3),et(this,t+1,t+2);return this},Qe.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)et(this,t,t+7),et(this,t+1,t+6),et(this,t+2,t+5),et(this,t+3,t+4);return this},Qe.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?ct(this,0,e):$e.apply(this,arguments)},Qe.prototype.equals=function(e){if(!Ze(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Qe.compare(this,e)},Qe.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Qe.prototype.compare=function(e,t,n,r,i){if(!Ze(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n),c=0;c<a;++c)if(u[c]!==l[c]){o=u[c],s=l[c];break}return o<s?-1:s<o?1:0},Qe.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Qe.prototype.indexOf=function(e,t,n){return tt(this,e,t,n,!0)},Qe.prototype.lastIndexOf=function(e,t,n){return tt(this,e,t,n,!1)},Qe.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return rt(this,e,t,n);case"utf8":case"utf-8":return it(this,e,t,n);case"ascii":return ot(this,e,t,n);case"latin1":case"binary":return st(this,e,t,n);case"base64":return at(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Qe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ht=4096;function ft(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function dt(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function pt(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=Ct(e[o]);return i}function gt(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function mt(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function _t(e,t,n,r,i,o){if(!Ze(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function At(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function vt(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function yt(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Tt(e,t,n,r,i){return i||yt(e,0,n,4),Fe(e,t,n,r,23,4),n+4}function St(e,t,n,r,i){return i||yt(e,0,n,8),Fe(e,t,n,r,52,8),n+8}Qe.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Qe.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Qe.prototype;else{var i=t-e;n=new Qe(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},Qe.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||mt(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},Qe.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||mt(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},Qe.prototype.readUInt8=function(e,t){return t||mt(e,1,this.length),this[e]},Qe.prototype.readUInt16LE=function(e,t){return t||mt(e,2,this.length),this[e]|this[e+1]<<8},Qe.prototype.readUInt16BE=function(e,t){return t||mt(e,2,this.length),this[e]<<8|this[e+1]},Qe.prototype.readUInt32LE=function(e,t){return t||mt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Qe.prototype.readUInt32BE=function(e,t){return t||mt(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Qe.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||mt(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Qe.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||mt(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Qe.prototype.readInt8=function(e,t){return t||mt(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Qe.prototype.readInt16LE=function(e,t){t||mt(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Qe.prototype.readInt16BE=function(e,t){t||mt(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Qe.prototype.readInt32LE=function(e,t){return t||mt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Qe.prototype.readInt32BE=function(e,t){return t||mt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Qe.prototype.readFloatLE=function(e,t){return t||mt(e,4,this.length),Be(this,e,!0,23,4)},Qe.prototype.readFloatBE=function(e,t){return t||mt(e,4,this.length),Be(this,e,!1,23,4)},Qe.prototype.readDoubleLE=function(e,t){return t||mt(e,8,this.length),Be(this,e,!0,52,8)},Qe.prototype.readDoubleBE=function(e,t){return t||mt(e,8,this.length),Be(this,e,!1,52,8)},Qe.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||_t(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},Qe.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||_t(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Qe.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,1,255,0),Qe.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Qe.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,2,65535,0),Qe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):At(this,e,t,!0),t+2},Qe.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,2,65535,0),Qe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):At(this,e,t,!1),t+2},Qe.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,4,4294967295,0),Qe.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):vt(this,e,t,!0),t+4},Qe.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,4,4294967295,0),Qe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):vt(this,e,t,!1),t+4},Qe.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);_t(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Qe.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);_t(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Qe.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,1,127,-128),Qe.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Qe.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,2,32767,-32768),Qe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):At(this,e,t,!0),t+2},Qe.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,2,32767,-32768),Qe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):At(this,e,t,!1),t+2},Qe.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,4,2147483647,-2147483648),Qe.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):vt(this,e,t,!0),t+4},Qe.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||_t(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Qe.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):vt(this,e,t,!1),t+4},Qe.prototype.writeFloatLE=function(e,t,n){return Tt(this,e,t,!0,n)},Qe.prototype.writeFloatBE=function(e,t,n){return Tt(this,e,t,!1,n)},Qe.prototype.writeDoubleLE=function(e,t,n){return St(this,e,t,!0,n)},Qe.prototype.writeDoubleBE=function(e,t,n){return St(this,e,t,!1,n)},Qe.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!Qe.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},Qe.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Qe.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=Ze(e)?e:wt(new Qe(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Et=/[^+\/0-9A-Za-z-_]/g;function Ct(e){return e<16?"0"+e.toString(16):e.toString(16)}function wt(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function bt(e){return function(e){var t,n,r,i,o,s;Ue||xe();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new Ne(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=qe[e.charCodeAt(t)]<<18|qe[e.charCodeAt(t+1)]<<12|qe[e.charCodeAt(t+2)]<<6|qe[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=qe[e.charCodeAt(t)]<<2|qe[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=qe[e.charCodeAt(t)]<<10|qe[e.charCodeAt(t+1)]<<4|qe[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Et,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function It(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Rt(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Ot="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},Dt=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},kt=/%[sdj%]/g;function Mt(e){if(!zt(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(Pt(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(kt,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<i;s=r[++n])Qt(s)||!Xt(s)?o+=" "+s:o+=" "+Pt(s);return o}function qt(e,t){if(Vt(W.process))return function(){return qt(e,t).apply(this,arguments)};if(!0===Te.noDeprecation)return e;var n=!1;return function(){if(!n){if(Te.throwDeprecation)throw new Error(t);Te.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var Nt,Ut={};function xt(e){if(Vt(Nt)&&(Nt=Te.env.NODE_DEBUG||""),e=e.toUpperCase(),!Ut[e])if(new RegExp("\\b"+e+"\\b","i").test(Nt)){Ut[e]=function(){var t=Mt.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Ut[e]=function(){};return Ut[e]}function Pt(e,t){var n={seen:[],stylize:Bt};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),jt(t)?n.showHidden=t:t&&ln(n,t),Vt(n.showHidden)&&(n.showHidden=!1),Vt(n.depth)&&(n.depth=2),Vt(n.colors)&&(n.colors=!1),Vt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Lt),Ft(n,e,n.depth)}function Lt(e,t){var n=Pt.styles[t];return n?"["+Pt.colors[n][0]+"m"+e+"["+Pt.colors[n][1]+"m":e}function Bt(e,t){return e}function Ft(e,t,n){if(e.customInspect&&t&&tn(t.inspect)&&t.inspect!==Pt&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return zt(r)||(r=Ft(e,r,n)),r}var i=function(e,t){if(Vt(t))return e.stylize("undefined","undefined");if(zt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(Kt(t))return e.stylize(""+t,"number");if(jt(t))return e.stylize(""+t,"boolean");if(Qt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),en(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ht(t);if(0===o.length){if(tn(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Zt(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if($t(t))return e.stylize(Date.prototype.toString.call(t),"date");if(en(t))return Ht(t)}var u,l="",c=!1,h=["{","}"];(Yt(t)&&(c=!0,h=["[","]"]),tn(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return Zt(t)&&(l=" "+RegExp.prototype.toString.call(t)),$t(t)&&(l=" "+Date.prototype.toUTCString.call(t)),en(t)&&(l=" "+Ht(t)),0!==o.length||c&&0!=t.length?n<0?Zt(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=c?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)cn(t,String(s))?o.push(Gt(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Gt(e,t,n,r,i,!0))})),o}(e,t,n,s,o):o.map((function(r){return Gt(e,t,n,s,r,c)})),e.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,h)):h[0]+l+h[1]}function Ht(e){return"["+Error.prototype.toString.call(e)+"]"}function Gt(e,t,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),cn(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=Qt(n)?Ft(e,u.value,null):Ft(e,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),Vt(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function Yt(e){return Array.isArray(e)}function jt(e){return"boolean"==typeof e}function Qt(e){return null===e}function Wt(e){return null==e}function Kt(e){return"number"==typeof e}function zt(e){return"string"==typeof e}function Jt(e){return"symbol"==typeof e}function Vt(e){return void 0===e}function Zt(e){return Xt(e)&&"[object RegExp]"===on(e)}function Xt(e){return"object"==typeof e&&null!==e}function $t(e){return Xt(e)&&"[object Date]"===on(e)}function en(e){return Xt(e)&&("[object Error]"===on(e)||e instanceof Error)}function tn(e){return"function"==typeof e}function nn(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function rn(e){return Qe.isBuffer(e)}function on(e){return Object.prototype.toString.call(e)}function sn(e){return e<10?"0"+e.toString(10):e.toString(10)}Pt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Pt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var an=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function un(){var e,t;console.log("%s - %s",(e=new Date,t=[sn(e.getHours()),sn(e.getMinutes()),sn(e.getSeconds())].join(":"),[e.getDate(),an[e.getMonth()],t].join(" ")),Mt.apply(null,arguments))}function ln(e,t){if(!t||!Xt(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function cn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var hn="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function fn(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(hn&&e[hn]){var t;if("function"!=typeof(t=e[hn]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,hn,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),hn&&Object.defineProperty(t,hn,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,Dt(e))}function dn(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}function pn(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if("function"!=typeof r)throw new TypeError("The last argument must be of type Function");var i=this,o=function(){return r.apply(i,arguments)};e.apply(this,t).then((function(e){Te.nextTick(o.bind(null,null,e))}),(function(e){Te.nextTick(dn.bind(null,e,o))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Dt(e)),t}fn.custom=hn;var gn,mn={inherits:Ot,_extend:ln,log:un,isBuffer:rn,isPrimitive:nn,isFunction:tn,isError:en,isDate:$t,isObject:Xt,isRegExp:Zt,isUndefined:Vt,isSymbol:Jt,isString:zt,isNumber:Kt,isNullOrUndefined:Wt,isNull:Qt,isBoolean:jt,isArray:Yt,inspect:Pt,deprecate:qt,format:Mt,debuglog:xt,promisify:fn,callbackify:pn},_n=s(Object.freeze({__proto__:null,_extend:ln,callbackify:pn,debuglog:xt,default:mn,deprecate:qt,format:Mt,inherits:Ot,inspect:Pt,isArray:Yt,isBoolean:jt,isBuffer:rn,isDate:$t,isError:en,isFunction:tn,isNull:Qt,isNullOrUndefined:Wt,isNumber:Kt,isObject:Xt,isPrimitive:nn,isRegExp:Zt,isString:zt,isSymbol:Jt,isUndefined:Vt,log:un,promisify:fn}));function An(){if(void 0===gn){var e=new ArrayBuffer(2),t=new Uint8Array(e),n=new Uint16Array(e);if(t[0]=1,t[1]=2,258===n[0])gn="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");gn="LE"}}return gn}function vn(){return void 0!==W.location?W.location.hostname:""}function yn(){return[]}function Tn(){return 0}function Sn(){return Number.MAX_VALUE}function En(){return Number.MAX_VALUE}function Cn(){return[]}function wn(){return"Browser"}function bn(){return void 0!==W.navigator?W.navigator.appVersion:""}function In(){return{}}function Rn(){return{}}function On(){return"javascript"}function Dn(){return"browser"}function kn(){return"/tmp"}var Mn=kn;function qn(){return"$HOME"}var Nn,Un,xn,Pn,Ln,Bn={homedir:qn,EOL:"\n",arch:On,platform:Dn,tmpdir:Mn,tmpDir:kn,networkInterfaces:In,getNetworkInterfaces:Rn,release:bn,type:wn,cpus:Cn,totalmem:En,freemem:Sn,uptime:Tn,loadavg:yn,hostname:vn,endianness:An},Fn=s(Object.freeze({__proto__:null,EOL:"\n",arch:On,cpus:Cn,default:Bn,endianness:An,freemem:Sn,getNetworkInterfaces:Rn,homedir:qn,hostname:vn,loadavg:yn,networkInterfaces:In,platform:Dn,release:bn,tmpDir:kn,tmpdir:Mn,totalmem:En,type:wn,uptime:Tn}));function Hn(){return Un||(Un=1,Nn=(e,t=Te.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r<i)}),Nn}void 0===Te||"renderer"===Te.type||!0===Te.browser||Te.__nwjs?Se.exports=(ye||(ye=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==Te&&"env"in Te&&(e=Te.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=we()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ee,Ee.exports)),Ee.exports):Se.exports=(Ln||(Ln=1,function(e,t){const n=ke,r=_n;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return Te.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),o=` ${i};1m${r} [0m`;n[0]=o+n[0].split("\n").join("\n"+o),n.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?Te.env.DEBUG=e:delete Te.env.DEBUG},t.load=function(){return Te.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(Te.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if(Pn)return xn;Pn=1;const e=Fn,t=ke,n=Hn(),{env:r}=Te;let i;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(t,o){if(0===i)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===i)return 0;const s=i||0;if("dumb"===r.TERM)return s;if("win32"===Te.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:s;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:s}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?i=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(i=1),"FORCE_COLOR"in r&&(i="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),xn={supportsColor:function(e){return o(s(e,e&&e.isTTY))},stdout:o(s(!0,t.isatty(1))),stderr:o(s(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(Te.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=Te.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=we()(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(be,be.exports)),be.exports);var Gn=Se.exports;function Yn(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var jn=Gn,Qn="JsSIP",Wn=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t?(this._debug=jn.default("".concat(Qn,":").concat(t)),this._warn=jn.default("".concat(Qn,":WARN:").concat(t)),this._error=jn.default("".concat(Qn,":ERROR:").concat(t))):(this._debug=jn.default(Qn),this._warn=jn.default("".concat(Qn,":WARN")),this._error=jn.default("".concat(Qn,":ERROR"))),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}return Yn(e,[{key:"debug",get:function(){return this._debug}},{key:"warn",get:function(){return this._warn}},{key:"error",get:function(){return this._error}}]),e}(),Kn={},zn={},Jn={exports:{}},Vn=Jn.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(Vn).forEach((function(e){Vn[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}));var Zn=Jn.exports;!function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,r){var i=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:i&&!n[e.name]&&(n[e.name]={});var o=e.push?{}:i?n[e.name]:n;!function(e,n,r,i){if(i&&!r)n[i]=t(e[1]);else for(var o=0;o<r.length;o+=1)null!=e[o+1]&&(n[r[o]]=t(e[o+1]))}(r.match(e.reg),o,e.names,e.name),e.push&&n[e.push].push(o)},r=Zn,i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],s=t;return e.split(/(\r\n|\r|\n)/).filter(i).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),s=o[o.length-1]);for(var a=0;a<(r[t]||[]).length;a+=1){var u=r[t][a];if(u.reg.test(i))return n(u,s,i)}})),t.media=o,t};var o=function(e,n){var r=n.split(/=(.+)/,2);return 2===r.length?e[r[0]]=t(r[1]):1===r.length&&n.length>1&&(e[r[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],r=e.split(" ").map(t),i=0;i<r.length;i+=3)n.push({component:r[i],ip:r[i+1],port:r[i+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,r=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),r=!0),{scid:n,paused:r}}))}))}}(zn);var Xn=Zn,$n=/%[sdv%]/g,er=function(e){var t=1,n=arguments,r=n.length;return e.replace($n,(function(e){if(t>=r)return e;var i=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},tr=function(e,t,n){var r=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var i=0;i<t.names.length;i+=1){var o=t.names[i];t.name?r.push(n[t.name][o]):r.push(n[t.names[i]])}else r.push(n[t.name]);return er.apply(null,r)},nr=["v","o","s","i","u","e","p","c","b","t","r","z","a"],rr=["i","c","b","a"],ir=zn,or=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||nr,r=t.innerOrder||rr,i=[];return n.forEach((function(t){Xn[t].forEach((function(n){n.name in e&&null!=e[n.name]?i.push(tr(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){i.push(tr(t,n,e))}))}))})),e.media.forEach((function(e){i.push(tr("m",Xn.m[0],e)),r.forEach((function(t){Xn[t].forEach((function(n){n.name in e&&null!=e[n.name]?i.push(tr(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){i.push(tr(t,n,e))}))}))}))})),i.join("\r\n")+"\r\n"};function sr(e){return sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sr(e)}function ar(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ur(e,t)}function ur(e,t){return ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ur(e,t)}function lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cr(e);if(t){var i=cr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===sr(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function hr(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fr(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pr(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}Kn.write=or,Kn.parse=ir.parse,Kn.parseParams=ir.parseParams,Kn.parseFmtpConfig=ir.parseFmtpConfig,Kn.parsePayloads=ir.parsePayloads,Kn.parseRemoteCandidates=ir.parseRemoteCandidates,Kn.parseImageAttributes=ir.parseImageAttributes,Kn.parseSimulcastStreamList=ir.parseSimulcastStreamList;var gr=Kn,mr=Wn,_r=l,Ar=P(),vr=N,yr=U(),Tr=new mr("SIPMessage"),Sr=function(){function e(t,n,r,i,o,s){if(dr(this,e),!t||!n||!r)return null;i=i||{},this.ua=r,this.headers={},this.method=t,this.ruri=n,this.body=s,this.extraHeaders=Ar.cloneArray(o),this.ua.configuration.extra_headers&&(this.extraHeaders=this.extraHeaders.concat(this.ua.configuration.extra_headers)),i.route_set?this.setHeader("route",i.route_set):r.configuration.use_preloaded_route&&this.setHeader("route","<".concat(r.transport.sip_uri,";lr>")),this.setHeader("via",""),this.setHeader("max-forwards",_r.MAX_FORWARDS);var a=i.to_uri||n,u=i.to_tag?{tag:i.to_tag}:null,l=void 0!==i.to_display_name?i.to_display_name:null;this.to=new vr(a,l,u),this.setHeader("to",this.to.toString());var c,h=i.from_uri||r.configuration.uri,f={tag:i.from_tag||Ar.newTag()};c=void 0!==i.from_display_name?i.from_display_name:r.configuration.display_name?r.configuration.display_name:null,this.from=new vr(h,c,f),this.setHeader("from",this.from.toString());var d=i.call_id||r.configuration.jssip_id+Ar.createRandomToken(15);this.call_id=d,this.setHeader("call-id",d);var p=i.cseq||Math.floor(1e4*Math.random());this.cseq=p,this.setHeader("cseq","".concat(p," ").concat(t))}return pr(e,[{key:"setHeader",value:function(e,t){for(var n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=0;r<this.extraHeaders.length;r++)n.test(this.extraHeaders[r])&&this.extraHeaders.splice(r,1);this.headers[Ar.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){var t=this.headers[Ar.headerize(e)];if(t){if(t[0])return t[0]}else{var n,r=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),i=hr(this.extraHeaders);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r.test(o))return o.substring(o.indexOf(":")+1).trim()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"getHeaders",value:function(e){var t=this.headers[Ar.headerize(e)],n=[];if(t){var r,i=hr(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.push(o)}}catch(e){i.e(e)}finally{i.f()}return n}var s,a=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),u=hr(this.extraHeaders);try{for(u.s();!(s=u.n()).done;){var l=s.value;a.test(l)&&n.push(l.substring(l.indexOf(":")+1).trim())}}catch(e){u.e(e)}finally{u.f()}return n}},{key:"hasHeader",value:function(e){if(this.headers[Ar.headerize(e)])return!0;var t,n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=hr(this.extraHeaders);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(n.test(i))return!0}}catch(e){r.e(e)}finally{r.f()}return!1}},{key:"parseSDP",value:function(e){return!e&&this.sdp||(this.sdp=gr.parse(this.body||"")),this.sdp}},{key:"toString",value:function(){var e="".concat(this.method," ").concat(this.ruri," SIP/2.0\r\n");for(var t in this.headers)if(Object.prototype.hasOwnProperty.call(this.headers,t)){var n,r=hr(this.headers[t]);try{for(r.s();!(n=r.n()).done;){var i=n.value;e+="".concat(t,": ").concat(i,"\r\n")}}catch(e){r.e(e)}finally{r.f()}}var o,s=hr(this.extraHeaders);try{for(s.s();!(o=s.n()).done;){var a=o.value;e+="".concat(a.trim(),"\r\n")}}catch(e){s.e(e)}finally{s.f()}var u=[];switch(this.method){case _r.REGISTER:u.push("path","gruu");break;case _r.INVITE:this.ua.configuration.session_timers&&u.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&u.push("gruu"),u.push("ice","replaces");break;case _r.UPDATE:this.ua.configuration.session_timers&&u.push("timer"),u.push("ice")}u.push("outbound");var l=this.ua.configuration.user_agent||_r.USER_AGENT;if(e+="Allow: ".concat(_r.ALLOWED_METHODS,"\r\n"),e+="Supported: ".concat(u,"\r\n"),e+="User-Agent: ".concat(l,"\r\n"),this.body){var c=Ar.str_utf8_length(this.body);e+="Content-Length: ".concat(c,"\r\n\r\n"),e+=this.body}else e+="Content-Length: 0\r\n\r\n";return e}},{key:"clone",value:function(){var t=new e(this.method,this.ruri,this.ua);return Object.keys(this.headers).forEach((function(e){t.headers[e]=this.headers[e].slice()}),this),t.body=this.body,t.extraHeaders=Ar.cloneArray(this.extraHeaders),t.to=this.to,t.from=this.from,t.call_id=this.call_id,t.cseq=this.cseq,t}}]),e}(),Er=function(){ar(t,Sr);var e=lr(t);function t(n,r,i,o,s){var a;return dr(this,t),(a=e.call(this,_r.INVITE,n,r,i,o,s)).transaction=null,a}return pr(t,[{key:"cancel",value:function(e){this.transaction.cancel(e)}},{key:"clone",value:function(){var e=new t(this.ruri,this.ua);return Object.keys(this.headers).forEach((function(t){e.headers[t]=this.headers[t].slice()}),this),e.body=this.body,e.extraHeaders=Ar.cloneArray(this.extraHeaders),e.to=this.to,e.from=this.from,e.call_id=this.call_id,e.cseq=this.cseq,e.transaction=this.transaction,e}}]),t}(),Cr=function(){function e(){dr(this,e),this.data=null,this.headers=null,this.method=null,this.via=null,this.via_branch=null,this.call_id=null,this.cseq=null,this.from=null,this.from_tag=null,this.to=null,this.to_tag=null,this.body=null,this.sdp=null}return pr(e,[{key:"addHeader",value:function(e,t){var n={raw:t};e=Ar.headerize(e),this.headers[e]?this.headers[e].push(n):this.headers[e]=[n]}},{key:"getHeader",value:function(e){var t=this.headers[Ar.headerize(e)];if(t)return t[0]?t[0].raw:void 0}},{key:"getHeaders",value:function(e){var t=this.headers[Ar.headerize(e)],n=[];if(!t)return[];var r,i=hr(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.push(o.raw)}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"hasHeader",value:function(e){return!!this.headers[Ar.headerize(e)]}},{key:"parseHeader",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e=Ar.headerize(e),this.headers[e]){if(!(t>=this.headers[e].length)){var n=this.headers[e][t],r=n.raw;if(n.parsed)return n.parsed;var i=yr.parse(r,e.replace(/-/g,"_"));return-1===i?(this.headers[e].splice(t,1),void Tr.debug('error parsing "'.concat(e,'" header field with value "').concat(r,'"'))):(n.parsed=i,i)}Tr.debug('not so many "'.concat(e,'" headers present'))}else Tr.debug('header "'.concat(e,'" not present'))}},{key:"s",value:function(e,t){return this.parseHeader(e,t)}},{key:"setHeader",value:function(e,t){var n={raw:t};this.headers[Ar.headerize(e)]=[n]}},{key:"parseSDP",value:function(e){return!e&&this.sdp||(this.sdp=gr.parse(this.body||"")),this.sdp}},{key:"toString",value:function(){return this.data}}]),e}(),wr=function(){ar(t,Cr);var e=lr(t);function t(n){var r;return dr(this,t),(r=e.call(this)).ua=n,r.headers={},r.ruri=null,r.transport=null,r.server_transaction=null,r}return pr(t,[{key:"reply",value:function(e,t,n,r,i,o){var s=[],a=this.getHeader("To");if(t=t||null,!(e=e||null)||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||_r.REASON_PHRASE[e]||"",n=Ar.cloneArray(n),this.ua.configuration.extra_headers&&(n=n.concat(this.ua.configuration.extra_headers));var u="SIP/2.0 ".concat(e," ").concat(t,"\r\n");if(this.method===_r.INVITE&&e>100&&e<=200){var l,c=hr(this.getHeaders("record-route"));try{for(c.s();!(l=c.n()).done;){var h=l.value;u+="Record-Route: ".concat(h,"\r\n")}}catch(e){c.e(e)}finally{c.f()}}var f,d=hr(this.getHeaders("via"));try{for(d.s();!(f=d.n()).done;){var p=f.value;u+="Via: ".concat(p,"\r\n")}}catch(e){d.e(e)}finally{d.f()}!this.to_tag&&e>100?a+=";tag=".concat(Ar.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(a+=";tag=".concat(this.to_tag)),u+="To: ".concat(a,"\r\n"),u+="From: ".concat(this.getHeader("From"),"\r\n"),u+="Call-ID: ".concat(this.call_id,"\r\n"),u+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n");var g,m=hr(n);try{for(m.s();!(g=m.n()).done;){var _=g.value;u+="".concat(_.trim(),"\r\n")}}catch(e){m.e(e)}finally{m.f()}switch(this.method){case _r.INVITE:this.ua.configuration.session_timers&&s.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&s.push("gruu"),s.push("ice","replaces");break;case _r.UPDATE:this.ua.configuration.session_timers&&s.push("timer"),r&&s.push("ice"),s.push("replaces")}if(s.push("outbound"),this.method===_r.OPTIONS?(u+="Allow: ".concat(_r.ALLOWED_METHODS,"\r\n"),u+="Accept: ".concat(_r.ACCEPTED_BODY_TYPES,"\r\n")):405===e?u+="Allow: ".concat(_r.ALLOWED_METHODS,"\r\n"):415===e&&(u+="Accept: ".concat(_r.ACCEPTED_BODY_TYPES,"\r\n")),u+="Supported: ".concat(s,"\r\n"),r){var A=Ar.str_utf8_length(r);u+="Content-Type: application/sdp\r\n",u+="Content-Length: ".concat(A,"\r\n\r\n"),u+=r}else u+="Content-Length: ".concat(0,"\r\n\r\n");this.server_transaction.receiveResponse(e,u,i,o)}},{key:"reply_sl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getHeaders("via");if(!e||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||_r.REASON_PHRASE[e]||"";var r,i="SIP/2.0 ".concat(e," ").concat(t,"\r\n"),o=hr(n);try{for(o.s();!(r=o.n()).done;){var s=r.value;i+="Via: ".concat(s,"\r\n")}}catch(e){o.e(e)}finally{o.f()}var a=this.getHeader("To");if(!this.to_tag&&e>100?a+=";tag=".concat(Ar.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(a+=";tag=".concat(this.to_tag)),i+="To: ".concat(a,"\r\n"),i+="From: ".concat(this.getHeader("From"),"\r\n"),i+="Call-ID: ".concat(this.call_id,"\r\n"),i+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n"),this.ua.configuration.extra_headers){var u,l=hr(this.ua.configuration.extra_headers);try{for(l.s();!(u=l.n()).done;){var c=u.value;i+="".concat(c.trim(),"\r\n")}}catch(e){l.e(e)}finally{l.f()}}i+="Content-Length: ".concat(0,"\r\n\r\n"),this.transport.send(i)}}]),t}(),br={OutgoingRequest:Sr,InitialOutgoingInviteRequest:Er,IncomingRequest:wr,IncomingResponse:function(){ar(t,Cr);var e=lr(t);function t(){var n;return dr(this,t),(n=e.call(this)).headers={},n.status_code=null,n.reason_phrase=null,n}return t}()};function Ir(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var Rr=Wn,Or=P(),Dr=new Rr("DigestAuthentication"),kr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._credentials=t,this._cnonce=null,this._nc=0,this._ncHex="00000000",this._algorithm=null,this._realm=null,this._nonce=null,this._opaque=null,this._stale=null,this._qop=null,this._method=null,this._uri=null,this._ha1=null,this._response=null}return Ir(e,[{key:"get",value:function(e){switch(e){case"realm":return this._realm;case"ha1":return this._ha1;default:return void Dr.warn('get() | cannot get "%s" parameter',e)}}},{key:"authenticate",value:function(e,t){var n=e.method,r=e.ruri,i=e.body,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this._algorithm=t.algorithm,this._realm=t.realm,this._nonce=t.nonce,this._opaque=t.opaque,this._stale=t.stale,this._algorithm){if("MD5"!==this._algorithm)return Dr.warn('authenticate() | challenge with Digest algorithm different than "MD5", authentication aborted'),!1}else this._algorithm="MD5";if(!this._nonce)return Dr.warn("authenticate() | challenge without Digest nonce, authentication aborted"),!1;if(!this._realm)return Dr.warn("authenticate() | challenge without Digest realm, authentication aborted"),!1;if(!this._credentials.password){if(!this._credentials.ha1)return Dr.warn("authenticate() | no plain SIP password nor ha1 provided, authentication aborted"),!1;if(this._credentials.realm!==this._realm)return Dr.warn('authenticate() | no plain SIP password, and stored `realm` does not match the given `realm`, cannot authenticate [stored:"%s", given:"%s"]',this._credentials.realm,this._realm),!1}if(t.qop)if(t.qop.indexOf("auth-int")>-1)this._qop="auth-int";else{if(!(t.qop.indexOf("auth")>-1))return Dr.warn('authenticate() | challenge without Digest qop different than "auth" or "auth-int", authentication aborted'),!1;this._qop="auth"}else this._qop=null;this._method=n,this._uri=r,this._cnonce=o||Or.createRandomToken(12),this._nc+=1;var s,a,u=Number(this._nc).toString(16);return this._ncHex="00000000".substr(0,8-u.length)+u,4294967296===this._nc&&(this._nc=1,this._ncHex="00000001"),this._credentials.password?this._ha1=Or.calculateMD5("".concat(this._credentials.username,":").concat(this._realm,":").concat(this._credentials.password)):this._ha1=this._credentials.ha1,"auth"===this._qop?(s="".concat(this._method,":").concat(this._uri),a=Or.calculateMD5(s),Dr.debug('authenticate() | using qop=auth [a2:"%s"]',s),this._response=Or.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth:").concat(a))):"auth-int"===this._qop?(s="".concat(this._method,":").concat(this._uri,":").concat(Or.calculateMD5(i||"")),a=Or.calculateMD5(s),Dr.debug('authenticate() | using qop=auth-int [a2:"%s"]',s),this._response=Or.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth-int:").concat(a))):null===this._qop&&(s="".concat(this._method,":").concat(this._uri),a=Or.calculateMD5(s),Dr.debug('authenticate() | using qop=null [a2:"%s"]',s),this._response=Or.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(a))),Dr.debug("authenticate() | response generated"),!0}},{key:"toString",value:function(){var e=[];if(!this._response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm=".concat(this._algorithm)),e.push('username="'.concat(this._credentials.username,'"')),e.push('realm="'.concat(this._realm,'"')),e.push('nonce="'.concat(this._nonce,'"')),e.push('uri="'.concat(this._uri,'"')),e.push('response="'.concat(this._response,'"')),this._opaque&&e.push('opaque="'.concat(this._opaque,'"')),this._qop&&(e.push("qop=".concat(this._qop)),e.push('cnonce="'.concat(this._cnonce,'"')),e.push("nc=".concat(this._ncHex))),"Digest ".concat(e.join(", "))}}]),e}(),Mr=500,qr={T1:Mr,T2:4e3,T4:5e3,TIMER_B:32e3,TIMER_D:0,TIMER_F:32e3,TIMER_H:32e3,TIMER_I:0,TIMER_J:0,TIMER_K:0,TIMER_L:32e3,TIMER_M:32e3,PROVISIONAL_RESPONSE_INTERVAL:6e4};function Nr(e){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nr(e)}function Ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Pr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lr(e,t)}function Lr(e,t){return Lr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Lr(e,t)}function Br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hr(e);if(t){var i=Hr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Nr(t)||"function"==typeof t))return t;return Fr(e)}(this,n)}}function Fr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hr(e){return Hr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hr(e)}var Gr=Q.EventEmitter,Yr=Wn,jr=l,Qr=br,Wr=qr,Kr=new Yr("NonInviteClientTransaction"),zr=new Yr("InviteClientTransaction"),Jr=new Yr("AckClientTransaction"),Vr=new Yr("NonInviteServerTransaction"),Zr=new Yr("InviteServerTransaction"),Xr={STATUS_TRYING:1,STATUS_PROCEEDING:2,STATUS_CALLING:3,STATUS_ACCEPTED:4,STATUS_COMPLETED:5,STATUS_TERMINATED:6,STATUS_CONFIRMED:7,NON_INVITE_CLIENT:"nict",NON_INVITE_SERVER:"nist",INVITE_CLIENT:"ict",INVITE_SERVER:"ist"},$r=function(){Pr(t,Gr);var e=Br(t);function t(n,r,i,o){var s;Ur(this,t),(s=e.call(this)).type=Xr.NON_INVITE_CLIENT,s.id="z9hG4bK".concat(Math.floor(1e7*Math.random())),s.ua=n,s.transport=r,s.request=i,s.eventHandlers=o;var a="SIP/2.0/".concat(r.via_transport);return a+=" ".concat(n.configuration.via_host,";branch=").concat(s.id),s.request.setHeader("via",a),s.ua.newTransaction(Fr(s)),s}return xr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"send",value:function(){var e=this;this.stateChanged(Xr.STATUS_TRYING),this.F=setTimeout((function(){e.timer_F()}),Wr.TIMER_F),this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){Kr.debug("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.F),clearTimeout(this.K),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onTransportError()}},{key:"timer_F",value:function(){Kr.debug("Timer F expired for transaction ".concat(this.id)),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onRequestTimeout()}},{key:"timer_K",value:function(){this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"receiveResponse",value:function(e){var t=this,n=e.status_code;if(n<200)switch(this.state){case Xr.STATUS_TRYING:case Xr.STATUS_PROCEEDING:this.stateChanged(Xr.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e)}else switch(this.state){case Xr.STATUS_TRYING:case Xr.STATUS_PROCEEDING:this.stateChanged(Xr.STATUS_COMPLETED),clearTimeout(this.F),408===n?this.eventHandlers.onRequestTimeout():this.eventHandlers.onReceiveResponse(e),this.K=setTimeout((function(){t.timer_K()}),Wr.TIMER_K)}}},{key:"C",get:function(){return Xr}}]),t}(),ei=function(){Pr(t,Gr);var e=Br(t);function t(n,r,i,o){var s;Ur(this,t),(s=e.call(this)).type=Xr.INVITE_CLIENT,s.id="z9hG4bK".concat(Math.floor(1e7*Math.random())),s.ua=n,s.transport=r,s.request=i,s.eventHandlers=o,i.transaction=Fr(s);var a="SIP/2.0/".concat(r.via_transport);return a+=" ".concat(n.configuration.via_host,";branch=").concat(s.id),s.request.setHeader("via",a),s.ua.newTransaction(Fr(s)),s}return xr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"send",value:function(){var e=this;this.stateChanged(Xr.STATUS_CALLING),this.B=setTimeout((function(){e.timer_B()}),Wr.TIMER_B),this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){clearTimeout(this.B),clearTimeout(this.D),clearTimeout(this.M),this.state!==Xr.STATUS_ACCEPTED&&(zr.debug("transport error occurred, deleting transaction ".concat(this.id)),this.eventHandlers.onTransportError()),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_M",value:function(){zr.debug("Timer M expired for transaction ".concat(this.id)),this.state===Xr.STATUS_ACCEPTED&&(clearTimeout(this.B),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"timer_B",value:function(){zr.debug("Timer B expired for transaction ".concat(this.id)),this.state===Xr.STATUS_CALLING&&(this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onRequestTimeout())}},{key:"timer_D",value:function(){zr.debug("Timer D expired for transaction ".concat(this.id)),clearTimeout(this.B),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"sendACK",value:function(e){var t=this,n=new Qr.OutgoingRequest(jr.ACK,this.request.ruri,this.ua,{route_set:this.request.getHeaders("route"),call_id:this.request.getHeader("call-id"),cseq:this.request.cseq});n.setHeader("from",this.request.getHeader("from")),n.setHeader("via",this.request.getHeader("via")),n.setHeader("to",e.getHeader("to")),this.D=setTimeout((function(){t.timer_D()}),Wr.TIMER_D),this.transport.send(n)}},{key:"cancel",value:function(e){if(this.state===Xr.STATUS_PROCEEDING){var t=new Qr.OutgoingRequest(jr.CANCEL,this.request.ruri,this.ua,{route_set:this.request.getHeaders("route"),call_id:this.request.getHeader("call-id"),cseq:this.request.cseq});t.setHeader("from",this.request.getHeader("from")),t.setHeader("via",this.request.getHeader("via")),t.setHeader("to",this.request.getHeader("to")),e&&t.setHeader("reason",e),this.transport.send(t)}}},{key:"receiveResponse",value:function(e){var t=this,n=e.status_code;if(n>=100&&n<=199)switch(this.state){case Xr.STATUS_CALLING:this.stateChanged(Xr.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e);break;case Xr.STATUS_PROCEEDING:this.eventHandlers.onReceiveResponse(e)}else if(n>=200&&n<=299)switch(this.state){case Xr.STATUS_CALLING:case Xr.STATUS_PROCEEDING:this.stateChanged(Xr.STATUS_ACCEPTED),this.M=setTimeout((function(){t.timer_M()}),Wr.TIMER_M),this.eventHandlers.onReceiveResponse(e);break;case Xr.STATUS_ACCEPTED:this.eventHandlers.onReceiveResponse(e)}else if(n>=300&&n<=699)switch(this.state){case Xr.STATUS_CALLING:case Xr.STATUS_PROCEEDING:this.stateChanged(Xr.STATUS_COMPLETED),this.sendACK(e),this.eventHandlers.onReceiveResponse(e);break;case Xr.STATUS_COMPLETED:this.sendACK(e)}}},{key:"C",get:function(){return Xr}}]),t}(),ti=function(){Pr(t,Gr);var e=Br(t);function t(n,r,i,o){var s;Ur(this,t),(s=e.call(this)).id="z9hG4bK".concat(Math.floor(1e7*Math.random())),s.transport=r,s.request=i,s.eventHandlers=o;var a="SIP/2.0/".concat(r.via_transport);return a+=" ".concat(n.configuration.via_host,";branch=").concat(s.id),s.request.setHeader("via",a),s}return xr(t,[{key:"send",value:function(){this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){Jr.debug("transport error occurred for transaction ".concat(this.id)),this.eventHandlers.onTransportError()}},{key:"C",get:function(){return Xr}}]),t}(),ni=function(){Pr(t,Gr);var e=Br(t);function t(n,r,i){var o;return Ur(this,t),(o=e.call(this)).type=Xr.NON_INVITE_SERVER,o.id=i.via_branch,o.ua=n,o.transport=r,o.request=i,o.last_response="",i.server_transaction=Fr(o),o.state=Xr.STATUS_TRYING,n.newTransaction(Fr(o)),o}return xr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_J",value:function(){Vr.debug("Timer J expired for transaction ".concat(this.id)),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,Vr.debug("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.J),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"receiveResponse",value:function(e,t,n,r){var i=this;if(100===e)switch(this.state){case Xr.STATUS_TRYING:this.stateChanged(Xr.STATUS_PROCEEDING),this.transport.send(t)||this.onTransportError();break;case Xr.STATUS_PROCEEDING:this.last_response=t,this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=200&&e<=699)switch(this.state){case Xr.STATUS_TRYING:case Xr.STATUS_PROCEEDING:this.stateChanged(Xr.STATUS_COMPLETED),this.last_response=t,this.J=setTimeout((function(){i.timer_J()}),Wr.TIMER_J),this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}}},{key:"C",get:function(){return Xr}}]),t}(),ri=function(){Pr(t,Gr);var e=Br(t);function t(n,r,i){var o;return Ur(this,t),(o=e.call(this)).type=Xr.INVITE_SERVER,o.id=i.via_branch,o.ua=n,o.transport=r,o.request=i,o.last_response="",i.server_transaction=Fr(o),o.state=Xr.STATUS_PROCEEDING,n.newTransaction(Fr(o)),o.resendProvisionalTimer=null,i.reply(100),o}return xr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_H",value:function(){Zr.debug("Timer H expired for transaction ".concat(this.id)),this.state===Xr.STATUS_COMPLETED&&Zr.debug("ACK not received, dialog will be terminated"),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_I",value:function(){this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_L",value:function(){Zr.debug("Timer L expired for transaction ".concat(this.id)),this.state===Xr.STATUS_ACCEPTED&&(this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,Zr.debug("transport error occurred, deleting transaction ".concat(this.id)),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),clearTimeout(this.L),clearTimeout(this.H),clearTimeout(this.I),this.stateChanged(Xr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"resend_provisional",value:function(){this.transport.send(this.last_response)||this.onTransportError()}},{key:"receiveResponse",value:function(e,t,n,r){var i=this;if(e>=100&&e<=199&&this.state===Xr.STATUS_PROCEEDING)this.transport.send(t)||this.onTransportError(),this.last_response=t;if(e>100&&e<=199&&this.state===Xr.STATUS_PROCEEDING)null===this.resendProvisionalTimer&&(this.resendProvisionalTimer=setInterval((function(){i.resend_provisional()}),Wr.PROVISIONAL_RESPONSE_INTERVAL));else if(e>=200&&e<=299)switch(this.state){case Xr.STATUS_PROCEEDING:this.stateChanged(Xr.STATUS_ACCEPTED),this.last_response=t,this.L=setTimeout((function(){i.timer_L()}),Wr.TIMER_L),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null);case Xr.STATUS_ACCEPTED:this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=300&&e<=699&&this.state===Xr.STATUS_PROCEEDING)null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),this.transport.send(t)?(this.stateChanged(Xr.STATUS_COMPLETED),this.H=setTimeout((function(){i.timer_H()}),Wr.TIMER_H),n&&n()):(this.onTransportError(),r&&r())}},{key:"C",get:function(){return Xr}}]),t}();var ii={C:Xr,NonInviteClientTransaction:$r,InviteClientTransaction:ei,AckClientTransaction:ti,NonInviteServerTransaction:ni,InviteServerTransaction:ri,checkTransaction:function(e,t){var n,r=e._transactions;switch(t.method){case jr.INVITE:if(n=r.ist[t.via_branch]){if(n.state===Xr.STATUS_PROCEEDING)n.transport.send(n.last_response);return!0}break;case jr.ACK:if(!(n=r.ist[t.via_branch]))return!1;if(n.state===Xr.STATUS_ACCEPTED)return!1;if(n.state===Xr.STATUS_COMPLETED)return n.state=Xr.STATUS_CONFIRMED,n.I=setTimeout((function(){n.timer_I()}),Wr.TIMER_I),!0;break;case jr.CANCEL:return(n=r.ist[t.via_branch])?(t.reply_sl(200),n.state!==Xr.STATUS_PROCEEDING):(t.reply_sl(481),!0);default:if(n=r.nist[t.via_branch]){switch(n.state){case Xr.STATUS_TRYING:break;case Xr.STATUS_PROCEEDING:case Xr.STATUS_COMPLETED:n.transport.send(n.last_response)}return!0}}}};function oi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var si=l,ai=kr,ui=ii,li=new Wn("RequestSender"),ci={onRequestTimeout:function(){},onTransportError:function(){},onReceiveResponse:function(){},onAuthenticated:function(){}},hi=function(){function e(t,n,r){for(var i in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ua=t,this._eventHandlers=r,this._method=n.method,this._request=n,this._auth=null,this._challenged=!1,this._staled=!1,ci)Object.prototype.hasOwnProperty.call(ci,i)&&(this._eventHandlers[i]||(this._eventHandlers[i]=ci[i]));t.status!==t.C.STATUS_USER_CLOSED||this._method===si.BYE&&this._method===si.ACK||this._eventHandlers.onTransportError()}return oi(e,[{key:"send",value:function(){var e=this,t={onRequestTimeout:function(){e._eventHandlers.onRequestTimeout()},onTransportError:function(){e._eventHandlers.onTransportError()},onReceiveResponse:function(t){e._receiveResponse(t)}};switch(this._method){case"INVITE":this.clientTransaction=new ui.InviteClientTransaction(this._ua,this._ua.transport,this._request,t);break;case"ACK":this.clientTransaction=new ui.AckClientTransaction(this._ua,this._ua.transport,this._request,t);break;default:this.clientTransaction=new ui.NonInviteClientTransaction(this._ua,this._ua.transport,this._request,t)}this._ua._configuration.authorization_jwt&&this._request.setHeader("Authorization",this._ua._configuration.authorization_jwt),this.clientTransaction.send()}},{key:"_receiveResponse",value:function(e){var t,n,r=e.status_code;if(401!==r&&407!==r||null===this._ua.configuration.password&&null===this._ua.configuration.ha1)this._eventHandlers.onReceiveResponse(e);else{if(401===e.status_code?(t=e.parseHeader("www-authenticate"),n="authorization"):(t=e.parseHeader("proxy-authenticate"),n="proxy-authorization"),!t)return li.debug("".concat(e.status_code," with wrong or missing challenge, cannot authenticate")),void this._eventHandlers.onReceiveResponse(e);if(!this._challenged||!this._staled&&!0===t.stale){if(this._auth||(this._auth=new ai({username:this._ua.configuration.authorization_user,password:this._ua.configuration.password,realm:this._ua.configuration.realm,ha1:this._ua.configuration.ha1})),!this._auth.authenticate(this._request,t))return void this._eventHandlers.onReceiveResponse(e);this._challenged=!0,this._ua.set("realm",this._auth.get("realm")),this._ua.set("ha1",this._auth.get("ha1")),t.stale&&(this._staled=!0),this._request=this._request.clone(),this._request.cseq+=1,this._request.setHeader("cseq","".concat(this._request.cseq," ").concat(this._method)),this._request.setHeader(n,this._auth.toString()),this._eventHandlers.onAuthenticated(this._request),this.send()}else this._eventHandlers.onReceiveResponse(e)}}}]),e}();function fi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var di=Wn,pi=P(),gi=l,mi=br,_i=hi,Ai=new di("Registrator"),vi=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._reg_id=1,this._ua=t,this._transport=n,this._registrar=t.configuration.registrar_server,this._expires=t.configuration.register_expires,this._call_id=pi.createRandomToken(22),this._cseq=0,this._to_uri=t.configuration.uri,this._registrationTimer=null,this._registering=!1,this._registered=!1,this._contact=this._ua.contact.toString(),this._contact+=";+sip.ice",this._extraHeaders=[],this._extraContactParams="",this._sipInstance='"<urn:uuid:'.concat(this._ua.configuration.instance_id,'>"'),this._contact+=";reg-id=".concat(this._reg_id),this._contact+=";+sip.instance=".concat(this._sipInstance)}return fi(e,[{key:"setExtraHeaders",value:function(e){Array.isArray(e)||(e=[]),this._extraHeaders=e.slice()}},{key:"setExtraContactParams",value:function(e){for(var t in e instanceof Object||(e={}),this._extraContactParams="",e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this._extraContactParams+=";".concat(t),n&&(this._extraContactParams+="=".concat(n))}}},{key:"register",value:function(){var e=this;if(this._registering)Ai.debug("Register request in progress...");else{var t=this._extraHeaders.slice();t.push("Contact: ".concat(this._contact,";expires=").concat(this._expires).concat(this._extraContactParams)),t.push("Expires: ".concat(this._expires));var n=new mi.OutgoingRequest(gi.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},t),r=new _i(this._ua,n,{onRequestTimeout:function(){e._registrationFailure(null,gi.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._registrationFailure(null,gi.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){if(t.cseq===e._cseq)switch(null!==e._registrationTimer&&(clearTimeout(e._registrationTimer),e._registrationTimer=null),!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):if(e._registering=!1,!t.hasHeader("Contact")){Ai.debug("no Contact header in response to REGISTER, response ignored");break}var n=t.headers.Contact.reduce((function(e,t){return e.concat(t.parsed)}),[]),r=n.find((function(t){return e._sipInstance===t.getParam("+sip.instance")&&e._reg_id===parseInt(t.getParam("reg-id"))}));if(r||(r=n.find((function(t){return t.uri.user===e._ua.contact.uri.user}))),!r){Ai.debug("no Contact header pointing to us, response ignored");break}var i=r.getParam("expires");!i&&t.hasHeader("expires")&&(i=t.getHeader("expires")),i||(i=e._expires),(i=Number(i))<10&&(i=10);var o=i>64?1e3*i/2+Math.floor(1e3*(i/2-32)*Math.random()):1e3*i-5e3;e._registrationTimer=setTimeout((function(){e._registrationTimer=null,0===e._ua.listeners("registrationExpiring").length?e.register():e._ua.emit("registrationExpiring")}),o),r.hasParam("temp-gruu")&&(e._ua.contact.temp_gruu=r.getParam("temp-gruu").replace(/"/g,"")),r.hasParam("pub-gruu")&&(e._ua.contact.pub_gruu=r.getParam("pub-gruu").replace(/"/g,"")),e._registered||(e._registered=!0,e._ua.registered({response:t}));break;case/^423$/.test(t.status_code):t.hasHeader("min-expires")?(e._expires=Number(t.getHeader("min-expires")),e._expires<10&&(e._expires=10),e.register()):(Ai.debug("423 response received for REGISTER without Min-Expires"),e._registrationFailure(t,gi.causes.SIP_FAILURE_CODE));break;default:var s=pi.sipErrorCause(t.status_code);e._registrationFailure(t,s)}}});this._registering=!0,r.send()}}},{key:"unregister",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._registered){this._registered=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null);var n=this._extraHeaders.slice();t.all?n.push("Contact: *".concat(this._extraContactParams)):n.push("Contact: ".concat(this._contact,";expires=0").concat(this._extraContactParams)),n.push("Expires: 0");var r=new mi.OutgoingRequest(gi.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},n);new _i(this._ua,r,{onRequestTimeout:function(){e._unregistered(null,gi.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._unregistered(null,gi.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){switch(!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):e._unregistered(t);break;default:var n=pi.sipErrorCause(t.status_code);e._unregistered(t,n)}}}).send()}else Ai.debug("already unregistered")}},{key:"close",value:function(){this._registered&&this.unregister()}},{key:"onTransportClosed",value:function(){this._registering=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null),this._registered&&(this._registered=!1,this._ua.unregistered({}))}},{key:"_registrationFailure",value:function(e,t){this._registering=!1,this._ua.registrationFailed({response:e||null,cause:t}),this._registered&&(this._registered=!1,this._ua.unregistered({response:e||null,cause:t}))}},{key:"_unregistered",value:function(e,t){this._registering=!1,this._registered=!1,this._ua.unregistered({response:e||null,cause:t||null})}},{key:"registered",get:function(){return this._registered}}]),e}();function yi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var Ti=l,Si=ii,Ei=hi,Ci={onRequestTimeout:function(){},onTransportError:function(){},onSuccessResponse:function(){},onErrorResponse:function(){},onAuthenticated:function(){},onDialogError:function(){}};function wi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bi(e,t,n){return t&&wi(e.prototype,t),n&&wi(e,n),e}var Ii=Wn,Ri=br,Oi=l,Di=ii,ki=function(){function e(t,n,r){for(var i in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._dialog=t,this._ua=t._ua,this._request=n,this._eventHandlers=r,this._reattempt=!1,this._reattemptTimer=null,Ci)Object.prototype.hasOwnProperty.call(Ci,i)&&(this._eventHandlers[i]||(this._eventHandlers[i]=Ci[i]))}return yi(e,[{key:"send",value:function(){var e=this,t=new Ei(this._ua,this._request,{onRequestTimeout:function(){e._eventHandlers.onRequestTimeout()},onTransportError:function(){e._eventHandlers.onTransportError()},onAuthenticated:function(t){e._eventHandlers.onAuthenticated(t)},onReceiveResponse:function(t){e._receiveResponse(t)}});if(t.send(),(this._request.method===Ti.INVITE||this._request.method===Ti.UPDATE&&this._request.body)&&t.clientTransaction.state!==Si.C.STATUS_TERMINATED){this._dialog.uac_pending_reply=!0;t.clientTransaction.on("stateChanged",(function n(){t.clientTransaction.state!==Si.C.STATUS_ACCEPTED&&t.clientTransaction.state!==Si.C.STATUS_COMPLETED&&t.clientTransaction.state!==Si.C.STATUS_TERMINATED||(t.clientTransaction.removeListener("stateChanged",n),e._dialog.uac_pending_reply=!1)}))}}},{key:"_receiveResponse",value:function(e){var t=this;408===e.status_code||481===e.status_code?this._eventHandlers.onDialogError(e):e.method===Ti.INVITE&&491===e.status_code?this._reattempt?e.status_code>=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e):(this._request.cseq=this._dialog.local_seqnum+=1,this._reattemptTimer=setTimeout((function(){t._dialog.isTerminated()||(t._reattempt=!0,t.send())}),1e3)):e.status_code>=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e)}},{key:"request",get:function(){return this._request}}]),e}(),Mi=P(),qi=new Ii("Dialog"),Ni={STATUS_EARLY:1,STATUS_CONFIRMED:2,STATUS_TERMINATED:3},Ui=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ni.STATUS_CONFIRMED;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._owner=t,this._ua=t._ua,this._uac_pending_reply=!1,this._uas_pending_reply=!1,!n.hasHeader("contact"))return{error:"unable to create a Dialog without Contact header field"};n instanceof Ri.IncomingResponse&&(i=n.status_code<200?Ni.STATUS_EARLY:Ni.STATUS_CONFIRMED);var o=n.parseHeader("contact");"UAS"===r?(this._id={call_id:n.call_id,local_tag:n.to_tag,remote_tag:n.from_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=i,this._remote_seqnum=n.cseq,this._local_uri=n.parseHeader("to").uri,this._remote_uri=n.parseHeader("from").uri,this._remote_target=o.uri,this._route_set=n.getHeaders("record-route"),this._ack_seqnum=this._remote_seqnum):"UAC"===r&&(this._id={call_id:n.call_id,local_tag:n.from_tag,remote_tag:n.to_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=i,this._local_seqnum=n.cseq,this._local_uri=n.parseHeader("from").uri,this._remote_uri=n.parseHeader("to").uri,this._remote_target=o.uri,this._route_set=n.getHeaders("record-route").reverse(),this._ack_seqnum=null),this._ua.newDialog(this),qi.debug("new ".concat(r," dialog created with status ").concat(this._state===Ni.STATUS_EARLY?"EARLY":"CONFIRMED"))}return bi(e,null,[{key:"C",get:function(){return Ni}}]),bi(e,[{key:"isTerminated",value:function(){return this._status===Ni.STATUS_TERMINATED}},{key:"update",value:function(e,t){this._state=Ni.STATUS_CONFIRMED,qi.debug("dialog ".concat(this._id.toString()," changed to CONFIRMED state")),"UAC"===t&&(this._route_set=e.getHeaders("record-route").reverse())}},{key:"terminate",value:function(){qi.debug("dialog ".concat(this._id.toString()," deleted")),this._ua.destroyDialog(this),this._state=Ni.STATUS_TERMINATED}},{key:"sendRequest",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Mi.cloneArray(n.extraHeaders),i=Mi.cloneObject(n.eventHandlers),o=n.body||null,s=this._createRequest(e,r,o);return i.onAuthenticated=function(){t._local_seqnum+=1},new ki(this,s,i).send(),s}},{key:"receiveRequest",value:function(e){this._checkInDialogRequest(e)&&(e.method===Oi.ACK&&null!==this._ack_seqnum?this._ack_seqnum=null:e.method===Oi.INVITE&&(this._ack_seqnum=e.cseq),this._owner.receiveRequest(e))}},{key:"_createRequest",value:function(e,t,n){t=Mi.cloneArray(t),this._local_seqnum||(this._local_seqnum=Math.floor(1e4*Math.random()));var r=e===Oi.CANCEL||e===Oi.ACK?this._local_seqnum:this._local_seqnum+=1;return new Ri.OutgoingRequest(e,this._remote_target,this._ua,{cseq:r,call_id:this._id.call_id,from_uri:this._local_uri,from_tag:this._id.local_tag,to_uri:this._remote_uri,to_tag:this._id.remote_tag,route_set:this._route_set},t,n)}},{key:"_checkInDialogRequest",value:function(e){var t=this;if(this._remote_seqnum)if(e.cseq<this._remote_seqnum){if(e.method!==Oi.ACK)return e.reply(500),!1;if(null===this._ack_seqnum||e.cseq!==this._ack_seqnum)return!1}else e.cseq>this._remote_seqnum&&(this._remote_seqnum=e.cseq);else this._remote_seqnum=e.cseq;if(e.method===Oi.INVITE||e.method===Oi.UPDATE&&e.body){if(!0===this._uac_pending_reply)e.reply(491);else{if(!0===this._uas_pending_reply){var n=1+(10*Math.random()|0);return e.reply(500,null,["Retry-After:".concat(n)]),!1}this._uas_pending_reply=!0;e.server_transaction.on("stateChanged",(function n(){e.server_transaction.state!==Di.C.STATUS_ACCEPTED&&e.server_transaction.state!==Di.C.STATUS_COMPLETED&&e.server_transaction.state!==Di.C.STATUS_TERMINATED||(e.server_transaction.removeListener("stateChanged",n),t._uas_pending_reply=!1)}))}e.hasHeader("contact")&&e.server_transaction.on("stateChanged",(function(){e.server_transaction.state===Di.C.STATUS_ACCEPTED&&(t._remote_target=e.parseHeader("contact").uri)}))}else e.method===Oi.NOTIFY&&e.hasHeader("contact")&&e.server_transaction.on("stateChanged",(function(){e.server_transaction.state===Di.C.STATUS_COMPLETED&&(t._remote_target=e.parseHeader("contact").uri)}));return!0}},{key:"id",get:function(){return this._id}},{key:"local_seqnum",get:function(){return this._local_seqnum},set:function(e){this._local_seqnum=e}},{key:"owner",get:function(){return this._owner}},{key:"uac_pending_reply",get:function(){return this._uac_pending_reply},set:function(e){this._uac_pending_reply=e}},{key:"uas_pending_reply",get:function(){return this._uas_pending_reply}}]),e}(),xi={exports:{}};function Pi(e){return Pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pi(e)}function Li(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Bi(e,t){return Bi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bi(e,t)}function Fi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hi(e);if(t){var i=Hi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Pi(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Hi(e){return Hi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hi(e)}var Gi=Q.EventEmitter,Yi=Wn,ji=l,Qi=E,Wi=P(),Ki=new Yi("RTCSession:DTMF"),zi={MIN_DURATION:70,MAX_DURATION:6e3,DEFAULT_DURATION:100,MIN_INTER_TONE_GAP:50,DEFAULT_INTER_TONE_GAP:500};xi.exports=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bi(e,t)}(t,Gi);var e=Fi(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._session=n,r._direction=null,r._tone=null,r._duration=null,r._request=null,r}return Li(t,[{key:"send",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===e)throw new TypeError("Not enough arguments");if(this._direction="outgoing",this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new Qi.InvalidStateError(this._session.status);var r=Wi.cloneArray(n.extraHeaders);if(this.eventHandlers=Wi.cloneObject(n.eventHandlers),"string"==typeof e)e=e.toUpperCase();else{if("number"!=typeof e)throw new TypeError("Invalid tone: ".concat(e));e=e.toString()}if(!e.match(/^[0-9A-DR#*]$/))throw new TypeError("Invalid tone: ".concat(e));this._tone=e,this._duration=n.duration,r.push("Content-Type: application/dtmf-relay");var i="Signal=".concat(this._tone,"\r\n");i+="Duration=".concat(this._duration),this._session.newDTMF({originator:"local",dtmf:this,request:this._request}),this._session.sendRequest(ji.INFO,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){t.eventHandlers.onFailed&&t.eventHandlers.onFailed(),t.emit("failed",{originator:"remote",response:e})},onRequestTimeout:function(){t._session.onRequestTimeout()},onTransportError:function(){t._session.onTransportError()},onDialogError:function(){t._session.onDialogError()}},body:i})}},{key:"init_incoming",value:function(e){var t=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/,n=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;if(this._direction="incoming",this._request=e,e.reply(200),e.body){var r=e.body.split("\n");r.length>=1&&t.test(r[0])&&(this._tone=r[0].replace(t,"$2")),r.length>=2&&n.test(r[1])&&(this._duration=parseInt(r[1].replace(n,"$2"),10))}this._duration||(this._duration=zi.DEFAULT_DURATION),this._tone?this._session.newDTMF({originator:"remote",dtmf:this,request:e}):Ki.debug("invalid INFO DTMF received, discarded")}},{key:"tone",get:function(){return this._tone}},{key:"duration",get:function(){return this._duration}}]),t}(),xi.exports.C=zi;var Ji=xi.exports;function Vi(e){return Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vi(e)}function Zi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Xi(e,t){return Xi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Xi(e,t)}function $i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=eo(e);if(t){var i=eo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Vi(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function eo(e){return eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},eo(e)}var to=Q.EventEmitter,no=l,ro=E,io=P(),oo=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xi(e,t)}(t,to);var e=$i(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._session=n,r._direction=null,r._contentType=null,r._body=null,r}return Zi(t,[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._direction="outgoing",void 0===e)throw new TypeError("Not enough arguments");if(this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new ro.InvalidStateError(this._session.status);this._contentType=e,this._body=t;var i=io.cloneArray(r.extraHeaders);i.push("Content-Type: ".concat(e)),this._session.newInfo({originator:"local",info:this,request:this.request}),this._session.sendRequest(no.INFO,{extraHeaders:i,eventHandlers:{onSuccessResponse:function(e){n.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){n.emit("failed",{originator:"remote",response:e})},onTransportError:function(){n._session.onTransportError()},onRequestTimeout:function(){n._session.onRequestTimeout()},onDialogError:function(){n._session.onDialogError()}},body:t})}},{key:"init_incoming",value:function(e){this._direction="incoming",this.request=e,e.reply(200),this._contentType=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,this._body=e.body,this._session.newInfo({originator:"remote",info:this,request:e})}},{key:"contentType",get:function(){return this._contentType}},{key:"body",get:function(){return this._body}}]),t}();function so(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var ao=l,uo=new Wn("RTCSession:ReferNotifier"),lo="refer",co="message/sipfrag;version=2.0",ho=300,fo=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._session=t,this._id=n,this._expires=r||ho,this._active=!0,this.notify(100)}return so(e,[{key:"notify",value:function(e,t){var n;(uo.debug("notify()"),!1!==this._active)&&(t=t||ao.REASON_PHRASE[e]||"",n=e>=200?"terminated;reason=noresource":"active;expires=".concat(this._expires),this._session.sendRequest(ao.NOTIFY,{extraHeaders:["Event: ".concat(lo,";id=").concat(this._id),"Subscription-State: ".concat(n),"Content-Type: ".concat(co)],body:"SIP/2.0 ".concat(e," ").concat(t),eventHandlers:{onErrorResponse:function(){this._active=!1}}}))}}]),e}();function po(e){return po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},po(e)}function go(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function mo(e,t){return mo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mo(e,t)}function _o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ao(e);if(t){var i=Ao(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===po(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Ao(e){return Ao=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ao(e)}var vo=Q.EventEmitter,yo=Wn,To=l,So=U(),Eo=P(),Co=new yo("RTCSession:ReferSubscriber"),wo=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mo(e,t)}(t,vo);var e=_o(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._id=null,r._session=n,r}return go(t,[{key:"sendRefer",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Co.debug("sendRefer()");var r=Eo.cloneArray(n.extraHeaders),i=Eo.cloneObject(n.eventHandlers);for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&this.on(o,i[o]);var s=null;n.replaces&&(s=n.replaces._request.call_id,s+=";to-tag=".concat(n.replaces._to_tag),s+=";from-tag=".concat(n.replaces._from_tag),s=encodeURIComponent(s));var a="Refer-To: <".concat(e).concat(s?"?Replaces=".concat(s):"",">");if(r.push(a),!r.some((function(e){return e.toLowerCase().startsWith("referred-by:")}))){var u="Referred-By: <".concat(this._session._ua._configuration.uri._scheme,":").concat(this._session._ua._configuration.uri._user,"@").concat(this._session._ua._configuration.uri._host,">");r.push(u)}r.push("Contact: ".concat(this._session.contact));var l=this._session.sendRequest(To.REFER,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t._requestSucceeded(e)},onErrorResponse:function(e){t._requestFailed(e,To.causes.REJECTED)},onTransportError:function(){t._requestFailed(null,To.causes.CONNECTION_ERROR)},onRequestTimeout:function(){t._requestFailed(null,To.causes.REQUEST_TIMEOUT)},onDialogError:function(){t._requestFailed(null,To.causes.DIALOG_ERROR)}}});this._id=l.cseq}},{key:"receiveNotify",value:function(e){if(Co.debug("receiveNotify()"),e.body){var t=So.parse(e.body.trim().split("\r\n",1)[0],"Status_Line");if(-1!==t)switch(!0){case/^100$/.test(t.status_code):this.emit("trying",{request:e,status_line:t});break;case/^1[0-9]{2}$/.test(t.status_code):this.emit("progress",{request:e,status_line:t});break;case/^2[0-9]{2}$/.test(t.status_code):this.emit("accepted",{request:e,status_line:t});break;default:this.emit("failed",{request:e,status_line:t})}else Co.debug('receiveNotify() | error parsing NOTIFY body: "'.concat(e.body,'"'))}}},{key:"_requestSucceeded",value:function(e){Co.debug("REFER succeeded"),Co.debug('emit "requestSucceeded"'),this.emit("requestSucceeded",{response:e})}},{key:"_requestFailed",value:function(e,t){Co.debug("REFER failed"),Co.debug('emit "requestFailed"'),this.emit("requestFailed",{response:e||null,cause:t})}},{key:"id",get:function(){return this._id}}]),t}();function bo(e){return bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bo(e)}function Io(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ro(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ro(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Do(e,t,n){return t&&Oo(e.prototype,t),n&&Oo(e,n),e}function ko(e,t){return ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ko(e,t)}function Mo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qo(e);if(t){var i=qo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===bo(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function qo(e){return qo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qo(e)}var No=Q.EventEmitter,Uo=Kn,xo=Wn,Po=l,Lo=E,Bo=ii,Fo=P(),Ho=qr,Go=br,Yo=Ui,jo=hi,Qo=Ji,Wo=oo,Ko=fo,zo=wo,Jo=x(),Vo=new xo("RTCSession"),Zo={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9},Xo=["audio","video"],$o=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ko(e,t)}(t,No);var e=Mo(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Vo.debug("new"),(r=e.call(this))._id=null,r._ua=n,r._status=Zo.STATUS_NULL,r._dialog=null,r._earlyDialogs={},r._contact=null,r._from_tag=null,r._to_tag=null,r._connection=null,r._connectionPromiseQueue=Promise.resolve(),r._request=null,r._is_canceled=!1,r._cancel_reason="",r._is_confirmed=!1,r._late_sdp=!1,r._rtcOfferConstraints=null,r._rtcAnswerConstraints=null,r._localMediaStream=null,r._localMediaStreamLocallyGenerated=!1,r._rtcReady=!0,r._iceReady=!1,r._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},r._direction=null,r._local_identity=null,r._remote_identity=null,r._start_time=null,r._end_time=null,r._tones=null,r._audioMuted=!1,r._videoMuted=!1,r._localHold=!1,r._remoteHold=!1,r._sessionTimers={enabled:r._ua.configuration.session_timers,refreshMethod:r._ua.configuration.session_timers_refresh_method,defaultExpires:Po.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},r._referSubscribers={},r._data={},r}return Do(t,null,[{key:"C",get:function(){return Zo}}]),Do(t,[{key:"isInProgress",value:function(){switch(this._status){case Zo.STATUS_NULL:case Zo.STATUS_INVITE_SENT:case Zo.STATUS_1XX_RECEIVED:case Zo.STATUS_INVITE_RECEIVED:case Zo.STATUS_WAITING_FOR_ANSWER:return!0;default:return!1}}},{key:"isEstablished",value:function(){switch(this._status){case Zo.STATUS_ANSWERED:case Zo.STATUS_WAITING_FOR_ACK:case Zo.STATUS_CONFIRMED:return!0;default:return!1}}},{key:"isEnded",value:function(){switch(this._status){case Zo.STATUS_CANCELED:case Zo.STATUS_TERMINATED:return!0;default:return!1}}},{key:"isMuted",value:function(){return{audio:this._audioMuted,video:this._videoMuted}}},{key:"isOnHold",value:function(){return{local:this._localHold,remote:this._remoteHold}}},{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;Vo.debug("connect()");var r=e,i=Fo.cloneObject(t.eventHandlers),o=Fo.cloneArray(t.extraHeaders),s=Fo.cloneObject(t.mediaConstraints,{audio:!0,video:!0}),a=t.mediaStream||null,u=Fo.cloneObject(t.pcConfig,{iceServers:[]}),l=t.rtcConstraints||null,c=t.rtcOfferConstraints||null;if(this._rtcOfferConstraints=c,this._rtcAnswerConstraints=t.rtcAnswerConstraints||null,this._data=t.data||this._data,void 0===e)throw new TypeError("Not enough arguments");if(this._status!==Zo.STATUS_NULL)throw new Lo.InvalidStateError(this._status);if(!window.RTCPeerConnection)throw new Lo.NotSupportedError("WebRTC not supported");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));for(var h in this._sessionTimers.enabled&&Fo.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=Po.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=Po.SESSION_EXPIRES),i)Object.prototype.hasOwnProperty.call(i,h)&&this.on(h,i[h]);this._from_tag=Fo.newTag();var f=t.anonymous||!1,d={from_tag:this._from_tag};this._contact=this._ua.contact.toString({anonymous:f,outbound:!0}),f?(d.from_display_name="Anonymous",d.from_uri=new Jo("sip","anonymous","anonymous.invalid"),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString())),o.push("Privacy: id")):t.fromUserName&&(d.from_uri=new Jo("sip",t.fromUserName,this._ua.configuration.uri.host),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),t.fromDisplayName&&(d.from_display_name=t.fromDisplayName),o.push("Contact: ".concat(this._contact)),o.push("Content-Type: application/sdp"),this._sessionTimers.enabled&&o.push("Session-Expires: ".concat(this._sessionTimers.defaultExpires).concat(this._ua.configuration.session_timers_force_refresher?";refresher=uac":"")),this._request=new Go.InitialOutgoingInviteRequest(e,this._ua,d,o),this._id=this._request.call_id+this._from_tag,this._createRTCConnection(u,l),this._direction="outgoing",this._local_identity=this._request.from,this._remote_identity=this._request.to,n&&n(this),this._newRTCSession("local",this._request),this._sendInitialRequest(s,c,a)}},{key:"init_incoming",value:function(e,t){var n,r=this;Vo.debug("init_incoming()");var i=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;e.body&&"application/sdp"!==i?e.reply(415):(this._status=Zo.STATUS_INVITE_RECEIVED,this._from_tag=e.from_tag,this._id=e.call_id+this._from_tag,this._request=e,this._contact=this._ua.contact.toString(),e.hasHeader("expires")&&(n=1e3*e.getHeader("expires")),e.to_tag=Fo.newTag(),this._createDialog(e,"UAS",!0)?(e.body?this._late_sdp=!1:this._late_sdp=!0,this._status=Zo.STATUS_WAITING_FOR_ANSWER,this._timers.userNoAnswerTimer=setTimeout((function(){e.reply(408),r._failed("local",null,Po.causes.NO_ANSWER)}),this._ua.configuration.no_answer_timeout),n&&(this._timers.expiresTimer=setTimeout((function(){r._status===Zo.STATUS_WAITING_FOR_ANSWER&&(e.reply(487),r._failed("system",null,Po.causes.EXPIRES))}),n)),this._direction="incoming",this._local_identity=e.to,this._remote_identity=e.from,t&&t(this),this._newRTCSession("remote",e),this._status!==Zo.STATUS_TERMINATED&&(e.reply(180,null,["Contact: ".concat(this._contact)]),this._progress("local",null))):e.reply(500,"Missing Contact header field"))}},{key:"answer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Vo.debug("answer()");var n=this._request,r=Fo.cloneArray(t.extraHeaders),i=Fo.cloneObject(t.mediaConstraints),o=t.mediaStream||null,s=Fo.cloneObject(t.pcConfig,{iceServers:[]}),a=t.rtcConstraints||null,u=t.rtcAnswerConstraints||null,l=Fo.cloneObject(t.rtcOfferConstraints),c=!1,h=!1,f=!1,d=!1;if(this._rtcAnswerConstraints=u,this._rtcOfferConstraints=t.rtcOfferConstraints||null,this._data=t.data||this._data,"incoming"!==this._direction)throw new Lo.NotSupportedError('"answer" not supported for outgoing RTCSession');if(this._status!==Zo.STATUS_WAITING_FOR_ANSWER)throw new Lo.InvalidStateError(this._status);if(this._sessionTimers.enabled&&Fo.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=Po.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=Po.SESSION_EXPIRES),this._status=Zo.STATUS_ANSWERED,this._createDialog(n,"UAS")){clearTimeout(this._timers.userNoAnswerTimer),r.unshift("Contact: ".concat(this._contact));var p=n.parseSDP();Array.isArray(p.media)||(p.media=[p.media]);var g,m=Io(p.media);try{for(m.s();!(g=m.n()).done;){var _=g.value;"audio"===_.type&&(c=!0,_.direction&&"sendrecv"!==_.direction||(f=!0)),"video"===_.type&&(h=!0,_.direction&&"sendrecv"!==_.direction||(d=!0))}}catch(e){m.e(e)}finally{m.f()}if(o&&!1===i.audio){var A,v=Io(o.getAudioTracks());try{for(v.s();!(A=v.n()).done;){var y=A.value;o.removeTrack(y)}}catch(e){v.e(e)}finally{v.f()}}if(o&&!1===i.video){var T,S=Io(o.getVideoTracks());try{for(S.s();!(T=S.n()).done;){var E=T.value;o.removeTrack(E)}}catch(e){S.e(e)}finally{S.f()}}o||void 0!==i.audio||(i.audio=f),o||void 0!==i.video||(i.video=d),o||c||l.offerToReceiveAudio||(i.audio=!1),o||h||l.offerToReceiveVideo||(i.video=!1),this._createRTCConnection(s,a),Promise.resolve().then((function(){return o||(i.audio||i.video?(e._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(i).catch((function(t){if(e._status===Zo.STATUS_TERMINATED)throw new Error("terminated");throw n.reply(480),e._failed("local",null,Po.causes.USER_DENIED_MEDIA_ACCESS),Vo.warn('emit "getusermediafailed" [error:%o]',t),e.emit("getusermediafailed",t),new Error("getUserMedia() failed")}))):void 0)})).then((function(t){if(e._status===Zo.STATUS_TERMINATED)throw new Error("terminated");e._localMediaStream=t,t&&t.getTracks().forEach((function(n){e._connection.addTrack(n,t)}))})).then((function(){if(!e._late_sdp){var t={originator:"remote",type:"offer",sdp:n.body};Vo.debug('emit "sdp"'),e.emit("sdp",t);var r=new RTCSessionDescription({type:"offer",sdp:t.sdp});return e._connectionPromiseQueue=e._connectionPromiseQueue.then((function(){return e._connection.setRemoteDescription(r)})).catch((function(t){throw n.reply(488),e._failed("system",null,Po.causes.WEBRTC_ERROR),Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',t),e.emit("peerconnection:setremotedescriptionfailed",t),new Error("peerconnection.setRemoteDescription() failed")})),e._connectionPromiseQueue}})).then((function(){if(e._status===Zo.STATUS_TERMINATED)throw new Error("terminated");return e._connecting(n),e._late_sdp?e._createLocalDescription("offer",e._rtcOfferConstraints).catch((function(){throw n.reply(500),new Error("_createLocalDescription() failed")})):e._createLocalDescription("answer",u).catch((function(){throw n.reply(500),new Error("_createLocalDescription() failed")}))})).then((function(t){if(e._status===Zo.STATUS_TERMINATED)throw new Error("terminated");e._handleSessionTimersInIncomingRequest(n,r),n.reply(200,null,r,t,(function(){e._status=Zo.STATUS_WAITING_FOR_ACK,e._setInvite2xxTimer(n,t),e._setACKTimer(),e._accepted("local")}),(function(){e._failed("system",null,Po.causes.CONNECTION_ERROR)}))})).catch((function(t){e._status!==Zo.STATUS_TERMINATED&&Vo.warn(t)}))}else n.reply(500,"Error creating dialog")}},{key:"terminate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Vo.debug("terminate()");var n,r=t.cause||Po.causes.BYE,i=Fo.cloneArray(t.extraHeaders),o=t.body,s=t.status_code,a=t.reason_phrase;if(this._status===Zo.STATUS_TERMINATED)throw new Lo.InvalidStateError(this._status);switch(this._status){case Zo.STATUS_NULL:case Zo.STATUS_INVITE_SENT:case Zo.STATUS_1XX_RECEIVED:if(Vo.debug("canceling session"),s&&(s<200||s>=700))throw new TypeError("Invalid status_code: ".concat(s));s&&(a=a||Po.REASON_PHRASE[s]||"",n="SIP ;cause=".concat(s,' ;text="').concat(a,'"')),this._status===Zo.STATUS_NULL||this._status===Zo.STATUS_INVITE_SENT?(this._is_canceled=!0,this._cancel_reason=n):this._status===Zo.STATUS_1XX_RECEIVED&&this._request.cancel(n),this._status=Zo.STATUS_CANCELED,this._failed("local",null,Po.causes.CANCELED);break;case Zo.STATUS_WAITING_FOR_ANSWER:case Zo.STATUS_ANSWERED:if(Vo.debug("rejecting session"),(s=s||480)<300||s>=700)throw new TypeError("Invalid status_code: ".concat(s));this._request.reply(s,a,i,o),this._failed("local",null,Po.causes.REJECTED);break;case Zo.STATUS_WAITING_FOR_ACK:case Zo.STATUS_CONFIRMED:if(Vo.debug("terminating session"),a=t.reason_phrase||Po.REASON_PHRASE[s]||"",s&&(s<200||s>=700))throw new TypeError("Invalid status_code: ".concat(s));if(s&&i.push("Reason: SIP ;cause=".concat(s,'; text="').concat(a,'"')),this._status===Zo.STATUS_WAITING_FOR_ACK&&"incoming"===this._direction&&this._request.server_transaction.state!==Bo.C.STATUS_TERMINATED){var u=this._dialog;this.receiveRequest=function(t){t.method===Po.ACK&&(e.sendRequest(Po.BYE,{extraHeaders:i,body:o}),u.terminate())},this._request.server_transaction.on("stateChanged",(function(){e._request.server_transaction.state===Bo.C.STATUS_TERMINATED&&(e.sendRequest(Po.BYE,{extraHeaders:i,body:o}),u.terminate())})),this._ended("local",null,r),this._dialog=u,this._ua.newDialog(u)}else this.sendRequest(Po.BYE,{extraHeaders:i,body:o}),this._ended("local",null,r)}}},{key:"sendDTMF",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Vo.debug("sendDTMF() | tones: %s",e);var n=0,r=t.duration||null,i=t.interToneGap||null,o=t.transportType||Po.DTMF_TRANSPORT.INFO;if(void 0===e)throw new TypeError("Not enough arguments");if(this._status!==Zo.STATUS_CONFIRMED&&this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_1XX_RECEIVED)throw new Lo.InvalidStateError(this._status);if(o!==Po.DTMF_TRANSPORT.INFO&&o!==Po.DTMF_TRANSPORT.RFC2833)throw new TypeError("invalid transportType: ".concat(o));if("number"==typeof e&&(e=e.toString()),!e||"string"!=typeof e||!e.match(/^[0-9A-DR#*,]+$/i))throw new TypeError("Invalid tones: ".concat(e));if(r&&!Fo.isDecimal(r))throw new TypeError("Invalid tone duration: ".concat(r));if(r?r<Qo.C.MIN_DURATION?(Vo.debug('"duration" value is lower than the minimum allowed, setting it to '.concat(Qo.C.MIN_DURATION," milliseconds")),r=Qo.C.MIN_DURATION):r>Qo.C.MAX_DURATION?(Vo.debug('"duration" value is greater than the maximum allowed, setting it to '.concat(Qo.C.MAX_DURATION," milliseconds")),r=Qo.C.MAX_DURATION):r=Math.abs(r):r=Qo.C.DEFAULT_DURATION,t.duration=r,i&&!Fo.isDecimal(i))throw new TypeError("Invalid interToneGap: ".concat(i));if(i?i<Qo.C.MIN_INTER_TONE_GAP?(Vo.debug('"interToneGap" value is lower than the minimum allowed, setting it to '.concat(Qo.C.MIN_INTER_TONE_GAP," milliseconds")),i=Qo.C.MIN_INTER_TONE_GAP):i=Math.abs(i):i=Qo.C.DEFAULT_INTER_TONE_GAP,o!==Po.DTMF_TRANSPORT.RFC2833)this._tones?this._tones+=e:(this._tones=e,function e(){var o,s=this;if(this._status===Zo.STATUS_TERMINATED||!this._tones||n>=this._tones.length)return void(this._tones=null);var a=this._tones[n];if(n+=1,","===a)o=2e3;else{var u=new Qo(this);t.eventHandlers={onFailed:function(){s._tones=null}},u.send(a,t),o=r+i}setTimeout(e.bind(this),o)}.call(this));else{var s=this._getDTMFRTPSender();s&&(e=s.toneBuffer+e,s.insertDTMF(e,r,i))}}},{key:"sendInfo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Vo.debug("sendInfo()"),this._status!==Zo.STATUS_CONFIRMED&&this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_1XX_RECEIVED)throw new Lo.InvalidStateError(this._status);new Wo(this).send(e,t,n)}},{key:"mute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!1};Vo.debug("mute()");var t=!1,n=!1;!1===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!0,this._toggleMuteAudio(!0)),!1===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!0,this._toggleMuteVideo(!0)),!0!==t&&!0!==n||this._onmute({audio:t,video:n})}},{key:"unmute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!0};Vo.debug("unmute()");var t=!1,n=!1;!0===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!1,!1===this._localHold&&this._toggleMuteAudio(!1)),!0===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!1,!1===this._localHold&&this._toggleMuteVideo(!1)),!0!==t&&!0!==n||this._onunmute({audio:t,video:n})}},{key:"hold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(Vo.debug("hold()"),this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_CONFIRMED)return!1;if(!0===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!0,this._onhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:Po.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Hold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"unhold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(Vo.debug("unhold()"),this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_CONFIRMED)return!1;if(!1===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!1,this._onunhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:Po.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Unhold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"renegotiate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;Vo.debug("renegotiate()");var r=t.rtcOfferConstraints||null;if(this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_CONFIRMED)return!1;if(!this._isReadyToReOffer())return!1;var i={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:Po.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Media Renegotiation Failed"})}};return this._setLocalMediaStatus(),t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:i,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:i,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}),!0}},{key:"refer",value:function(e,t){var n=this;Vo.debug("refer()");var r=e;if(this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_CONFIRMED)return!1;if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));var i=new zo(this);i.sendRefer(e,t);var o=i.id;return this._referSubscribers[o]=i,i.on("requestFailed",(function(){delete n._referSubscribers[o]})),i.on("accepted",(function(){delete n._referSubscribers[o]})),i.on("failed",(function(){delete n._referSubscribers[o]})),i}},{key:"sendRequest",value:function(e,t){return Vo.debug("sendRequest()"),this._dialog.sendRequest(e,t)}},{key:"receiveRequest",value:function(e){var t=this;if(Vo.debug("receiveRequest()"),e.method===Po.CANCEL)this._status!==Zo.STATUS_WAITING_FOR_ANSWER&&this._status!==Zo.STATUS_ANSWERED||(this._status=Zo.STATUS_CANCELED,this._request.reply(487),this._failed("remote",e,Po.causes.CANCELED));else switch(e.method){case Po.ACK:if(this._status!==Zo.STATUS_WAITING_FOR_ACK)return;if(this._status=Zo.STATUS_CONFIRMED,clearTimeout(this._timers.ackTimer),clearTimeout(this._timers.invite2xxTimer),this._late_sdp){if(!e.body){this.terminate({cause:Po.causes.MISSING_SDP,status_code:400});break}var n={originator:"remote",type:"answer",sdp:e.body};Vo.debug('emit "sdp"'),this.emit("sdp",n);var r=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(r)})).then((function(){t._is_confirmed||t._confirmed("remote",e)})).catch((function(e){t.terminate({cause:Po.causes.BAD_MEDIA_DESCRIPTION,status_code:488}),Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}))}else this._is_confirmed||this._confirmed("remote",e);break;case Po.BYE:this._status===Zo.STATUS_CONFIRMED||this._status===Zo.STATUS_WAITING_FOR_ACK?(e.reply(200),this._ended("remote",e,Po.causes.BYE)):this._status===Zo.STATUS_INVITE_RECEIVED||this._status===Zo.STATUS_WAITING_FOR_ANSWER?(e.reply(200),this._request.reply(487,"BYE Received"),this._ended("remote",e,Po.causes.BYE)):e.reply(403,"Wrong Status");break;case Po.INVITE:this._status===Zo.STATUS_CONFIRMED?e.hasHeader("replaces")?this._receiveReplaces(e):this._receiveReinvite(e):e.reply(403,"Wrong Status");break;case Po.INFO:if(this._status===Zo.STATUS_1XX_RECEIVED||this._status===Zo.STATUS_WAITING_FOR_ANSWER||this._status===Zo.STATUS_ANSWERED||this._status===Zo.STATUS_WAITING_FOR_ACK||this._status===Zo.STATUS_CONFIRMED){var i=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;i&&i.match(/^application\/dtmf-relay/i)?new Qo(this).init_incoming(e):void 0!==i?new Wo(this).init_incoming(e):e.reply(415)}else e.reply(403,"Wrong Status");break;case Po.UPDATE:this._status===Zo.STATUS_CONFIRMED?this._receiveUpdate(e):e.reply(403,"Wrong Status");break;case Po.REFER:this._status===Zo.STATUS_CONFIRMED?this._receiveRefer(e):e.reply(403,"Wrong Status");break;case Po.NOTIFY:this._status===Zo.STATUS_CONFIRMED?this._receiveNotify(e):e.reply(403,"Wrong Status");break;default:e.reply(501)}}},{key:"onTransportError",value:function(){Vo.warn("onTransportError()"),this._status!==Zo.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:Po.causes.CONNECTION_ERROR,cause:Po.causes.CONNECTION_ERROR})}},{key:"onRequestTimeout",value:function(){Vo.warn("onRequestTimeout()"),this._status!==Zo.STATUS_TERMINATED&&this.terminate({status_code:408,reason_phrase:Po.causes.REQUEST_TIMEOUT,cause:Po.causes.REQUEST_TIMEOUT})}},{key:"onDialogError",value:function(){Vo.warn("onDialogError()"),this._status!==Zo.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:Po.causes.DIALOG_ERROR,cause:Po.causes.DIALOG_ERROR})}},{key:"newDTMF",value:function(e){Vo.debug("newDTMF()"),this.emit("newDTMF",e)}},{key:"newInfo",value:function(e){Vo.debug("newInfo()"),this.emit("newInfo",e)}},{key:"_isReadyToReOffer",value:function(){return this._rtcReady?this._dialog?!0!==this._dialog.uac_pending_reply&&!0!==this._dialog.uas_pending_reply||(Vo.debug("_isReadyToReOffer() | there is another INVITE/UPDATE transaction in progress"),!1):(Vo.debug("_isReadyToReOffer() | session not established yet"),!1):(Vo.debug("_isReadyToReOffer() | internal WebRTC status not ready"),!1)}},{key:"_close",value:function(){if(Vo.debug("close()"),this._localMediaStream&&this._localMediaStreamLocallyGenerated&&(Vo.debug("close() | closing local MediaStream"),Fo.closeMediaStream(this._localMediaStream)),this._status!==Zo.STATUS_TERMINATED){if(this._status=Zo.STATUS_TERMINATED,this._connection)try{this._connection.close()}catch(e){Vo.warn("close() | error closing the RTCPeerConnection: %o",e)}for(var e in this._timers)Object.prototype.hasOwnProperty.call(this._timers,e)&&clearTimeout(this._timers[e]);for(var t in clearTimeout(this._sessionTimers.timer),this._dialog&&(this._dialog.terminate(),delete this._dialog),this._earlyDialogs)Object.prototype.hasOwnProperty.call(this._earlyDialogs,t)&&(this._earlyDialogs[t].terminate(),delete this._earlyDialogs[t]);for(var n in this._referSubscribers)Object.prototype.hasOwnProperty.call(this._referSubscribers,n)&&delete this._referSubscribers[n];this._ua.destroyRTCSession(this)}}},{key:"_setInvite2xxTimer",value:function(e,t){var n=Ho.T1;this._timers.invite2xxTimer=setTimeout(function r(){this._status===Zo.STATUS_WAITING_FOR_ACK&&(e.reply(200,null,["Contact: ".concat(this._contact)],t),n<Ho.T2&&(n*=2)>Ho.T2&&(n=Ho.T2),this._timers.invite2xxTimer=setTimeout(r.bind(this),n))}.bind(this),n)}},{key:"_setACKTimer",value:function(){var e=this;this._timers.ackTimer=setTimeout((function(){e._status===Zo.STATUS_WAITING_FOR_ACK&&(Vo.debug("no ACK received, terminating the session"),clearTimeout(e._timers.invite2xxTimer),e.sendRequest(Po.BYE),e._ended("remote",null,Po.causes.NO_ACK))}),Ho.TIMER_H)}},{key:"_createRTCConnection",value:function(e,t){var n=this;this._connection=new RTCPeerConnection(e,t),this._connection.addEventListener("iceconnectionstatechange",(function(){"failed"===n._connection.iceConnectionState&&n.terminate({cause:Po.causes.RTP_TIMEOUT,status_code:408,reason_phrase:Po.causes.RTP_TIMEOUT})})),Vo.debug('emit "peerconnection"'),this.emit("peerconnection",{peerconnection:this._connection})}},{key:"_createLocalDescription",value:function(e,t){var n=this;if(Vo.debug("createLocalDescription()"),"offer"!==e&&"answer"!==e)throw new Error('createLocalDescription() | invalid type "'.concat(e,'"'));var r=this._connection;return this._rtcReady=!1,Promise.resolve().then((function(){return"offer"===e?r.createOffer(t).catch((function(e){return Vo.warn('emit "peerconnection:createofferfailed" [error:%o]',e),n.emit("peerconnection:createofferfailed",e),Promise.reject(e)})):r.createAnswer(t).catch((function(e){return Vo.warn('emit "peerconnection:createanswerfailed" [error:%o]',e),n.emit("peerconnection:createanswerfailed",e),Promise.reject(e)}))})).then((function(e){return r.setLocalDescription(e).catch((function(e){return n._rtcReady=!0,Vo.warn('emit "peerconnection:setlocaldescriptionfailed" [error:%o]',e),n.emit("peerconnection:setlocaldescriptionfailed",e),Promise.reject(e)}))})).then((function(){var i=t&&t.iceRestart;if("complete"===r.iceGatheringState&&!i||"gathering"===r.iceGatheringState&&n._iceReady){n._rtcReady=!0;var o={originator:"local",type:e,sdp:r.localDescription.sdp};return Vo.debug('emit "sdp"'),n.emit("sdp",o),Promise.resolve(o.sdp)}return new Promise((function(t){var i,o,s=!1;n._iceReady=!1;var a=function(){if(!s){r.removeEventListener("icecandidate",i),r.removeEventListener("icegatheringstatechange",o),s=!0,n._rtcReady=!0,n._iceReady=!0;var a={originator:"local",type:e,sdp:r.localDescription.sdp};Vo.debug('emit "sdp"'),n.emit("sdp",a),t(a.sdp)}};r.addEventListener("icecandidate",i=function(e){var t=e.candidate;t?n.emit("icecandidate",{candidate:t,ready:a}):a()}),r.addEventListener("icegatheringstatechange",o=function(){"complete"===r.iceGatheringState&&a()})}))}))}},{key:"_createDialog",value:function(e,t,n){var r="UAS"===t?e.to_tag:e.from_tag,i="UAS"===t?e.from_tag:e.to_tag,o=e.call_id+r+i,s=this._earlyDialogs[o];if(n)return!!s||((s=new Yo(this,e,t,Yo.C.STATUS_EARLY)).error?(Vo.debug(s.error),this._failed("remote",e,Po.causes.INTERNAL_ERROR),!1):(this._earlyDialogs[o]=s,!0));if(this._from_tag=e.from_tag,this._to_tag=e.to_tag,s)return s.update(e,t),this._dialog=s,delete this._earlyDialogs[o],!0;var a=new Yo(this,e,t);return a.error?(Vo.debug(a.error),this._failed("remote",e,Po.causes.INTERNAL_ERROR),!1):(this._dialog=a,!0)}},{key:"_receiveReinvite",value:function(e){var t=this;Vo.debug("receiveReinvite()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i=!0;var n=t.status_code||403,r=t.reason_phrase||"",o=Fo.cloneArray(t.extraHeaders);if(this._status!==Zo.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,o)}.bind(this)},i=!1;if(this.emit("reinvite",r),!i){if(this._late_sdp=!1,!e.body)return this._late_sdp=!0,this._remoteHold&&(this._remoteHold=!1,this._onunhold("remote")),void(this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._createLocalDescription("offer",t._rtcOfferConstraints)})).then((function(e){o.call(t,e)})).catch((function(){e.reply(500)})));if("application/sdp"!==n)return Vo.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then((function(e){t._status!==Zo.STATUS_TERMINATED&&o.call(t,e)})).catch((function(e){Vo.warn(e)}))}function o(t){var n=this,i=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,i),this._late_sdp&&(t=this._mangleOffer(t)),e.reply(200,null,i,t,(function(){n._status=Zo.STATUS_WAITING_FOR_ACK,n._setInvite2xxTimer(e,t),n._setACKTimer()})),"function"==typeof r.callback&&r.callback()}}},{key:"_receiveUpdate",value:function(e){var t=this;Vo.debug("receiveUpdate()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i=!0;var n=t.status_code||403,r=t.reason_phrase||"",o=Fo.cloneArray(t.extraHeaders);if(this._status!==Zo.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,o)}.bind(this)},i=!1;if(this.emit("update",r),!i)if(e.body){if("application/sdp"!==n)return Vo.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then((function(e){t._status!==Zo.STATUS_TERMINATED&&o.call(t,e)})).catch((function(e){Vo.warn(e)}))}else o.call(this,null);function o(t){var n=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,n),e.reply(200,null,n,t),"function"==typeof r.callback&&r.callback()}}},{key:"_processInDialogSdpOffer",value:function(e){var t=this;Vo.debug("_processInDialogSdpOffer()");var n,r=e.parseSDP(),i=!1,o=Io(r.media);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(-1!==Xo.indexOf(s.type)){var a=s.direction||r.direction||"sendrecv";if("sendonly"!==a&&"inactive"!==a){i=!1;break}i=!0}}}catch(e){o.e(e)}finally{o.f()}var u={originator:"remote",type:"offer",sdp:e.body};Vo.debug('emit "sdp"'),this.emit("sdp",u);var l=new RTCSessionDescription({type:"offer",sdp:u.sdp});return this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){if(t._status===Zo.STATUS_TERMINATED)throw new Error("terminated");return t._connection.setRemoteDescription(l).catch((function(n){throw e.reply(488),Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n),n}))})).then((function(){if(t._status===Zo.STATUS_TERMINATED)throw new Error("terminated");!0===t._remoteHold&&!1===i?(t._remoteHold=!1,t._onunhold("remote")):!1===t._remoteHold&&!0===i&&(t._remoteHold=!0,t._onhold("remote"))})).then((function(){if(t._status===Zo.STATUS_TERMINATED)throw new Error("terminated");return t._createLocalDescription("answer",t._rtcAnswerConstraints).catch((function(t){throw e.reply(500),Vo.warn('emit "peerconnection:createtelocaldescriptionfailed" [error:%o]',t),t}))})).catch((function(e){Vo.warn("_processInDialogSdpOffer() failed [error: %o]",e)})),this._connectionPromiseQueue}},{key:"_receiveRefer",value:function(e){var n=this;if(Vo.debug("receiveRefer()"),!e.refer_to)return Vo.debug("no Refer-To header field present in REFER"),void e.reply(400);if(e.refer_to.uri.scheme!==Po.SIP)return Vo.debug("Refer-To header field points to a non-SIP URI scheme"),void e.reply(416);e.reply(202);var r=new Ko(this,e.cseq);function i(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n="function"==typeof n?n:null,this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_CONFIRMED)return!1;var o=new t(this._ua);if(o.on("progress",(function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)})),o.on("accepted",(function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)})),o.on("_failed",(function(e){var t=e.message,n=e.cause;t?r.notify(t.status_code,t.reason_phrase):r.notify(487,n)})),e.refer_to.uri.hasHeader("replaces")){var s=decodeURIComponent(e.refer_to.uri.getHeader("replaces"));i.extraHeaders=Fo.cloneArray(i.extraHeaders),i.extraHeaders.push("Replaces: ".concat(s))}o.connect(e.refer_to.uri.toAor(),i,n)}function o(){r.notify(603)}Vo.debug('emit "refer"'),this.emit("refer",{request:e,accept:function(e,t){i.call(n,e,t)},reject:function(){o.call(n)}})}},{key:"_receiveNotify",value:function(e){if(Vo.debug("receiveNotify()"),e.event||e.reply(400),"refer"===e.event.event){var t,n;if(e.event.params&&e.event.params.id)t=e.event.params.id,n=this._referSubscribers[t];else{if(1!==Object.keys(this._referSubscribers).length)return void e.reply(400,"Missing event id parameter");n=this._referSubscribers[Object.keys(this._referSubscribers)[0]]}if(!n)return void e.reply(481,"Subscription does not exist");n.receiveNotify(e),e.reply(200)}else e.reply(489)}},{key:"_receiveReplaces",value:function(e){var n=this;function r(n){var r=this;if(this._status!==Zo.STATUS_WAITING_FOR_ACK&&this._status!==Zo.STATUS_CONFIRMED)return!1;var i=new t(this._ua);i.on("confirmed",(function(){r.terminate()})),i.init_incoming(e,n)}function i(){Vo.debug("Replaced INVITE rejected by the user"),e.reply(486)}Vo.debug("receiveReplaces()"),this.emit("replaces",{request:e,accept:function(e){r.call(n,e)},reject:function(){i.call(n)}})}},{key:"_sendInitialRequest",value:function(e,t,n){var r=this,i=new jo(this._ua,this._request,{onRequestTimeout:function(){r.onRequestTimeout()},onTransportError:function(){r.onTransportError()},onAuthenticated:function(e){r._request=e},onReceiveResponse:function(e){r._receiveInviteResponse(e)}});Promise.resolve().then((function(){return n||(e.audio||e.video?(r._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(e).catch((function(e){if(r._status===Zo.STATUS_TERMINATED)throw new Error("terminated");throw r._failed("local",null,Po.causes.USER_DENIED_MEDIA_ACCESS),Vo.warn('emit "getusermediafailed" [error:%o]',e),r.emit("getusermediafailed",e),e}))):void 0)})).then((function(e){if(r._status===Zo.STATUS_TERMINATED)throw new Error("terminated");return r._localMediaStream=e,e&&e.getTracks().forEach((function(t){r._connection.addTrack(t,e)})),r._connecting(r._request),r._createLocalDescription("offer",t).catch((function(e){throw r._failed("local",null,Po.causes.WEBRTC_ERROR),e}))})).then((function(e){if(r._is_canceled||r._status===Zo.STATUS_TERMINATED)throw new Error("terminated");r._request.body=e,r._status=Zo.STATUS_INVITE_SENT,Vo.debug('emit "sending" [request:%o]',r._request),r.emit("sending",{request:r._request}),i.send()})).catch((function(e){r._status!==Zo.STATUS_TERMINATED&&Vo.warn(e)}))}},{key:"_getDTMFRTPSender",value:function(){var e=this._connection.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(e&&e.dtmf)return e.dtmf;Vo.warn("sendDTMF() | no local audio track to send DTMF with")}},{key:"_receiveInviteResponse",value:function(e){var t=this;if(Vo.debug("receiveInviteResponse()"),this._dialog&&e.status_code>=200&&e.status_code<=299){if(this._dialog.id.call_id===e.call_id&&this._dialog.id.local_tag===e.from_tag&&this._dialog.id.remote_tag===e.to_tag)return void this.sendRequest(Po.ACK);var n=new Yo(this,e,"UAC");return void 0!==n.error?void Vo.debug(n.error):(this.sendRequest(Po.ACK),void this.sendRequest(Po.BYE))}if(this._is_canceled)e.status_code>=100&&e.status_code<200?this._request.cancel(this._cancel_reason):e.status_code>=200&&e.status_code<299&&this._acceptAndTerminate(e);else if(this._status===Zo.STATUS_INVITE_SENT||this._status===Zo.STATUS_1XX_RECEIVED)switch(!0){case/^100$/.test(e.status_code):this._status=Zo.STATUS_1XX_RECEIVED;break;case/^1[0-9]{2}$/.test(e.status_code):if(!e.to_tag){Vo.debug("1xx response received without to tag");break}if(e.hasHeader("contact")&&!this._createDialog(e,"UAC",!0))break;if(this._status=Zo.STATUS_1XX_RECEIVED,!e.body){this._progress("remote",e);break}var r={originator:"remote",type:"answer",sdp:e.body};Vo.debug('emit "sdp"'),this.emit("sdp",r);var i=new RTCSessionDescription({type:"answer",sdp:r.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(i)})).then((function(){return t._progress("remote",e)})).catch((function(e){Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}));break;case/^2[0-9]{2}$/.test(e.status_code):if(this._status=Zo.STATUS_CONFIRMED,!e.body){this._acceptAndTerminate(e,400,Po.causes.MISSING_SDP),this._failed("remote",e,Po.causes.BAD_MEDIA_DESCRIPTION);break}if(!this._createDialog(e,"UAC"))break;var o={originator:"remote",type:"answer",sdp:e.body};Vo.debug('emit "sdp"'),this.emit("sdp",o);var s=new RTCSessionDescription({type:"answer",sdp:o.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){if("stable"===t._connection.signalingState)return t._connection.createOffer(t._rtcOfferConstraints).then((function(e){return t._connection.setLocalDescription(e)})).catch((function(n){t._acceptAndTerminate(e,500,n.toString()),t._failed("local",e,Po.causes.WEBRTC_ERROR)}))})).then((function(){t._connection.setRemoteDescription(s).then((function(){t._handleSessionTimersInIncomingResponse(e),t._accepted("remote",e),t.sendRequest(Po.ACK),t._confirmed("local",null)})).catch((function(n){t._acceptAndTerminate(e,488,"Not Acceptable Here"),t._failed("remote",e,Po.causes.BAD_MEDIA_DESCRIPTION),Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n)}))}));break;default:var a=Fo.sipErrorCause(e.status_code);this._failed("remote",e,a)}}},{key:"_sendReinvite",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Vo.debug("sendReinvite()");var n=Fo.cloneArray(t.extraHeaders),r=Fo.cloneObject(t.eventHandlers),i=t.rtcOfferConstraints||this._rtcOfferConstraints||null,o=!1;function s(e){var t=this;if(this._status!==Zo.STATUS_TERMINATED&&(this.sendRequest(Po.ACK),!o))if(this._handleSessionTimersInIncomingResponse(e),e.body)if(e.hasHeader("Content-Type")&&"application/sdp"===e.getHeader("Content-Type").toLowerCase()){var n={originator:"remote",type:"answer",sdp:e.body};Vo.debug('emit "sdp"'),this.emit("sdp",n);var i=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(i)})).then((function(){r.succeeded&&r.succeeded(e)})).catch((function(e){a.call(t),Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}))}else a.call(this);else a.call(this)}function a(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),n.push("Content-Type: application/sdp"),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return e._createLocalDescription("offer",i)})).then((function(t){var r={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};Vo.debug('emit "sdp"'),e.emit("sdp",r),e.sendRequest(Po.INVITE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){s.call(e,t),o=!0},onErrorResponse:function(t){a.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})})).catch((function(){a()}))}},{key:"_sendUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Vo.debug("sendUpdate()");var n=Fo.cloneArray(t.extraHeaders),r=Fo.cloneObject(t.eventHandlers),i=t.rtcOfferConstraints||this._rtcOfferConstraints||null,o=t.sdpOffer||!1,s=!1;function a(e){var t=this;if(this._status!==Zo.STATUS_TERMINATED&&!s)if(this._handleSessionTimersInIncomingResponse(e),o){if(!e.body)return void u.call(this);if(!e.hasHeader("Content-Type")||"application/sdp"!==e.getHeader("Content-Type").toLowerCase())return void u.call(this);var n={originator:"remote",type:"answer",sdp:e.body};Vo.debug('emit "sdp"'),this.emit("sdp",n);var i=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(i)})).then((function(){r.succeeded&&r.succeeded(e)})).catch((function(e){u.call(t),Vo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}))}else r.succeeded&&r.succeeded(e)}function u(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),o?(n.push("Content-Type: application/sdp"),this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return e._createLocalDescription("offer",i)})).then((function(t){var r={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};Vo.debug('emit "sdp"'),e.emit("sdp",r),e.sendRequest(Po.UPDATE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){a.call(e,t),s=!0},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})})).catch((function(){u.call(e)}))):this.sendRequest(Po.UPDATE,{extraHeaders:n,eventHandlers:{onSuccessResponse:function(t){a.call(e,t)},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}},{key:"_acceptAndTerminate",value:function(e,t,n){Vo.debug("acceptAndTerminate()");var r=[];t&&(n=n||Po.REASON_PHRASE[t]||"",r.push("Reason: SIP ;cause=".concat(t,'; text="').concat(n,'"'))),(this._dialog||this._createDialog(e,"UAC"))&&(this.sendRequest(Po.ACK),this.sendRequest(Po.BYE,{extraHeaders:r})),this._status=Zo.STATUS_TERMINATED}},{key:"_mangleOffer",value:function(e){if(!this._localHold&&!this._remoteHold)return e;if(e=Uo.parse(e),this._localHold&&!this._remoteHold){Vo.debug("mangleOffer() | me on hold, mangling offer");var t,n=Io(e.media);try{for(n.s();!(t=n.n()).done;){var r=t.value;-1!==Xo.indexOf(r.type)&&(r.direction?"sendrecv"===r.direction?r.direction="sendonly":"recvonly"===r.direction&&(r.direction="inactive"):r.direction="sendonly")}}catch(e){n.e(e)}finally{n.f()}}else if(this._localHold&&this._remoteHold){Vo.debug("mangleOffer() | both on hold, mangling offer");var i,o=Io(e.media);try{for(o.s();!(i=o.n()).done;){var s=i.value;-1!==Xo.indexOf(s.type)&&(s.direction="inactive")}}catch(e){o.e(e)}finally{o.f()}}else if(this._remoteHold){Vo.debug("mangleOffer() | remote on hold, mangling offer");var a,u=Io(e.media);try{for(u.s();!(a=u.n()).done;){var l=a.value;-1!==Xo.indexOf(l.type)&&(l.direction?"sendrecv"===l.direction?l.direction="recvonly":"recvonly"===l.direction&&(l.direction="inactive"):l.direction="recvonly")}}catch(e){u.e(e)}finally{u.f()}}return Uo.write(e)}},{key:"_setLocalMediaStatus",value:function(){var e=!0,t=!0;(this._localHold||this._remoteHold)&&(e=!1,t=!1),this._audioMuted&&(e=!1),this._videoMuted&&(t=!1),this._toggleMuteAudio(!e),this._toggleMuteVideo(!t)}},{key:"_handleSessionTimersInIncomingRequest",value:function(e,t){var n;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=Po.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,n=e.session_expires_refresher||"uas"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,n="uas"),t.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(n)),this._sessionTimers.refresher="uas"===n,this._runSessionTimer())}},{key:"_handleSessionTimersInIncomingResponse",value:function(e){var t;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=Po.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,t=e.session_expires_refresher||"uac"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,t="uac"),this._sessionTimers.refresher="uac"===t,this._runSessionTimer())}},{key:"_runSessionTimer",value:function(){var e=this,t=this._sessionTimers.currentExpires;this._sessionTimers.running=!0,clearTimeout(this._sessionTimers.timer),this._sessionTimers.refresher?this._sessionTimers.timer=setTimeout((function(){e._status!==Zo.STATUS_TERMINATED&&e._isReadyToReOffer()&&(Vo.debug("runSessionTimer() | sending session refresh request"),e._sessionTimers.refreshMethod===Po.UPDATE?e._sendUpdate():e._sendReinvite())}),500*t):this._sessionTimers.timer=setTimeout((function(){e._status!==Zo.STATUS_TERMINATED&&(Vo.warn("runSessionTimer() | timer expired, terminating the session"),e.terminate({cause:Po.causes.REQUEST_TIMEOUT,status_code:408,reason_phrase:"Session Timer Expired"}))}),1100*t)}},{key:"_toggleMuteAudio",value:function(e){var t,n=this._connection.getSenders().filter((function(e){return e.track&&"audio"===e.track.kind})),r=Io(n);try{for(r.s();!(t=r.n()).done;){t.value.track.enabled=!e}}catch(e){r.e(e)}finally{r.f()}}},{key:"_toggleMuteVideo",value:function(e){var t,n=this._connection.getSenders().filter((function(e){return e.track&&"video"===e.track.kind})),r=Io(n);try{for(r.s();!(t=r.n()).done;){t.value.track.enabled=!e}}catch(e){r.e(e)}finally{r.f()}}},{key:"_newRTCSession",value:function(e,t){Vo.debug("newRTCSession()"),this._ua.newRTCSession(this,{originator:e,session:this,request:t})}},{key:"_connecting",value:function(e){Vo.debug("session connecting"),Vo.debug('emit "connecting"'),this.emit("connecting",{request:e})}},{key:"_progress",value:function(e,t){Vo.debug("session progress"),Vo.debug('emit "progress"'),this.emit("progress",{originator:e,response:t||null})}},{key:"_accepted",value:function(e,t){Vo.debug("session accepted"),this._start_time=new Date,Vo.debug('emit "accepted"'),this.emit("accepted",{originator:e,response:t||null})}},{key:"_confirmed",value:function(e,t){Vo.debug("session confirmed"),this._is_confirmed=!0,Vo.debug('emit "confirmed"'),this.emit("confirmed",{originator:e,ack:t||null})}},{key:"_ended",value:function(e,t,n){Vo.debug("session ended"),this._end_time=new Date,this._close(),Vo.debug('emit "ended"'),this.emit("ended",{originator:e,message:t||null,cause:n})}},{key:"_failed",value:function(e,t,n){Vo.debug("session failed"),Vo.debug('emit "_failed"'),this.emit("_failed",{originator:e,message:t||null,cause:n}),this._close(),Vo.debug('emit "failed"'),this.emit("failed",{originator:e,message:t||null,cause:n})}},{key:"_onhold",value:function(e){Vo.debug("session onhold"),this._setLocalMediaStatus(),Vo.debug('emit "hold"'),this.emit("hold",{originator:e})}},{key:"_onunhold",value:function(e){Vo.debug("session onunhold"),this._setLocalMediaStatus(),Vo.debug('emit "unhold"'),this.emit("unhold",{originator:e})}},{key:"_onmute",value:function(e){var t=e.audio,n=e.video;Vo.debug("session onmute"),this._setLocalMediaStatus(),Vo.debug('emit "muted"'),this.emit("muted",{audio:t,video:n})}},{key:"_onunmute",value:function(e){var t=e.audio,n=e.video;Vo.debug("session onunmute"),this._setLocalMediaStatus(),Vo.debug('emit "unmuted"'),this.emit("unmuted",{audio:t,video:n})}},{key:"C",get:function(){return Zo}},{key:"causes",get:function(){return Po.causes}},{key:"id",get:function(){return this._id}},{key:"connection",get:function(){return this._connection}},{key:"contact",get:function(){return this._contact}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}},{key:"start_time",get:function(){return this._start_time}},{key:"end_time",get:function(){return this._end_time}},{key:"data",get:function(){return this._data},set:function(e){this._data=e}},{key:"status",get:function(){return this._status}}]),t}();function es(e){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},es(e)}function ts(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function ns(e,t){return ns=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ns(e,t)}function rs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=is(e);if(t){var i=is(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===es(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function is(e){return is=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},is(e)}var os=Q.EventEmitter,ss=Wn,as=l,us=br,ls=P(),cs=hi,hs=E,fs=x(),ds=new ss("Message"),ps=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ns(e,t)}(t,os);var e=rs(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._ua=n,r._request=null,r._closed=!1,r._direction=null,r._local_identity=null,r._remote_identity=null,r._is_replied=!1,r._data={},r}return ts(t,[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e;if(void 0===e||void 0===t)throw new TypeError("Not enough arguments");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(i));var o=ls.cloneArray(r.extraHeaders),s=ls.cloneObject(r.eventHandlers),a=r.contentType||"text/plain",u={};for(var l in r.fromUserName&&(u.from_uri=new fs("sip",r.fromUserName,this._ua.configuration.uri.host),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),r.fromDisplayName&&(u.from_display_name=r.fromDisplayName),s)Object.prototype.hasOwnProperty.call(s,l)&&this.on(l,s[l]);o.push("Content-Type: ".concat(a)),this._request=new us.OutgoingRequest(as.MESSAGE,e,this._ua,u,o),t&&(this._request.body=t);var c=new cs(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newMessage("local",this._request),c.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newMessage("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ls.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new hs.NotSupportedError('"accept" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=ls.cloneArray(e.extraHeaders),i=e.body;if("incoming"!==this._direction)throw new hs.NotSupportedError('"reject" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,i)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=ls.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,as.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,as.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newMessage",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newMessage(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){ds.debug("MESSAGE failed"),this._close(),ds.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){ds.debug("MESSAGE succeeded"),this._close(),ds.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}]),t}();function gs(e){return gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gs(e)}function ms(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function _s(e,t){return _s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_s(e,t)}function As(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vs(e);if(t){var i=vs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===gs(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function vs(e){return vs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vs(e)}var ys=Q.EventEmitter,Ts=Wn,Ss=l,Es=br,Cs=P(),ws=hi,bs=E,Is=new Ts("Options"),Rs=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_s(e,t)}(t,ys);var e=As(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._ua=n,r._request=null,r._closed=!1,r._direction=null,r._local_identity=null,r._remote_identity=null,r._is_replied=!1,r._data={},r}return ms(t,[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e;if(void 0===e)throw new TypeError("A target is required for OPTIONS");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(i));var o=Cs.cloneArray(r.extraHeaders),s=Cs.cloneObject(r.eventHandlers),a=r.contentType||"application/sdp";for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&this.on(u,s[u]);o.push("Content-Type: ".concat(a)),this._request=new Es.OutgoingRequest(Ss.OPTIONS,e,this._ua,null,o),t&&(this._request.body=t);var l=new ws(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newOptions("local",this._request),l.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newOptions("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Cs.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new bs.NotSupportedError('"accept" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=Cs.cloneArray(e.extraHeaders),i=e.body;if("incoming"!==this._direction)throw new bs.NotSupportedError('"reject" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,i)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=Cs.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,Ss.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,Ss.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newOptions",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newOptions(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){Is.debug("OPTIONS failed"),this._close(),Is.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){Is.debug("OPTIONS succeeded"),this._close(),Is.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}]),t}(),Os={},Ds=Wn,ks=P(),Ms=U(),qs=new Ds("Socket");function Ns(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}Os.isSocket=function(e){if(Array.isArray(e))return!1;if(void 0===e)return qs.warn("undefined JsSIP.Socket instance"),!1;try{if(!ks.isString(e.url))throw qs.warn("missing or invalid JsSIP.Socket url property"),new Error("Missing or invalid JsSIP.Socket url property");if(!ks.isString(e.via_transport))throw qs.warn("missing or invalid JsSIP.Socket via_transport property"),new Error("Missing or invalid JsSIP.Socket via_transport property");if(-1===Ms.parse(e.sip_uri,"SIP_URI"))throw qs.warn("missing or invalid JsSIP.Socket sip_uri property"),new Error("missing or invalid JsSIP.Socket sip_uri property")}catch(e){return!1}try{["connect","disconnect","send"].forEach((function(t){if(!ks.isFunction(e[t]))throw qs.warn("missing or invalid JsSIP.Socket method: ".concat(t)),new Error("Missing or invalid JsSIP.Socket method: ".concat(t))}))}catch(e){return!1}return!0};var Us=Os,xs=l,Ps=new Wn("Transport"),Ls={STATUS_CONNECTED:0,STATUS_CONNECTING:1,STATUS_DISCONNECTED:2,SOCKET_STATUS_READY:0,SOCKET_STATUS_ERROR:1,recovery_options:{min_interval:xs.CONNECTION_RECOVERY_MIN_INTERVAL,max_interval:xs.CONNECTION_RECOVERY_MAX_INTERVAL}},Bs=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ls.recovery_options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ps.debug("new()"),this.status=Ls.STATUS_DISCONNECTED,this.socket=null,this.sockets=[],this.recovery_options=n,this.recover_attempts=0,this.recovery_timer=null,this.close_requested=!1;try{this.textDecoder=new TextDecoder("utf8")}catch(e){Ps.warn("cannot use TextDecoder: ".concat(e))}if(void 0===t)throw new TypeError("Invalid argument. undefined 'sockets' argument");t instanceof Array||(t=[t]),t.forEach((function(e){if(!Us.isSocket(e.socket))throw new TypeError("Invalid argument. invalid 'JsSIP.Socket' instance");if(e.weight&&!Number(e.weight))throw new TypeError("Invalid argument. 'weight' attribute is not a number");this.sockets.push({socket:e.socket,weight:e.weight||0,status:Ls.SOCKET_STATUS_READY})}),this),this._getSocket()}return Ns(e,[{key:"connect",value:function(){Ps.debug("connect()"),this.isConnected()?Ps.debug("Transport is already connected"):this.isConnecting()?Ps.debug("Transport is connecting"):(this.close_requested=!1,this.status=Ls.STATUS_CONNECTING,this.onconnecting({socket:this.socket,attempts:this.recover_attempts}),this.close_requested||(this.socket.onconnect=this._onConnect.bind(this),this.socket.ondisconnect=this._onDisconnect.bind(this),this.socket.ondata=this._onData.bind(this),this.socket.connect()))}},{key:"disconnect",value:function(){Ps.debug("close()"),this.close_requested=!0,this.recover_attempts=0,this.status=Ls.STATUS_DISCONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.socket.onconnect=function(){},this.socket.ondisconnect=function(){},this.socket.ondata=function(){},this.socket.disconnect(),this.ondisconnect({socket:this.socket,error:!1})}},{key:"send",value:function(e){if(Ps.debug("send()"),!this.isConnected())return Ps.warn("unable to send message, transport is not connected"),!1;var t=e.toString();return Ps.debug("sending message:\n\n".concat(t,"\n")),this.socket.send(t)}},{key:"isConnected",value:function(){return this.status===Ls.STATUS_CONNECTED}},{key:"isConnecting",value:function(){return this.status===Ls.STATUS_CONNECTING}},{key:"_reconnect",value:function(){var e=this;this.recover_attempts+=1;var t=Math.floor(Math.random()*Math.pow(2,this.recover_attempts)+1);t<this.recovery_options.min_interval?t=this.recovery_options.min_interval:t>this.recovery_options.max_interval&&(t=this.recovery_options.max_interval),Ps.debug("reconnection attempt: ".concat(this.recover_attempts,". next connection attempt in ").concat(t," seconds")),this.recovery_timer=setTimeout((function(){e.close_requested||e.isConnected()||e.isConnecting()||(e._getSocket(),e.connect())}),1e3*t)}},{key:"_getSocket",value:function(){var e=[];if(this.sockets.forEach((function(t){t.status!==Ls.SOCKET_STATUS_ERROR&&(0===e.length?e.push(t):t.weight>e[0].weight?e=[t]:t.weight===e[0].weight&&e.push(t))})),0===e.length)return this.sockets.forEach((function(e){e.status=Ls.SOCKET_STATUS_READY})),void this._getSocket();var t=Math.floor(Math.random()*e.length);this.socket=e[t].socket}},{key:"_onConnect",value:function(){this.recover_attempts=0,this.status=Ls.STATUS_CONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.onconnect({socket:this})}},{key:"_onDisconnect",value:function(e,t,n){this.status=Ls.STATUS_DISCONNECTED,this.ondisconnect({socket:this.socket,error:e,code:t,reason:n}),this.close_requested||(this.sockets.forEach((function(e){this.socket===e.socket&&(e.status=Ls.SOCKET_STATUS_ERROR)}),this),this._reconnect(e))}},{key:"_onData",value:function(e){if("\r\n\r\n"!==e)if("\r\n"!==e){if("string"!=typeof e){try{e=this.textDecoder?this.textDecoder.decode(e):String.fromCharCode.apply(null,new Uint8Array(e))}catch(e){return void Ps.debug("received binary message failed to be converted into string, message discarded")}Ps.debug("received binary message:\n\n".concat(e,"\n"))}else Ps.debug("received text message:\n\n".concat(e,"\n"));this.ondata({transport:this,message:e})}else Ps.debug("received message with CRLF Keep Alive response");else{Ps.debug("received message with double-CRLF Keep Alive request");try{this.socket.send("\r\n")}catch(e){Ps.warn("error sending Keep Alive response: ".concat(e))}}}},{key:"via_transport",get:function(){return this.socket.via_transport}},{key:"url",get:function(){return this.socket.url}},{key:"sip_uri",get:function(){return this.socket.sip_uri}}]),e}(),Fs={};function Hs(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Gs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gs(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Gs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ys=Wn,js=U(),Qs=br,Ws=new Ys("Parser");function Ks(e,t){var n=t,r=0,i=0;if(e.substring(n,n+2).match(/(^\r\n)/))return-2;for(;0===r;){if(-1===(i=e.indexOf("\r\n",n)))return i;!e.substring(i+2,i+4).match(/(^\r\n)/)&&e.charAt(i+2).match(/(^\s+)/)?n=i+2:r=i}return r}function zs(e,t,n,r){var i,o=t.indexOf(":",n),s=t.substring(n,o).trim(),a=t.substring(o+1,r).trim();switch(s.toLowerCase()){case"via":case"v":e.addHeader("via",a),1===e.getHeaders("via").length?(i=e.parseHeader("Via"))&&(e.via=i,e.via_branch=i.branch):i=0;break;case"from":case"f":e.setHeader("from",a),(i=e.parseHeader("from"))&&(e.from=i,e.from_tag=i.getParam("tag"));break;case"to":case"t":e.setHeader("to",a),(i=e.parseHeader("to"))&&(e.to=i,e.to_tag=i.getParam("tag"));break;case"record-route":if(-1===(i=js.parse(a,"Record_Route")))i=void 0;else{var u,l=Hs(i);try{for(l.s();!(u=l.n()).done;){var c=u.value;e.addHeader("record-route",a.substring(c.possition,c.offset)),e.headers["Record-Route"][e.getHeaders("record-route").length-1].parsed=c.parsed}}catch(e){l.e(e)}finally{l.f()}}break;case"call-id":case"i":e.setHeader("call-id",a),(i=e.parseHeader("call-id"))&&(e.call_id=a);break;case"contact":case"m":if(-1===(i=js.parse(a,"Contact")))i=void 0;else{var h,f=Hs(i);try{for(f.s();!(h=f.n()).done;){var d=h.value;e.addHeader("contact",a.substring(d.possition,d.offset)),e.headers.Contact[e.getHeaders("contact").length-1].parsed=d.parsed}}catch(e){f.e(e)}finally{f.f()}}break;case"content-length":case"l":e.setHeader("content-length",a),i=e.parseHeader("content-length");break;case"content-type":case"c":e.setHeader("content-type",a),i=e.parseHeader("content-type");break;case"cseq":e.setHeader("cseq",a),(i=e.parseHeader("cseq"))&&(e.cseq=i.value),e instanceof Qs.IncomingResponse&&(e.method=i.method);break;case"max-forwards":e.setHeader("max-forwards",a),i=e.parseHeader("max-forwards");break;case"www-authenticate":e.setHeader("www-authenticate",a),i=e.parseHeader("www-authenticate");break;case"proxy-authenticate":e.setHeader("proxy-authenticate",a),i=e.parseHeader("proxy-authenticate");break;case"session-expires":case"x":e.setHeader("session-expires",a),(i=e.parseHeader("session-expires"))&&(e.session_expires=i.expires,e.session_expires_refresher=i.refresher);break;case"refer-to":case"r":e.setHeader("refer-to",a),(i=e.parseHeader("refer-to"))&&(e.refer_to=i);break;case"replaces":e.setHeader("replaces",a),(i=e.parseHeader("replaces"))&&(e.replaces=i);break;case"event":case"o":e.setHeader("event",a),(i=e.parseHeader("event"))&&(e.event=i);break;default:e.addHeader(s,a),i=0}return void 0!==i||{error:'error parsing header "'.concat(s,'"')}}function Js(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vs(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Fs.parseMessage=function(e,t){var n,r,i=e.indexOf("\r\n");if(-1!==i){var o=e.substring(0,i),s=js.parse(o,"Request_Response");if(-1!==s){s.status_code?((n=new Qs.IncomingResponse).status_code=s.status_code,n.reason_phrase=s.reason_phrase):((n=new Qs.IncomingRequest(t)).method=s.method,n.ruri=s.uri),n.data=e;for(var a=i+2;;){if(-2===(i=Ks(e,a))){r=a+2;break}if(-1===i)return void Ws.warn("parseMessage() | malformed message");if(!0!==(s=zs(n,e,a,i)))return void Ws.warn("parseMessage() |",s.error);a=i+2}if(n.hasHeader("content-length")){var u=n.getHeader("content-length");n.body=e.substr(r,u)}else n.body=e.substring(r);return n}Ws.warn('parseMessage() | error parsing first line of SIP message: "'.concat(o,'"'))}else Ws.warn("parseMessage() | no CRLF found, not a SIP message")};var Zs,Xs,$s,ea=Wn,ta=l,na=br,ra=P(),ia=new ea("sanityCheck"),oa=[function(){for(var e=0,t=["from","to","call_id","cseq","via"];e<t.length;e++){var n=t[e];if(!Zs.hasHeader(n))return ia.debug("missing mandatory header field : ".concat(n,", dropping the response")),!1}}],sa=[function(){if("sip"!==Zs.s("to").uri.scheme)return ua(416),!1},function(){if(!Zs.to_tag&&Zs.call_id.substr(0,5)===Xs.configuration.jssip_id)return ua(482),!1},function(){var e=ra.str_utf8_length(Zs.body),t=Zs.getHeader("content-length");if(e<t)return ua(400),!1},function(){var e,t=Zs.from_tag,n=Zs.call_id,r=Zs.cseq;if(Zs.to_tag)return;if(Zs.method===ta.INVITE){if(Xs._transactions.ist[Zs.via_branch])return!1;for(var i in Xs._transactions.ist)if(Object.prototype.hasOwnProperty.call(Xs._transactions.ist,i)&&(e=Xs._transactions.ist[i]).request.from_tag===t&&e.request.call_id===n&&e.request.cseq===r)return ua(482),!1}else{if(Xs._transactions.nist[Zs.via_branch])return!1;for(var o in Xs._transactions.nist)if(Object.prototype.hasOwnProperty.call(Xs._transactions.nist,o)&&(e=Xs._transactions.nist[o]).request.from_tag===t&&e.request.call_id===n&&e.request.cseq===r)return ua(482),!1}}],aa=[function(){if(Zs.getHeaders("via").length>1)return ia.debug("more than one Via header field present in the response, dropping the response"),!1},function(){var e=ra.str_utf8_length(Zs.body),t=Zs.getHeader("content-length");if(e<t)return ia.debug("message body length is lower than the value in Content-Length header field, dropping the response"),!1}];function ua(e){var t,n,r=Zs.getHeaders("via"),i="SIP/2.0 ".concat(e," ").concat(ta.REASON_PHRASE[e],"\r\n"),o=Js(r);try{for(o.s();!(n=o.n()).done;){var s=n.value;i+="Via: ".concat(s,"\r\n")}}catch(e){o.e(e)}finally{o.f()}t=Zs.getHeader("To"),Zs.to_tag||(t+=";tag=".concat(ra.newTag())),i+="To: ".concat(t,"\r\n"),i+="From: ".concat(Zs.getHeader("From"),"\r\n"),i+="Call-ID: ".concat(Zs.call_id,"\r\n"),i+="CSeq: ".concat(Zs.cseq," ").concat(Zs.method,"\r\n"),i+="\r\n",$s.send(i)}var la={};function ca(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ha(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fa=P(),da=l,pa=U(),ga=x(),ma=Os,_a=E;la.settings={authorization_user:null,password:null,realm:null,ha1:null,authorization_jwt:null,display_name:null,uri:null,contact_uri:null,instance_id:null,use_preloaded_route:!1,session_timers:!0,session_timers_refresh_method:da.UPDATE,session_timers_force_refresher:!1,no_answer_timeout:60,register:!0,register_expires:600,registrar_server:null,sockets:null,connection_recovery_max_interval:da.CONNECTION_RECOVERY_MAX_INTERVAL,connection_recovery_min_interval:da.CONNECTION_RECOVERY_MIN_INTERVAL,extra_headers:null,via_host:"".concat(fa.createRandomToken(12),".invalid")};var Aa={mandatory:{sockets:function(e){var t=[];if(ma.isSocket(e))t.push({socket:e});else{if(!Array.isArray(e)||!e.length)return;var n,r=ca(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;Object.prototype.hasOwnProperty.call(i,"socket")&&ma.isSocket(i.socket)?t.push(i):ma.isSocket(i)&&t.push({socket:i})}}catch(e){r.e(e)}finally{r.f()}}return t},uri:function(e){/^sip:/i.test(e)||(e="".concat(da.SIP,":").concat(e));var t=ga.parse(e);return t&&t.user?t:void 0}},optional:{authorization_user:function(e){return-1===pa.parse('"'.concat(e,'"'),"quoted_string")?void 0:e},authorization_jwt:function(e){if("string"==typeof e)return e},user_agent:function(e){if("string"==typeof e)return e},connection_recovery_max_interval:function(e){if(fa.isDecimal(e)){var t=Number(e);if(t>0)return t}},connection_recovery_min_interval:function(e){if(fa.isDecimal(e)){var t=Number(e);if(t>0)return t}},contact_uri:function(e){if("string"==typeof e){var t=pa.parse(e,"SIP_URI");if(-1!==t)return t}},display_name:function(e){return e},instance_id:function(e){return/^uuid:/i.test(e)&&(e=e.substr(5)),-1===pa.parse(e,"uuid")?void 0:e},no_answer_timeout:function(e){if(fa.isDecimal(e)){var t=Number(e);if(t>0)return t}},session_timers:function(e){if("boolean"==typeof e)return e},session_timers_refresh_method:function(e){if("string"==typeof e&&((e=e.toUpperCase())===da.INVITE||e===da.UPDATE))return e},session_timers_force_refresher:function(e){if("boolean"==typeof e)return e},password:function(e){return String(e)},realm:function(e){return String(e)},ha1:function(e){return String(e)},register:function(e){if("boolean"==typeof e)return e},register_expires:function(e){if(fa.isDecimal(e)){var t=Number(e);if(t>0)return t}},registrar_server:function(e){/^sip:/i.test(e)||(e="".concat(da.SIP,":").concat(e));var t=ga.parse(e);return t?t.user?void 0:t:void 0},use_preloaded_route:function(e){if("boolean"==typeof e)return e},extra_headers:function(e){var t=[];if(Array.isArray(e)&&e.length){var n,r=ca(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;"string"==typeof i&&t.push(i)}}catch(e){r.e(e)}finally{r.f()}return t}}}};function va(e){return va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},va(e)}function ya(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ta(e,t,n){return t&&ya(e.prototype,t),n&&ya(e,n),e}function Sa(e,t){return Sa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Sa(e,t)}function Ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wa(e);if(t){var i=wa(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===va(t)||"function"==typeof t))return t;return Ca(e)}(this,n)}}function Ca(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wa(e){return wa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},wa(e)}la.load=function(e,t){for(var n in Aa.mandatory){if(!t.hasOwnProperty(n))throw new _a.ConfigurationError(n);var r=t[n],i=Aa.mandatory[n](r);if(void 0===i)throw new _a.ConfigurationError(n,r);e[n]=i}for(var o in Aa.optional)if(t.hasOwnProperty(o)){var s=t[o];if(fa.isEmpty(s))continue;var a=Aa.optional[o](s);if(void 0===a)throw new _a.ConfigurationError(o,s);e[o]=a}};var ba=Q.EventEmitter,Ia=Wn,Ra=l,Oa=vi,Da=$o,ka=ps,Ma=Rs,qa=ii,Na=Bs,Ua=P(),xa=E,Pa=x(),La=Fs,Ba=br,Fa=function(e,t,n){Zs=e,Xs=t,$s=n;var r,i=Js(oa);try{for(i.s();!(r=i.n()).done;){if(!1===(0,r.value)())return!1}}catch(e){i.e(e)}finally{i.f()}if(Zs instanceof na.IncomingRequest){var o,s=Js(sa);try{for(s.s();!(o=s.n()).done;){if(!1===(0,o.value)())return!1}}catch(e){s.e(e)}finally{s.f()}}else if(Zs instanceof na.IncomingResponse){var a,u=Js(aa);try{for(u.s();!(a=u.n()).done;){if(!1===(0,a.value)())return!1}}catch(e){u.e(e)}finally{u.f()}}return!0},Ha=la,Ga=new Ia("UA"),Ya={STATUS_INIT:0,STATUS_READY:1,STATUS_USER_CLOSED:2,STATUS_NOT_READY:3,CONFIGURATION_ERROR:1,NETWORK_ERROR:2},ja=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sa(e,t)}(t,ba);var e=Ea(t);function t(n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ga.debug("new() [configuration:%o]",n),(r=e.call(this))._cache={credentials:{}},r._configuration=Object.assign({},Ha.settings),r._dynConfiguration={},r._dialogs={},r._applicants={},r._sessions={},r._transport=null,r._contact=null,r._status=Ya.STATUS_INIT,r._error=null,r._transactions={nist:{},nict:{},ist:{},ict:{}},r._data={},r._closeTimer=null,void 0===n)throw new TypeError("Not enough arguments");try{r._loadConfig(n)}catch(e){throw r._status=Ya.STATUS_NOT_READY,r._error=Ya.CONFIGURATION_ERROR,e}return r._registrator=new Oa(Ca(r)),r}return Ta(t,null,[{key:"C",get:function(){return Ya}}]),Ta(t,[{key:"start",value:function(){Ga.debug("start()"),this._status===Ya.STATUS_INIT?this._transport.connect():this._status===Ya.STATUS_USER_CLOSED?(Ga.debug("restarting UA"),null!==this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null,this._transport.disconnect()),this._status=Ya.STATUS_INIT,this._transport.connect()):this._status===Ya.STATUS_READY?Ga.debug("UA is in READY status, not restarted"):Ga.debug("ERROR: connection is down, Auto-Recovery system is trying to reconnect"),this._dynConfiguration.register=this._configuration.register}},{key:"register",value:function(){Ga.debug("register()"),this._dynConfiguration.register=!0,this._registrator.register()}},{key:"unregister",value:function(e){Ga.debug("unregister()"),this._dynConfiguration.register=!1,this._registrator.unregister(e)}},{key:"registrator",value:function(){return this._registrator}},{key:"isRegistered",value:function(){return this._registrator.registered}},{key:"isConnected",value:function(){return this._transport.isConnected()}},{key:"call",value:function(e,t){Ga.debug("call()");var n=new Da(this);return n.connect(e,t),n}},{key:"sendMessage",value:function(e,t,n){Ga.debug("sendMessage()");var r=new ka(this);return r.send(e,t,n),r}},{key:"sendOptions",value:function(e,t,n){Ga.debug("sendOptions()");var r=new Ma(this);return r.send(e,t,n),r}},{key:"terminateSessions",value:function(e){for(var t in Ga.debug("terminateSessions()"),this._sessions)this._sessions[t].isEnded()||this._sessions[t].terminate(e)}},{key:"stop",value:function(){var e=this;if(Ga.debug("stop()"),this._dynConfiguration={},this._status!==Ya.STATUS_USER_CLOSED){this._registrator.close();var t=Object.keys(this._sessions).length;for(var n in this._sessions)if(Object.prototype.hasOwnProperty.call(this._sessions,n)){Ga.debug("closing session ".concat(n));try{this._sessions[n].terminate()}catch(e){}}for(var r in this._applicants)if(Object.prototype.hasOwnProperty.call(this._applicants,r))try{this._applicants[r].close()}catch(e){}this._status=Ya.STATUS_USER_CLOSED,0===Object.keys(this._transactions.nict).length+Object.keys(this._transactions.nist).length+Object.keys(this._transactions.ict).length+Object.keys(this._transactions.ist).length&&0===t?this._transport.disconnect():this._closeTimer=setTimeout((function(){e._closeTimer=null,e._transport.disconnect()}),2e3)}else Ga.debug("UA already closed")}},{key:"normalizeTarget",value:function(e){return Ua.normalizeTarget(e,this._configuration.hostport_params)}},{key:"get",value:function(e){switch(e){case"authorization_user":return this._configuration.authorization_user;case"realm":return this._configuration.realm;case"ha1":return this._configuration.ha1;case"authorization_jwt":return this._configuration.authorization_jwt;default:return void Ga.warn('get() | cannot get "%s" parameter in runtime',e)}}},{key:"set",value:function(e,t){switch(e){case"authorization_user":this._configuration.authorization_user=String(t);break;case"password":this._configuration.password=String(t);break;case"realm":this._configuration.realm=String(t);break;case"ha1":this._configuration.ha1=String(t),this._configuration.password=null;break;case"authorization_jwt":this._configuration.authorization_jwt=String(t);break;case"display_name":this._configuration.display_name=t;break;case"extra_headers":this._configuration.extra_headers=t;break;default:return Ga.warn('set() | cannot set "%s" parameter in runtime',e),!1}return!0}},{key:"newTransaction",value:function(e){this._transactions[e.type][e.id]=e,this.emit("newTransaction",{transaction:e})}},{key:"destroyTransaction",value:function(e){delete this._transactions[e.type][e.id],this.emit("transactionDestroyed",{transaction:e})}},{key:"newDialog",value:function(e){this._dialogs[e.id]=e}},{key:"destroyDialog",value:function(e){delete this._dialogs[e.id]}},{key:"newMessage",value:function(e,t){this._applicants[e]=e,this.emit("newMessage",t)}},{key:"newOptions",value:function(e,t){this._applicants[e]=e,this.emit("newOptions",t)}},{key:"destroyMessage",value:function(e){delete this._applicants[e]}},{key:"newRTCSession",value:function(e,t){this._sessions[e.id]=e,this.emit("newRTCSession",t)}},{key:"destroyRTCSession",value:function(e){delete this._sessions[e.id]}},{key:"registered",value:function(e){this.emit("registered",e)}},{key:"unregistered",value:function(e){this.emit("unregistered",e)}},{key:"registrationFailed",value:function(e){this.emit("registrationFailed",e)}},{key:"receiveRequest",value:function(e){var t=e.method;if(e.ruri.user!==this._configuration.uri.user&&e.ruri.user!==this._contact.uri.user)return Ga.debug("Request-URI does not point to us"),void(e.method!==Ra.ACK&&e.reply_sl(404));if(e.ruri.scheme!==Ra.SIPS){if(!qa.checkTransaction(this,e)){if(t===Ra.INVITE?new qa.InviteServerTransaction(this,this._transport,e):t!==Ra.ACK&&t!==Ra.CANCEL&&new qa.NonInviteServerTransaction(this,this._transport,e),t===Ra.OPTIONS){if(0===this.listeners("newOptions").length)return void e.reply(200);new Ma(this).init_incoming(e)}else if(t===Ra.MESSAGE){if(0===this.listeners("newMessage").length)return void e.reply(405);new ka(this).init_incoming(e)}else if(t===Ra.INVITE&&!e.to_tag&&0===this.listeners("newRTCSession").length)return void e.reply(405);var n,r;if(e.to_tag)(n=this._findDialog(e.call_id,e.from_tag,e.to_tag))?n.receiveRequest(e):t===Ra.NOTIFY?(r=this._findSession(e))?r.receiveRequest(e):(Ga.debug("received NOTIFY request for a non existent subscription"),e.reply(481,"Subscription does not exist")):t!==Ra.ACK&&e.reply(481);else switch(t){case Ra.INVITE:if(window.RTCPeerConnection)if(e.hasHeader("replaces")){var i=e.replaces;(n=this._findDialog(i.call_id,i.from_tag,i.to_tag))?(r=n.owner).isEnded()?e.reply(603):r.receiveRequest(e):e.reply(481)}else(r=new Da(this)).init_incoming(e);else Ga.warn("INVITE received but WebRTC is not supported"),e.reply(488);break;case Ra.BYE:e.reply(481);break;case Ra.CANCEL:(r=this._findSession(e))?r.receiveRequest(e):Ga.debug("received CANCEL request for a non existent session");break;case Ra.ACK:break;case Ra.NOTIFY:this.emit("sipEvent",{event:e.event,request:e}),e.reply(200);break;default:e.reply(405)}}}else e.reply_sl(416)}},{key:"_findSession",value:function(e){var t=e.call_id,n=e.from_tag,r=e.to_tag,i=t+n,o=this._sessions[i],s=t+r,a=this._sessions[s];return o||(a||null)}},{key:"_findDialog",value:function(e,t,n){var r=e+t+n,i=this._dialogs[r];return i||(r=e+n+t,(i=this._dialogs[r])||null)}},{key:"_loadConfig",value:function(e){try{Ha.load(this._configuration,e)}catch(e){throw e}0===this._configuration.display_name&&(this._configuration.display_name="0"),this._configuration.instance_id||(this._configuration.instance_id=Ua.newUUID()),this._configuration.jssip_id=Ua.createRandomToken(5);var t=this._configuration.uri.clone();t.user=null,this._configuration.hostport_params=t.toString().replace(/^sip:/i,"");try{this._transport=new Na(this._configuration.sockets,{max_interval:this._configuration.connection_recovery_max_interval,min_interval:this._configuration.connection_recovery_min_interval}),this._transport.onconnecting=Qa.bind(this),this._transport.onconnect=Wa.bind(this),this._transport.ondisconnect=Ka.bind(this),this._transport.ondata=za.bind(this)}catch(e){throw Ga.warn(e),new xa.ConfigurationError("sockets",this._configuration.sockets)}if(delete this._configuration.sockets,this._configuration.authorization_user||(this._configuration.authorization_user=this._configuration.uri.user),!this._configuration.registrar_server){var n=this._configuration.uri.clone();n.user=null,n.clearParams(),n.clearHeaders(),this._configuration.registrar_server=n}this._configuration.no_answer_timeout*=1e3,this._configuration.contact_uri?this._configuration.via_host=this._configuration.contact_uri.host:this._configuration.contact_uri=new Pa("sip",Ua.createRandomToken(8),this._configuration.via_host,null,{transport:"ws"}),this._contact={pub_gruu:null,temp_gruu:null,uri:this._configuration.contact_uri,toString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.anonymous||null,n=e.outbound||null,r="<";return r+=t?this.temp_gruu||"sip:anonymous@anonymous.invalid;transport=ws":this.pub_gruu||this.uri.toString(),!n||(t?this.temp_gruu:this.pub_gruu)||(r+=";ob"),r+=">"}};var r=["authorization_user","password","realm","ha1","authorization_jwt","display_name","register","extra_headers"];for(var i in this._configuration)Object.prototype.hasOwnProperty.call(this._configuration,i)&&(-1!==r.indexOf(i)?Object.defineProperty(this._configuration,i,{writable:!0,configurable:!1}):Object.defineProperty(this._configuration,i,{writable:!1,configurable:!1}));for(var o in Ga.debug("configuration parameters after validation:"),this._configuration)if(Object.prototype.hasOwnProperty.call(Ha.settings,o))switch(o){case"uri":case"registrar_server":Ga.debug("- ".concat(o,": ").concat(this._configuration[o]));break;case"password":case"ha1":case"authorization_jwt":Ga.debug("- ".concat(o,": NOT SHOWN"));break;default:Ga.debug("- ".concat(o,": ").concat(JSON.stringify(this._configuration[o])))}}},{key:"C",get:function(){return Ya}},{key:"status",get:function(){return this._status}},{key:"contact",get:function(){return this._contact}},{key:"configuration",get:function(){return this._configuration}},{key:"transport",get:function(){return this._transport}}]),t}();function Qa(e){this.emit("connecting",e)}function Wa(e){this._status!==Ya.STATUS_USER_CLOSED&&(this._status=Ya.STATUS_READY,this._error=null,this.emit("connected",e),this._dynConfiguration.register&&this._registrator.register())}function Ka(e){for(var t=0,n=["nict","ict","nist","ist"];t<n.length;t++){var r=n[t];for(var i in this._transactions[r])Object.prototype.hasOwnProperty.call(this._transactions[r],i)&&this._transactions[r][i].onTransportError()}this.emit("disconnected",e),this._registrator.onTransportClosed(),this._status!==Ya.STATUS_USER_CLOSED&&(this._status=Ya.STATUS_NOT_READY,this._error=Ya.NETWORK_ERROR)}function za(e){var t=e.transport,n=e.message;if((n=La.parseMessage(n,this))&&!(this._status===Ya.STATUS_USER_CLOSED&&n instanceof Ba.IncomingRequest)&&Fa(n,this,t))if(n instanceof Ba.IncomingRequest)n.transport=t,this.receiveRequest(n);else if(n instanceof Ba.IncomingResponse){var r;switch(n.method){case Ra.INVITE:(r=this._transactions.ict[n.via_branch])&&r.receiveResponse(n);break;case Ra.ACK:break;default:(r=this._transactions.nict[n.via_branch])&&r.receiveResponse(n)}}}function Ja(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var Va=Wn,Za=U(),Xa=new Va("WebSocketInterface"),$a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Xa.debug('new() [url:"%s"]',t),this._url=t,this._sip_uri=null,this._via_transport=null,this._ws=null;var n=Za.parse(t,"absoluteURI");if(-1===n)throw Xa.warn("invalid WebSocket URI: ".concat(t)),new TypeError("Invalid argument: ".concat(t));if("wss"!==n.scheme&&"ws"!==n.scheme)throw Xa.warn("invalid WebSocket URI scheme: ".concat(n.scheme)),new TypeError("Invalid argument: ".concat(t));this._sip_uri="sip:".concat(n.host).concat(n.port?":".concat(n.port):"",";transport=ws"),this._via_transport=n.scheme.toUpperCase()}return Ja(e,[{key:"connect",value:function(){if(Xa.debug("connect()"),this.isConnected())Xa.debug("WebSocket ".concat(this._url," is already connected"));else if(this.isConnecting())Xa.debug("WebSocket ".concat(this._url," is connecting"));else{this._ws&&this.disconnect(),Xa.debug("connecting to WebSocket ".concat(this._url));try{this._ws=new WebSocket(this._url,"sip"),this._ws.binaryType="arraybuffer",this._ws.onopen=this._onOpen.bind(this),this._ws.onclose=this._onClose.bind(this),this._ws.onmessage=this._onMessage.bind(this),this._ws.onerror=this._onError.bind(this)}catch(e){this._onError(e)}}}},{key:"disconnect",value:function(){Xa.debug("disconnect()"),this._ws&&(this._ws.onopen=function(){},this._ws.onclose=function(){},this._ws.onmessage=function(){},this._ws.onerror=function(){},this._ws.close(),this._ws=null)}},{key:"send",value:function(e){return Xa.debug("send()"),this.isConnected()?(this._ws.send(e),!0):(Xa.warn("unable to send message, WebSocket is not open"),!1)}},{key:"isConnected",value:function(){return this._ws&&this._ws.readyState===this._ws.OPEN}},{key:"isConnecting",value:function(){return this._ws&&this._ws.readyState===this._ws.CONNECTING}},{key:"_onOpen",value:function(){Xa.debug("WebSocket ".concat(this._url," connected")),this.onconnect()}},{key:"_onClose",value:function(e){var t=e.wasClean,n=e.code,r=e.reason;Xa.debug("WebSocket ".concat(this._url," closed")),!1===t&&Xa.debug("WebSocket abrupt disconnection"),this.ondisconnect(!t,n,r)}},{key:"_onMessage",value:function(e){var t=e.data;Xa.debug("received WebSocket message"),this.ondata(t)}},{key:"_onError",value:function(e){Xa.warn("WebSocket ".concat(this._url," error: "),e)}},{key:"via_transport",get:function(){return this._via_transport},set:function(e){this._via_transport=e.toUpperCase()}},{key:"sip_uri",get:function(){return this._sip_uri}},{key:"url",get:function(){return this._url}}]),e}(),eu=a,tu=l,nu=E,ru=P(),iu=ja,ou=x(),su=N,au=U(),uu=$a;Gn("JsSIP")("version %s",eu.version);var lu,cu,hu=o({C:tu,Exceptions:nu,Utils:ru,UA:iu,URI:ou,NameAddrHeader:su,WebSocketInterface:uu,Grammar:au,debug:Gn,get name(){return eu.title},get version(){return eu.version}});!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=-1]="FAILED",e[e.TIMEOUT=-2]="TIMEOUT",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE=403]="UNAVAILABLE",e[e.SYSTEMBUSY=450]="SYSTEMBUSY",e[e.NOENOUGNCHARACTER=10001]="NOENOUGNCHARACTER"}(lu||(lu={})),function(e){e[e.SUCCESS=200]="SUCCESS",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE=403]="UNAVAILABLE",e[e.TIMEOUT=408]="TIMEOUT",e[e.LOCKED=423]="LOCKED",e[e.SYSTEMBUSY=450]="SYSTEMBUSY",e[e.FAILED=500]="FAILED",e[e.NOENOUGNCHARACTER=10001]="NOENOUGNCHARACTER"}(cu||(cu={})),hu.debug.disable();var fu=function(){function e(e){this.callType="",this.ua={},this.socket={},this.isManualStop=!1,this.pingTimerId=0,this.newRTCSession={},this.incomingSession={},this.outgoingSession={},this.stream={},this.audio=new Audio,this.ringAudio=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjEyLjEwMAAAAAAAAAAAAAAA/+NAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAABGAABmoQACAwMDBAgIDBAUFBYaGh4iIiUpLCwvMzM3Ozs/Q0dHS09PU1dXW19kZGhsbHB0dHh8gICEiIiMkJCUmJycoKSkqKyssLO3t7u/v8PHx8vP0tLW2tre4uLm6u7u8fT0+Pv7//8AAAAATGF2YzYwLjI2AAAAAAAAAAAAAAAAJANAAAAAAAAAZqGS3w4qAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/jEGQAAAABpAAAAAAAAANIAAAAAP+YSXZLC+9DgcDGZj1QcY5YcTQaglIDDNqAdgLpg2P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JfbfVopgAmv2AYdsw1v7393ya3/8yiTvRqr5srFsgBwAAAAKTgKUWWQOl+a////66K/v0b//+hEb5m+f/oxX+lF9X/R+X9P///+mm1u/0SztjAEGmcwt84pf89/zFwAFa7ksqi1eUyliKgqlLhoTQYAZgMDphREZlIJZgsBYGDQiAtCWYEgMaHuEYeAAYCgIBgBMT/+OAZDYlMgswo+74AA2RokofwRAACxMZhXMiFeMHBVgxUw7jCrA2IAD21HgFVPPO3FjTrOKy10XGgODn6gN+5Daty+ds242wSvFqkWf6DY1G5a88IeCFQ640zGFkWFOr8Rn2gF3ZWYAgAqMyzw4AWK0D7U2Gr9NTS6m2kNIJyJO3DrpAUAAwAQCB4BYwBQLDBHCwMJ0AJ8AaAAiMyq64MPWv5rv/v8u44440tLl12b0MVIRGIax/3uq1dU0as6pqamy3Symm7+qaNU1NTY////////8/e99/////////////////f/+6WVT2pVZ////yy1TRqNRqXU1NKqWzjjzVNKqaz+X/jS0tkR4BiYoYA/zN4S//J+ye4USGdv5G//+kx3Q3/+n/WqCv/+p3/xFEQNHv///1BVzPMi9I12M4lYAAAYPL5XczooDZ2yqWytmxgcCg4IBqYT5pyMZgGC5hiDpg8FhQVRgAEpnt5Zj4MpguEpgoMhmYSpqOUp3SfJoMR1mHmKKYhYR5gvgZlUAQBAWGAQAMwUQgDvomQJACOswN/+OAZGInQb8k8674ABRDJkWvQVAAubAUVk8BIA5m76vw2GSL6gIYADSoMBYAFTOC1GG0ZS0l00Q1mqduy9qUwQAGnIl4zUtMq5ym+XKra/ooAOFACjAiAtSpC4AQ0AjDTT5WrqKRhkim0FsqSIVkIgBGdurPMJjbI0EjTzADADAQCJgEg9GAuAUYDoG48Amw58XNqYYcz/DDD//+09Ky/Dsruw9DkYjDsxS9XiUCR+336kYl9v////////////////uFPU//y/Cxblj/xSRMsdOL77//nc///////lSrlE41Altvn4UJqcvBiPeWLAiKBgHv81/jBg/Ge3zG/+YYqmHnt/ukw+hpcn/7Oiu3///1T///5rfu3/////mD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oADpig75Q+46aaDhhGYMDpAhcA3J1wYBCwFXCdTwuM4UMF83czo/x5nYGEAQ5CgZAcAha51MkrGb/43Bk/CmJ4zF/zmgSCeAKSlOCAAANJcdmKxVtRJ+oBmYzHq1Nd3n3F44y8tLU1jjz/6/z8OlYZvFmdS2zSU9LPyymx1+W946////+m1z//////9c/7m+3u49wywzx7ruHed/LVWQCAARAMEiCgCACGJYS8OuPZaE3yp9q/1fh54fnf1Pt/93//2///6JMQU1FMy4xMDEgKGJldGEgMimqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/jEGTgAAAB/gDgAAAAAAP8AcAAAKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo="),this.answerEvent=[],this.newMessageEvent=[],this.sessionEvent={},this.callDetails=null,this.getMediaStream=function(){return navigator.mediaDevices.getUserMedia({audio:!0,video:!1})},this.incomingCallCallback=e.incomingCallCallback,(null==e?void 0:e.getMediaStream)&&(this.getMediaStream=e.getMediaStream)}return e.prototype.initMicrophone=function(){var e=this;this.getMediaStream().then((function(t){e.stream=t})).catch((function(){console.error("Error getting microphone stream")}))},e.prototype.destroyMicrophone=function(){var e,t;this.stream&&(null===(t=(e=this.stream).getTracks)||void 0===t||t.call(e).forEach((function(e){return e.stop()})),this.stream={})},e.prototype.reset=function(){this.newRTCSession={},this.incomingSession={},this.outgoingSession={},this.setCallType(""),this.callDetails=null,clearTimeout(this.pingTimerId),this.pingTimerId=0},e.prototype.setCallType=function(e){this.callType=e},e.prototype.getCallType=function(){return this.callType},e.prototype.init=function(e){return t(this,void 0,void 0,(function(){var r,i,o,s,a,u=this;return n(this,(function(l){return r=e.wssuri,i=e.password,o=e.uri,this.socket=new hu.WebSocketInterface(r),s={sockets:[this.socket],uri:o,password:i,register:!0,register_expires:300,session_timers:!0},(a=new hu.UA(s)).on("connected",(function(){u.sendPing()})),a.on("disconnected",(function(){u.isManualStop&&u.stop()})),a.on("registrationFailed",(function(){u.stop()})),a.on("registrationExpiring",(function(){u.ua.register()})),a.on("newMessage",(function(e){var t=JSON.parse(e.request.body);u.emitNewMessageEvent({code:cu.SUCCESS,data:t,message:"success"})})),a.on("newRTCSession",(function(e){return t(u,void 0,void 0,(function(){var t,r,i=this;return n(this,(function(n){switch(n.label){case 0:return this.callDetails=null,this.newRTCSession=e,t=e.session,"remote"!==e.originator?[3,4]:"outboundCall"!==this.callType?[3,1]:(this.answer(),[3,3]);case 1:return this.setCallType("inboundCall"),[4,this.incomingCallCallback(e)];case 2:r=n.sent(),this.callDetails=r.data,this.playRing(),this.emitAnswerEvent(r),n.label=3;case 3:return this.incomingSession=t,this.incomingSession.on("connecting",(function(){})),[3,5];case 4:this.outgoingSession=t,this.outgoingSession.on("connecting",(function(){})),n.label=5;case 5:return t.on("confirmed",(function(e){"outboundCall"!==i.callType&&i.emitSessionEvent("success",{code:cu.SUCCESS,data:i.callDetails,message:"success"})})),t.on("ended",(function(e){i.emitSessionEvent("ended",{code:cu.SUCCESS,data:i.callDetails,message:"success"}),i.reset()})),t.on("failed",(function(e){i.emitSessionEvent("failed",{code:cu.FAILED,data:i.callDetails,message:"failed"}),i.stopRing(),i.reset()})),t.on("peerconnection",(function(e){e.peerconnection.ontrack=function(e){if(e.streams&&e.streams[0])i.audio.srcObject=e.streams[0],i.audio.paused&&i.audio.play();else{var t=new MediaStream;t.addTrack(e.track),i.audio.srcObject=t,i.audio.paused&&i.audio.play()}}})),[2]}}))}))})),this.ua=a,this.ringAudio.loop=!0,[2]}))}))},e.prototype.start=function(){this.isManualStop=!1,this.initMicrophone(),this.ua.start()},e.prototype.stop=function(e){e&&(this.isManualStop=!0),this.destroyMicrophone(),this.reset(),this.ua.stop()},e.prototype.destroy=function(){this.stop(),this.ua={}},e.prototype.getSocketWS=function(){return this.socket._ws},e.prototype.sendPing=function(){var e=this;this.pingTimerId=setTimeout((function(){var t=!1;try{t=e.socket.send("ping")}catch(e){t=!1}var n=e.getSocketWS();if(!t&&![0,1].includes(null==n?void 0:n.readyState))return e.socket.connect(),clearTimeout(e.pingTimerId),void(e.pingTimerId=0);e.sendPing()}),3e3)},e.prototype.playRing=function(){this.ringAudio.play()},e.prototype.stopRing=function(){this.ringAudio.pause(),this.ringAudio.currentTime=0},e.prototype.call=function(e,t,n,r){var i={eventHandlers:t,mediaConstraints:{audio:!0,video:!1},mediaStream:this.stream,sessionTimersExpires:1800};this.ua.call(e,i)},e.prototype.hangup=function(){this.stopRing(),this.ua.terminateSessions()},e.prototype.ignore=function(){this.stopRing(),this.ua.terminateSessions({cause:"Busy",status_code:486})},e.prototype.answer=function(){var e,t,n;this.stopRing(),null===(n=null===(t=null===(e=this.newRTCSession)||void 0===e?void 0:e.session)||void 0===t?void 0:t.answer)||void 0===n||n.call(t,{mediaConstraints:{audio:!0,video:!1},mediaStream:this.stream,sessionTimersExpires:1800})},e.prototype.attachAnswerEvent=function(e){e&&"function"==typeof e&&this.answerEvent.push(e)},e.prototype.removeAnswerEvent=function(e){var t=this.answerEvent;if(t&&t.length)for(var n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}},e.prototype.emitAnswerEvent=function(e){this.answerEvent.forEach((function(t){t(e)}))},e.prototype.attachNewMessageEvent=function(e){var t;e&&"function"==typeof e&&(null===(t=this.newMessageEvent)||void 0===t||t.push(e))},e.prototype.removeNewMessageEvent=function(e){var t=this.newMessageEvent;if(t&&t.length)for(var n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}},e.prototype.emitNewMessageEvent=function(e){this.newMessageEvent.forEach((function(t){t(e)}))},e.prototype.attchSessionEvent=function(e,t){t&&"function"==typeof t&&(this.sessionEvent[e]||(this.sessionEvent[e]=[]),this.sessionEvent[e].push(t))},e.prototype.removeSessionEvent=function(e,t){var n=this.sessionEvent[e];if(n&&n.length)for(var r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}},e.prototype.emitSessionEvent=function(e,t){(this.sessionEvent[e]||[]).forEach((function(e){e(t)}))},e.prototype.on=function(e,t){return this.ua.on(e,t),this},e.prototype.RTCSessionOn=function(e,t){this.newRTCSession.session.on(e,t)},e.prototype.mute=function(){this.newRTCSession.session.mute({audio:!0})},e.prototype.unmute=function(){this.newRTCSession.session.unmute({audio:!0})},e.prototype.isMuted=function(){return this.newRTCSession.session.isMuted()},e.prototype.getIsRegistered=function(){return this.ua.isRegistered()},e}(),du={exports:{}};
|
|
1
|
+
"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}"function"==typeof SuppressedError&&SuppressedError;let r=(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var a={name:"jssip",title:"JsSIP",description:"the Javascript SIP library",version:"3.10.1",homepage:"https://jssip.net",contributors:["José Luis Millán <jmillan@aliax.net> (https://github.com/jmillan)","Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)"],types:"lib/JsSIP.d.ts",main:"lib-es5/JsSIP.js",keywords:["sip","websocket","webrtc","node","browser","library"],license:"MIT",repository:{type:"git",url:"https://github.com/versatica/JsSIP.git"},bugs:{url:"https://github.com/versatica/JsSIP/issues"},dependencies:{"@types/events":"^3.0.0","@types/debug":"^4.1.7",debug:"^4.3.1",events:"^3.3.0","sdp-transform":"^2.14.1"},devDependencies:{"@babel/core":"^7.19.6","@babel/preset-env":"^7.19.4","ansi-colors":"^3.2.4",browserify:"^16.5.1",eslint:"^5.16.0","fancy-log":"^1.3.3",gulp:"^4.0.2","gulp-babel":"^8.0.0","gulp-eslint":"^5.0.0","gulp-expect-file":"^1.0.2","gulp-header":"^2.0.9","gulp-nodeunit-runner":"^0.2.2","gulp-plumber":"^1.2.1","gulp-rename":"^1.4.0","gulp-uglify-es":"^1.0.4",pegjs:"^0.7.0","vinyl-buffer":"^1.0.1","vinyl-source-stream":"^2.0.0"},scripts:{lint:"node npm-scripts.js lint",test:"node npm-scripts.js test",prepublish:"node npm-scripts.js prepublish",release:"node npm-scripts.js release"}},u=a,l={USER_AGENT:"".concat(u.title," ").concat(u.version),SIP:"sip",SIPS:"sips",causes:{CONNECTION_ERROR:"Connection Error",REQUEST_TIMEOUT:"Request Timeout",SIP_FAILURE_CODE:"SIP Failure Code",INTERNAL_ERROR:"Internal Error",BUSY:"Busy",REJECTED:"Rejected",REDIRECTED:"Redirected",UNAVAILABLE:"Unavailable",NOT_FOUND:"Not Found",ADDRESS_INCOMPLETE:"Address Incomplete",INCOMPATIBLE_SDP:"Incompatible SDP",MISSING_SDP:"Missing SDP",AUTHENTICATION_ERROR:"Authentication Error",BYE:"Terminated",WEBRTC_ERROR:"WebRTC Error",CANCELED:"Canceled",NO_ANSWER:"No Answer",EXPIRES:"Expires",NO_ACK:"No ACK",DIALOG_ERROR:"Dialog Error",USER_DENIED_MEDIA_ACCESS:"User Denied Media Access",BAD_MEDIA_DESCRIPTION:"Bad Media Description",RTP_TIMEOUT:"RTP Timeout"},SIP_ERROR_CAUSES:{REDIRECTED:[300,301,302,305,380],BUSY:[486,600],REJECTED:[403,603],NOT_FOUND:[404,604],UNAVAILABLE:[480,410,408,430],ADDRESS_INCOMPLETE:[484,424],INCOMPATIBLE_SDP:[488,606],AUTHENTICATION_ERROR:[401,407]},ACK:"ACK",BYE:"BYE",CANCEL:"CANCEL",INFO:"INFO",INVITE:"INVITE",MESSAGE:"MESSAGE",NOTIFY:"NOTIFY",OPTIONS:"OPTIONS",REGISTER:"REGISTER",REFER:"REFER",UPDATE:"UPDATE",SUBSCRIBE:"SUBSCRIBE",DTMF_TRANSPORT:{INFO:"INFO",RFC2833:"RFC2833"},REASON_PHRASE:{100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",424:"Bad Location Information",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"JsSIP Internal Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"},ALLOWED_METHODS:"INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60,CONNECTION_RECOVERY_MAX_INTERVAL:30,CONNECTION_RECOVERY_MIN_INTERVAL:2};function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}function d(e){var t=m();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function p(e){var t="function"==typeof Map?new Map:void 0;return p=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return g(e,arguments,A(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_(r,e)},p(e)}function g(e,t,n){return g=m()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&_(i,n.prototype),i},g.apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var v,y,T,S,E,C,w,b=function(){f(t,p(Error));var e=d(t);function t(n,r){var i;return h(this,t),(i=e.call(this)).code=1,i.name="CONFIGURATION_ERROR",i.parameter=n,i.value=r,i.message=i.value?"Invalid value ".concat(JSON.stringify(i.value),' for parameter "').concat(i.parameter,'"'):"Missing parameter: ".concat(i.parameter),i}return t}(),I=function(){f(t,p(Error));var e=d(t);function t(n){var r;return h(this,t),(r=e.call(this)).code=2,r.name="INVALID_STATE_ERROR",r.status=n,r.message="Invalid status: ".concat(n),r}return t}(),R=function(){f(t,p(Error));var e=d(t);function t(n){var r;return h(this,t),(r=e.call(this)).code=3,r.name="NOT_SUPPORTED_ERROR",r.message=n,r}return t}(),O=function(){f(t,p(Error));var e=d(t);function t(n){var r;return h(this,t),(r=e.call(this)).code=4,r.name="NOT_READY_ERROR",r.message=n,r}return t}(),D={ConfigurationError:b,InvalidStateError:I,NotSupportedError:R,NotReadyError:O},k={};function M(){if(y)return v;function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}y=1;var n=N(),r=q();return v=function(){function e(t,r,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!(t&&t instanceof n))throw new TypeError('missing or invalid "uri" parameter');for(var o in this._uri=t,this._parameters={},this.display_name=r,i)Object.prototype.hasOwnProperty.call(i,o)&&this.setParam(o,i[o])}return t(e,null,[{key:"parse",value:function(e){return-1!==(e=r.parse(e,"Name_Addr_Header"))?e:void 0}}]),t(e,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]=null==t?null:t.toString())}},{key:"getParam",value:function(e){if(e)return this._parameters[e.toLowerCase()]}},{key:"hasParam",value:function(e){if(e)return!!this._parameters.hasOwnProperty(e.toLowerCase())}},{key:"deleteParam",value:function(e){if(e=e.toLowerCase(),this._parameters.hasOwnProperty(e)){var t=this._parameters[e];return delete this._parameters[e],t}}},{key:"clearParams",value:function(){this._parameters={}}},{key:"clone",value:function(){return new e(this._uri.clone(),this._display_name,JSON.parse(JSON.stringify(this._parameters)))}},{key:"_quote",value:function(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}},{key:"toString",value:function(){var e=this._display_name?'"'.concat(this._quote(this._display_name),'" '):"";for(var t in e+="<".concat(this._uri.toString(),">"),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,t)&&(e+=";".concat(t),null!==this._parameters[t]&&(e+="=".concat(this._parameters[t])));return e}},{key:"uri",get:function(){return this._uri}},{key:"display_name",get:function(){return this._display_name},set:function(e){this._display_name=0===e?"0":e}}]),e}(),v}function q(){return S||(S=1,T=function(){function e(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var t={parse:function(t,n){var r={CRLF:u,DIGIT:l,ALPHA:c,HEXDIG:h,WSP:f,OCTET:d,DQUOTE:p,SP:g,HTAB:m,alphanum:_,reserved:A,unreserved:v,mark:y,escaped:T,LWS:S,SWS:E,HCOLON:C,TEXT_UTF8_TRIM:w,TEXT_UTF8char:b,UTF8_NONASCII:I,UTF8_CONT:R,LHEX:function(){var e;null===(e=l())&&(/^[a-f]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[a-f]")));return e},token:O,token_nodot:D,separators:function(){var e;40===t.charCodeAt(i)?(e="(",i++):(e=null,a('"("'));null===e&&(41===t.charCodeAt(i)?(e=")",i++):(e=null,a('")"')),null===e&&(60===t.charCodeAt(i)?(e="<",i++):(e=null,a('"<"')),null===e&&(62===t.charCodeAt(i)?(e=">",i++):(e=null,a('">"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","')),null===e&&(59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(92===t.charCodeAt(i)?(e="\\",i++):(e=null,a('"\\\\"')),null===e&&null===(e=p())&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null===e&&(93===t.charCodeAt(i)?(e="]",i++):(e=null,a('"]"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(123===t.charCodeAt(i)?(e="{",i++):(e=null,a('"{"')),null===e&&(125===t.charCodeAt(i)?(e="}",i++):(e=null,a('"}"')),null===e&&null===(e=g())&&(e=m()))))))))))))))));return e},word:k,STAR:q,SLASH:U,EQUAL:x,LPAREN:P,RPAREN:L,RAQUOT:B,LAQUOT:F,COMMA:H,SEMI:G,COLON:Y,LDQUOT:j,RDQUOT:Q,comment:function e(){var t,n,r,o;if(o=i,null!==(t=P())){for(n=[],null===(r=W())&&null===(r=V())&&(r=e());null!==r;)n.push(r),null===(r=W())&&null===(r=V())&&(r=e());null!==n&&null!==(r=L())?t=[t,n,r]:(t=null,i=o)}else t=null,i=o;return t},ctext:W,quoted_string:K,quoted_string_clean:z,qdtext:J,quoted_pair:V,SIP_URI_noparams:Z,SIP_URI:X,uri_scheme:$,uri_scheme_sips:ee,uri_scheme_sip:te,userinfo:ne,user:re,user_unreserved:ie,password:oe,hostport:se,host:ae,hostname:ue,domainlabel:le,toplabel:ce,IPv6reference:he,IPv6address:fe,h16:de,ls32:pe,IPv4address:ge,dec_octet:me,port:_e,uri_parameters:Ae,uri_parameter:ve,transport_param:ye,user_param:Te,method_param:Se,ttl_param:Ee,maddr_param:Ce,lr_param:we,other_param:be,pname:Ie,pvalue:Re,paramchar:Oe,param_unreserved:De,headers:ke,header:Me,hname:qe,hvalue:Ne,hnv_unreserved:Ue,Request_Response:function(){var e;null===(e=ht())&&(e=xe());return e},Request_Line:xe,Request_URI:Pe,absoluteURI:Le,hier_part:Be,net_path:Fe,abs_path:He,opaque_part:Ge,uric:Ye,uric_no_slash:je,path_segments:Qe,segment:We,param:Ke,pchar:ze,scheme:Je,authority:Ve,srvr:Ze,reg_name:Xe,query:$e,SIP_Version:et,INVITEm:tt,ACKm:nt,OPTIONSm:rt,BYEm:it,CANCELm:ot,REGISTERm:st,SUBSCRIBEm:at,NOTIFYm:ut,REFERm:lt,Method:ct,Status_Line:ht,Status_Code:ft,extension_code:dt,Reason_Phrase:pt,Allow_Events:function(){var e,t,n,r,o,s;if(o=i,null!==(e=Lt())){for(t=[],s=i,null!==(n=H())&&null!==(r=Lt())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=Lt())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Call_ID:function(){var e,n,r,o,s,u;o=i,s=i,null!==(e=k())?(u=i,64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null!==n&&null!==(r=k())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s);null!==e&&(e=function(e){Hn=t.substring(i,e)}(o));null===e&&(i=o);return e},Contact:function(){var e,t,n,r,o,s,a;if(o=i,null===(e=q()))if(s=i,null!==(e=gt())){for(t=[],a=i,null!==(n=H())&&null!==(r=gt())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=H())&&null!==(r=gt())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e,t;for(t=Hn.multi_header.length,e=0;e<t;e++)if(null===Hn.multi_header[e].parsed){Hn=null;break}Hn=null!==Hn?Hn.multi_header:-1}());null===e&&(i=o);return e},contact_param:gt,name_addr:mt,display_name:_t,contact_params:At,c_p_q:vt,c_p_expires:yt,delta_seconds:Tt,qvalue:St,generic_param:Et,gen_value:Ct,Content_Disposition:function(){var e,t,n,r,o,s;if(o=i,null!==(e=wt())){for(t=[],s=i,null!==(n=G())&&null!==(r=bt())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=bt())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},disp_type:wt,disp_param:bt,handling_param:It,Content_Encoding:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Content_Length:function(){var e,t,n;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;null!==e&&(e=void(Hn=parseInt(e.join(""))));null===e&&(i=n);return e},Content_Type:function(){var e,n;n=i,null!==(e=Rt())&&(e=function(e){Hn=t.substring(i,e)}(n));null===e&&(i=n);return e},media_type:Rt,m_type:Ot,discrete_type:Dt,composite_type:kt,extension_token:Mt,x_token:qt,m_subtype:Nt,m_parameter:Ut,m_value:xt,CSeq:function(){var e,t,n,r;r=i,null!==(e=Pt())&&null!==(t=S())&&null!==(n=ct())?e=[e,t,n]:(e=null,i=r);return e},CSeq_value:Pt,Expires:function(){var e,t;t=i,null!==(e=Tt())&&(e=void(Hn=e));null===e&&(i=t);return e},Event:function(){var e,t,n,r,o,s,a;if(o=i,s=i,null!==(e=Lt())){for(t=[],a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(u=e[0],e=void(Hn.event=u.join("").toLowerCase()));var u;null===e&&(i=o);return e},event_type:Lt,From:function(){var e,t,n,r,o,s,a;o=i,s=i,null===(e=Z())&&(e=mt());if(null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=Bt())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Bt())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e=Hn.tag;try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params),e&&Hn.setParam("tag",e)}catch(e){Hn=-1}}());null===e&&(i=o);return e},from_param:Bt,tag_param:Ft,Max_Forwards:function(){var e,t,n;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;null!==e&&(e=void(Hn=parseInt(e.join(""))));null===e&&(i=n);return e},Min_Expires:function(){var e,t;t=i,null!==(e=Tt())&&(e=void(Hn=e));null===e&&(i=t);return e},Name_Addr_Header:function(){var e,t,n,r,o,s,a,u,l,c;u=i,l=i,e=[],t=_t();for(;null!==t;)e.push(t),t=_t();if(null!==e)if(null!==(t=F()))if(null!==(n=X()))if(null!==(r=B())){for(o=[],c=i,null!==(s=G())&&null!==(a=Et())?s=[s,a]:(s=null,i=c);null!==s;)o.push(s),c=i,null!==(s=G())&&null!==(a=Et())?s=[s,a]:(s=null,i=c);null!==o?e=[e,t,n,r,o]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;else e=null,i=l;null!==e&&(e=function(){try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params)}catch(e){Hn=-1}}());null===e&&(i=u);return e},Proxy_Authenticate:function(){return Ht()},challenge:Ht,other_challenge:Gt,auth_param:Yt,digest_cln:jt,realm:Qt,realm_value:Wt,domain:Kt,URI:zt,nonce:Jt,nonce_value:Vt,opaque:Zt,stale:Xt,algorithm:$t,qop_options:en,qop_value:tn,Proxy_Require:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Record_Route:function(){var e,t,n,r,o,s,a;if(o=i,s=i,null!==(e=nn())){for(t=[],a=i,null!==(n=H())&&null!==(r=nn())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=H())&&null!==(r=nn())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e,t;for(t=Hn.multi_header.length,e=0;e<t;e++)if(null===Hn.multi_header[e].parsed){Hn=null;break}Hn=null!==Hn?Hn.multi_header:-1}());null===e&&(i=o);return e},rec_route:nn,Reason:function(){var e,n,r,o,s,u,l;s=i,u=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"SIP"'));null===e&&(e=O());if(null!==e){for(n=[],l=i,null!==(r=G())&&null!==(o=rn())?r=[r,o]:(r=null,i=l);null!==r;)n.push(r),l=i,null!==(r=G())&&null!==(o=rn())?r=[r,o]:(r=null,i=l);null!==n?e=[e,n]:(e=null,i=u)}else e=null,i=u;null!==e&&(e=function(e,t){if(Hn.protocol=t.toLowerCase(),Hn.params||(Hn.params={}),Hn.params.text&&'"'===Hn.params.text[0]){var n=Hn.params.text;Hn.text=n.substring(1,n.length-1),delete Hn.params.text}}(0,e[0]));null===e&&(i=s);return e},reason_param:rn,reason_cause:on,Require:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},Route:function(){var e,t,n,r,o,s;if(o=i,null!==(e=sn())){for(t=[],s=i,null!==(n=H())&&null!==(r=sn())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=sn())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},route_param:sn,Subscription_State:function(){var e,t,n,r,o,s;if(o=i,null!==(e=an())){for(t=[],s=i,null!==(n=G())&&null!==(r=un())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=un())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},substate_value:an,subexp_params:un,event_reason_value:ln,Subject:function(){var e;return e=null!==(e=w())?e:""},Supported:function(){var e,t,n,r,o,s;if(o=i,null!==(e=O())){for(t=[],s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=O())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e=null!==e?e:""},To:function(){var e,t,n,r,o,s,a;o=i,s=i,null===(e=Z())&&(e=mt());if(null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=cn())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=cn())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){var e=Hn.tag;try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params),e&&Hn.setParam("tag",e)}catch(e){Hn=-1}}());null===e&&(i=o);return e},to_param:cn,Via:function(){var e,t,n,r,o,s;if(o=i,null!==(e=hn())){for(t=[],s=i,null!==(n=H())&&null!==(r=hn())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=H())&&null!==(r=hn())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},via_param:hn,via_params:fn,via_ttl:dn,via_maddr:pn,via_received:gn,via_branch:mn,response_port:_n,rport:An,sent_protocol:vn,protocol_name:yn,transport:Tn,sent_by:Sn,via_host:En,via_port:Cn,ttl:wn,WWW_Authenticate:function(){return Ht()},Session_Expires:function(){var e,t,n,r,o,s;if(o=i,null!==(e=bn())){for(t=[],s=i,null!==(n=G())&&null!==(r=In())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=In())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},s_e_expires:bn,s_e_params:In,s_e_refresher:Rn,extension_header:function(){var e,t,n,r;r=i,null!==(e=O())&&null!==(t=C())&&null!==(n=On())?e=[e,t,n]:(e=null,i=r);return e},header_value:On,message_body:function(){var e,t;e=[],t=d();for(;null!==t;)e.push(t),t=d();return e},uuid_URI:function(){var e,n,r;r=i,"uuid:"===t.substr(i,5)?(e="uuid:",i+=5):(e=null,a('"uuid:"'));null!==e&&null!==(n=Dn())?e=[e,n]:(e=null,i=r);return e},uuid:Dn,hex4:kn,hex8:Mn,hex12:qn,Refer_To:function(){var e,t,n,r,o,s,a;o=i,s=i,null===(e=Z())&&(e=mt());if(null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;null!==e&&(e=function(){try{Hn=new Fn(Hn.uri,Hn.display_name,Hn.params)}catch(e){Hn=-1}}());null===e&&(i=o);return e},Replaces:function(){var e,t,n,r,o,s;if(o=i,null!==(e=Nn())){for(t=[],s=i,null!==(n=G())&&null!==(r=Un())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=Un())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e},call_id:Nn,replaces_param:Un,to_tag:xn,from_tag:Pn,early_flag:Ln};if(void 0!==n){if(void 0===r[n])throw new Error("Invalid rule name: "+e(n)+".")}else n="CRLF";var i=0,o=0,s=[];function a(e){i<o||(i>o&&(o=i,s=[]),s.push(e))}function u(){var e;return"\r\n"===t.substr(i,2)?(e="\r\n",i+=2):(e=null,a('"\\r\\n"')),e}function l(){var e;return/^[0-9]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[0-9]")),e}function c(){var e;return/^[a-zA-Z]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[a-zA-Z]")),e}function h(){var e;return/^[0-9a-fA-F]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[0-9a-fA-F]")),e}function f(){var e;return null===(e=g())&&(e=m()),e}function d(){var e;return/^[\0-\xFF]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\0-\\xFF]")),e}function p(){var e;return/^["]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a('["]')),e}function g(){var e;return 32===t.charCodeAt(i)?(e=" ",i++):(e=null,a('" "')),e}function m(){var e;return 9===t.charCodeAt(i)?(e="\t",i++):(e=null,a('"\\t"')),e}function _(){var e;return/^[a-zA-Z0-9]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[a-zA-Z0-9]")),e}function A(){var e;return 59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","'))))))))))),e}function v(){var e;return null===(e=_())&&(e=y()),e}function y(){var e;return 45===t.charCodeAt(i)?(e="-",i++):(e=null,a('"-"')),null===e&&(95===t.charCodeAt(i)?(e="_",i++):(e=null,a('"_"')),null===e&&(46===t.charCodeAt(i)?(e=".",i++):(e=null,a('"."')),null===e&&(33===t.charCodeAt(i)?(e="!",i++):(e=null,a('"!"')),null===e&&(126===t.charCodeAt(i)?(e="~",i++):(e=null,a('"~"')),null===e&&(42===t.charCodeAt(i)?(e="*",i++):(e=null,a('"*"')),null===e&&(39===t.charCodeAt(i)?(e="'",i++):(e=null,a('"\'"')),null===e&&(40===t.charCodeAt(i)?(e="(",i++):(e=null,a('"("')),null===e&&(41===t.charCodeAt(i)?(e=")",i++):(e=null,a('")"')))))))))),e}function T(){var e,n,r,o,s;return o=i,s=i,37===t.charCodeAt(i)?(e="%",i++):(e=null,a('"%"')),null!==e&&null!==(n=h())&&null!==(r=h())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=e.join("")),null===e&&(i=o),e}function S(){var e,t,n,r,o,s;for(r=i,o=i,s=i,e=[],t=f();null!==t;)e.push(t),t=f();if(null!==e&&null!==(t=u())?e=[e,t]:(e=null,i=s),null!==(e=null!==e?e:"")){if(null!==(n=f()))for(t=[];null!==n;)t.push(n),n=f();else t=null;null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return null!==e&&(e=" "),null===e&&(i=r),e}function E(){var e;return e=null!==(e=S())?e:""}function C(){var e,n,r,o,s;for(o=i,s=i,e=[],null===(n=g())&&(n=m());null!==n;)e.push(n),null===(n=g())&&(n=m());return null!==e?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=":"),null===e&&(i=o),e}function w(){var e,n,r,o,s,a,u;if(s=i,a=i,null!==(n=b()))for(e=[];null!==n;)e.push(n),n=b();else e=null;if(null!==e){for(n=[],u=i,r=[],o=S();null!==o;)r.push(o),o=S();for(null!==r&&null!==(o=b())?r=[r,o]:(r=null,i=u);null!==r;){for(n.push(r),u=i,r=[],o=S();null!==o;)r.push(o),o=S();null!==r&&null!==(o=b())?r=[r,o]:(r=null,i=u)}null!==n?e=[e,n]:(e=null,i=a)}else e=null,i=a;return null!==e&&(e=function(e){return t.substring(i,e)}(s)),null===e&&(i=s),e}function b(){var e;return/^[!-~]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[!-~]")),null===e&&(e=I()),e}function I(){var e;return/^[\x80-\uFFFF]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\x80-\\uFFFF]")),e}function R(){var e;return/^[\x80-\xBF]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\x80-\\xBF]")),e}function O(){var e,n,r;if(r=i,null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"'))))))))))));else e=null;return null!==e&&(e=function(e){return t.substring(i,e)}(r)),null===e&&(i=r),e}function D(){var e,n,r;if(r=i,null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"'))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')))))))))));else e=null;return null!==e&&(e=function(e){return t.substring(i,e)}(r)),null===e&&(i=r),e}function k(){var e,n,r;if(r=i,null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')),null===n&&(40===t.charCodeAt(i)?(n="(",i++):(n=null,a('"("')),null===n&&(41===t.charCodeAt(i)?(n=")",i++):(n=null,a('")"')),null===n&&(60===t.charCodeAt(i)?(n="<",i++):(n=null,a('"<"')),null===n&&(62===t.charCodeAt(i)?(n=">",i++):(n=null,a('">"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(92===t.charCodeAt(i)?(n="\\",i++):(n=null,a('"\\\\"')),null===n&&null===(n=p())&&(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null===n&&(91===t.charCodeAt(i)?(n="[",i++):(n=null,a('"["')),null===n&&(93===t.charCodeAt(i)?(n="]",i++):(n=null,a('"]"')),null===n&&(63===t.charCodeAt(i)?(n="?",i++):(n=null,a('"?"')),null===n&&(123===t.charCodeAt(i)?(n="{",i++):(n=null,a('"{"')),null===n&&(125===t.charCodeAt(i)?(n="}",i++):(n=null,a('"}"')))))))))))))))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=_())&&(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null===n&&(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null===n&&(33===t.charCodeAt(i)?(n="!",i++):(n=null,a('"!"')),null===n&&(37===t.charCodeAt(i)?(n="%",i++):(n=null,a('"%"')),null===n&&(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null===n&&(95===t.charCodeAt(i)?(n="_",i++):(n=null,a('"_"')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(96===t.charCodeAt(i)?(n="`",i++):(n=null,a('"`"')),null===n&&(39===t.charCodeAt(i)?(n="'",i++):(n=null,a('"\'"')),null===n&&(126===t.charCodeAt(i)?(n="~",i++):(n=null,a('"~"')),null===n&&(40===t.charCodeAt(i)?(n="(",i++):(n=null,a('"("')),null===n&&(41===t.charCodeAt(i)?(n=")",i++):(n=null,a('")"')),null===n&&(60===t.charCodeAt(i)?(n="<",i++):(n=null,a('"<"')),null===n&&(62===t.charCodeAt(i)?(n=">",i++):(n=null,a('">"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(92===t.charCodeAt(i)?(n="\\",i++):(n=null,a('"\\\\"')),null===n&&null===(n=p())&&(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null===n&&(91===t.charCodeAt(i)?(n="[",i++):(n=null,a('"["')),null===n&&(93===t.charCodeAt(i)?(n="]",i++):(n=null,a('"]"')),null===n&&(63===t.charCodeAt(i)?(n="?",i++):(n=null,a('"?"')),null===n&&(123===t.charCodeAt(i)?(n="{",i++):(n=null,a('"{"')),null===n&&(125===t.charCodeAt(i)?(n="}",i++):(n=null,a('"}"'))))))))))))))))))))))));else e=null;return null!==e&&(e=function(e){return t.substring(i,e)}(r)),null===e&&(i=r),e}function q(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(42===t.charCodeAt(i)?(n="*",i++):(n=null,a('"*"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="*"),null===e&&(i=o),e}function U(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="/"),null===e&&(i=o),e}function x(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="="),null===e&&(i=o),e}function P(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(40===t.charCodeAt(i)?(n="(",i++):(n=null,a('"("')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e="("),null===e&&(i=o),e}function L(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(41===t.charCodeAt(i)?(n=")",i++):(n=null,a('")"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=")"),null===e&&(i=o),e}function B(){var e,n,r,o;return r=i,o=i,62===t.charCodeAt(i)?(e=">",i++):(e=null,a('">"')),null!==e&&null!==(n=E())?e=[e,n]:(e=null,i=o),null!==e&&(e=">"),null===e&&(i=r),e}function F(){var e,n,r,o;return r=i,o=i,null!==(e=E())?(60===t.charCodeAt(i)?(n="<",i++):(n=null,a('"<"')),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==e&&(e="<"),null===e&&(i=r),e}function H(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=","),null===e&&(i=o),e}function G(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=";"),null===e&&(i=o),e}function Y(){var e,n,r,o,s;return o=i,s=i,null!==(e=E())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=E())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=":"),null===e&&(i=o),e}function j(){var e,t,n,r;return n=i,r=i,null!==(e=E())&&null!==(t=p())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function Q(){var e,t,n,r;return n=i,r=i,null!==(e=p())&&null!==(t=E())?e=[e,t]:(e=null,i=r),null!==e&&(e='"'),null===e&&(i=n),e}function W(){var e;return/^[!-']/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[!-']")),null===e&&(/^[*-[]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[*-[]")),null===e&&(/^[\]-~]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\]-~]")),null===e&&null===(e=I())&&(e=S()))),e}function K(){var e,n,r,o,s,a;if(s=i,a=i,null!==(e=E()))if(null!==(n=p())){for(r=[],null===(o=J())&&(o=V());null!==o;)r.push(o),null===(o=J())&&(o=V());null!==r&&null!==(o=p())?e=[e,n,r,o]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;return null!==e&&(e=function(e){return t.substring(i,e)}(s)),null===e&&(i=s),e}function z(){var e,n,r,o,s,a;if(s=i,a=i,null!==(e=E()))if(null!==(n=p())){for(r=[],null===(o=J())&&(o=V());null!==o;)r.push(o),null===(o=J())&&(o=V());null!==r&&null!==(o=p())?e=[e,n,r,o]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;return null!==e&&(e=function(e){var n=t.substring(i,e).trim();return n.substring(1,n.length-1).replace(/\\([\x00-\x09\x0b-\x0c\x0e-\x7f])/g,"$1")}(s)),null===e&&(i=s),e}function J(){var e;return null===(e=S())&&(33===t.charCodeAt(i)?(e="!",i++):(e=null,a('"!"')),null===e&&(/^[#-[]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[#-[]")),null===e&&(/^[\]-~]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[\\]-~]")),null===e&&(e=I())))),e}function V(){var e,n,r;return r=i,92===t.charCodeAt(i)?(e="\\",i++):(e=null,a('"\\\\"')),null!==e?(/^[\0-\t]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[\\0-\\t]")),null===n&&(/^[\x0B-\f]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[\\x0B-\\f]")),null===n&&(/^[\x0E-]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[\\x0E-]")))),null!==n?e=[e,n]:(e=null,i=r)):(e=null,i=r),e}function Z(){var e,n,r,o,s,u;return s=i,u=i,null!==(e=$())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=null!==(r=ne())?r:"")&&null!==(o=se())?e=[e,n,r,o]:(e=null,i=u)):(e=null,i=u),null!==e&&(e=function(){try{Hn.uri=new Bn(Hn.scheme,Hn.user,Hn.host,Hn.port),delete Hn.scheme,delete Hn.user,delete Hn.host,delete Hn.host_type,delete Hn.port}catch(e){Hn=-1}}()),null===e&&(i=s),e}function X(){var e,r,o,s,u,l,c,h;return c=i,h=i,null!==(e=$())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=null!==(o=ne())?o:"")&&null!==(s=se())&&null!==(u=Ae())&&null!==(l=null!==(l=ke())?l:"")?e=[e,r,o,s,u,l]:(e=null,i=h)):(e=null,i=h),null!==e&&(e=function(){try{Hn.uri=new Bn(Hn.scheme,Hn.user,Hn.host,Hn.port,Hn.uri_params,Hn.uri_headers),delete Hn.scheme,delete Hn.user,delete Hn.host,delete Hn.host_type,delete Hn.port,delete Hn.uri_params,"SIP_URI"===n&&(Hn=Hn.uri)}catch(e){Hn=-1}}()),null===e&&(i=c),e}function $(){var e;return null===(e=ee())&&(e=te()),e}function ee(){var e,n,r;return n=i,"sips"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"sips"')),null!==e&&(r=e,e=void(Hn.scheme=r.toLowerCase())),null===e&&(i=n),e}function te(){var e,n,r;return n=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"sip"')),null!==e&&(r=e,e=void(Hn.scheme=r.toLowerCase())),null===e&&(i=n),e}function ne(){var e,n,r,o,s,u;return o=i,s=i,null!==(e=re())?(u=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=oe())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?(64===t.charCodeAt(i)?(r="@",i++):(r=null,a('"@"')),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){Hn.user=decodeURIComponent(t.substring(i-1,e))}(o)),null===e&&(i=o),e}function re(){var e,t;if(null===(t=v())&&null===(t=T())&&(t=ie()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=v())&&null===(t=T())&&(t=ie());else e=null;return e}function ie(){var e;return 38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","')),null===e&&(59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"'))))))))),e}function oe(){var e,n,r;for(r=i,e=[],null===(n=v())&&null===(n=T())&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')))))));null!==n;)e.push(n),null===(n=v())&&null===(n=T())&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')),null===n&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')))))));return null!==e&&(e=function(e){Hn.password=t.substring(i,e)}(r)),null===e&&(i=r),e}function se(){var e,n,r,o,s;return o=i,null!==(e=ae())?(s=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=_e())?n=[n,r]:(n=null,i=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=o)):(e=null,i=o),e}function ae(){var e,n;return n=i,null===(e=ue())&&null===(e=ge())&&(e=he()),null!==e&&(e=function(e){return Hn.host=t.substring(i,e).toLowerCase(),Hn.host}(n)),null===e&&(i=n),e}function ue(){var e,n,r,o,s,u;for(o=i,s=i,e=[],u=i,null!==(n=le())?(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r?n=[n,r]:(n=null,i=u)):(n=null,i=u);null!==n;)e.push(n),u=i,null!==(n=le())?(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r?n=[n,r]:(n=null,i=u)):(n=null,i=u);return null!==e&&null!==(n=ce())?(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==(r=null!==r?r:"")?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){return Hn.host_type="domain",t.substring(i,e)}(o)),null===e&&(i=o),e}function le(){var e,n,r,o;if(o=i,null!==(e=_())){for(n=[],null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==r;)n.push(r),null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==n?e=[e,n]:(e=null,i=o)}else e=null,i=o;return e}function ce(){var e,n,r,o;if(o=i,null!==(e=c())){for(n=[],null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==r;)n.push(r),null===(r=_())&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(95===t.charCodeAt(i)?(r="_",i++):(r=null,a('"_"'))));null!==n?e=[e,n]:(e=null,i=o)}else e=null,i=o;return e}function he(){var e,n,r,o,s;return o=i,s=i,91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null!==e&&null!==(n=fe())?(93===t.charCodeAt(i)?(r="]",i++):(r=null,a('"]"')),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){return Hn.host_type="IPv6",t.substring(i,e)}(o)),null===e&&(i=o),e}function fe(){var e,n,r,o,s,u,l,c,h,f,d,p,g,m,_,A;return m=i,_=i,null!==(e=de())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?(58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?(58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?(58===t.charCodeAt(i)?(c=":",i++):(c=null,a('":"')),null!==c&&null!==(h=de())?(58===t.charCodeAt(i)?(f=":",i++):(f=null,a('":"')),null!==f&&null!==(d=de())?(58===t.charCodeAt(i)?(p=":",i++):(p=null,a('":"')),null!==p&&null!==(g=pe())?e=[e,n,r,o,s,u,l,c,h,f,d,p,g]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?(58===t.charCodeAt(i)?(h=":",i++):(h=null,a('":"')),null!==h&&null!==(f=de())?(58===t.charCodeAt(i)?(d=":",i++):(d=null,a('":"')),null!==d&&null!==(p=pe())?e=[e,n,r,o,s,u,l,c,h,f,d,p]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?(58===t.charCodeAt(i)?(h=":",i++):(h=null,a('":"')),null!==h&&null!==(f=pe())?e=[e,n,r,o,s,u,l,c,h,f]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=pe())?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=pe())?e=[e,n,r,o,s,u]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?(58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=pe())?e=[e,n,r,o]:(e=null,i=_)):(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=pe())?e=[e,n]:(e=null,i=_),null===e&&(_=i,"::"===t.substr(i,2)?(e="::",i+=2):(e=null,a('"::"')),null!==e&&null!==(n=de())?e=[e,n]:(e=null,i=_),null===e&&(_=i,null!==(e=de())?("::"===t.substr(i,2)?(n="::",i+=2):(n=null,a('"::"')),null!==n&&null!==(r=de())?(58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?(58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?(58===t.charCodeAt(i)?(c=":",i++):(c=null,a('":"')),null!==c&&null!==(h=de())?(58===t.charCodeAt(i)?(f=":",i++):(f=null,a('":"')),null!==f&&null!==(d=pe())?e=[e,n,r,o,s,u,l,c,h,f,d]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?("::"===t.substr(i,2)?(r="::",i+=2):(r=null,a('"::"')),null!==r&&null!==(o=de())?(58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?(58===t.charCodeAt(i)?(h=":",i++):(h=null,a('":"')),null!==h&&null!==(f=pe())?e=[e,n,r,o,s,u,l,c,h,f]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?("::"===t.substr(i,2)?(o="::",i+=2):(o=null,a('"::"')),null!==o&&null!==(s=de())?(58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?(58===t.charCodeAt(i)?(c=":",i++):(c=null,a('":"')),null!==c&&null!==(h=pe())?e=[e,n,r,o,s,u,l,c,h]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?("::"===t.substr(i,2)?(s="::",i+=2):(s=null,a('"::"')),null!==s&&null!==(u=de())?(58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=pe())?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?(A=i,58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?s=[s,u]:(s=null,i=A),null!==(s=null!==s?s:"")?("::"===t.substr(i,2)?(u="::",i+=2):(u=null,a('"::"')),null!==u&&null!==(l=pe())?e=[e,n,r,o,s,u,l]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?(A=i,58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?s=[s,u]:(s=null,i=A),null!==(s=null!==s?s:"")?(A=i,58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?u=[u,l]:(u=null,i=A),null!==(u=null!==u?u:"")?("::"===t.substr(i,2)?(l="::",i+=2):(l=null,a('"::"')),null!==l&&null!==(c=de())?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_),null===e&&(_=i,null!==(e=de())?(A=i,58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?n=[n,r]:(n=null,i=A),null!==(n=null!==n?n:"")?(A=i,58===t.charCodeAt(i)?(r=":",i++):(r=null,a('":"')),null!==r&&null!==(o=de())?r=[r,o]:(r=null,i=A),null!==(r=null!==r?r:"")?(A=i,58===t.charCodeAt(i)?(o=":",i++):(o=null,a('":"')),null!==o&&null!==(s=de())?o=[o,s]:(o=null,i=A),null!==(o=null!==o?o:"")?(A=i,58===t.charCodeAt(i)?(s=":",i++):(s=null,a('":"')),null!==s&&null!==(u=de())?s=[s,u]:(s=null,i=A),null!==(s=null!==s?s:"")?(A=i,58===t.charCodeAt(i)?(u=":",i++):(u=null,a('":"')),null!==u&&null!==(l=de())?u=[u,l]:(u=null,i=A),null!==(u=null!==u?u:"")?(A=i,58===t.charCodeAt(i)?(l=":",i++):(l=null,a('":"')),null!==l&&null!==(c=de())?l=[l,c]:(l=null,i=A),null!==(l=null!==l?l:"")?("::"===t.substr(i,2)?(c="::",i+=2):(c=null,a('"::"')),null!==c?e=[e,n,r,o,s,u,l,c]:(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_)):(e=null,i=_))))))))))))))),null!==e&&(e=function(e){return Hn.host_type="IPv6",t.substring(i,e)}(m)),null===e&&(i=m),e}function de(){var e,t,n,r,o;return o=i,null!==(e=h())&&null!==(t=null!==(t=h())?t:"")&&null!==(n=null!==(n=h())?n:"")&&null!==(r=null!==(r=h())?r:"")?e=[e,t,n,r]:(e=null,i=o),e}function pe(){var e,n,r,o;return o=i,null!==(e=de())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n&&null!==(r=de())?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),null===e&&(e=ge()),e}function ge(){var e,n,r,o,s,u,l,c,h;return c=i,h=i,null!==(e=me())?(46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null!==n&&null!==(r=me())?(46===t.charCodeAt(i)?(o=".",i++):(o=null,a('"."')),null!==o&&null!==(s=me())?(46===t.charCodeAt(i)?(u=".",i++):(u=null,a('"."')),null!==u&&null!==(l=me())?e=[e,n,r,o,s,u,l]:(e=null,i=h)):(e=null,i=h)):(e=null,i=h)):(e=null,i=h),null!==e&&(e=function(e){return Hn.host_type="IPv4",t.substring(i,e)}(c)),null===e&&(i=c),e}function me(){var e,n,r,o;return o=i,"25"===t.substr(i,2)?(e="25",i+=2):(e=null,a('"25"')),null!==e?(/^[0-5]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[0-5]")),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null===e&&(o=i,50===t.charCodeAt(i)?(e="2",i++):(e=null,a('"2"')),null!==e?(/^[0-4]/.test(t.charAt(i))?(n=t.charAt(i),i++):(n=null,a("[0-4]")),null!==n&&null!==(r=l())?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),null===e&&(o=i,49===t.charCodeAt(i)?(e="1",i++):(e=null,a('"1"')),null!==e&&null!==(n=l())&&null!==(r=l())?e=[e,n,r]:(e=null,i=o),null===e&&(o=i,/^[1-9]/.test(t.charAt(i))?(e=t.charAt(i),i++):(e=null,a("[1-9]")),null!==e&&null!==(n=l())?e=[e,n]:(e=null,i=o),null===e&&(e=l())))),e}function _e(){var e,t,n,r,o,s,a,u;return s=i,a=i,null!==(e=null!==(e=l())?e:"")&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")?e=[e,t,n,r,o]:(e=null,i=a),null!==e&&(u=e,u=parseInt(u.join("")),Hn.port=u,e=u),null===e&&(i=s),e}function Ae(){var e,n,r,o;for(e=[],o=i,59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null!==n&&null!==(r=ve())?n=[n,r]:(n=null,i=o);null!==n;)e.push(n),o=i,59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null!==n&&null!==(r=ve())?n=[n,r]:(n=null,i=o);return e}function ve(){var e;return null===(e=ye())&&null===(e=Te())&&null===(e=Se())&&null===(e=Ee())&&null===(e=Ce())&&null===(e=we())&&(e=be()),e}function ye(){var e,n,r,o;return r=i,o=i,"transport="===t.substr(i,10).toLowerCase()?(e=t.substr(i,10),i+=10):(e=null,a('"transport="')),null!==e?("udp"===t.substr(i,3).toLowerCase()?(n=t.substr(i,3),i+=3):(n=null,a('"udp"')),null===n&&("tcp"===t.substr(i,3).toLowerCase()?(n=t.substr(i,3),i+=3):(n=null,a('"tcp"')),null===n&&("sctp"===t.substr(i,4).toLowerCase()?(n=t.substr(i,4),i+=4):(n=null,a('"sctp"')),null===n&&("tls"===t.substr(i,3).toLowerCase()?(n=t.substr(i,3),i+=3):(n=null,a('"tls"')),null===n&&(n=O())))),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==e&&(e=function(e,t){Hn.uri_params||(Hn.uri_params={}),Hn.uri_params.transport=t.toLowerCase()}(0,e[1])),null===e&&(i=r),e}function Te(){var e,n,r,o,s;return r=i,o=i,"user="===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"user="')),null!==e?("phone"===t.substr(i,5).toLowerCase()?(n=t.substr(i,5),i+=5):(n=null,a('"phone"')),null===n&&("ip"===t.substr(i,2).toLowerCase()?(n=t.substr(i,2),i+=2):(n=null,a('"ip"')),null===n&&(n=O())),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.user=s.toLowerCase())),null===e&&(i=r),e}function Se(){var e,n,r,o,s;return r=i,o=i,"method="===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"method="')),null!==e&&null!==(n=ct())?e=[e,n]:(e=null,i=o),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.method=s)),null===e&&(i=r),e}function Ee(){var e,n,r,o,s;return r=i,o=i,"ttl="===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"ttl="')),null!==e&&null!==(n=wn())?e=[e,n]:(e=null,i=o),null!==e&&(s=e[1],Hn.params||(Hn.params={}),e=void(Hn.params.ttl=s)),null===e&&(i=r),e}function Ce(){var e,n,r,o,s;return r=i,o=i,"maddr="===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"maddr="')),null!==e&&null!==(n=ae())?e=[e,n]:(e=null,i=o),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.maddr=s)),null===e&&(i=r),e}function we(){var e,n,r,o,s,u;return o=i,s=i,"lr"===t.substr(i,2).toLowerCase()?(e=t.substr(i,2),i+=2):(e=null,a('"lr"')),null!==e?(u=i,61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=O())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s),null!==e&&(Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.lr=void 0)),null===e&&(i=o),e}function be(){var e,n,r,o,s,u,l,c;return o=i,s=i,null!==(e=Ie())?(u=i,61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=Re())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s),null!==e&&(l=e[0],c=e[1],Hn.uri_params||(Hn.uri_params={}),c=void 0===c?void 0:c[1],e=void(Hn.uri_params[l.toLowerCase()]=c)),null===e&&(i=o),e}function Ie(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Re(){var e,t,n;if(n=i,null!==(t=Oe()))for(e=[];null!==t;)e.push(t),t=Oe();else e=null;return null!==e&&(e=e.join("")),null===e&&(i=n),e}function Oe(){var e;return null===(e=De())&&null===(e=v())&&(e=T()),e}function De(){var e;return 91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null===e&&(93===t.charCodeAt(i)?(e="]",i++):(e=null,a('"]"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')))))))),e}function ke(){var e,n,r,o,s,u,l;if(u=i,63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null!==e)if(null!==(n=Me())){for(r=[],l=i,38===t.charCodeAt(i)?(o="&",i++):(o=null,a('"&"')),null!==o&&null!==(s=Me())?o=[o,s]:(o=null,i=l);null!==o;)r.push(o),l=i,38===t.charCodeAt(i)?(o="&",i++):(o=null,a('"&"')),null!==o&&null!==(s=Me())?o=[o,s]:(o=null,i=l);null!==r?e=[e,n,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return e}function Me(){var e,n,r,o,s,u,l;return o=i,s=i,null!==(e=qe())?(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null!==n&&null!==(r=Ne())?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[0],l=e[2],u=u.join("").toLowerCase(),l=l.join(""),Hn.uri_headers||(Hn.uri_headers={}),e=void(Hn.uri_headers[u]?Hn.uri_headers[u].push(l):Hn.uri_headers[u]=[l])),null===e&&(i=o),e}function qe(){var e,t;if(null===(t=Ue())&&null===(t=v())&&(t=T()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=Ue())&&null===(t=v())&&(t=T());else e=null;return e}function Ne(){var e,t;for(e=[],null===(t=Ue())&&null===(t=v())&&(t=T());null!==t;)e.push(t),null===(t=Ue())&&null===(t=v())&&(t=T());return e}function Ue(){var e;return 91===t.charCodeAt(i)?(e="[",i++):(e=null,a('"["')),null===e&&(93===t.charCodeAt(i)?(e="]",i++):(e=null,a('"]"')),null===e&&(47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')))))))),e}function xe(){var e,t,n,r,o,s;return s=i,null!==(e=ct())&&null!==(t=g())&&null!==(n=Pe())&&null!==(r=g())&&null!==(o=et())?e=[e,t,n,r,o]:(e=null,i=s),e}function Pe(){var e;return null===(e=X())&&(e=Le()),e}function Le(){var e,n,r,o;return o=i,null!==(e=Je())?(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null!==n?(null===(r=Be())&&(r=Ge()),null!==r?e=[e,n,r]:(e=null,i=o)):(e=null,i=o)):(e=null,i=o),e}function Be(){var e,n,r,o,s;return o=i,null===(e=Fe())&&(e=He()),null!==e?(s=i,63===t.charCodeAt(i)?(n="?",i++):(n=null,a('"?"')),null!==n&&null!==(r=$e())?n=[n,r]:(n=null,i=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=o)):(e=null,i=o),e}function Fe(){var e,n,r,o;return o=i,"//"===t.substr(i,2)?(e="//",i+=2):(e=null,a('"//"')),null!==e&&null!==(n=Ve())&&null!==(r=null!==(r=He())?r:"")?e=[e,n,r]:(e=null,i=o),e}function He(){var e,n,r;return r=i,47===t.charCodeAt(i)?(e="/",i++):(e=null,a('"/"')),null!==e&&null!==(n=Qe())?e=[e,n]:(e=null,i=r),e}function Ge(){var e,t,n,r;if(r=i,null!==(e=je())){for(t=[],n=Ye();null!==n;)t.push(n),n=Ye();null!==t?e=[e,t]:(e=null,i=r)}else e=null,i=r;return e}function Ye(){var e;return null===(e=A())&&null===(e=v())&&(e=T()),e}function je(){var e;return null===(e=v())&&null===(e=T())&&(59===t.charCodeAt(i)?(e=";",i++):(e=null,a('";"')),null===e&&(63===t.charCodeAt(i)?(e="?",i++):(e=null,a('"?"')),null===e&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","'))))))))))),e}function Qe(){var e,n,r,o,s,u;if(s=i,null!==(e=We())){for(n=[],u=i,47===t.charCodeAt(i)?(r="/",i++):(r=null,a('"/"')),null!==r&&null!==(o=We())?r=[r,o]:(r=null,i=u);null!==r;)n.push(r),u=i,47===t.charCodeAt(i)?(r="/",i++):(r=null,a('"/"')),null!==r&&null!==(o=We())?r=[r,o]:(r=null,i=u);null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return e}function We(){var e,n,r,o,s,u;for(s=i,e=[],n=ze();null!==n;)e.push(n),n=ze();if(null!==e){for(n=[],u=i,59===t.charCodeAt(i)?(r=";",i++):(r=null,a('";"')),null!==r&&null!==(o=Ke())?r=[r,o]:(r=null,i=u);null!==r;)n.push(r),u=i,59===t.charCodeAt(i)?(r=";",i++):(r=null,a('";"')),null!==r&&null!==(o=Ke())?r=[r,o]:(r=null,i=u);null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return e}function Ke(){var e,t;for(e=[],t=ze();null!==t;)e.push(t),t=ze();return e}function ze(){var e;return null===(e=v())&&null===(e=T())&&(58===t.charCodeAt(i)?(e=":",i++):(e=null,a('":"')),null===e&&(64===t.charCodeAt(i)?(e="@",i++):(e=null,a('"@"')),null===e&&(38===t.charCodeAt(i)?(e="&",i++):(e=null,a('"&"')),null===e&&(61===t.charCodeAt(i)?(e="=",i++):(e=null,a('"="')),null===e&&(43===t.charCodeAt(i)?(e="+",i++):(e=null,a('"+"')),null===e&&(36===t.charCodeAt(i)?(e="$",i++):(e=null,a('"$"')),null===e&&(44===t.charCodeAt(i)?(e=",",i++):(e=null,a('","'))))))))),e}function Je(){var e,n,r,o,s;if(o=i,s=i,null!==(e=c())){for(n=[],null===(r=c())&&null===(r=l())&&(43===t.charCodeAt(i)?(r="+",i++):(r=null,a('"+"')),null===r&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')))));null!==r;)n.push(r),null===(r=c())&&null===(r=l())&&(43===t.charCodeAt(i)?(r="+",i++):(r=null,a('"+"')),null===r&&(45===t.charCodeAt(i)?(r="-",i++):(r=null,a('"-"')),null===r&&(46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')))));null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=function(e){Hn.scheme=t.substring(i,e)}(o)),null===e&&(i=o),e}function Ve(){var e;return null===(e=Ze())&&(e=Xe()),e}function Ze(){var e,n,r,o;return r=i,o=i,null!==(e=ne())?(64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null!==n?e=[e,n]:(e=null,i=o)):(e=null,i=o),null!==(e=null!==e?e:"")&&null!==(n=se())?e=[e,n]:(e=null,i=r),e=null!==e?e:""}function Xe(){var e,n;if(null===(n=v())&&null===(n=T())&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')),null===n&&(59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null===n&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"')))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=v())&&null===(n=T())&&(36===t.charCodeAt(i)?(n="$",i++):(n=null,a('"$"')),null===n&&(44===t.charCodeAt(i)?(n=",",i++):(n=null,a('","')),null===n&&(59===t.charCodeAt(i)?(n=";",i++):(n=null,a('";"')),null===n&&(58===t.charCodeAt(i)?(n=":",i++):(n=null,a('":"')),null===n&&(64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null===n&&(38===t.charCodeAt(i)?(n="&",i++):(n=null,a('"&"')),null===n&&(61===t.charCodeAt(i)?(n="=",i++):(n=null,a('"="')),null===n&&(43===t.charCodeAt(i)?(n="+",i++):(n=null,a('"+"'))))))))));else e=null;return e}function $e(){var e,t;for(e=[],t=Ye();null!==t;)e.push(t),t=Ye();return e}function et(){var e,n,r,o,s,u,c,h;if(c=i,h=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"SIP"')),null!==e)if(47===t.charCodeAt(i)?(n="/",i++):(n=null,a('"/"')),null!==n){if(null!==(o=l()))for(r=[];null!==o;)r.push(o),o=l();else r=null;if(null!==r)if(46===t.charCodeAt(i)?(o=".",i++):(o=null,a('"."')),null!==o){if(null!==(u=l()))for(s=[];null!==u;)s.push(u),u=l();else s=null;null!==s?e=[e,n,r,o,s]:(e=null,i=h)}else e=null,i=h;else e=null,i=h}else e=null,i=h;else e=null,i=h;return null!==e&&(e=function(e){Hn.sip_version=t.substring(i,e)}(c)),null===e&&(i=c),e}function tt(){var e;return"INVITE"===t.substr(i,6)?(e="INVITE",i+=6):(e=null,a('"INVITE"')),e}function nt(){var e;return"ACK"===t.substr(i,3)?(e="ACK",i+=3):(e=null,a('"ACK"')),e}function rt(){var e;return"OPTIONS"===t.substr(i,7)?(e="OPTIONS",i+=7):(e=null,a('"OPTIONS"')),e}function it(){var e;return"BYE"===t.substr(i,3)?(e="BYE",i+=3):(e=null,a('"BYE"')),e}function ot(){var e;return"CANCEL"===t.substr(i,6)?(e="CANCEL",i+=6):(e=null,a('"CANCEL"')),e}function st(){var e;return"REGISTER"===t.substr(i,8)?(e="REGISTER",i+=8):(e=null,a('"REGISTER"')),e}function at(){var e;return"SUBSCRIBE"===t.substr(i,9)?(e="SUBSCRIBE",i+=9):(e=null,a('"SUBSCRIBE"')),e}function ut(){var e;return"NOTIFY"===t.substr(i,6)?(e="NOTIFY",i+=6):(e=null,a('"NOTIFY"')),e}function lt(){var e;return"REFER"===t.substr(i,5)?(e="REFER",i+=5):(e=null,a('"REFER"')),e}function ct(){var e,n;return n=i,null===(e=tt())&&null===(e=nt())&&null===(e=rt())&&null===(e=it())&&null===(e=ot())&&null===(e=st())&&null===(e=at())&&null===(e=ut())&&null===(e=lt())&&(e=O()),null!==e&&(e=function(e){return Hn.method=t.substring(i,e),Hn.method}(n)),null===e&&(i=n),e}function ht(){var e,t,n,r,o,s;return s=i,null!==(e=et())&&null!==(t=g())&&null!==(n=ft())&&null!==(r=g())&&null!==(o=pt())?e=[e,t,n,r,o]:(e=null,i=s),e}function ft(){var e,t,n;return t=i,null!==(e=dt())&&(n=e,e=void(Hn.status_code=parseInt(n.join("")))),null===e&&(i=t),e}function dt(){var e,t,n,r;return r=i,null!==(e=l())&&null!==(t=l())&&null!==(n=l())?e=[e,t,n]:(e=null,i=r),e}function pt(){var e,n,r;for(r=i,e=[],null===(n=A())&&null===(n=v())&&null===(n=T())&&null===(n=I())&&null===(n=R())&&null===(n=g())&&(n=m());null!==n;)e.push(n),null===(n=A())&&null===(n=v())&&null===(n=T())&&null===(n=I())&&null===(n=R())&&null===(n=g())&&(n=m());return null!==e&&(e=function(e){Hn.reason_phrase=t.substring(i,e)}(r)),null===e&&(i=r),e}function gt(){var e,t,n,r,o,s,a;if(o=i,s=i,null===(e=Z())&&(e=mt()),null!==e){for(t=[],a=i,null!==(n=G())&&null!==(r=At())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=At())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=function(e){var t;Hn.multi_header||(Hn.multi_header=[]);try{t=new Fn(Hn.uri,Hn.display_name,Hn.params),delete Hn.uri,delete Hn.display_name,delete Hn.params}catch(e){t=null}Hn.multi_header.push({possition:i,offset:e,parsed:t})}(o)),null===e&&(i=o),e}function mt(){var e,t,n,r,o;return o=i,null!==(e=null!==(e=_t())?e:"")&&null!==(t=F())&&null!==(n=X())&&null!==(r=B())?e=[e,t,n,r]:(e=null,i=o),e}function _t(){var e,t,n,r,o,s,a,u;if(o=i,s=i,null!==(e=O())){for(t=[],a=i,null!==(n=S())&&null!==(r=O())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=S())&&null!==(r=O())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null===e&&(e=z()),null!==e&&(u=e,e=void(Hn.display_name="string"==typeof u?u:u[1].reduce((function(e,t){return e+t[0]+t[1]}),u[0]))),null===e&&(i=o),e}function At(){var e;return null===(e=vt())&&null===(e=yt())&&(e=Et()),e}function vt(){var e,n,r,o,s,u;return o=i,s=i,"q"===t.substr(i,1).toLowerCase()?(e=t.substr(i,1),i++):(e=null,a('"q"')),null!==e&&null!==(n=x())&&null!==(r=St())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],Hn.params||(Hn.params={}),e=void(Hn.params.q=u)),null===e&&(i=o),e}function yt(){var e,n,r,o,s,u;return o=i,s=i,"expires"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"expires"')),null!==e&&null!==(n=x())&&null!==(r=Tt())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],Hn.params||(Hn.params={}),e=void(Hn.params.expires=u)),null===e&&(i=o),e}function Tt(){var e,t,n;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;return null!==e&&(e=parseInt(e.join(""))),null===e&&(i=n),e}function St(){var e,n,r,o,s,u,c,h;return u=i,c=i,48===t.charCodeAt(i)?(e="0",i++):(e=null,a('"0"')),null!==e?(h=i,46===t.charCodeAt(i)?(n=".",i++):(n=null,a('"."')),null!==n&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")&&null!==(s=null!==(s=l())?s:"")?n=[n,r,o,s]:(n=null,i=h),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=c)):(e=null,i=c),null!==e&&(e=function(e){return parseFloat(t.substring(i,e))}(u)),null===e&&(i=u),e}function Et(){var e,t,n,r,o,s,a,u;return r=i,o=i,null!==(e=O())?(s=i,null!==(t=x())&&null!==(n=Ct())?t=[t,n]:(t=null,i=s),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=o)):(e=null,i=o),null!==e&&(a=e[0],u=e[1],Hn.params||(Hn.params={}),u=void 0===u?void 0:u[1],e=void(Hn.params[a.toLowerCase()]=u)),null===e&&(i=r),e}function Ct(){var e;return null===(e=O())&&null===(e=ae())&&(e=K()),e}function wt(){var e;return"render"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"render"')),null===e&&("session"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"session"')),null===e&&("icon"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"icon"')),null===e&&("alert"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"alert"')),null===e&&(e=O())))),e}function bt(){var e;return null===(e=It())&&(e=Et()),e}function It(){var e,n,r,o;return o=i,"handling"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"handling"')),null!==e&&null!==(n=x())?("optional"===t.substr(i,8).toLowerCase()?(r=t.substr(i,8),i+=8):(r=null,a('"optional"')),null===r&&("required"===t.substr(i,8).toLowerCase()?(r=t.substr(i,8),i+=8):(r=null,a('"required"')),null===r&&(r=O())),null!==r?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),e}function Rt(){var e,t,n,r,o,s,a,u;if(a=i,null!==(e=Ot()))if(null!==(t=U()))if(null!==(n=Nt())){for(r=[],u=i,null!==(o=G())&&null!==(s=Ut())?o=[o,s]:(o=null,i=u);null!==o;)r.push(o),u=i,null!==(o=G())&&null!==(s=Ut())?o=[o,s]:(o=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;else e=null,i=a;return e}function Ot(){var e;return null===(e=Dt())&&(e=kt()),e}function Dt(){var e;return"text"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"text"')),null===e&&("image"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"image"')),null===e&&("audio"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"audio"')),null===e&&("video"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"video"')),null===e&&("application"===t.substr(i,11).toLowerCase()?(e=t.substr(i,11),i+=11):(e=null,a('"application"')),null===e&&(e=Mt()))))),e}function kt(){var e;return"message"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"message"')),null===e&&("multipart"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"multipart"')),null===e&&(e=Mt())),e}function Mt(){var e;return null===(e=O())&&(e=qt()),e}function qt(){var e,n,r;return r=i,"x-"===t.substr(i,2).toLowerCase()?(e=t.substr(i,2),i+=2):(e=null,a('"x-"')),null!==e&&null!==(n=O())?e=[e,n]:(e=null,i=r),e}function Nt(){var e;return null===(e=Mt())&&(e=O()),e}function Ut(){var e,t,n,r;return r=i,null!==(e=O())&&null!==(t=x())&&null!==(n=xt())?e=[e,t,n]:(e=null,i=r),e}function xt(){var e;return null===(e=O())&&(e=K()),e}function Pt(){var e,t,n,r;if(n=i,null!==(t=l()))for(e=[];null!==t;)e.push(t),t=l();else e=null;return null!==e&&(r=e,e=void(Hn.value=parseInt(r.join("")))),null===e&&(i=n),e}function Lt(){var e,n,r,o,s,u;if(s=i,null!==(e=D())){for(n=[],u=i,46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r&&null!==(o=D())?r=[r,o]:(r=null,i=u);null!==r;)n.push(r),u=i,46===t.charCodeAt(i)?(r=".",i++):(r=null,a('"."')),null!==r&&null!==(o=D())?r=[r,o]:(r=null,i=u);null!==n?e=[e,n]:(e=null,i=s)}else e=null,i=s;return e}function Bt(){var e;return null===(e=Ft())&&(e=Et()),e}function Ft(){var e,n,r,o,s,u;return o=i,s=i,"tag"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"tag"')),null!==e&&null!==(n=x())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.tag=u)),null===e&&(i=o),e}function Ht(){var e,n,r,o,s,u,l,c;if(l=i,"digest"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"Digest"')),null!==e)if(null!==(n=S()))if(null!==(r=jt())){for(o=[],c=i,null!==(s=H())&&null!==(u=jt())?s=[s,u]:(s=null,i=c);null!==s;)o.push(s),c=i,null!==(s=H())&&null!==(u=jt())?s=[s,u]:(s=null,i=c);null!==o?e=[e,n,r,o]:(e=null,i=l)}else e=null,i=l;else e=null,i=l;else e=null,i=l;return null===e&&(e=Gt()),e}function Gt(){var e,t,n,r,o,s,a,u;if(a=i,null!==(e=O()))if(null!==(t=S()))if(null!==(n=Yt())){for(r=[],u=i,null!==(o=H())&&null!==(s=Yt())?o=[o,s]:(o=null,i=u);null!==o;)r.push(o),u=i,null!==(o=H())&&null!==(s=Yt())?o=[o,s]:(o=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;else e=null,i=a;return e}function Yt(){var e,t,n,r;return r=i,null!==(e=O())&&null!==(t=x())?(null===(n=O())&&(n=K()),null!==n?e=[e,t,n]:(e=null,i=r)):(e=null,i=r),e}function jt(){var e;return null===(e=Qt())&&null===(e=Kt())&&null===(e=Jt())&&null===(e=Zt())&&null===(e=Xt())&&null===(e=$t())&&null===(e=en())&&(e=Yt()),e}function Qt(){var e,n,r,o;return o=i,"realm"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"realm"')),null!==e&&null!==(n=x())&&null!==(r=Wt())?e=[e,n,r]:(e=null,i=o),e}function Wt(){var e,t,n;return t=i,null!==(e=z())&&(n=e,e=void(Hn.realm=n)),null===e&&(i=t),e}function Kt(){var e,n,r,o,s,u,l,c,h;if(c=i,"domain"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"domain"')),null!==e)if(null!==(n=x()))if(null!==(r=j()))if(null!==(o=zt())){if(s=[],h=i,null!==(l=g()))for(u=[];null!==l;)u.push(l),l=g();else u=null;for(null!==u&&null!==(l=zt())?u=[u,l]:(u=null,i=h);null!==u;){if(s.push(u),h=i,null!==(l=g()))for(u=[];null!==l;)u.push(l),l=g();else u=null;null!==u&&null!==(l=zt())?u=[u,l]:(u=null,i=h)}null!==s&&null!==(u=Q())?e=[e,n,r,o,s,u]:(e=null,i=c)}else e=null,i=c;else e=null,i=c;else e=null,i=c;else e=null,i=c;return e}function zt(){var e;return null===(e=Le())&&(e=He()),e}function Jt(){var e,n,r,o;return o=i,"nonce"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"nonce"')),null!==e&&null!==(n=x())&&null!==(r=Vt())?e=[e,n,r]:(e=null,i=o),e}function Vt(){var e,t,n;return t=i,null!==(e=z())&&(n=e,e=void(Hn.nonce=n)),null===e&&(i=t),e}function Zt(){var e,n,r,o,s,u;return o=i,s=i,"opaque"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"opaque"')),null!==e&&null!==(n=x())&&null!==(r=z())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.opaque=u)),null===e&&(i=o),e}function Xt(){var e,n,r,o,s;return o=i,"stale"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"stale"')),null!==e&&null!==(n=x())?(s=i,"true"===t.substr(i,4).toLowerCase()?(r=t.substr(i,4),i+=4):(r=null,a('"true"')),null!==r&&(r=void(Hn.stale=!0)),null===r&&(i=s),null===r&&(s=i,"false"===t.substr(i,5).toLowerCase()?(r=t.substr(i,5),i+=5):(r=null,a('"false"')),null!==r&&(r=void(Hn.stale=!1)),null===r&&(i=s)),null!==r?e=[e,n,r]:(e=null,i=o)):(e=null,i=o),e}function $t(){var e,n,r,o,s,u;return o=i,s=i,"algorithm"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"algorithm"')),null!==e&&null!==(n=x())?("md5"===t.substr(i,3).toLowerCase()?(r=t.substr(i,3),i+=3):(r=null,a('"MD5"')),null===r&&("md5-sess"===t.substr(i,8).toLowerCase()?(r=t.substr(i,8),i+=8):(r=null,a('"MD5-sess"')),null===r&&(r=O())),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.algorithm=u.toUpperCase())),null===e&&(i=o),e}function en(){var e,n,r,o,s,u,l,c,h,f;if(c=i,"qop"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"qop"')),null!==e)if(null!==(n=x()))if(null!==(r=j())){if(h=i,null!==(o=tn())){for(s=[],f=i,44===t.charCodeAt(i)?(u=",",i++):(u=null,a('","')),null!==u&&null!==(l=tn())?u=[u,l]:(u=null,i=f);null!==u;)s.push(u),f=i,44===t.charCodeAt(i)?(u=",",i++):(u=null,a('","')),null!==u&&null!==(l=tn())?u=[u,l]:(u=null,i=f);null!==s?o=[o,s]:(o=null,i=h)}else o=null,i=h;null!==o&&null!==(s=Q())?e=[e,n,r,o,s]:(e=null,i=c)}else e=null,i=c;else e=null,i=c;else e=null,i=c;return e}function tn(){var e,n,r;return n=i,"auth-int"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"auth-int"')),null===e&&("auth"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"auth"')),null===e&&(e=O())),null!==e&&(r=e,Hn.qop||(Hn.qop=[]),e=void Hn.qop.push(r.toLowerCase())),null===e&&(i=n),e}function nn(){var e,t,n,r,o,s,a;if(o=i,s=i,null!==(e=mt())){for(t=[],a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==n;)t.push(n),a=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=a);null!==t?e=[e,t]:(e=null,i=s)}else e=null,i=s;return null!==e&&(e=function(e){var t;Hn.multi_header||(Hn.multi_header=[]);try{t=new Fn(Hn.uri,Hn.display_name,Hn.params),delete Hn.uri,delete Hn.display_name,delete Hn.params}catch(e){t=null}Hn.multi_header.push({possition:i,offset:e,parsed:t})}(o)),null===e&&(i=o),e}function rn(){var e;return null===(e=on())&&(e=Et()),e}function on(){var e,n,r,o,s,u,c;if(s=i,u=i,"cause"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"cause"')),null!==e)if(null!==(n=x())){if(null!==(o=l()))for(r=[];null!==o;)r.push(o),o=l();else r=null;null!==r?e=[e,n,r]:(e=null,i=u)}else e=null,i=u;else e=null,i=u;return null!==e&&(c=e[2],e=void(Hn.cause=parseInt(c.join("")))),null===e&&(i=s),e}function sn(){var e,t,n,r,o,s;if(o=i,null!==(e=mt())){for(t=[],s=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=s);null!==n;)t.push(n),s=i,null!==(n=G())&&null!==(r=Et())?n=[n,r]:(n=null,i=s);null!==t?e=[e,t]:(e=null,i=o)}else e=null,i=o;return e}function an(){var e,n;return n=i,"active"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"active"')),null===e&&("pending"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"pending"')),null===e&&("terminated"===t.substr(i,10).toLowerCase()?(e=t.substr(i,10),i+=10):(e=null,a('"terminated"')),null===e&&(e=O()))),null!==e&&(e=function(e){Hn.state=t.substring(i,e)}(n)),null===e&&(i=n),e}function un(){var e,n,r,o,s,u,l,c;return o=i,s=i,"reason"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"reason"')),null!==e&&null!==(n=x())&&null!==(r=ln())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=void(void 0!==(u=e[2])&&(Hn.reason=u))),null===e&&(i=o),null===e&&(o=i,s=i,"expires"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"expires"')),null!==e&&null!==(n=x())&&null!==(r=Tt())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=void(void 0!==(c=e[2])&&(Hn.expires=c))),null===e&&(i=o),null===e&&(o=i,s=i,"retry_after"===t.substr(i,11).toLowerCase()?(e=t.substr(i,11),i+=11):(e=null,a('"retry_after"')),null!==e&&null!==(n=x())&&null!==(r=Tt())?e=[e,n,r]:(e=null,i=s),null!==e&&(e=void(void 0!==(l=e[2])&&(Hn.retry_after=l))),null===e&&(i=o),null===e&&(e=Et()))),e}function ln(){var e;return"deactivated"===t.substr(i,11).toLowerCase()?(e=t.substr(i,11),i+=11):(e=null,a('"deactivated"')),null===e&&("probation"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"probation"')),null===e&&("rejected"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"rejected"')),null===e&&("timeout"===t.substr(i,7).toLowerCase()?(e=t.substr(i,7),i+=7):(e=null,a('"timeout"')),null===e&&("giveup"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"giveup"')),null===e&&("noresource"===t.substr(i,10).toLowerCase()?(e=t.substr(i,10),i+=10):(e=null,a('"noresource"')),null===e&&("invariant"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"invariant"')),null===e&&(e=O()))))))),e}function cn(){var e;return null===(e=Ft())&&(e=Et()),e}function hn(){var e,t,n,r,o,s,a,u;if(a=i,null!==(e=vn()))if(null!==(t=S()))if(null!==(n=Sn())){for(r=[],u=i,null!==(o=G())&&null!==(s=fn())?o=[o,s]:(o=null,i=u);null!==o;)r.push(o),u=i,null!==(o=G())&&null!==(s=fn())?o=[o,s]:(o=null,i=u);null!==r?e=[e,t,n,r]:(e=null,i=a)}else e=null,i=a;else e=null,i=a;else e=null,i=a;return e}function fn(){var e;return null===(e=dn())&&null===(e=pn())&&null===(e=gn())&&null===(e=mn())&&null===(e=_n())&&(e=Et()),e}function dn(){var e,n,r,o,s,u;return o=i,s=i,"ttl"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"ttl"')),null!==e&&null!==(n=x())&&null!==(r=wn())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.ttl=u)),null===e&&(i=o),e}function pn(){var e,n,r,o,s,u;return o=i,s=i,"maddr"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"maddr"')),null!==e&&null!==(n=x())&&null!==(r=ae())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.maddr=u)),null===e&&(i=o),e}function gn(){var e,n,r,o,s,u;return o=i,s=i,"received"===t.substr(i,8).toLowerCase()?(e=t.substr(i,8),i+=8):(e=null,a('"received"')),null!==e&&null!==(n=x())?(null===(r=ge())&&(r=fe()),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.received=u)),null===e&&(i=o),e}function mn(){var e,n,r,o,s,u;return o=i,s=i,"branch"===t.substr(i,6).toLowerCase()?(e=t.substr(i,6),i+=6):(e=null,a('"branch"')),null!==e&&null!==(n=x())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.branch=u)),null===e&&(i=o),e}function _n(){var e,n,r,o,s;return o=i,"rport"===t.substr(i,5).toLowerCase()?(e=t.substr(i,5),i+=5):(e=null,a('"rport"')),null!==e?(s=i,null!==(n=x())&&null!==(r=An())?n=[n,r]:(n=null,i=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=o)):(e=null,i=o),e}function An(){var e,t,n,r,o,s,a,u;return s=i,a=i,null!==(e=null!==(e=l())?e:"")&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")?e=[e,t,n,r,o]:(e=null,i=a),null!==e&&(u=e,e=void(Hn.rport=parseInt(u.join("")))),null===e&&(i=s),e}function vn(){var e,t,n,r,o,s;return s=i,null!==(e=yn())&&null!==(t=U())&&null!==(n=O())&&null!==(r=U())&&null!==(o=Tn())?e=[e,t,n,r,o]:(e=null,i=s),e}function yn(){var e,n,r;return n=i,"sip"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"SIP"')),null===e&&(e=O()),null!==e&&(r=e,e=void(Hn.protocol=r)),null===e&&(i=n),e}function Tn(){var e,n,r;return n=i,"udp"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"UDP"')),null===e&&("tcp"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"TCP"')),null===e&&("tls"===t.substr(i,3).toLowerCase()?(e=t.substr(i,3),i+=3):(e=null,a('"TLS"')),null===e&&("sctp"===t.substr(i,4).toLowerCase()?(e=t.substr(i,4),i+=4):(e=null,a('"SCTP"')),null===e&&(e=O())))),null!==e&&(r=e,e=void(Hn.transport=r)),null===e&&(i=n),e}function Sn(){var e,t,n,r,o;return r=i,null!==(e=En())?(o=i,null!==(t=Y())&&null!==(n=Cn())?t=[t,n]:(t=null,i=o),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,i=r)):(e=null,i=r),e}function En(){var e,n;return n=i,null===(e=ge())&&null===(e=he())&&(e=ue()),null!==e&&(e=function(e){Hn.host=t.substring(i,e)}(n)),null===e&&(i=n),e}function Cn(){var e,t,n,r,o,s,a,u;return s=i,a=i,null!==(e=null!==(e=l())?e:"")&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")&&null!==(r=null!==(r=l())?r:"")&&null!==(o=null!==(o=l())?o:"")?e=[e,t,n,r,o]:(e=null,i=a),null!==e&&(u=e,e=void(Hn.port=parseInt(u.join("")))),null===e&&(i=s),e}function wn(){var e,t,n,r,o;return r=i,o=i,null!==(e=l())&&null!==(t=null!==(t=l())?t:"")&&null!==(n=null!==(n=l())?n:"")?e=[e,t,n]:(e=null,i=o),null!==e&&(e=parseInt(e.join(""))),null===e&&(i=r),e}function bn(){var e,t,n;return t=i,null!==(e=Tt())&&(n=e,e=void(Hn.expires=n)),null===e&&(i=t),e}function In(){var e;return null===(e=Rn())&&(e=Et()),e}function Rn(){var e,n,r,o,s,u;return o=i,s=i,"refresher"===t.substr(i,9).toLowerCase()?(e=t.substr(i,9),i+=9):(e=null,a('"refresher"')),null!==e&&null!==(n=x())?("uac"===t.substr(i,3).toLowerCase()?(r=t.substr(i,3),i+=3):(r=null,a('"uac"')),null===r&&("uas"===t.substr(i,3).toLowerCase()?(r=t.substr(i,3),i+=3):(r=null,a('"uas"'))),null!==r?e=[e,n,r]:(e=null,i=s)):(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.refresher=u.toLowerCase())),null===e&&(i=o),e}function On(){var e,t;for(e=[],null===(t=b())&&null===(t=R())&&(t=S());null!==t;)e.push(t),null===(t=b())&&null===(t=R())&&(t=S());return e}function Dn(){var e,n,r,o,s,u,l,c,h,f,d;return f=i,d=i,null!==(e=Mn())?(45===t.charCodeAt(i)?(n="-",i++):(n=null,a('"-"')),null!==n&&null!==(r=kn())?(45===t.charCodeAt(i)?(o="-",i++):(o=null,a('"-"')),null!==o&&null!==(s=kn())?(45===t.charCodeAt(i)?(u="-",i++):(u=null,a('"-"')),null!==u&&null!==(l=kn())?(45===t.charCodeAt(i)?(c="-",i++):(c=null,a('"-"')),null!==c&&null!==(h=qn())?e=[e,n,r,o,s,u,l,c,h]:(e=null,i=d)):(e=null,i=d)):(e=null,i=d)):(e=null,i=d)):(e=null,i=d),null!==e&&(e=function(e){Hn=t.substring(i+5,e)}(f,e[0])),null===e&&(i=f),e}function kn(){var e,t,n,r,o;return o=i,null!==(e=h())&&null!==(t=h())&&null!==(n=h())&&null!==(r=h())?e=[e,t,n,r]:(e=null,i=o),e}function Mn(){var e,t,n;return n=i,null!==(e=kn())&&null!==(t=kn())?e=[e,t]:(e=null,i=n),e}function qn(){var e,t,n,r;return r=i,null!==(e=kn())&&null!==(t=kn())&&null!==(n=kn())?e=[e,t,n]:(e=null,i=r),e}function Nn(){var e,n,r,o,s,u;return o=i,s=i,null!==(e=k())?(u=i,64===t.charCodeAt(i)?(n="@",i++):(n=null,a('"@"')),null!==n&&null!==(r=k())?n=[n,r]:(n=null,i=u),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,i=s)):(e=null,i=s),null!==e&&(e=function(e){Hn.call_id=t.substring(i,e)}(o)),null===e&&(i=o),e}function Un(){var e;return null===(e=xn())&&null===(e=Pn())&&null===(e=Ln())&&(e=Et()),e}function xn(){var e,n,r,o,s,u;return o=i,s=i,"to-tag"===t.substr(i,6)?(e="to-tag",i+=6):(e=null,a('"to-tag"')),null!==e&&null!==(n=x())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.to_tag=u)),null===e&&(i=o),e}function Pn(){var e,n,r,o,s,u;return o=i,s=i,"from-tag"===t.substr(i,8)?(e="from-tag",i+=8):(e=null,a('"from-tag"')),null!==e&&null!==(n=x())&&null!==(r=O())?e=[e,n,r]:(e=null,i=s),null!==e&&(u=e[2],e=void(Hn.from_tag=u)),null===e&&(i=o),e}function Ln(){var e,n;return n=i,"early-only"===t.substr(i,10)?(e="early-only",i+=10):(e=null,a('"early-only"')),null!==e&&(e=void(Hn.early_only=!0)),null===e&&(i=n),e}var Bn=N(),Fn=M(),Hn={};if(null===r[n]()||i!==t.length){var Gn=Math.max(i,o),Yn=Gn<t.length?t.charAt(Gn):null,jn=function(){for(var e=1,n=1,r=!1,s=0;s<Math.max(i,o);s++){var a=t.charAt(s);"\n"===a?(r||e++,n=1,r=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e++,n=1,r=!0):(n++,r=!1)}return{line:e,column:n}}();return new this.SyntaxError(function(e){e.sort();for(var t=null,n=[],r=0;r<e.length;r++)e[r]!==t&&(n.push(e[r]),t=e[r]);return n}(s),Yn,Gn,jn.line,jn.column),-1}return Hn},toSource:function(){return this._source},SyntaxError:function(t,n,r,i,o){this.name="SyntaxError",this.expected=t,this.found=n,this.message=function(t,n){var r;switch(t.length){case 0:r="end of input";break;case 1:r=t[0];break;default:r=t.slice(0,t.length-1).join(", ")+" or "+t[t.length-1]}return"Expected "+r+" but "+(n?e(n):"end of input")+" found."}(t,n),this.offset=r,this.line=i,this.column=o}};return t.SyntaxError.prototype=Error.prototype,t}()),T}function N(){if(C)return E;function e(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e))||n){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}C=1;var i=l,o=U(),s=q();return E=function(){function t(e,n,r,o){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw new TypeError('missing or invalid "host" parameter');for(var u in this._parameters={},this._headers={},this._scheme=e||i.SIP,this._user=n,this._host=r,this._port=o,s)Object.prototype.hasOwnProperty.call(s,u)&&this.setParam(u,s[u]);for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&this.setHeader(l,a[l])}return r(t,null,[{key:"parse",value:function(e){return-1!==(e=s.parse(e,"SIP_URI"))?e:void 0}}]),r(t,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]=null==t?null:t.toString())}},{key:"getParam",value:function(e){if(e)return this._parameters[e.toLowerCase()]}},{key:"hasParam",value:function(e){if(e)return!!this._parameters.hasOwnProperty(e.toLowerCase())}},{key:"deleteParam",value:function(e){if(e=e.toLowerCase(),this._parameters.hasOwnProperty(e)){var t=this._parameters[e];return delete this._parameters[e],t}}},{key:"clearParams",value:function(){this._parameters={}}},{key:"setHeader",value:function(e,t){this._headers[o.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){if(e)return this._headers[o.headerize(e)]}},{key:"hasHeader",value:function(e){if(e)return!!this._headers.hasOwnProperty(o.headerize(e))}},{key:"deleteHeader",value:function(e){if(e=o.headerize(e),this._headers.hasOwnProperty(e)){var t=this._headers[e];return delete this._headers[e],t}}},{key:"clearHeaders",value:function(){this._headers={}}},{key:"clone",value:function(){return new t(this._scheme,this._user,this._host,this._port,JSON.parse(JSON.stringify(this._parameters)),JSON.parse(JSON.stringify(this._headers)))}},{key:"toString",value:function(){var t=[],n="".concat(this._scheme,":");for(var r in this._user&&(n+="".concat(o.escapeUser(this._user),"@")),n+=this._host,(this._port||0===this._port)&&(n+=":".concat(this._port)),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,r)&&(n+=";".concat(r),null!==this._parameters[r]&&(n+="=".concat(this._parameters[r])));for(var i in this._headers)if(Object.prototype.hasOwnProperty.call(this._headers,i)){var s,a=e(this._headers[i]);try{for(a.s();!(s=a.n()).done;){var u=s.value;t.push("".concat(i,"=").concat(u))}}catch(e){a.e(e)}finally{a.f()}}return t.length>0&&(n+="?".concat(t.join("&"))),n}},{key:"toAor",value:function(e){var t="".concat(this._scheme,":");return this._user&&(t+="".concat(o.escapeUser(this._user),"@")),t+=this._host,e&&(this._port||0===this._port)&&(t+=":".concat(this._port)),t}},{key:"scheme",get:function(){return this._scheme},set:function(e){this._scheme=e.toLowerCase()}},{key:"user",get:function(){return this._user},set:function(e){this._user=e}},{key:"host",get:function(){return this._host},set:function(e){this._host=e.toLowerCase()}},{key:"port",get:function(){return this._port},set:function(e){this._port=0===e?e:parseInt(e,10)||null}}]),t}(),E}function U(){if(w)return k;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}w=1;var r=l,i=N(),o=q();k.str_utf8_length=function(e){return unescape(encodeURIComponent(e)).length};var s=k.isFunction=function(e){return void 0!==e&&"[object Function]"===Object.prototype.toString.call(e)};k.isString=function(e){return void 0!==e&&"[object String]"===Object.prototype.toString.call(e)},k.isDecimal=function(e){return!isNaN(e)&&parseFloat(e)===parseInt(e,10)},k.isEmpty=function(e){return null===e||""===e||void 0===e||Array.isArray(e)&&0===e.length||"number"==typeof e&&isNaN(e)},k.hasMethods=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];if(s(e[a]))return!1}return!0};var a=k.createRandomToken=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,r="";for(t=0;t<e;t++)r+=(Math.random()*n|0).toString(n);return r};k.newTag=function(){return a(10)},k.newUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},k.hostType=function(e){if(e)return-1!==(e=o.parse(e,"host"))?e.host_type:void 0};var u=k.escapeUser=function(e){return encodeURIComponent(decodeURIComponent(e)).replace(/%3A/gi,":").replace(/%2B/gi,"+").replace(/%3F/gi,"?").replace(/%2F/gi,"/")};return k.normalizeTarget=function(e,t){if(e){if(e instanceof i)return e;if("string"==typeof e){var n,o,s,a=e.split("@");switch(a.length){case 1:if(!t)return;n=e,o=t;break;case 2:n=a[0],o=a[1];break;default:n=a.slice(0,a.length-1).join("@"),o=a[a.length-1]}return n=n.replace(/^(sips?|tel):/i,""),/^[-.()]*\+?[0-9\-.()]+$/.test(n)&&(n=n.replace(/[-.()]/g,"")),e="".concat(r.SIP,":").concat(u(n),"@").concat(o),(s=i.parse(e))?s:void 0}}else;},k.headerize=function(e){var t,n={"Call-Id":"Call-ID",Cseq:"CSeq","Www-Authenticate":"WWW-Authenticate"},r=e.toLowerCase().replace(/_/g,"-").split("-"),i="",o=r.length;for(t=0;t<o;t++)0!==t&&(i+="-"),i+=r[t].charAt(0).toUpperCase()+r[t].substring(1);return n[i]&&(i=n[i]),i},k.sipErrorCause=function(e){for(var t in r.SIP_ERROR_CAUSES)if(-1!==r.SIP_ERROR_CAUSES[t].indexOf(e))return r.causes[t];return r.causes.SIP_FAILURE_CODE},k.getRandomTestNetIP=function(){return"192.0.2.".concat(function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}(1,254))},k.calculateMD5=function(e){function t(e,t){return e<<t|e>>>32-t}function n(e,t){var n=2147483648&e,r=2147483648&t,i=1073741824&e,o=1073741824&t,s=(1073741823&e)+(1073741823&t);return i&o?2147483648^s^n^r:i|o?1073741824&s?3221225472^s^n^r:1073741824^s^n^r:s^n^r}function r(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return e&t|~e&n}(r,i,o),s),u)),n(t(e,a),r)}function i(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return e&n|t&~n}(r,i,o),s),u)),n(t(e,a),r)}function o(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return e^t^n}(r,i,o),s),u)),n(t(e,a),r)}function s(e,r,i,o,s,a,u){return e=n(e,n(n(function(e,t,n){return t^(e|~n)}(r,i,o),s),u)),n(t(e,a),r)}function a(e){var t,n="",r="";for(t=0;t<=3;t++)n+=(r="0".concat((e>>>8*t&255).toString(16))).substr(r.length-2,2);return n}var u,l,c,h,f,d,p,g,m,_;for(u=function(e){for(var t,n=e.length,r=n+8,i=16*((r-r%64)/64+1),o=new Array(i-1),s=0,a=0;a<n;)s=a%4*8,o[t=(a-a%4)/4]=o[t]|e.charCodeAt(a)<<s,a++;return s=a%4*8,o[t=(a-a%4)/4]=o[t]|128<<s,o[i-2]=n<<3,o[i-1]=n>>>29,o}(e=function(e){for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(e)),p=1732584193,g=4023233417,m=2562383102,_=271733878,l=0;l<u.length;l+=16)c=p,h=g,f=m,d=_,p=r(p,g,m,_,u[l+0],7,3614090360),_=r(_,p,g,m,u[l+1],12,3905402710),m=r(m,_,p,g,u[l+2],17,606105819),g=r(g,m,_,p,u[l+3],22,3250441966),p=r(p,g,m,_,u[l+4],7,4118548399),_=r(_,p,g,m,u[l+5],12,1200080426),m=r(m,_,p,g,u[l+6],17,2821735955),g=r(g,m,_,p,u[l+7],22,4249261313),p=r(p,g,m,_,u[l+8],7,1770035416),_=r(_,p,g,m,u[l+9],12,2336552879),m=r(m,_,p,g,u[l+10],17,4294925233),g=r(g,m,_,p,u[l+11],22,2304563134),p=r(p,g,m,_,u[l+12],7,1804603682),_=r(_,p,g,m,u[l+13],12,4254626195),m=r(m,_,p,g,u[l+14],17,2792965006),p=i(p,g=r(g,m,_,p,u[l+15],22,1236535329),m,_,u[l+1],5,4129170786),_=i(_,p,g,m,u[l+6],9,3225465664),m=i(m,_,p,g,u[l+11],14,643717713),g=i(g,m,_,p,u[l+0],20,3921069994),p=i(p,g,m,_,u[l+5],5,3593408605),_=i(_,p,g,m,u[l+10],9,38016083),m=i(m,_,p,g,u[l+15],14,3634488961),g=i(g,m,_,p,u[l+4],20,3889429448),p=i(p,g,m,_,u[l+9],5,568446438),_=i(_,p,g,m,u[l+14],9,3275163606),m=i(m,_,p,g,u[l+3],14,4107603335),g=i(g,m,_,p,u[l+8],20,1163531501),p=i(p,g,m,_,u[l+13],5,2850285829),_=i(_,p,g,m,u[l+2],9,4243563512),m=i(m,_,p,g,u[l+7],14,1735328473),p=o(p,g=i(g,m,_,p,u[l+12],20,2368359562),m,_,u[l+5],4,4294588738),_=o(_,p,g,m,u[l+8],11,2272392833),m=o(m,_,p,g,u[l+11],16,1839030562),g=o(g,m,_,p,u[l+14],23,4259657740),p=o(p,g,m,_,u[l+1],4,2763975236),_=o(_,p,g,m,u[l+4],11,1272893353),m=o(m,_,p,g,u[l+7],16,4139469664),g=o(g,m,_,p,u[l+10],23,3200236656),p=o(p,g,m,_,u[l+13],4,681279174),_=o(_,p,g,m,u[l+0],11,3936430074),m=o(m,_,p,g,u[l+3],16,3572445317),g=o(g,m,_,p,u[l+6],23,76029189),p=o(p,g,m,_,u[l+9],4,3654602809),_=o(_,p,g,m,u[l+12],11,3873151461),m=o(m,_,p,g,u[l+15],16,530742520),p=s(p,g=o(g,m,_,p,u[l+2],23,3299628645),m,_,u[l+0],6,4096336452),_=s(_,p,g,m,u[l+7],10,1126891415),m=s(m,_,p,g,u[l+14],15,2878612391),g=s(g,m,_,p,u[l+5],21,4237533241),p=s(p,g,m,_,u[l+12],6,1700485571),_=s(_,p,g,m,u[l+3],10,2399980690),m=s(m,_,p,g,u[l+10],15,4293915773),g=s(g,m,_,p,u[l+1],21,2240044497),p=s(p,g,m,_,u[l+8],6,1873313359),_=s(_,p,g,m,u[l+15],10,4264355552),m=s(m,_,p,g,u[l+6],15,2734768916),g=s(g,m,_,p,u[l+13],21,1309151649),p=s(p,g,m,_,u[l+4],6,4149444226),_=s(_,p,g,m,u[l+11],10,3174756917),m=s(m,_,p,g,u[l+2],15,718787259),g=s(g,m,_,p,u[l+9],21,3951481745),p=n(p,c),g=n(g,h),m=n(m,f),_=n(_,d);return(a(p)+a(g)+a(m)+a(_)).toLowerCase()},k.closeMediaStream=function(n){if(n)try{if(n.getTracks){var r,i=t(n.getTracks());try{for(i.s();!(r=i.n()).done;){r.value.stop()}}catch(e){i.e(e)}finally{i.f()}}else{var o,s=t(n.getAudioTracks());try{for(s.s();!(o=s.n()).done;){o.value.stop()}}catch(e){s.e(e)}finally{s.f()}var a,u=t(n.getVideoTracks());try{for(u.s();!(a=u.n()).done;){a.value.stop()}}catch(e){u.e(e)}finally{u.f()}}}catch(t){"function"!=typeof n.stop&&"object"!==e(n.stop)||n.stop()}},k.cloneArray=function(e){return e&&e.slice()||[]},k.cloneObject=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e&&Object.assign({},e)||t},k}function x(){}function P(){P.init.call(this)}function L(e){return void 0===e._maxListeners?P.defaultMaxListeners:e._maxListeners}function B(e,t,n,r){var i,o,s,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]):(o=e._events=new x,e._eventsCount=0),s){if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),!s.warned&&(i=L(e))&&i>0&&s.length>i){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=o[t]=n,++e._eventsCount;return e}function F(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function H(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function G(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}x.prototype=Object.create(null),P.EventEmitter=P,P.usingDomains=!1,P.prototype.domain=void 0,P.prototype._events=void 0,P.prototype._maxListeners=void 0,P.defaultMaxListeners=10,P.init=function(){this.domain=null,P.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new x,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},P.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},P.prototype.getMaxListeners=function(){return L(this)},P.prototype.emit=function(e){var t,n,r,i,o,s,a,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(n=s[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=G(e,r),o=0;o<r;++o)i[o].call(n)}(n,c,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=G(e,i),s=0;s<i;++s)o[s].call(n,r)}(n,c,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,s=G(e,o),a=0;a<o;++a)s[a].call(n,r,i)}(n,c,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var s=e.length,a=G(e,s),u=0;u<s;++u)a[u].call(n,r,i,o)}(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=G(e,i),s=0;s<i;++s)o[s].apply(n,r)}(n,c,this,i)}return!0},P.prototype.addListener=function(e,t){return B(this,e,t,!1)},P.prototype.on=P.prototype.addListener,P.prototype.prependListener=function(e,t){return B(this,e,t,!0)},P.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,F(this,e,t)),this},P.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,F(this,e,t)),this},P.prototype.removeListener=function(e,t){var n,r,i,o,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new x:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new x,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,s||t)}return this},P.prototype.off=function(e,t){return this.removeListener(e,t)},P.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new x,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new x:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new x,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},P.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},P.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):H.call(e,t)},P.prototype.listenerCount=H,P.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Y=s(Object.freeze({__proto__:null,EventEmitter:P,default:P})),j="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Q(){throw new Error("setTimeout has not been defined")}function W(){throw new Error("clearTimeout has not been defined")}var K=Q,z=W;function J(e){if(K===setTimeout)return setTimeout(e,0);if((K===Q||!K)&&setTimeout)return K=setTimeout,setTimeout(e,0);try{return K(e,0)}catch(t){try{return K.call(null,e,0)}catch(t){return K.call(this,e,0)}}}"function"==typeof j.setTimeout&&(K=setTimeout),"function"==typeof j.clearTimeout&&(z=clearTimeout);var V,Z=[],X=!1,$=-1;function ee(){X&&V&&(X=!1,V.length?Z=V.concat(Z):$=-1,Z.length&&te())}function te(){if(!X){var e=J(ee);X=!0;for(var t=Z.length;t;){for(V=Z,Z=[];++$<t;)V&&V[$].run();$=-1,t=Z.length}V=null,X=!1,function(e){if(z===clearTimeout)return clearTimeout(e);if((z===W||!z)&&clearTimeout)return z=clearTimeout,clearTimeout(e);try{return z(e)}catch(t){try{return z.call(null,e)}catch(t){return z.call(this,e)}}}(e)}}function ne(e,t){this.fun=e,this.array=t}ne.prototype.run=function(){this.fun.apply(null,this.array)};function re(){}var ie=re,oe=re,se=re,ae=re,ue=re,le=re,ce=re;var he=j.performance||{},fe=he.now||he.mozNow||he.msNow||he.oNow||he.webkitNow||function(){return(new Date).getTime()};var de=new Date;var pe,ge,me,_e,Ae,ve={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Z.push(new ne(e,t)),1!==Z.length||X||J(te)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ie,addListener:oe,once:se,off:ae,removeListener:ue,removeAllListeners:le,emit:ce,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*fe.call(he),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-de)/1e3}},ye={exports:{}},Te={exports:{}};function Se(){if(ge)return pe;ge=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return pe=function(a,u){u=u||{};var l=typeof a;if("string"===l&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*r;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*t;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(a);if("number"===l&&isFinite(a))return u.long?function(i){var o=Math.abs(i);if(o>=r)return s(i,o,r,"day");if(o>=n)return s(i,o,n,"hour");if(o>=t)return s(i,o,t,"minute");if(o>=e)return s(i,o,e,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},pe}function Ee(){if(_e)return me;return _e=1,me=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Se(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},me}var Ce={exports:{}};function we(){return!1}function be(){throw new Error("tty.ReadStream is not implemented")}function Ie(){throw new Error("tty.ReadStream is not implemented")}var Re={isatty:we,ReadStream:be,WriteStream:Ie},Oe=s(Object.freeze({__proto__:null,ReadStream:be,WriteStream:Ie,default:Re,isatty:we})),De=[],ke=[],Me="undefined"!=typeof Uint8Array?Uint8Array:Array,qe=!1;function Ne(){qe=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)De[t]=e[t],ke[e.charCodeAt(t)]=t;ke["-".charCodeAt(0)]=62,ke["_".charCodeAt(0)]=63}function Ue(e,t,n){for(var r,i,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(De[(i=r)>>18&63]+De[i>>12&63]+De[i>>6&63]+De[63&i]);return o.join("")}function xe(e){var t;qe||Ne();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(Ue(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=De[t>>2],i+=De[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=De[t>>10],i+=De[t>>4&63],i+=De[t<<2&63],i+="="),o.push(i),o.join("")}function Pe(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,l=u>>1,c=-7,h=n?i-1:0,f=n?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=l}return(d?-1:1)*s*Math.pow(2,o-r)}function Le(e,t,n,r,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[n+d]=255&s,d+=p,s/=256,l-=8);e[n+d-p]|=128*g}var Be={}.toString,Fe=Array.isArray||function(e){return"[object Array]"==Be.call(e)};function He(){return Ye.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ge(e,t){if(He()<t)throw new RangeError("Invalid typed array length");return Ye.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Ye.prototype:(null===e&&(e=new Ye(t)),e.length=t),e}function Ye(e,t,n){if(!(Ye.TYPED_ARRAY_SUPPORT||this instanceof Ye))return new Ye(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return We(this,e)}return je(this,e,t,n)}function je(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Ye.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Ye.prototype:e=Ke(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Ye.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Ve(t,n);e=Ge(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(Je(t)){var n=0|ze(t.length);return 0===(e=Ge(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Ge(e,0):Ke(e,t);if("Buffer"===t.type&&Fe(t.data))return Ke(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Qe(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function We(e,t){if(Qe(t),e=Ge(e,t<0?0:0|ze(t)),!Ye.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Ke(e,t){var n=t.length<0?0:0|ze(t.length);e=Ge(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function ze(e){if(e>=He())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+He().toString(16)+" bytes");return 0|e}function Je(e){return!(null==e||!e._isBuffer)}function Ve(e,t){if(Je(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Ct(e).length;default:if(r)return Et(e).length;t=(""+t).toLowerCase(),r=!0}}function Ze(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return ft(this,t,n);case"utf8":case"utf-8":return ut(this,t,n);case"ascii":return ct(this,t,n);case"latin1":case"binary":return ht(this,t,n);case"base64":return at(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dt(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Xe(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function $e(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Ye.from(t,r)),Je(t))return 0===t.length?-1:et(e,t,n,r,i);if("number"==typeof t)return t&=255,Ye.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):et(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function et(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=n;o<a;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(l(e,o+f)!==l(t,f)){h=!1;break}if(h)return o}return-1}function tt(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function nt(e,t,n,r){return wt(Et(t,e.length-n),e,n,r)}function rt(e,t,n,r){return wt(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function it(e,t,n,r){return rt(e,t,n,r)}function ot(e,t,n,r){return wt(Ct(t),e,n,r)}function st(e,t,n,r){return wt(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function at(e,t,n){return 0===t&&n===e.length?xe(e):xe(e.slice(t,n))}function ut(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=lt)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=lt));return n}(r)}Ye.TYPED_ARRAY_SUPPORT=void 0===j.TYPED_ARRAY_SUPPORT||j.TYPED_ARRAY_SUPPORT,He(),Ye.poolSize=8192,Ye._augment=function(e){return e.__proto__=Ye.prototype,e},Ye.from=function(e,t,n){return je(null,e,t,n)},Ye.TYPED_ARRAY_SUPPORT&&(Ye.prototype.__proto__=Uint8Array.prototype,Ye.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Ye[Symbol.species]),Ye.alloc=function(e,t,n){return function(e,t,n,r){return Qe(t),t<=0?Ge(e,t):void 0!==n?"string"==typeof r?Ge(e,t).fill(n,r):Ge(e,t).fill(n):Ge(e,t)}(null,e,t,n)},Ye.allocUnsafe=function(e){return We(null,e)},Ye.allocUnsafeSlow=function(e){return We(null,e)},Ye.isBuffer=function(e){return null!=e&&(!!e._isBuffer||bt(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&bt(e.slice(0,0))}(e))},Ye.compare=function(e,t){if(!Je(e)||!Je(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},Ye.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Ye.concat=function(e,t){if(!Fe(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Ye.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Ye.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!Je(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Ye.byteLength=Ve,Ye.prototype._isBuffer=!0,Ye.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Xe(this,t,t+1);return this},Ye.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Xe(this,t,t+3),Xe(this,t+1,t+2);return this},Ye.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Xe(this,t,t+7),Xe(this,t+1,t+6),Xe(this,t+2,t+5),Xe(this,t+3,t+4);return this},Ye.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?ut(this,0,e):Ze.apply(this,arguments)},Ye.prototype.equals=function(e){if(!Je(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Ye.compare(this,e)},Ye.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Ye.prototype.compare=function(e,t,n,r,i){if(!Je(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n),c=0;c<a;++c)if(u[c]!==l[c]){o=u[c],s=l[c];break}return o<s?-1:s<o?1:0},Ye.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Ye.prototype.indexOf=function(e,t,n){return $e(this,e,t,n,!0)},Ye.prototype.lastIndexOf=function(e,t,n){return $e(this,e,t,n,!1)},Ye.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return tt(this,e,t,n);case"utf8":case"utf-8":return nt(this,e,t,n);case"ascii":return rt(this,e,t,n);case"latin1":case"binary":return it(this,e,t,n);case"base64":return ot(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Ye.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var lt=4096;function ct(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function ht(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ft(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=St(e[o]);return i}function dt(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function pt(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function gt(e,t,n,r,i,o){if(!Je(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function mt(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function _t(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function At(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function vt(e,t,n,r,i){return i||At(e,0,n,4),Le(e,t,n,r,23,4),n+4}function yt(e,t,n,r,i){return i||At(e,0,n,8),Le(e,t,n,r,52,8),n+8}Ye.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Ye.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Ye.prototype;else{var i=t-e;n=new Ye(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},Ye.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||pt(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},Ye.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||pt(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},Ye.prototype.readUInt8=function(e,t){return t||pt(e,1,this.length),this[e]},Ye.prototype.readUInt16LE=function(e,t){return t||pt(e,2,this.length),this[e]|this[e+1]<<8},Ye.prototype.readUInt16BE=function(e,t){return t||pt(e,2,this.length),this[e]<<8|this[e+1]},Ye.prototype.readUInt32LE=function(e,t){return t||pt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Ye.prototype.readUInt32BE=function(e,t){return t||pt(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Ye.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||pt(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Ye.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||pt(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Ye.prototype.readInt8=function(e,t){return t||pt(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Ye.prototype.readInt16LE=function(e,t){t||pt(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Ye.prototype.readInt16BE=function(e,t){t||pt(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Ye.prototype.readInt32LE=function(e,t){return t||pt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Ye.prototype.readInt32BE=function(e,t){return t||pt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Ye.prototype.readFloatLE=function(e,t){return t||pt(e,4,this.length),Pe(this,e,!0,23,4)},Ye.prototype.readFloatBE=function(e,t){return t||pt(e,4,this.length),Pe(this,e,!1,23,4)},Ye.prototype.readDoubleLE=function(e,t){return t||pt(e,8,this.length),Pe(this,e,!0,52,8)},Ye.prototype.readDoubleBE=function(e,t){return t||pt(e,8,this.length),Pe(this,e,!1,52,8)},Ye.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||gt(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},Ye.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||gt(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Ye.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,1,255,0),Ye.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Ye.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,2,65535,0),Ye.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):mt(this,e,t,!0),t+2},Ye.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,2,65535,0),Ye.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):mt(this,e,t,!1),t+2},Ye.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,4,4294967295,0),Ye.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_t(this,e,t,!0),t+4},Ye.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,4,4294967295,0),Ye.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_t(this,e,t,!1),t+4},Ye.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);gt(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Ye.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);gt(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Ye.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,1,127,-128),Ye.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Ye.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,2,32767,-32768),Ye.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):mt(this,e,t,!0),t+2},Ye.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,2,32767,-32768),Ye.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):mt(this,e,t,!1),t+2},Ye.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,4,2147483647,-2147483648),Ye.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_t(this,e,t,!0),t+4},Ye.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||gt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Ye.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_t(this,e,t,!1),t+4},Ye.prototype.writeFloatLE=function(e,t,n){return vt(this,e,t,!0,n)},Ye.prototype.writeFloatBE=function(e,t,n){return vt(this,e,t,!1,n)},Ye.prototype.writeDoubleLE=function(e,t,n){return yt(this,e,t,!0,n)},Ye.prototype.writeDoubleBE=function(e,t,n){return yt(this,e,t,!1,n)},Ye.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!Ye.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},Ye.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Ye.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=Je(e)?e:Et(new Ye(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Tt=/[^+\/0-9A-Za-z-_]/g;function St(e){return e<16?"0"+e.toString(16):e.toString(16)}function Et(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Ct(e){return function(e){var t,n,r,i,o,s;qe||Ne();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new Me(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=ke[e.charCodeAt(t)]<<18|ke[e.charCodeAt(t+1)]<<12|ke[e.charCodeAt(t+2)]<<6|ke[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=ke[e.charCodeAt(t)]<<2|ke[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=ke[e.charCodeAt(t)]<<10|ke[e.charCodeAt(t+1)]<<4|ke[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Tt,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function wt(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function bt(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var It="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},Rt=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},Ot=/%[sdj%]/g;function Dt(e){if(!Wt(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(Ut(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(Ot,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<i;s=r[++n])Yt(s)||!Vt(s)?o+=" "+s:o+=" "+Ut(s);return o}function kt(e,t){if(zt(j.process))return function(){return kt(e,t).apply(this,arguments)};if(!0===ve.noDeprecation)return e;var n=!1;return function(){if(!n){if(ve.throwDeprecation)throw new Error(t);ve.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var Mt,qt={};function Nt(e){if(zt(Mt)&&(Mt=ve.env.NODE_DEBUG||""),e=e.toUpperCase(),!qt[e])if(new RegExp("\\b"+e+"\\b","i").test(Mt)){qt[e]=function(){var t=Dt.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else qt[e]=function(){};return qt[e]}function Ut(e,t){var n={seen:[],stylize:Pt};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),Gt(t)?n.showHidden=t:t&&an(n,t),zt(n.showHidden)&&(n.showHidden=!1),zt(n.depth)&&(n.depth=2),zt(n.colors)&&(n.colors=!1),zt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=xt),Lt(n,e,n.depth)}function xt(e,t){var n=Ut.styles[t];return n?"["+Ut.colors[n][0]+"m"+e+"["+Ut.colors[n][1]+"m":e}function Pt(e,t){return e}function Lt(e,t,n){if(e.customInspect&&t&&$t(t.inspect)&&t.inspect!==Ut&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return Wt(r)||(r=Lt(e,r,n)),r}var i=function(e,t){if(zt(t))return e.stylize("undefined","undefined");if(Wt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(Qt(t))return e.stylize(""+t,"number");if(Gt(t))return e.stylize(""+t,"boolean");if(Yt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Xt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Bt(t);if(0===o.length){if($t(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Jt(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Zt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Xt(t))return Bt(t)}var u,l="",c=!1,h=["{","}"];(Ht(t)&&(c=!0,h=["[","]"]),$t(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return Jt(t)&&(l=" "+RegExp.prototype.toString.call(t)),Zt(t)&&(l=" "+Date.prototype.toUTCString.call(t)),Xt(t)&&(l=" "+Bt(t)),0!==o.length||c&&0!=t.length?n<0?Jt(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=c?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)un(t,String(s))?o.push(Ft(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Ft(e,t,n,r,i,!0))})),o}(e,t,n,s,o):o.map((function(r){return Ft(e,t,n,s,r,c)})),e.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,h)):h[0]+l+h[1]}function Bt(e){return"["+Error.prototype.toString.call(e)+"]"}function Ft(e,t,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),un(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=Yt(n)?Lt(e,u.value,null):Lt(e,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),zt(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function Ht(e){return Array.isArray(e)}function Gt(e){return"boolean"==typeof e}function Yt(e){return null===e}function jt(e){return null==e}function Qt(e){return"number"==typeof e}function Wt(e){return"string"==typeof e}function Kt(e){return"symbol"==typeof e}function zt(e){return void 0===e}function Jt(e){return Vt(e)&&"[object RegExp]"===nn(e)}function Vt(e){return"object"==typeof e&&null!==e}function Zt(e){return Vt(e)&&"[object Date]"===nn(e)}function Xt(e){return Vt(e)&&("[object Error]"===nn(e)||e instanceof Error)}function $t(e){return"function"==typeof e}function en(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function tn(e){return Ye.isBuffer(e)}function nn(e){return Object.prototype.toString.call(e)}function rn(e){return e<10?"0"+e.toString(10):e.toString(10)}Ut.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Ut.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var on=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function sn(){var e,t;console.log("%s - %s",(e=new Date,t=[rn(e.getHours()),rn(e.getMinutes()),rn(e.getSeconds())].join(":"),[e.getDate(),on[e.getMonth()],t].join(" ")),Dt.apply(null,arguments))}function an(e,t){if(!t||!Vt(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function un(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ln="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function cn(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(ln&&e[ln]){var t;if("function"!=typeof(t=e[ln]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,ln,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),ln&&Object.defineProperty(t,ln,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,Rt(e))}function hn(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}function fn(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if("function"!=typeof r)throw new TypeError("The last argument must be of type Function");var i=this,o=function(){return r.apply(i,arguments)};e.apply(this,t).then((function(e){ve.nextTick(o.bind(null,null,e))}),(function(e){ve.nextTick(hn.bind(null,e,o))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Rt(e)),t}cn.custom=ln;var dn,pn={inherits:It,_extend:an,log:sn,isBuffer:tn,isPrimitive:en,isFunction:$t,isError:Xt,isDate:Zt,isObject:Vt,isRegExp:Jt,isUndefined:zt,isSymbol:Kt,isString:Wt,isNumber:Qt,isNullOrUndefined:jt,isNull:Yt,isBoolean:Gt,isArray:Ht,inspect:Ut,deprecate:kt,format:Dt,debuglog:Nt,promisify:cn,callbackify:fn},gn=s(Object.freeze({__proto__:null,_extend:an,callbackify:fn,debuglog:Nt,default:pn,deprecate:kt,format:Dt,inherits:It,inspect:Ut,isArray:Ht,isBoolean:Gt,isBuffer:tn,isDate:Zt,isError:Xt,isFunction:$t,isNull:Yt,isNullOrUndefined:jt,isNumber:Qt,isObject:Vt,isPrimitive:en,isRegExp:Jt,isString:Wt,isSymbol:Kt,isUndefined:zt,log:sn,promisify:cn}));function mn(){if(void 0===dn){var e=new ArrayBuffer(2),t=new Uint8Array(e),n=new Uint16Array(e);if(t[0]=1,t[1]=2,258===n[0])dn="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");dn="LE"}}return dn}function _n(){return void 0!==j.location?j.location.hostname:""}function An(){return[]}function vn(){return 0}function yn(){return Number.MAX_VALUE}function Tn(){return Number.MAX_VALUE}function Sn(){return[]}function En(){return"Browser"}function Cn(){return void 0!==j.navigator?j.navigator.appVersion:""}function wn(){return{}}function bn(){return{}}function In(){return"javascript"}function Rn(){return"browser"}function On(){return"/tmp"}var Dn=On;function kn(){return"$HOME"}var Mn,qn,Nn,Un,xn,Pn={homedir:kn,EOL:"\n",arch:In,platform:Rn,tmpdir:Dn,tmpDir:On,networkInterfaces:wn,getNetworkInterfaces:bn,release:Cn,type:En,cpus:Sn,totalmem:Tn,freemem:yn,uptime:vn,loadavg:An,hostname:_n,endianness:mn},Ln=s(Object.freeze({__proto__:null,EOL:"\n",arch:In,cpus:Sn,default:Pn,endianness:mn,freemem:yn,getNetworkInterfaces:bn,homedir:kn,hostname:_n,loadavg:An,networkInterfaces:wn,platform:Rn,release:Cn,tmpDir:On,tmpdir:Dn,totalmem:Tn,type:En,uptime:vn}));function Bn(){return qn||(qn=1,Mn=(e,t=ve.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r<i)}),Mn}void 0===ve||"renderer"===ve.type||!0===ve.browser||ve.__nwjs?ye.exports=(Ae||(Ae=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==ve&&"env"in ve&&(e=ve.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Ee()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Te,Te.exports)),Te.exports):ye.exports=(xn||(xn=1,function(e,t){const n=Oe,r=gn;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return ve.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),o=` ${i};1m${r} [0m`;n[0]=o+n[0].split("\n").join("\n"+o),n.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?ve.env.DEBUG=e:delete ve.env.DEBUG},t.load=function(){return ve.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(ve.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if(Un)return Nn;Un=1;const e=Ln,t=Oe,n=Bn(),{env:r}=ve;let i;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(t,o){if(0===i)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===i)return 0;const s=i||0;if("dumb"===r.TERM)return s;if("win32"===ve.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:s;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:s}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?i=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(i=1),"FORCE_COLOR"in r&&(i="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),Nn={supportsColor:function(e){return o(s(e,e&&e.isTTY))},stdout:o(s(!0,t.isatty(1))),stderr:o(s(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(ve.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=ve.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=Ee()(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Ce,Ce.exports)),Ce.exports);var Fn=ye.exports;function Hn(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var Gn=Fn,Yn="JsSIP",jn=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t?(this._debug=Gn.default("".concat(Yn,":").concat(t)),this._warn=Gn.default("".concat(Yn,":WARN:").concat(t)),this._error=Gn.default("".concat(Yn,":ERROR:").concat(t))):(this._debug=Gn.default(Yn),this._warn=Gn.default("".concat(Yn,":WARN")),this._error=Gn.default("".concat(Yn,":ERROR"))),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}return Hn(e,[{key:"debug",get:function(){return this._debug}},{key:"warn",get:function(){return this._warn}},{key:"error",get:function(){return this._error}}]),e}(),Qn={},Wn={},Kn={exports:{}},zn=Kn.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(zn).forEach((function(e){zn[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}));var Jn=Kn.exports;!function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,r){var i=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:i&&!n[e.name]&&(n[e.name]={});var o=e.push?{}:i?n[e.name]:n;!function(e,n,r,i){if(i&&!r)n[i]=t(e[1]);else for(var o=0;o<r.length;o+=1)null!=e[o+1]&&(n[r[o]]=t(e[o+1]))}(r.match(e.reg),o,e.names,e.name),e.push&&n[e.push].push(o)},r=Jn,i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],s=t;return e.split(/(\r\n|\r|\n)/).filter(i).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),s=o[o.length-1]);for(var a=0;a<(r[t]||[]).length;a+=1){var u=r[t][a];if(u.reg.test(i))return n(u,s,i)}})),t.media=o,t};var o=function(e,n){var r=n.split(/=(.+)/,2);return 2===r.length?e[r[0]]=t(r[1]):1===r.length&&n.length>1&&(e[r[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],r=e.split(" ").map(t),i=0;i<r.length;i+=3)n.push({component:r[i],ip:r[i+1],port:r[i+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,r=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),r=!0),{scid:n,paused:r}}))}))}}(Wn);var Vn=Jn,Zn=/%[sdv%]/g,Xn=function(e){var t=1,n=arguments,r=n.length;return e.replace(Zn,(function(e){if(t>=r)return e;var i=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},$n=function(e,t,n){var r=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var i=0;i<t.names.length;i+=1){var o=t.names[i];t.name?r.push(n[t.name][o]):r.push(n[t.names[i]])}else r.push(n[t.name]);return Xn.apply(null,r)},er=["v","o","s","i","u","e","p","c","b","t","r","z","a"],tr=["i","c","b","a"],nr=Wn,rr=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||er,r=t.innerOrder||tr,i=[];return n.forEach((function(t){Vn[t].forEach((function(n){n.name in e&&null!=e[n.name]?i.push($n(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){i.push($n(t,n,e))}))}))})),e.media.forEach((function(e){i.push($n("m",Vn.m[0],e)),r.forEach((function(t){Vn[t].forEach((function(n){n.name in e&&null!=e[n.name]?i.push($n(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){i.push($n(t,n,e))}))}))}))})),i.join("\r\n")+"\r\n"};function ir(e){return ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(e)}function or(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sr(e,t)}function sr(e,t){return sr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sr(e,t)}function ar(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ur(e);if(t){var i=ur(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ir(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function ur(e){return ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ur(e)}function lr(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cr(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fr(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}Qn.write=rr,Qn.parse=nr.parse,Qn.parseParams=nr.parseParams,Qn.parseFmtpConfig=nr.parseFmtpConfig,Qn.parsePayloads=nr.parsePayloads,Qn.parseRemoteCandidates=nr.parseRemoteCandidates,Qn.parseImageAttributes=nr.parseImageAttributes,Qn.parseSimulcastStreamList=nr.parseSimulcastStreamList;var dr=Qn,pr=jn,gr=l,mr=U(),_r=M(),Ar=q(),vr=new pr("SIPMessage"),yr=function(){function e(t,n,r,i,o,s){if(hr(this,e),!t||!n||!r)return null;i=i||{},this.ua=r,this.headers={},this.method=t,this.ruri=n,this.body=s,this.extraHeaders=mr.cloneArray(o),this.ua.configuration.extra_headers&&(this.extraHeaders=this.extraHeaders.concat(this.ua.configuration.extra_headers)),i.route_set?this.setHeader("route",i.route_set):r.configuration.use_preloaded_route&&this.setHeader("route","<".concat(r.transport.sip_uri,";lr>")),this.setHeader("via",""),this.setHeader("max-forwards",gr.MAX_FORWARDS);var a=i.to_uri||n,u=i.to_tag?{tag:i.to_tag}:null,l=void 0!==i.to_display_name?i.to_display_name:null;this.to=new _r(a,l,u),this.setHeader("to",this.to.toString());var c,h=i.from_uri||r.configuration.uri,f={tag:i.from_tag||mr.newTag()};c=void 0!==i.from_display_name?i.from_display_name:r.configuration.display_name?r.configuration.display_name:null,this.from=new _r(h,c,f),this.setHeader("from",this.from.toString());var d=i.call_id||r.configuration.jssip_id+mr.createRandomToken(15);this.call_id=d,this.setHeader("call-id",d);var p=i.cseq||Math.floor(1e4*Math.random());this.cseq=p,this.setHeader("cseq","".concat(p," ").concat(t))}return fr(e,[{key:"setHeader",value:function(e,t){for(var n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=0;r<this.extraHeaders.length;r++)n.test(this.extraHeaders[r])&&this.extraHeaders.splice(r,1);this.headers[mr.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){var t=this.headers[mr.headerize(e)];if(t){if(t[0])return t[0]}else{var n,r=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),i=lr(this.extraHeaders);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r.test(o))return o.substring(o.indexOf(":")+1).trim()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"getHeaders",value:function(e){var t=this.headers[mr.headerize(e)],n=[];if(t){var r,i=lr(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.push(o)}}catch(e){i.e(e)}finally{i.f()}return n}var s,a=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),u=lr(this.extraHeaders);try{for(u.s();!(s=u.n()).done;){var l=s.value;a.test(l)&&n.push(l.substring(l.indexOf(":")+1).trim())}}catch(e){u.e(e)}finally{u.f()}return n}},{key:"hasHeader",value:function(e){if(this.headers[mr.headerize(e)])return!0;var t,n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=lr(this.extraHeaders);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(n.test(i))return!0}}catch(e){r.e(e)}finally{r.f()}return!1}},{key:"parseSDP",value:function(e){return!e&&this.sdp||(this.sdp=dr.parse(this.body||"")),this.sdp}},{key:"toString",value:function(){var e="".concat(this.method," ").concat(this.ruri," SIP/2.0\r\n");for(var t in this.headers)if(Object.prototype.hasOwnProperty.call(this.headers,t)){var n,r=lr(this.headers[t]);try{for(r.s();!(n=r.n()).done;){var i=n.value;e+="".concat(t,": ").concat(i,"\r\n")}}catch(e){r.e(e)}finally{r.f()}}var o,s=lr(this.extraHeaders);try{for(s.s();!(o=s.n()).done;){var a=o.value;e+="".concat(a.trim(),"\r\n")}}catch(e){s.e(e)}finally{s.f()}var u=[];switch(this.method){case gr.REGISTER:u.push("path","gruu");break;case gr.INVITE:this.ua.configuration.session_timers&&u.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&u.push("gruu"),u.push("ice","replaces");break;case gr.UPDATE:this.ua.configuration.session_timers&&u.push("timer"),u.push("ice")}u.push("outbound");var l=this.ua.configuration.user_agent||gr.USER_AGENT;if(e+="Allow: ".concat(gr.ALLOWED_METHODS,"\r\n"),e+="Supported: ".concat(u,"\r\n"),e+="User-Agent: ".concat(l,"\r\n"),this.body){var c=mr.str_utf8_length(this.body);e+="Content-Length: ".concat(c,"\r\n\r\n"),e+=this.body}else e+="Content-Length: 0\r\n\r\n";return e}},{key:"clone",value:function(){var t=new e(this.method,this.ruri,this.ua);return Object.keys(this.headers).forEach((function(e){t.headers[e]=this.headers[e].slice()}),this),t.body=this.body,t.extraHeaders=mr.cloneArray(this.extraHeaders),t.to=this.to,t.from=this.from,t.call_id=this.call_id,t.cseq=this.cseq,t}}]),e}(),Tr=function(){or(t,yr);var e=ar(t);function t(n,r,i,o,s){var a;return hr(this,t),(a=e.call(this,gr.INVITE,n,r,i,o,s)).transaction=null,a}return fr(t,[{key:"cancel",value:function(e){this.transaction.cancel(e)}},{key:"clone",value:function(){var e=new t(this.ruri,this.ua);return Object.keys(this.headers).forEach((function(t){e.headers[t]=this.headers[t].slice()}),this),e.body=this.body,e.extraHeaders=mr.cloneArray(this.extraHeaders),e.to=this.to,e.from=this.from,e.call_id=this.call_id,e.cseq=this.cseq,e.transaction=this.transaction,e}}]),t}(),Sr=function(){function e(){hr(this,e),this.data=null,this.headers=null,this.method=null,this.via=null,this.via_branch=null,this.call_id=null,this.cseq=null,this.from=null,this.from_tag=null,this.to=null,this.to_tag=null,this.body=null,this.sdp=null}return fr(e,[{key:"addHeader",value:function(e,t){var n={raw:t};e=mr.headerize(e),this.headers[e]?this.headers[e].push(n):this.headers[e]=[n]}},{key:"getHeader",value:function(e){var t=this.headers[mr.headerize(e)];if(t)return t[0]?t[0].raw:void 0}},{key:"getHeaders",value:function(e){var t=this.headers[mr.headerize(e)],n=[];if(!t)return[];var r,i=lr(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.push(o.raw)}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"hasHeader",value:function(e){return!!this.headers[mr.headerize(e)]}},{key:"parseHeader",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e=mr.headerize(e),this.headers[e]){if(!(t>=this.headers[e].length)){var n=this.headers[e][t],r=n.raw;if(n.parsed)return n.parsed;var i=Ar.parse(r,e.replace(/-/g,"_"));return-1===i?(this.headers[e].splice(t,1),void vr.debug('error parsing "'.concat(e,'" header field with value "').concat(r,'"'))):(n.parsed=i,i)}vr.debug('not so many "'.concat(e,'" headers present'))}else vr.debug('header "'.concat(e,'" not present'))}},{key:"s",value:function(e,t){return this.parseHeader(e,t)}},{key:"setHeader",value:function(e,t){var n={raw:t};this.headers[mr.headerize(e)]=[n]}},{key:"parseSDP",value:function(e){return!e&&this.sdp||(this.sdp=dr.parse(this.body||"")),this.sdp}},{key:"toString",value:function(){return this.data}}]),e}(),Er=function(){or(t,Sr);var e=ar(t);function t(n){var r;return hr(this,t),(r=e.call(this)).ua=n,r.headers={},r.ruri=null,r.transport=null,r.server_transaction=null,r}return fr(t,[{key:"reply",value:function(e,t,n,r,i,o){var s=[],a=this.getHeader("To");if(t=t||null,!(e=e||null)||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||gr.REASON_PHRASE[e]||"",n=mr.cloneArray(n),this.ua.configuration.extra_headers&&(n=n.concat(this.ua.configuration.extra_headers));var u="SIP/2.0 ".concat(e," ").concat(t,"\r\n");if(this.method===gr.INVITE&&e>100&&e<=200){var l,c=lr(this.getHeaders("record-route"));try{for(c.s();!(l=c.n()).done;){var h=l.value;u+="Record-Route: ".concat(h,"\r\n")}}catch(e){c.e(e)}finally{c.f()}}var f,d=lr(this.getHeaders("via"));try{for(d.s();!(f=d.n()).done;){var p=f.value;u+="Via: ".concat(p,"\r\n")}}catch(e){d.e(e)}finally{d.f()}!this.to_tag&&e>100?a+=";tag=".concat(mr.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(a+=";tag=".concat(this.to_tag)),u+="To: ".concat(a,"\r\n"),u+="From: ".concat(this.getHeader("From"),"\r\n"),u+="Call-ID: ".concat(this.call_id,"\r\n"),u+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n");var g,m=lr(n);try{for(m.s();!(g=m.n()).done;){var _=g.value;u+="".concat(_.trim(),"\r\n")}}catch(e){m.e(e)}finally{m.f()}switch(this.method){case gr.INVITE:this.ua.configuration.session_timers&&s.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&s.push("gruu"),s.push("ice","replaces");break;case gr.UPDATE:this.ua.configuration.session_timers&&s.push("timer"),r&&s.push("ice"),s.push("replaces")}if(s.push("outbound"),this.method===gr.OPTIONS?(u+="Allow: ".concat(gr.ALLOWED_METHODS,"\r\n"),u+="Accept: ".concat(gr.ACCEPTED_BODY_TYPES,"\r\n")):405===e?u+="Allow: ".concat(gr.ALLOWED_METHODS,"\r\n"):415===e&&(u+="Accept: ".concat(gr.ACCEPTED_BODY_TYPES,"\r\n")),u+="Supported: ".concat(s,"\r\n"),r){var A=mr.str_utf8_length(r);u+="Content-Type: application/sdp\r\n",u+="Content-Length: ".concat(A,"\r\n\r\n"),u+=r}else u+="Content-Length: ".concat(0,"\r\n\r\n");this.server_transaction.receiveResponse(e,u,i,o)}},{key:"reply_sl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getHeaders("via");if(!e||e<100||e>699)throw new TypeError("Invalid status_code: ".concat(e));if(t&&"string"!=typeof t&&!(t instanceof String))throw new TypeError("Invalid reason_phrase: ".concat(t));t=t||gr.REASON_PHRASE[e]||"";var r,i="SIP/2.0 ".concat(e," ").concat(t,"\r\n"),o=lr(n);try{for(o.s();!(r=o.n()).done;){var s=r.value;i+="Via: ".concat(s,"\r\n")}}catch(e){o.e(e)}finally{o.f()}var a=this.getHeader("To");if(!this.to_tag&&e>100?a+=";tag=".concat(mr.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(a+=";tag=".concat(this.to_tag)),i+="To: ".concat(a,"\r\n"),i+="From: ".concat(this.getHeader("From"),"\r\n"),i+="Call-ID: ".concat(this.call_id,"\r\n"),i+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n"),this.ua.configuration.extra_headers){var u,l=lr(this.ua.configuration.extra_headers);try{for(l.s();!(u=l.n()).done;){var c=u.value;i+="".concat(c.trim(),"\r\n")}}catch(e){l.e(e)}finally{l.f()}}i+="Content-Length: ".concat(0,"\r\n\r\n"),this.transport.send(i)}}]),t}(),Cr={OutgoingRequest:yr,InitialOutgoingInviteRequest:Tr,IncomingRequest:Er,IncomingResponse:function(){or(t,Sr);var e=ar(t);function t(){var n;return hr(this,t),(n=e.call(this)).headers={},n.status_code=null,n.reason_phrase=null,n}return t}()};function wr(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var br=jn,Ir=U(),Rr=new br("DigestAuthentication"),Or=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._credentials=t,this._cnonce=null,this._nc=0,this._ncHex="00000000",this._algorithm=null,this._realm=null,this._nonce=null,this._opaque=null,this._stale=null,this._qop=null,this._method=null,this._uri=null,this._ha1=null,this._response=null}return wr(e,[{key:"get",value:function(e){switch(e){case"realm":return this._realm;case"ha1":return this._ha1;default:return void Rr.warn('get() | cannot get "%s" parameter',e)}}},{key:"authenticate",value:function(e,t){var n=e.method,r=e.ruri,i=e.body,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this._algorithm=t.algorithm,this._realm=t.realm,this._nonce=t.nonce,this._opaque=t.opaque,this._stale=t.stale,this._algorithm){if("MD5"!==this._algorithm)return Rr.warn('authenticate() | challenge with Digest algorithm different than "MD5", authentication aborted'),!1}else this._algorithm="MD5";if(!this._nonce)return Rr.warn("authenticate() | challenge without Digest nonce, authentication aborted"),!1;if(!this._realm)return Rr.warn("authenticate() | challenge without Digest realm, authentication aborted"),!1;if(!this._credentials.password){if(!this._credentials.ha1)return Rr.warn("authenticate() | no plain SIP password nor ha1 provided, authentication aborted"),!1;if(this._credentials.realm!==this._realm)return Rr.warn('authenticate() | no plain SIP password, and stored `realm` does not match the given `realm`, cannot authenticate [stored:"%s", given:"%s"]',this._credentials.realm,this._realm),!1}if(t.qop)if(t.qop.indexOf("auth-int")>-1)this._qop="auth-int";else{if(!(t.qop.indexOf("auth")>-1))return Rr.warn('authenticate() | challenge without Digest qop different than "auth" or "auth-int", authentication aborted'),!1;this._qop="auth"}else this._qop=null;this._method=n,this._uri=r,this._cnonce=o||Ir.createRandomToken(12),this._nc+=1;var s,a,u=Number(this._nc).toString(16);return this._ncHex="00000000".substr(0,8-u.length)+u,4294967296===this._nc&&(this._nc=1,this._ncHex="00000001"),this._credentials.password?this._ha1=Ir.calculateMD5("".concat(this._credentials.username,":").concat(this._realm,":").concat(this._credentials.password)):this._ha1=this._credentials.ha1,"auth"===this._qop?(s="".concat(this._method,":").concat(this._uri),a=Ir.calculateMD5(s),Rr.debug('authenticate() | using qop=auth [a2:"%s"]',s),this._response=Ir.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth:").concat(a))):"auth-int"===this._qop?(s="".concat(this._method,":").concat(this._uri,":").concat(Ir.calculateMD5(i||"")),a=Ir.calculateMD5(s),Rr.debug('authenticate() | using qop=auth-int [a2:"%s"]',s),this._response=Ir.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth-int:").concat(a))):null===this._qop&&(s="".concat(this._method,":").concat(this._uri),a=Ir.calculateMD5(s),Rr.debug('authenticate() | using qop=null [a2:"%s"]',s),this._response=Ir.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(a))),Rr.debug("authenticate() | response generated"),!0}},{key:"toString",value:function(){var e=[];if(!this._response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm=".concat(this._algorithm)),e.push('username="'.concat(this._credentials.username,'"')),e.push('realm="'.concat(this._realm,'"')),e.push('nonce="'.concat(this._nonce,'"')),e.push('uri="'.concat(this._uri,'"')),e.push('response="'.concat(this._response,'"')),this._opaque&&e.push('opaque="'.concat(this._opaque,'"')),this._qop&&(e.push("qop=".concat(this._qop)),e.push('cnonce="'.concat(this._cnonce,'"')),e.push("nc=".concat(this._ncHex))),"Digest ".concat(e.join(", "))}}]),e}(),Dr=500,kr={T1:Dr,T2:4e3,T4:5e3,TIMER_B:32e3,TIMER_D:0,TIMER_F:32e3,TIMER_H:32e3,TIMER_I:0,TIMER_J:0,TIMER_K:0,TIMER_L:32e3,TIMER_M:32e3,PROVISIONAL_RESPONSE_INTERVAL:6e4};function Mr(e){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mr(e)}function qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nr(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Ur(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xr(e,t)}function xr(e,t){return xr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xr(e,t)}function Pr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Br(e);if(t){var i=Br(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Mr(t)||"function"==typeof t))return t;return Lr(e)}(this,n)}}function Lr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Br(e){return Br=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Br(e)}var Fr=Y.EventEmitter,Hr=jn,Gr=l,Yr=Cr,jr=kr,Qr=new Hr("NonInviteClientTransaction"),Wr=new Hr("InviteClientTransaction"),Kr=new Hr("AckClientTransaction"),zr=new Hr("NonInviteServerTransaction"),Jr=new Hr("InviteServerTransaction"),Vr={STATUS_TRYING:1,STATUS_PROCEEDING:2,STATUS_CALLING:3,STATUS_ACCEPTED:4,STATUS_COMPLETED:5,STATUS_TERMINATED:6,STATUS_CONFIRMED:7,NON_INVITE_CLIENT:"nict",NON_INVITE_SERVER:"nist",INVITE_CLIENT:"ict",INVITE_SERVER:"ist"},Zr=function(){Ur(t,Fr);var e=Pr(t);function t(n,r,i,o){var s;qr(this,t),(s=e.call(this)).type=Vr.NON_INVITE_CLIENT,s.id="z9hG4bK".concat(Math.floor(1e7*Math.random())),s.ua=n,s.transport=r,s.request=i,s.eventHandlers=o;var a="SIP/2.0/".concat(r.via_transport);return a+=" ".concat(n.configuration.via_host,";branch=").concat(s.id),s.request.setHeader("via",a),s.ua.newTransaction(Lr(s)),s}return Nr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"send",value:function(){var e=this;this.stateChanged(Vr.STATUS_TRYING),this.F=setTimeout((function(){e.timer_F()}),jr.TIMER_F),this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){Qr.debug("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.F),clearTimeout(this.K),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onTransportError()}},{key:"timer_F",value:function(){Qr.debug("Timer F expired for transaction ".concat(this.id)),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onRequestTimeout()}},{key:"timer_K",value:function(){this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"receiveResponse",value:function(e){var t=this,n=e.status_code;if(n<200)switch(this.state){case Vr.STATUS_TRYING:case Vr.STATUS_PROCEEDING:this.stateChanged(Vr.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e)}else switch(this.state){case Vr.STATUS_TRYING:case Vr.STATUS_PROCEEDING:this.stateChanged(Vr.STATUS_COMPLETED),clearTimeout(this.F),408===n?this.eventHandlers.onRequestTimeout():this.eventHandlers.onReceiveResponse(e),this.K=setTimeout((function(){t.timer_K()}),jr.TIMER_K)}}},{key:"C",get:function(){return Vr}}]),t}(),Xr=function(){Ur(t,Fr);var e=Pr(t);function t(n,r,i,o){var s;qr(this,t),(s=e.call(this)).type=Vr.INVITE_CLIENT,s.id="z9hG4bK".concat(Math.floor(1e7*Math.random())),s.ua=n,s.transport=r,s.request=i,s.eventHandlers=o,i.transaction=Lr(s);var a="SIP/2.0/".concat(r.via_transport);return a+=" ".concat(n.configuration.via_host,";branch=").concat(s.id),s.request.setHeader("via",a),s.ua.newTransaction(Lr(s)),s}return Nr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"send",value:function(){var e=this;this.stateChanged(Vr.STATUS_CALLING),this.B=setTimeout((function(){e.timer_B()}),jr.TIMER_B),this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){clearTimeout(this.B),clearTimeout(this.D),clearTimeout(this.M),this.state!==Vr.STATUS_ACCEPTED&&(Wr.debug("transport error occurred, deleting transaction ".concat(this.id)),this.eventHandlers.onTransportError()),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_M",value:function(){Wr.debug("Timer M expired for transaction ".concat(this.id)),this.state===Vr.STATUS_ACCEPTED&&(clearTimeout(this.B),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"timer_B",value:function(){Wr.debug("Timer B expired for transaction ".concat(this.id)),this.state===Vr.STATUS_CALLING&&(this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onRequestTimeout())}},{key:"timer_D",value:function(){Wr.debug("Timer D expired for transaction ".concat(this.id)),clearTimeout(this.B),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"sendACK",value:function(e){var t=this,n=new Yr.OutgoingRequest(Gr.ACK,this.request.ruri,this.ua,{route_set:this.request.getHeaders("route"),call_id:this.request.getHeader("call-id"),cseq:this.request.cseq});n.setHeader("from",this.request.getHeader("from")),n.setHeader("via",this.request.getHeader("via")),n.setHeader("to",e.getHeader("to")),this.D=setTimeout((function(){t.timer_D()}),jr.TIMER_D),this.transport.send(n)}},{key:"cancel",value:function(e){if(this.state===Vr.STATUS_PROCEEDING){var t=new Yr.OutgoingRequest(Gr.CANCEL,this.request.ruri,this.ua,{route_set:this.request.getHeaders("route"),call_id:this.request.getHeader("call-id"),cseq:this.request.cseq});t.setHeader("from",this.request.getHeader("from")),t.setHeader("via",this.request.getHeader("via")),t.setHeader("to",this.request.getHeader("to")),e&&t.setHeader("reason",e),this.transport.send(t)}}},{key:"receiveResponse",value:function(e){var t=this,n=e.status_code;if(n>=100&&n<=199)switch(this.state){case Vr.STATUS_CALLING:this.stateChanged(Vr.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e);break;case Vr.STATUS_PROCEEDING:this.eventHandlers.onReceiveResponse(e)}else if(n>=200&&n<=299)switch(this.state){case Vr.STATUS_CALLING:case Vr.STATUS_PROCEEDING:this.stateChanged(Vr.STATUS_ACCEPTED),this.M=setTimeout((function(){t.timer_M()}),jr.TIMER_M),this.eventHandlers.onReceiveResponse(e);break;case Vr.STATUS_ACCEPTED:this.eventHandlers.onReceiveResponse(e)}else if(n>=300&&n<=699)switch(this.state){case Vr.STATUS_CALLING:case Vr.STATUS_PROCEEDING:this.stateChanged(Vr.STATUS_COMPLETED),this.sendACK(e),this.eventHandlers.onReceiveResponse(e);break;case Vr.STATUS_COMPLETED:this.sendACK(e)}}},{key:"C",get:function(){return Vr}}]),t}(),$r=function(){Ur(t,Fr);var e=Pr(t);function t(n,r,i,o){var s;qr(this,t),(s=e.call(this)).id="z9hG4bK".concat(Math.floor(1e7*Math.random())),s.transport=r,s.request=i,s.eventHandlers=o;var a="SIP/2.0/".concat(r.via_transport);return a+=" ".concat(n.configuration.via_host,";branch=").concat(s.id),s.request.setHeader("via",a),s}return Nr(t,[{key:"send",value:function(){this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){Kr.debug("transport error occurred for transaction ".concat(this.id)),this.eventHandlers.onTransportError()}},{key:"C",get:function(){return Vr}}]),t}(),ei=function(){Ur(t,Fr);var e=Pr(t);function t(n,r,i){var o;return qr(this,t),(o=e.call(this)).type=Vr.NON_INVITE_SERVER,o.id=i.via_branch,o.ua=n,o.transport=r,o.request=i,o.last_response="",i.server_transaction=Lr(o),o.state=Vr.STATUS_TRYING,n.newTransaction(Lr(o)),o}return Nr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_J",value:function(){zr.debug("Timer J expired for transaction ".concat(this.id)),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,zr.debug("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.J),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"receiveResponse",value:function(e,t,n,r){var i=this;if(100===e)switch(this.state){case Vr.STATUS_TRYING:this.stateChanged(Vr.STATUS_PROCEEDING),this.transport.send(t)||this.onTransportError();break;case Vr.STATUS_PROCEEDING:this.last_response=t,this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=200&&e<=699)switch(this.state){case Vr.STATUS_TRYING:case Vr.STATUS_PROCEEDING:this.stateChanged(Vr.STATUS_COMPLETED),this.last_response=t,this.J=setTimeout((function(){i.timer_J()}),jr.TIMER_J),this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}}},{key:"C",get:function(){return Vr}}]),t}(),ti=function(){Ur(t,Fr);var e=Pr(t);function t(n,r,i){var o;return qr(this,t),(o=e.call(this)).type=Vr.INVITE_SERVER,o.id=i.via_branch,o.ua=n,o.transport=r,o.request=i,o.last_response="",i.server_transaction=Lr(o),o.state=Vr.STATUS_PROCEEDING,n.newTransaction(Lr(o)),o.resendProvisionalTimer=null,i.reply(100),o}return Nr(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_H",value:function(){Jr.debug("Timer H expired for transaction ".concat(this.id)),this.state===Vr.STATUS_COMPLETED&&Jr.debug("ACK not received, dialog will be terminated"),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_I",value:function(){this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_L",value:function(){Jr.debug("Timer L expired for transaction ".concat(this.id)),this.state===Vr.STATUS_ACCEPTED&&(this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,Jr.debug("transport error occurred, deleting transaction ".concat(this.id)),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),clearTimeout(this.L),clearTimeout(this.H),clearTimeout(this.I),this.stateChanged(Vr.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"resend_provisional",value:function(){this.transport.send(this.last_response)||this.onTransportError()}},{key:"receiveResponse",value:function(e,t,n,r){var i=this;if(e>=100&&e<=199&&this.state===Vr.STATUS_PROCEEDING)this.transport.send(t)||this.onTransportError(),this.last_response=t;if(e>100&&e<=199&&this.state===Vr.STATUS_PROCEEDING)null===this.resendProvisionalTimer&&(this.resendProvisionalTimer=setInterval((function(){i.resend_provisional()}),jr.PROVISIONAL_RESPONSE_INTERVAL));else if(e>=200&&e<=299)switch(this.state){case Vr.STATUS_PROCEEDING:this.stateChanged(Vr.STATUS_ACCEPTED),this.last_response=t,this.L=setTimeout((function(){i.timer_L()}),jr.TIMER_L),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null);case Vr.STATUS_ACCEPTED:this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=300&&e<=699&&this.state===Vr.STATUS_PROCEEDING)null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),this.transport.send(t)?(this.stateChanged(Vr.STATUS_COMPLETED),this.H=setTimeout((function(){i.timer_H()}),jr.TIMER_H),n&&n()):(this.onTransportError(),r&&r())}},{key:"C",get:function(){return Vr}}]),t}();var ni={C:Vr,NonInviteClientTransaction:Zr,InviteClientTransaction:Xr,AckClientTransaction:$r,NonInviteServerTransaction:ei,InviteServerTransaction:ti,checkTransaction:function(e,t){var n,r=e._transactions;switch(t.method){case Gr.INVITE:if(n=r.ist[t.via_branch]){if(n.state===Vr.STATUS_PROCEEDING)n.transport.send(n.last_response);return!0}break;case Gr.ACK:if(!(n=r.ist[t.via_branch]))return!1;if(n.state===Vr.STATUS_ACCEPTED)return!1;if(n.state===Vr.STATUS_COMPLETED)return n.state=Vr.STATUS_CONFIRMED,n.I=setTimeout((function(){n.timer_I()}),jr.TIMER_I),!0;break;case Gr.CANCEL:return(n=r.ist[t.via_branch])?(t.reply_sl(200),n.state!==Vr.STATUS_PROCEEDING):(t.reply_sl(481),!0);default:if(n=r.nist[t.via_branch]){switch(n.state){case Vr.STATUS_TRYING:break;case Vr.STATUS_PROCEEDING:case Vr.STATUS_COMPLETED:n.transport.send(n.last_response)}return!0}}}};function ri(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var ii=l,oi=Or,si=ni,ai=new jn("RequestSender"),ui={onRequestTimeout:function(){},onTransportError:function(){},onReceiveResponse:function(){},onAuthenticated:function(){}},li=function(){function e(t,n,r){for(var i in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ua=t,this._eventHandlers=r,this._method=n.method,this._request=n,this._auth=null,this._challenged=!1,this._staled=!1,ui)Object.prototype.hasOwnProperty.call(ui,i)&&(this._eventHandlers[i]||(this._eventHandlers[i]=ui[i]));t.status!==t.C.STATUS_USER_CLOSED||this._method===ii.BYE&&this._method===ii.ACK||this._eventHandlers.onTransportError()}return ri(e,[{key:"send",value:function(){var e=this,t={onRequestTimeout:function(){e._eventHandlers.onRequestTimeout()},onTransportError:function(){e._eventHandlers.onTransportError()},onReceiveResponse:function(t){e._receiveResponse(t)}};switch(this._method){case"INVITE":this.clientTransaction=new si.InviteClientTransaction(this._ua,this._ua.transport,this._request,t);break;case"ACK":this.clientTransaction=new si.AckClientTransaction(this._ua,this._ua.transport,this._request,t);break;default:this.clientTransaction=new si.NonInviteClientTransaction(this._ua,this._ua.transport,this._request,t)}this._ua._configuration.authorization_jwt&&this._request.setHeader("Authorization",this._ua._configuration.authorization_jwt),this.clientTransaction.send()}},{key:"_receiveResponse",value:function(e){var t,n,r=e.status_code;if(401!==r&&407!==r||null===this._ua.configuration.password&&null===this._ua.configuration.ha1)this._eventHandlers.onReceiveResponse(e);else{if(401===e.status_code?(t=e.parseHeader("www-authenticate"),n="authorization"):(t=e.parseHeader("proxy-authenticate"),n="proxy-authorization"),!t)return ai.debug("".concat(e.status_code," with wrong or missing challenge, cannot authenticate")),void this._eventHandlers.onReceiveResponse(e);if(!this._challenged||!this._staled&&!0===t.stale){if(this._auth||(this._auth=new oi({username:this._ua.configuration.authorization_user,password:this._ua.configuration.password,realm:this._ua.configuration.realm,ha1:this._ua.configuration.ha1})),!this._auth.authenticate(this._request,t))return void this._eventHandlers.onReceiveResponse(e);this._challenged=!0,this._ua.set("realm",this._auth.get("realm")),this._ua.set("ha1",this._auth.get("ha1")),t.stale&&(this._staled=!0),this._request=this._request.clone(),this._request.cseq+=1,this._request.setHeader("cseq","".concat(this._request.cseq," ").concat(this._method)),this._request.setHeader(n,this._auth.toString()),this._eventHandlers.onAuthenticated(this._request),this.send()}else this._eventHandlers.onReceiveResponse(e)}}}]),e}();function ci(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var hi=jn,fi=U(),di=l,pi=Cr,gi=li,mi=new hi("Registrator"),_i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._reg_id=1,this._ua=t,this._transport=n,this._registrar=t.configuration.registrar_server,this._expires=t.configuration.register_expires,this._call_id=fi.createRandomToken(22),this._cseq=0,this._to_uri=t.configuration.uri,this._registrationTimer=null,this._registering=!1,this._registered=!1,this._contact=this._ua.contact.toString(),this._contact+=";+sip.ice",this._extraHeaders=[],this._extraContactParams="",this._sipInstance='"<urn:uuid:'.concat(this._ua.configuration.instance_id,'>"'),this._contact+=";reg-id=".concat(this._reg_id),this._contact+=";+sip.instance=".concat(this._sipInstance)}return ci(e,[{key:"setExtraHeaders",value:function(e){Array.isArray(e)||(e=[]),this._extraHeaders=e.slice()}},{key:"setExtraContactParams",value:function(e){for(var t in e instanceof Object||(e={}),this._extraContactParams="",e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];this._extraContactParams+=";".concat(t),n&&(this._extraContactParams+="=".concat(n))}}},{key:"register",value:function(){var e=this;if(this._registering)mi.debug("Register request in progress...");else{var t=this._extraHeaders.slice();t.push("Contact: ".concat(this._contact,";expires=").concat(this._expires).concat(this._extraContactParams)),t.push("Expires: ".concat(this._expires));var n=new pi.OutgoingRequest(di.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},t),r=new gi(this._ua,n,{onRequestTimeout:function(){e._registrationFailure(null,di.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._registrationFailure(null,di.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){if(t.cseq===e._cseq)switch(null!==e._registrationTimer&&(clearTimeout(e._registrationTimer),e._registrationTimer=null),!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):if(e._registering=!1,!t.hasHeader("Contact")){mi.debug("no Contact header in response to REGISTER, response ignored");break}var n=t.headers.Contact.reduce((function(e,t){return e.concat(t.parsed)}),[]),r=n.find((function(t){return e._sipInstance===t.getParam("+sip.instance")&&e._reg_id===parseInt(t.getParam("reg-id"))}));if(r||(r=n.find((function(t){return t.uri.user===e._ua.contact.uri.user}))),!r){mi.debug("no Contact header pointing to us, response ignored");break}var i=r.getParam("expires");!i&&t.hasHeader("expires")&&(i=t.getHeader("expires")),i||(i=e._expires),(i=Number(i))<10&&(i=10);var o=i>64?1e3*i/2+Math.floor(1e3*(i/2-32)*Math.random()):1e3*i-5e3;e._registrationTimer=setTimeout((function(){e._registrationTimer=null,0===e._ua.listeners("registrationExpiring").length?e.register():e._ua.emit("registrationExpiring")}),o),r.hasParam("temp-gruu")&&(e._ua.contact.temp_gruu=r.getParam("temp-gruu").replace(/"/g,"")),r.hasParam("pub-gruu")&&(e._ua.contact.pub_gruu=r.getParam("pub-gruu").replace(/"/g,"")),e._registered||(e._registered=!0,e._ua.registered({response:t}));break;case/^423$/.test(t.status_code):t.hasHeader("min-expires")?(e._expires=Number(t.getHeader("min-expires")),e._expires<10&&(e._expires=10),e.register()):(mi.debug("423 response received for REGISTER without Min-Expires"),e._registrationFailure(t,di.causes.SIP_FAILURE_CODE));break;default:var s=fi.sipErrorCause(t.status_code);e._registrationFailure(t,s)}}});this._registering=!0,r.send()}}},{key:"unregister",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._registered){this._registered=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null);var n=this._extraHeaders.slice();t.all?n.push("Contact: *".concat(this._extraContactParams)):n.push("Contact: ".concat(this._contact,";expires=0").concat(this._extraContactParams)),n.push("Expires: 0");var r=new pi.OutgoingRequest(di.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},n);new gi(this._ua,r,{onRequestTimeout:function(){e._unregistered(null,di.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._unregistered(null,di.causes.CONNECTION_ERROR)},onAuthenticated:function(){e._cseq+=1},onReceiveResponse:function(t){switch(!0){case/^1[0-9]{2}$/.test(t.status_code):break;case/^2[0-9]{2}$/.test(t.status_code):e._unregistered(t);break;default:var n=fi.sipErrorCause(t.status_code);e._unregistered(t,n)}}}).send()}else mi.debug("already unregistered")}},{key:"close",value:function(){this._registered&&this.unregister()}},{key:"onTransportClosed",value:function(){this._registering=!1,null!==this._registrationTimer&&(clearTimeout(this._registrationTimer),this._registrationTimer=null),this._registered&&(this._registered=!1,this._ua.unregistered({}))}},{key:"_registrationFailure",value:function(e,t){this._registering=!1,this._ua.registrationFailed({response:e||null,cause:t}),this._registered&&(this._registered=!1,this._ua.unregistered({response:e||null,cause:t}))}},{key:"_unregistered",value:function(e,t){this._registering=!1,this._registered=!1,this._ua.unregistered({response:e||null,cause:t||null})}},{key:"registered",get:function(){return this._registered}}]),e}();function Ai(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var vi=l,yi=ni,Ti=li,Si={onRequestTimeout:function(){},onTransportError:function(){},onSuccessResponse:function(){},onErrorResponse:function(){},onAuthenticated:function(){},onDialogError:function(){}};function Ei(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ci(e,t,n){return t&&Ei(e.prototype,t),n&&Ei(e,n),e}var wi=jn,bi=Cr,Ii=l,Ri=ni,Oi=function(){function e(t,n,r){for(var i in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._dialog=t,this._ua=t._ua,this._request=n,this._eventHandlers=r,this._reattempt=!1,this._reattemptTimer=null,Si)Object.prototype.hasOwnProperty.call(Si,i)&&(this._eventHandlers[i]||(this._eventHandlers[i]=Si[i]))}return Ai(e,[{key:"send",value:function(){var e=this,t=new Ti(this._ua,this._request,{onRequestTimeout:function(){e._eventHandlers.onRequestTimeout()},onTransportError:function(){e._eventHandlers.onTransportError()},onAuthenticated:function(t){e._eventHandlers.onAuthenticated(t)},onReceiveResponse:function(t){e._receiveResponse(t)}});if(t.send(),(this._request.method===vi.INVITE||this._request.method===vi.UPDATE&&this._request.body)&&t.clientTransaction.state!==yi.C.STATUS_TERMINATED){this._dialog.uac_pending_reply=!0;t.clientTransaction.on("stateChanged",(function n(){t.clientTransaction.state!==yi.C.STATUS_ACCEPTED&&t.clientTransaction.state!==yi.C.STATUS_COMPLETED&&t.clientTransaction.state!==yi.C.STATUS_TERMINATED||(t.clientTransaction.removeListener("stateChanged",n),e._dialog.uac_pending_reply=!1)}))}}},{key:"_receiveResponse",value:function(e){var t=this;408===e.status_code||481===e.status_code?this._eventHandlers.onDialogError(e):e.method===vi.INVITE&&491===e.status_code?this._reattempt?e.status_code>=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e):(this._request.cseq=this._dialog.local_seqnum+=1,this._reattemptTimer=setTimeout((function(){t._dialog.isTerminated()||(t._reattempt=!0,t.send())}),1e3)):e.status_code>=200&&e.status_code<300?this._eventHandlers.onSuccessResponse(e):e.status_code>=300&&this._eventHandlers.onErrorResponse(e)}},{key:"request",get:function(){return this._request}}]),e}(),Di=U(),ki=new wi("Dialog"),Mi={STATUS_EARLY:1,STATUS_CONFIRMED:2,STATUS_TERMINATED:3},qi=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mi.STATUS_CONFIRMED;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._owner=t,this._ua=t._ua,this._uac_pending_reply=!1,this._uas_pending_reply=!1,!n.hasHeader("contact"))return{error:"unable to create a Dialog without Contact header field"};n instanceof bi.IncomingResponse&&(i=n.status_code<200?Mi.STATUS_EARLY:Mi.STATUS_CONFIRMED);var o=n.parseHeader("contact");"UAS"===r?(this._id={call_id:n.call_id,local_tag:n.to_tag,remote_tag:n.from_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=i,this._remote_seqnum=n.cseq,this._local_uri=n.parseHeader("to").uri,this._remote_uri=n.parseHeader("from").uri,this._remote_target=o.uri,this._route_set=n.getHeaders("record-route"),this._ack_seqnum=this._remote_seqnum):"UAC"===r&&(this._id={call_id:n.call_id,local_tag:n.from_tag,remote_tag:n.to_tag,toString:function(){return this.call_id+this.local_tag+this.remote_tag}},this._state=i,this._local_seqnum=n.cseq,this._local_uri=n.parseHeader("from").uri,this._remote_uri=n.parseHeader("to").uri,this._remote_target=o.uri,this._route_set=n.getHeaders("record-route").reverse(),this._ack_seqnum=null),this._ua.newDialog(this),ki.debug("new ".concat(r," dialog created with status ").concat(this._state===Mi.STATUS_EARLY?"EARLY":"CONFIRMED"))}return Ci(e,null,[{key:"C",get:function(){return Mi}}]),Ci(e,[{key:"isTerminated",value:function(){return this._status===Mi.STATUS_TERMINATED}},{key:"update",value:function(e,t){this._state=Mi.STATUS_CONFIRMED,ki.debug("dialog ".concat(this._id.toString()," changed to CONFIRMED state")),"UAC"===t&&(this._route_set=e.getHeaders("record-route").reverse())}},{key:"terminate",value:function(){ki.debug("dialog ".concat(this._id.toString()," deleted")),this._ua.destroyDialog(this),this._state=Mi.STATUS_TERMINATED}},{key:"sendRequest",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Di.cloneArray(n.extraHeaders),i=Di.cloneObject(n.eventHandlers),o=n.body||null,s=this._createRequest(e,r,o);return i.onAuthenticated=function(){t._local_seqnum+=1},new Oi(this,s,i).send(),s}},{key:"receiveRequest",value:function(e){this._checkInDialogRequest(e)&&(e.method===Ii.ACK&&null!==this._ack_seqnum?this._ack_seqnum=null:e.method===Ii.INVITE&&(this._ack_seqnum=e.cseq),this._owner.receiveRequest(e))}},{key:"_createRequest",value:function(e,t,n){t=Di.cloneArray(t),this._local_seqnum||(this._local_seqnum=Math.floor(1e4*Math.random()));var r=e===Ii.CANCEL||e===Ii.ACK?this._local_seqnum:this._local_seqnum+=1;return new bi.OutgoingRequest(e,this._remote_target,this._ua,{cseq:r,call_id:this._id.call_id,from_uri:this._local_uri,from_tag:this._id.local_tag,to_uri:this._remote_uri,to_tag:this._id.remote_tag,route_set:this._route_set},t,n)}},{key:"_checkInDialogRequest",value:function(e){var t=this;if(this._remote_seqnum)if(e.cseq<this._remote_seqnum){if(e.method!==Ii.ACK)return e.reply(500),!1;if(null===this._ack_seqnum||e.cseq!==this._ack_seqnum)return!1}else e.cseq>this._remote_seqnum&&(this._remote_seqnum=e.cseq);else this._remote_seqnum=e.cseq;if(e.method===Ii.INVITE||e.method===Ii.UPDATE&&e.body){if(!0===this._uac_pending_reply)e.reply(491);else{if(!0===this._uas_pending_reply){var n=1+(10*Math.random()|0);return e.reply(500,null,["Retry-After:".concat(n)]),!1}this._uas_pending_reply=!0;e.server_transaction.on("stateChanged",(function n(){e.server_transaction.state!==Ri.C.STATUS_ACCEPTED&&e.server_transaction.state!==Ri.C.STATUS_COMPLETED&&e.server_transaction.state!==Ri.C.STATUS_TERMINATED||(e.server_transaction.removeListener("stateChanged",n),t._uas_pending_reply=!1)}))}e.hasHeader("contact")&&e.server_transaction.on("stateChanged",(function(){e.server_transaction.state===Ri.C.STATUS_ACCEPTED&&(t._remote_target=e.parseHeader("contact").uri)}))}else e.method===Ii.NOTIFY&&e.hasHeader("contact")&&e.server_transaction.on("stateChanged",(function(){e.server_transaction.state===Ri.C.STATUS_COMPLETED&&(t._remote_target=e.parseHeader("contact").uri)}));return!0}},{key:"id",get:function(){return this._id}},{key:"local_seqnum",get:function(){return this._local_seqnum},set:function(e){this._local_seqnum=e}},{key:"owner",get:function(){return this._owner}},{key:"uac_pending_reply",get:function(){return this._uac_pending_reply},set:function(e){this._uac_pending_reply=e}},{key:"uas_pending_reply",get:function(){return this._uas_pending_reply}}]),e}(),Ni={exports:{}};function Ui(e){return Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ui(e)}function xi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Pi(e,t){return Pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pi(e,t)}function Li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bi(e);if(t){var i=Bi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ui(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Bi(e){return Bi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Bi(e)}var Fi=Y.EventEmitter,Hi=jn,Gi=l,Yi=D,ji=U(),Qi=new Hi("RTCSession:DTMF"),Wi={MIN_DURATION:70,MAX_DURATION:6e3,DEFAULT_DURATION:100,MIN_INTER_TONE_GAP:50,DEFAULT_INTER_TONE_GAP:500};Ni.exports=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pi(e,t)}(t,Fi);var e=Li(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._session=n,r._direction=null,r._tone=null,r._duration=null,r._request=null,r}return xi(t,[{key:"send",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===e)throw new TypeError("Not enough arguments");if(this._direction="outgoing",this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new Yi.InvalidStateError(this._session.status);var r=ji.cloneArray(n.extraHeaders);if(this.eventHandlers=ji.cloneObject(n.eventHandlers),"string"==typeof e)e=e.toUpperCase();else{if("number"!=typeof e)throw new TypeError("Invalid tone: ".concat(e));e=e.toString()}if(!e.match(/^[0-9A-DR#*]$/))throw new TypeError("Invalid tone: ".concat(e));this._tone=e,this._duration=n.duration,r.push("Content-Type: application/dtmf-relay");var i="Signal=".concat(this._tone,"\r\n");i+="Duration=".concat(this._duration),this._session.newDTMF({originator:"local",dtmf:this,request:this._request}),this._session.sendRequest(Gi.INFO,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){t.eventHandlers.onFailed&&t.eventHandlers.onFailed(),t.emit("failed",{originator:"remote",response:e})},onRequestTimeout:function(){t._session.onRequestTimeout()},onTransportError:function(){t._session.onTransportError()},onDialogError:function(){t._session.onDialogError()}},body:i})}},{key:"init_incoming",value:function(e){var t=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/,n=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;if(this._direction="incoming",this._request=e,e.reply(200),e.body){var r=e.body.split("\n");r.length>=1&&t.test(r[0])&&(this._tone=r[0].replace(t,"$2")),r.length>=2&&n.test(r[1])&&(this._duration=parseInt(r[1].replace(n,"$2"),10))}this._duration||(this._duration=Wi.DEFAULT_DURATION),this._tone?this._session.newDTMF({originator:"remote",dtmf:this,request:e}):Qi.debug("invalid INFO DTMF received, discarded")}},{key:"tone",get:function(){return this._tone}},{key:"duration",get:function(){return this._duration}}]),t}(),Ni.exports.C=Wi;var Ki=Ni.exports;function zi(e){return zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zi(e)}function Ji(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function Vi(e,t){return Vi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vi(e,t)}function Zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xi(e);if(t){var i=Xi(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===zi(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Xi(e){return Xi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xi(e)}var $i=Y.EventEmitter,eo=l,to=D,no=U(),ro=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vi(e,t)}(t,$i);var e=Zi(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._session=n,r._direction=null,r._contentType=null,r._body=null,r}return Ji(t,[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._direction="outgoing",void 0===e)throw new TypeError("Not enough arguments");if(this._session.status!==this._session.C.STATUS_CONFIRMED&&this._session.status!==this._session.C.STATUS_WAITING_FOR_ACK)throw new to.InvalidStateError(this._session.status);this._contentType=e,this._body=t;var i=no.cloneArray(r.extraHeaders);i.push("Content-Type: ".concat(e)),this._session.newInfo({originator:"local",info:this,request:this.request}),this._session.sendRequest(eo.INFO,{extraHeaders:i,eventHandlers:{onSuccessResponse:function(e){n.emit("succeeded",{originator:"remote",response:e})},onErrorResponse:function(e){n.emit("failed",{originator:"remote",response:e})},onTransportError:function(){n._session.onTransportError()},onRequestTimeout:function(){n._session.onRequestTimeout()},onDialogError:function(){n._session.onDialogError()}},body:t})}},{key:"init_incoming",value:function(e){this._direction="incoming",this.request=e,e.reply(200),this._contentType=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,this._body=e.body,this._session.newInfo({originator:"remote",info:this,request:e})}},{key:"contentType",get:function(){return this._contentType}},{key:"body",get:function(){return this._body}}]),t}();function io(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var oo=l,so=new jn("RTCSession:ReferNotifier"),ao="refer",uo="message/sipfrag;version=2.0",lo=300,co=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._session=t,this._id=n,this._expires=r||lo,this._active=!0,this.notify(100)}return io(e,[{key:"notify",value:function(e,t){var n;(so.debug("notify()"),!1!==this._active)&&(t=t||oo.REASON_PHRASE[e]||"",n=e>=200?"terminated;reason=noresource":"active;expires=".concat(this._expires),this._session.sendRequest(oo.NOTIFY,{extraHeaders:["Event: ".concat(ao,";id=").concat(this._id),"Subscription-State: ".concat(n),"Content-Type: ".concat(uo)],body:"SIP/2.0 ".concat(e," ").concat(t),eventHandlers:{onErrorResponse:function(){this._active=!1}}}))}}]),e}();function ho(e){return ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ho(e)}function fo(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function po(e,t){return po=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},po(e,t)}function go(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=mo(e);if(t){var i=mo(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ho(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function mo(e){return mo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},mo(e)}var _o=Y.EventEmitter,Ao=jn,vo=l,yo=q(),To=U(),So=new Ao("RTCSession:ReferSubscriber"),Eo=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&po(e,t)}(t,_o);var e=go(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._id=null,r._session=n,r}return fo(t,[{key:"sendRefer",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};So.debug("sendRefer()");var r=To.cloneArray(n.extraHeaders),i=To.cloneObject(n.eventHandlers);for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&this.on(o,i[o]);var s=null;n.replaces&&(s=n.replaces._request.call_id,s+=";to-tag=".concat(n.replaces._to_tag),s+=";from-tag=".concat(n.replaces._from_tag),s=encodeURIComponent(s));var a="Refer-To: <".concat(e).concat(s?"?Replaces=".concat(s):"",">");if(r.push(a),!r.some((function(e){return e.toLowerCase().startsWith("referred-by:")}))){var u="Referred-By: <".concat(this._session._ua._configuration.uri._scheme,":").concat(this._session._ua._configuration.uri._user,"@").concat(this._session._ua._configuration.uri._host,">");r.push(u)}r.push("Contact: ".concat(this._session.contact));var l=this._session.sendRequest(vo.REFER,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t._requestSucceeded(e)},onErrorResponse:function(e){t._requestFailed(e,vo.causes.REJECTED)},onTransportError:function(){t._requestFailed(null,vo.causes.CONNECTION_ERROR)},onRequestTimeout:function(){t._requestFailed(null,vo.causes.REQUEST_TIMEOUT)},onDialogError:function(){t._requestFailed(null,vo.causes.DIALOG_ERROR)}}});this._id=l.cseq}},{key:"receiveNotify",value:function(e){if(So.debug("receiveNotify()"),e.body){var t=yo.parse(e.body.trim().split("\r\n",1)[0],"Status_Line");if(-1!==t)switch(!0){case/^100$/.test(t.status_code):this.emit("trying",{request:e,status_line:t});break;case/^1[0-9]{2}$/.test(t.status_code):this.emit("progress",{request:e,status_line:t});break;case/^2[0-9]{2}$/.test(t.status_code):this.emit("accepted",{request:e,status_line:t});break;default:this.emit("failed",{request:e,status_line:t})}else So.debug('receiveNotify() | error parsing NOTIFY body: "'.concat(e.body,'"'))}}},{key:"_requestSucceeded",value:function(e){So.debug("REFER succeeded"),So.debug('emit "requestSucceeded"'),this.emit("requestSucceeded",{response:e})}},{key:"_requestFailed",value:function(e,t){So.debug("REFER failed"),So.debug('emit "requestFailed"'),this.emit("requestFailed",{response:e||null,cause:t})}},{key:"id",get:function(){return this._id}}]),t}();function Co(e){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Co(e)}function wo(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return bo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bo(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function bo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Io(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ro(e,t,n){return t&&Io(e.prototype,t),n&&Io(e,n),e}function Oo(e,t){return Oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Oo(e,t)}function Do(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ko(e);if(t){var i=ko(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Co(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function ko(e){return ko=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ko(e)}var Mo=Y.EventEmitter,qo=Qn,No=jn,Uo=l,xo=D,Po=ni,Lo=U(),Bo=kr,Fo=Cr,Ho=qi,Go=li,Yo=Ki,jo=ro,Qo=co,Wo=Eo,Ko=N(),zo=new No("RTCSession"),Jo={STATUS_NULL:0,STATUS_INVITE_SENT:1,STATUS_1XX_RECEIVED:2,STATUS_INVITE_RECEIVED:3,STATUS_WAITING_FOR_ANSWER:4,STATUS_ANSWERED:5,STATUS_WAITING_FOR_ACK:6,STATUS_CANCELED:7,STATUS_TERMINATED:8,STATUS_CONFIRMED:9},Vo=["audio","video"],Zo=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Oo(e,t)}(t,Mo);var e=Do(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),zo.debug("new"),(r=e.call(this))._id=null,r._ua=n,r._status=Jo.STATUS_NULL,r._dialog=null,r._earlyDialogs={},r._contact=null,r._from_tag=null,r._to_tag=null,r._connection=null,r._connectionPromiseQueue=Promise.resolve(),r._request=null,r._is_canceled=!1,r._cancel_reason="",r._is_confirmed=!1,r._late_sdp=!1,r._rtcOfferConstraints=null,r._rtcAnswerConstraints=null,r._localMediaStream=null,r._localMediaStreamLocallyGenerated=!1,r._rtcReady=!0,r._iceReady=!1,r._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},r._direction=null,r._local_identity=null,r._remote_identity=null,r._start_time=null,r._end_time=null,r._tones=null,r._audioMuted=!1,r._videoMuted=!1,r._localHold=!1,r._remoteHold=!1,r._sessionTimers={enabled:r._ua.configuration.session_timers,refreshMethod:r._ua.configuration.session_timers_refresh_method,defaultExpires:Uo.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},r._referSubscribers={},r._data={},r}return Ro(t,null,[{key:"C",get:function(){return Jo}}]),Ro(t,[{key:"isInProgress",value:function(){switch(this._status){case Jo.STATUS_NULL:case Jo.STATUS_INVITE_SENT:case Jo.STATUS_1XX_RECEIVED:case Jo.STATUS_INVITE_RECEIVED:case Jo.STATUS_WAITING_FOR_ANSWER:return!0;default:return!1}}},{key:"isEstablished",value:function(){switch(this._status){case Jo.STATUS_ANSWERED:case Jo.STATUS_WAITING_FOR_ACK:case Jo.STATUS_CONFIRMED:return!0;default:return!1}}},{key:"isEnded",value:function(){switch(this._status){case Jo.STATUS_CANCELED:case Jo.STATUS_TERMINATED:return!0;default:return!1}}},{key:"isMuted",value:function(){return{audio:this._audioMuted,video:this._videoMuted}}},{key:"isOnHold",value:function(){return{local:this._localHold,remote:this._remoteHold}}},{key:"connect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;zo.debug("connect()");var r=e,i=Lo.cloneObject(t.eventHandlers),o=Lo.cloneArray(t.extraHeaders),s=Lo.cloneObject(t.mediaConstraints,{audio:!0,video:!0}),a=t.mediaStream||null,u=Lo.cloneObject(t.pcConfig,{iceServers:[]}),l=t.rtcConstraints||null,c=t.rtcOfferConstraints||null;if(this._rtcOfferConstraints=c,this._rtcAnswerConstraints=t.rtcAnswerConstraints||null,this._data=t.data||this._data,void 0===e)throw new TypeError("Not enough arguments");if(this._status!==Jo.STATUS_NULL)throw new xo.InvalidStateError(this._status);if(!window.RTCPeerConnection)throw new xo.NotSupportedError("WebRTC not supported");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));for(var h in this._sessionTimers.enabled&&Lo.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=Uo.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=Uo.SESSION_EXPIRES),i)Object.prototype.hasOwnProperty.call(i,h)&&this.on(h,i[h]);this._from_tag=Lo.newTag();var f=t.anonymous||!1,d={from_tag:this._from_tag};this._contact=this._ua.contact.toString({anonymous:f,outbound:!0}),f?(d.from_display_name="Anonymous",d.from_uri=new Ko("sip","anonymous","anonymous.invalid"),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString())),o.push("Privacy: id")):t.fromUserName&&(d.from_uri=new Ko("sip",t.fromUserName,this._ua.configuration.uri.host),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),t.fromDisplayName&&(d.from_display_name=t.fromDisplayName),o.push("Contact: ".concat(this._contact)),o.push("Content-Type: application/sdp"),this._sessionTimers.enabled&&o.push("Session-Expires: ".concat(this._sessionTimers.defaultExpires).concat(this._ua.configuration.session_timers_force_refresher?";refresher=uac":"")),this._request=new Fo.InitialOutgoingInviteRequest(e,this._ua,d,o),this._id=this._request.call_id+this._from_tag,this._createRTCConnection(u,l),this._direction="outgoing",this._local_identity=this._request.from,this._remote_identity=this._request.to,n&&n(this),this._newRTCSession("local",this._request),this._sendInitialRequest(s,c,a)}},{key:"init_incoming",value:function(e,t){var n,r=this;zo.debug("init_incoming()");var i=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;e.body&&"application/sdp"!==i?e.reply(415):(this._status=Jo.STATUS_INVITE_RECEIVED,this._from_tag=e.from_tag,this._id=e.call_id+this._from_tag,this._request=e,this._contact=this._ua.contact.toString(),e.hasHeader("expires")&&(n=1e3*e.getHeader("expires")),e.to_tag=Lo.newTag(),this._createDialog(e,"UAS",!0)?(e.body?this._late_sdp=!1:this._late_sdp=!0,this._status=Jo.STATUS_WAITING_FOR_ANSWER,this._timers.userNoAnswerTimer=setTimeout((function(){e.reply(408),r._failed("local",null,Uo.causes.NO_ANSWER)}),this._ua.configuration.no_answer_timeout),n&&(this._timers.expiresTimer=setTimeout((function(){r._status===Jo.STATUS_WAITING_FOR_ANSWER&&(e.reply(487),r._failed("system",null,Uo.causes.EXPIRES))}),n)),this._direction="incoming",this._local_identity=e.to,this._remote_identity=e.from,t&&t(this),this._newRTCSession("remote",e),this._status!==Jo.STATUS_TERMINATED&&(e.reply(180,null,["Contact: ".concat(this._contact)]),this._progress("local",null))):e.reply(500,"Missing Contact header field"))}},{key:"answer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zo.debug("answer()");var n=this._request,r=Lo.cloneArray(t.extraHeaders),i=Lo.cloneObject(t.mediaConstraints),o=t.mediaStream||null,s=Lo.cloneObject(t.pcConfig,{iceServers:[]}),a=t.rtcConstraints||null,u=t.rtcAnswerConstraints||null,l=Lo.cloneObject(t.rtcOfferConstraints),c=!1,h=!1,f=!1,d=!1;if(this._rtcAnswerConstraints=u,this._rtcOfferConstraints=t.rtcOfferConstraints||null,this._data=t.data||this._data,"incoming"!==this._direction)throw new xo.NotSupportedError('"answer" not supported for outgoing RTCSession');if(this._status!==Jo.STATUS_WAITING_FOR_ANSWER)throw new xo.InvalidStateError(this._status);if(this._sessionTimers.enabled&&Lo.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=Uo.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=Uo.SESSION_EXPIRES),this._status=Jo.STATUS_ANSWERED,this._createDialog(n,"UAS")){clearTimeout(this._timers.userNoAnswerTimer),r.unshift("Contact: ".concat(this._contact));var p=n.parseSDP();Array.isArray(p.media)||(p.media=[p.media]);var g,m=wo(p.media);try{for(m.s();!(g=m.n()).done;){var _=g.value;"audio"===_.type&&(c=!0,_.direction&&"sendrecv"!==_.direction||(f=!0)),"video"===_.type&&(h=!0,_.direction&&"sendrecv"!==_.direction||(d=!0))}}catch(e){m.e(e)}finally{m.f()}if(o&&!1===i.audio){var A,v=wo(o.getAudioTracks());try{for(v.s();!(A=v.n()).done;){var y=A.value;o.removeTrack(y)}}catch(e){v.e(e)}finally{v.f()}}if(o&&!1===i.video){var T,S=wo(o.getVideoTracks());try{for(S.s();!(T=S.n()).done;){var E=T.value;o.removeTrack(E)}}catch(e){S.e(e)}finally{S.f()}}o||void 0!==i.audio||(i.audio=f),o||void 0!==i.video||(i.video=d),o||c||l.offerToReceiveAudio||(i.audio=!1),o||h||l.offerToReceiveVideo||(i.video=!1),this._createRTCConnection(s,a),Promise.resolve().then((function(){return o||(i.audio||i.video?(e._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(i).catch((function(t){if(e._status===Jo.STATUS_TERMINATED)throw new Error("terminated");throw n.reply(480),e._failed("local",null,Uo.causes.USER_DENIED_MEDIA_ACCESS),zo.warn('emit "getusermediafailed" [error:%o]',t),e.emit("getusermediafailed",t),new Error("getUserMedia() failed")}))):void 0)})).then((function(t){if(e._status===Jo.STATUS_TERMINATED)throw new Error("terminated");e._localMediaStream=t,t&&t.getTracks().forEach((function(n){e._connection.addTrack(n,t)}))})).then((function(){if(!e._late_sdp){var t={originator:"remote",type:"offer",sdp:n.body};zo.debug('emit "sdp"'),e.emit("sdp",t);var r=new RTCSessionDescription({type:"offer",sdp:t.sdp});return e._connectionPromiseQueue=e._connectionPromiseQueue.then((function(){return e._connection.setRemoteDescription(r)})).catch((function(t){throw n.reply(488),e._failed("system",null,Uo.causes.WEBRTC_ERROR),zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',t),e.emit("peerconnection:setremotedescriptionfailed",t),new Error("peerconnection.setRemoteDescription() failed")})),e._connectionPromiseQueue}})).then((function(){if(e._status===Jo.STATUS_TERMINATED)throw new Error("terminated");return e._connecting(n),e._late_sdp?e._createLocalDescription("offer",e._rtcOfferConstraints).catch((function(){throw n.reply(500),new Error("_createLocalDescription() failed")})):e._createLocalDescription("answer",u).catch((function(){throw n.reply(500),new Error("_createLocalDescription() failed")}))})).then((function(t){if(e._status===Jo.STATUS_TERMINATED)throw new Error("terminated");e._handleSessionTimersInIncomingRequest(n,r),n.reply(200,null,r,t,(function(){e._status=Jo.STATUS_WAITING_FOR_ACK,e._setInvite2xxTimer(n,t),e._setACKTimer(),e._accepted("local")}),(function(){e._failed("system",null,Uo.causes.CONNECTION_ERROR)}))})).catch((function(t){e._status!==Jo.STATUS_TERMINATED&&zo.warn(t)}))}else n.reply(500,"Error creating dialog")}},{key:"terminate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zo.debug("terminate()");var n,r=t.cause||Uo.causes.BYE,i=Lo.cloneArray(t.extraHeaders),o=t.body,s=t.status_code,a=t.reason_phrase;if(this._status===Jo.STATUS_TERMINATED)throw new xo.InvalidStateError(this._status);switch(this._status){case Jo.STATUS_NULL:case Jo.STATUS_INVITE_SENT:case Jo.STATUS_1XX_RECEIVED:if(zo.debug("canceling session"),s&&(s<200||s>=700))throw new TypeError("Invalid status_code: ".concat(s));s&&(a=a||Uo.REASON_PHRASE[s]||"",n="SIP ;cause=".concat(s,' ;text="').concat(a,'"')),this._status===Jo.STATUS_NULL||this._status===Jo.STATUS_INVITE_SENT?(this._is_canceled=!0,this._cancel_reason=n):this._status===Jo.STATUS_1XX_RECEIVED&&this._request.cancel(n),this._status=Jo.STATUS_CANCELED,this._failed("local",null,Uo.causes.CANCELED);break;case Jo.STATUS_WAITING_FOR_ANSWER:case Jo.STATUS_ANSWERED:if(zo.debug("rejecting session"),(s=s||480)<300||s>=700)throw new TypeError("Invalid status_code: ".concat(s));this._request.reply(s,a,i,o),this._failed("local",null,Uo.causes.REJECTED);break;case Jo.STATUS_WAITING_FOR_ACK:case Jo.STATUS_CONFIRMED:if(zo.debug("terminating session"),a=t.reason_phrase||Uo.REASON_PHRASE[s]||"",s&&(s<200||s>=700))throw new TypeError("Invalid status_code: ".concat(s));if(s&&i.push("Reason: SIP ;cause=".concat(s,'; text="').concat(a,'"')),this._status===Jo.STATUS_WAITING_FOR_ACK&&"incoming"===this._direction&&this._request.server_transaction.state!==Po.C.STATUS_TERMINATED){var u=this._dialog;this.receiveRequest=function(t){t.method===Uo.ACK&&(e.sendRequest(Uo.BYE,{extraHeaders:i,body:o}),u.terminate())},this._request.server_transaction.on("stateChanged",(function(){e._request.server_transaction.state===Po.C.STATUS_TERMINATED&&(e.sendRequest(Uo.BYE,{extraHeaders:i,body:o}),u.terminate())})),this._ended("local",null,r),this._dialog=u,this._ua.newDialog(u)}else this.sendRequest(Uo.BYE,{extraHeaders:i,body:o}),this._ended("local",null,r)}}},{key:"sendDTMF",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zo.debug("sendDTMF() | tones: %s",e);var n=0,r=t.duration||null,i=t.interToneGap||null,o=t.transportType||Uo.DTMF_TRANSPORT.INFO;if(void 0===e)throw new TypeError("Not enough arguments");if(this._status!==Jo.STATUS_CONFIRMED&&this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_1XX_RECEIVED)throw new xo.InvalidStateError(this._status);if(o!==Uo.DTMF_TRANSPORT.INFO&&o!==Uo.DTMF_TRANSPORT.RFC2833)throw new TypeError("invalid transportType: ".concat(o));if("number"==typeof e&&(e=e.toString()),!e||"string"!=typeof e||!e.match(/^[0-9A-DR#*,]+$/i))throw new TypeError("Invalid tones: ".concat(e));if(r&&!Lo.isDecimal(r))throw new TypeError("Invalid tone duration: ".concat(r));if(r?r<Yo.C.MIN_DURATION?(zo.debug('"duration" value is lower than the minimum allowed, setting it to '.concat(Yo.C.MIN_DURATION," milliseconds")),r=Yo.C.MIN_DURATION):r>Yo.C.MAX_DURATION?(zo.debug('"duration" value is greater than the maximum allowed, setting it to '.concat(Yo.C.MAX_DURATION," milliseconds")),r=Yo.C.MAX_DURATION):r=Math.abs(r):r=Yo.C.DEFAULT_DURATION,t.duration=r,i&&!Lo.isDecimal(i))throw new TypeError("Invalid interToneGap: ".concat(i));if(i?i<Yo.C.MIN_INTER_TONE_GAP?(zo.debug('"interToneGap" value is lower than the minimum allowed, setting it to '.concat(Yo.C.MIN_INTER_TONE_GAP," milliseconds")),i=Yo.C.MIN_INTER_TONE_GAP):i=Math.abs(i):i=Yo.C.DEFAULT_INTER_TONE_GAP,o!==Uo.DTMF_TRANSPORT.RFC2833)this._tones?this._tones+=e:(this._tones=e,function e(){var o,s=this;if(this._status===Jo.STATUS_TERMINATED||!this._tones||n>=this._tones.length)return void(this._tones=null);var a=this._tones[n];if(n+=1,","===a)o=2e3;else{var u=new Yo(this);t.eventHandlers={onFailed:function(){s._tones=null}},u.send(a,t),o=r+i}setTimeout(e.bind(this),o)}.call(this));else{var s=this._getDTMFRTPSender();s&&(e=s.toneBuffer+e,s.insertDTMF(e,r,i))}}},{key:"sendInfo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(zo.debug("sendInfo()"),this._status!==Jo.STATUS_CONFIRMED&&this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_1XX_RECEIVED)throw new xo.InvalidStateError(this._status);new jo(this).send(e,t,n)}},{key:"mute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!1};zo.debug("mute()");var t=!1,n=!1;!1===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!0,this._toggleMuteAudio(!0)),!1===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!0,this._toggleMuteVideo(!0)),!0!==t&&!0!==n||this._onmute({audio:t,video:n})}},{key:"unmute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!0};zo.debug("unmute()");var t=!1,n=!1;!0===this._audioMuted&&e.audio&&(t=!0,this._audioMuted=!1,!1===this._localHold&&this._toggleMuteAudio(!1)),!0===this._videoMuted&&e.video&&(n=!0,this._videoMuted=!1,!1===this._localHold&&this._toggleMuteVideo(!1)),!0!==t&&!0!==n||this._onunmute({audio:t,video:n})}},{key:"hold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(zo.debug("hold()"),this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_CONFIRMED)return!1;if(!0===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!0,this._onhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:Uo.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Hold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"unhold",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(zo.debug("unhold()"),this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_CONFIRMED)return!1;if(!1===this._localHold)return!1;if(!this._isReadyToReOffer())return!1;this._localHold=!1,this._onunhold("local");var r={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:Uo.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Unhold Failed"})}};return t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:r,extraHeaders:t.extraHeaders}),!0}},{key:"renegotiate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;zo.debug("renegotiate()");var r=t.rtcOfferConstraints||null;if(this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_CONFIRMED)return!1;if(!this._isReadyToReOffer())return!1;var i={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:Uo.causes.WEBRTC_ERROR,status_code:500,reason_phrase:"Media Renegotiation Failed"})}};return this._setLocalMediaStatus(),t.useUpdate?this._sendUpdate({sdpOffer:!0,eventHandlers:i,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}):this._sendReinvite({eventHandlers:i,rtcOfferConstraints:r,extraHeaders:t.extraHeaders}),!0}},{key:"refer",value:function(e,t){var n=this;zo.debug("refer()");var r=e;if(this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_CONFIRMED)return!1;if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));var i=new Wo(this);i.sendRefer(e,t);var o=i.id;return this._referSubscribers[o]=i,i.on("requestFailed",(function(){delete n._referSubscribers[o]})),i.on("accepted",(function(){delete n._referSubscribers[o]})),i.on("failed",(function(){delete n._referSubscribers[o]})),i}},{key:"sendRequest",value:function(e,t){return zo.debug("sendRequest()"),this._dialog.sendRequest(e,t)}},{key:"receiveRequest",value:function(e){var t=this;if(zo.debug("receiveRequest()"),e.method===Uo.CANCEL)this._status!==Jo.STATUS_WAITING_FOR_ANSWER&&this._status!==Jo.STATUS_ANSWERED||(this._status=Jo.STATUS_CANCELED,this._request.reply(487),this._failed("remote",e,Uo.causes.CANCELED));else switch(e.method){case Uo.ACK:if(this._status!==Jo.STATUS_WAITING_FOR_ACK)return;if(this._status=Jo.STATUS_CONFIRMED,clearTimeout(this._timers.ackTimer),clearTimeout(this._timers.invite2xxTimer),this._late_sdp){if(!e.body){this.terminate({cause:Uo.causes.MISSING_SDP,status_code:400});break}var n={originator:"remote",type:"answer",sdp:e.body};zo.debug('emit "sdp"'),this.emit("sdp",n);var r=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(r)})).then((function(){t._is_confirmed||t._confirmed("remote",e)})).catch((function(e){t.terminate({cause:Uo.causes.BAD_MEDIA_DESCRIPTION,status_code:488}),zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}))}else this._is_confirmed||this._confirmed("remote",e);break;case Uo.BYE:this._status===Jo.STATUS_CONFIRMED||this._status===Jo.STATUS_WAITING_FOR_ACK?(e.reply(200),this._ended("remote",e,Uo.causes.BYE)):this._status===Jo.STATUS_INVITE_RECEIVED||this._status===Jo.STATUS_WAITING_FOR_ANSWER?(e.reply(200),this._request.reply(487,"BYE Received"),this._ended("remote",e,Uo.causes.BYE)):e.reply(403,"Wrong Status");break;case Uo.INVITE:this._status===Jo.STATUS_CONFIRMED?e.hasHeader("replaces")?this._receiveReplaces(e):this._receiveReinvite(e):e.reply(403,"Wrong Status");break;case Uo.INFO:if(this._status===Jo.STATUS_1XX_RECEIVED||this._status===Jo.STATUS_WAITING_FOR_ANSWER||this._status===Jo.STATUS_ANSWERED||this._status===Jo.STATUS_WAITING_FOR_ACK||this._status===Jo.STATUS_CONFIRMED){var i=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0;i&&i.match(/^application\/dtmf-relay/i)?new Yo(this).init_incoming(e):void 0!==i?new jo(this).init_incoming(e):e.reply(415)}else e.reply(403,"Wrong Status");break;case Uo.UPDATE:this._status===Jo.STATUS_CONFIRMED?this._receiveUpdate(e):e.reply(403,"Wrong Status");break;case Uo.REFER:this._status===Jo.STATUS_CONFIRMED?this._receiveRefer(e):e.reply(403,"Wrong Status");break;case Uo.NOTIFY:this._status===Jo.STATUS_CONFIRMED?this._receiveNotify(e):e.reply(403,"Wrong Status");break;default:e.reply(501)}}},{key:"onTransportError",value:function(){zo.warn("onTransportError()"),this._status!==Jo.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:Uo.causes.CONNECTION_ERROR,cause:Uo.causes.CONNECTION_ERROR})}},{key:"onRequestTimeout",value:function(){zo.warn("onRequestTimeout()"),this._status!==Jo.STATUS_TERMINATED&&this.terminate({status_code:408,reason_phrase:Uo.causes.REQUEST_TIMEOUT,cause:Uo.causes.REQUEST_TIMEOUT})}},{key:"onDialogError",value:function(){zo.warn("onDialogError()"),this._status!==Jo.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:Uo.causes.DIALOG_ERROR,cause:Uo.causes.DIALOG_ERROR})}},{key:"newDTMF",value:function(e){zo.debug("newDTMF()"),this.emit("newDTMF",e)}},{key:"newInfo",value:function(e){zo.debug("newInfo()"),this.emit("newInfo",e)}},{key:"_isReadyToReOffer",value:function(){return this._rtcReady?this._dialog?!0!==this._dialog.uac_pending_reply&&!0!==this._dialog.uas_pending_reply||(zo.debug("_isReadyToReOffer() | there is another INVITE/UPDATE transaction in progress"),!1):(zo.debug("_isReadyToReOffer() | session not established yet"),!1):(zo.debug("_isReadyToReOffer() | internal WebRTC status not ready"),!1)}},{key:"_close",value:function(){if(zo.debug("close()"),this._localMediaStream&&this._localMediaStreamLocallyGenerated&&(zo.debug("close() | closing local MediaStream"),Lo.closeMediaStream(this._localMediaStream)),this._status!==Jo.STATUS_TERMINATED){if(this._status=Jo.STATUS_TERMINATED,this._connection)try{this._connection.close()}catch(e){zo.warn("close() | error closing the RTCPeerConnection: %o",e)}for(var e in this._timers)Object.prototype.hasOwnProperty.call(this._timers,e)&&clearTimeout(this._timers[e]);for(var t in clearTimeout(this._sessionTimers.timer),this._dialog&&(this._dialog.terminate(),delete this._dialog),this._earlyDialogs)Object.prototype.hasOwnProperty.call(this._earlyDialogs,t)&&(this._earlyDialogs[t].terminate(),delete this._earlyDialogs[t]);for(var n in this._referSubscribers)Object.prototype.hasOwnProperty.call(this._referSubscribers,n)&&delete this._referSubscribers[n];this._ua.destroyRTCSession(this)}}},{key:"_setInvite2xxTimer",value:function(e,t){var n=Bo.T1;this._timers.invite2xxTimer=setTimeout(function r(){this._status===Jo.STATUS_WAITING_FOR_ACK&&(e.reply(200,null,["Contact: ".concat(this._contact)],t),n<Bo.T2&&(n*=2)>Bo.T2&&(n=Bo.T2),this._timers.invite2xxTimer=setTimeout(r.bind(this),n))}.bind(this),n)}},{key:"_setACKTimer",value:function(){var e=this;this._timers.ackTimer=setTimeout((function(){e._status===Jo.STATUS_WAITING_FOR_ACK&&(zo.debug("no ACK received, terminating the session"),clearTimeout(e._timers.invite2xxTimer),e.sendRequest(Uo.BYE),e._ended("remote",null,Uo.causes.NO_ACK))}),Bo.TIMER_H)}},{key:"_createRTCConnection",value:function(e,t){var n=this;this._connection=new RTCPeerConnection(e,t),this._connection.addEventListener("iceconnectionstatechange",(function(){"failed"===n._connection.iceConnectionState&&n.terminate({cause:Uo.causes.RTP_TIMEOUT,status_code:408,reason_phrase:Uo.causes.RTP_TIMEOUT})})),zo.debug('emit "peerconnection"'),this.emit("peerconnection",{peerconnection:this._connection})}},{key:"_createLocalDescription",value:function(e,t){var n=this;if(zo.debug("createLocalDescription()"),"offer"!==e&&"answer"!==e)throw new Error('createLocalDescription() | invalid type "'.concat(e,'"'));var r=this._connection;return this._rtcReady=!1,Promise.resolve().then((function(){return"offer"===e?r.createOffer(t).catch((function(e){return zo.warn('emit "peerconnection:createofferfailed" [error:%o]',e),n.emit("peerconnection:createofferfailed",e),Promise.reject(e)})):r.createAnswer(t).catch((function(e){return zo.warn('emit "peerconnection:createanswerfailed" [error:%o]',e),n.emit("peerconnection:createanswerfailed",e),Promise.reject(e)}))})).then((function(e){return r.setLocalDescription(e).catch((function(e){return n._rtcReady=!0,zo.warn('emit "peerconnection:setlocaldescriptionfailed" [error:%o]',e),n.emit("peerconnection:setlocaldescriptionfailed",e),Promise.reject(e)}))})).then((function(){var i=t&&t.iceRestart;if("complete"===r.iceGatheringState&&!i||"gathering"===r.iceGatheringState&&n._iceReady){n._rtcReady=!0;var o={originator:"local",type:e,sdp:r.localDescription.sdp};return zo.debug('emit "sdp"'),n.emit("sdp",o),Promise.resolve(o.sdp)}return new Promise((function(t){var i,o,s=!1;n._iceReady=!1;var a=function(){if(!s){r.removeEventListener("icecandidate",i),r.removeEventListener("icegatheringstatechange",o),s=!0,n._rtcReady=!0,n._iceReady=!0;var a={originator:"local",type:e,sdp:r.localDescription.sdp};zo.debug('emit "sdp"'),n.emit("sdp",a),t(a.sdp)}};r.addEventListener("icecandidate",i=function(e){var t=e.candidate;t?n.emit("icecandidate",{candidate:t,ready:a}):a()}),r.addEventListener("icegatheringstatechange",o=function(){"complete"===r.iceGatheringState&&a()})}))}))}},{key:"_createDialog",value:function(e,t,n){var r="UAS"===t?e.to_tag:e.from_tag,i="UAS"===t?e.from_tag:e.to_tag,o=e.call_id+r+i,s=this._earlyDialogs[o];if(n)return!!s||((s=new Ho(this,e,t,Ho.C.STATUS_EARLY)).error?(zo.debug(s.error),this._failed("remote",e,Uo.causes.INTERNAL_ERROR),!1):(this._earlyDialogs[o]=s,!0));if(this._from_tag=e.from_tag,this._to_tag=e.to_tag,s)return s.update(e,t),this._dialog=s,delete this._earlyDialogs[o],!0;var a=new Ho(this,e,t);return a.error?(zo.debug(a.error),this._failed("remote",e,Uo.causes.INTERNAL_ERROR),!1):(this._dialog=a,!0)}},{key:"_receiveReinvite",value:function(e){var t=this;zo.debug("receiveReinvite()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i=!0;var n=t.status_code||403,r=t.reason_phrase||"",o=Lo.cloneArray(t.extraHeaders);if(this._status!==Jo.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,o)}.bind(this)},i=!1;if(this.emit("reinvite",r),!i){if(this._late_sdp=!1,!e.body)return this._late_sdp=!0,this._remoteHold&&(this._remoteHold=!1,this._onunhold("remote")),void(this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._createLocalDescription("offer",t._rtcOfferConstraints)})).then((function(e){o.call(t,e)})).catch((function(){e.reply(500)})));if("application/sdp"!==n)return zo.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then((function(e){t._status!==Jo.STATUS_TERMINATED&&o.call(t,e)})).catch((function(e){zo.warn(e)}))}function o(t){var n=this,i=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,i),this._late_sdp&&(t=this._mangleOffer(t)),e.reply(200,null,i,t,(function(){n._status=Jo.STATUS_WAITING_FOR_ACK,n._setInvite2xxTimer(e,t),n._setACKTimer()})),"function"==typeof r.callback&&r.callback()}}},{key:"_receiveUpdate",value:function(e){var t=this;zo.debug("receiveUpdate()");var n=e.hasHeader("Content-Type")?e.getHeader("Content-Type").toLowerCase():void 0,r={request:e,callback:void 0,reject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i=!0;var n=t.status_code||403,r=t.reason_phrase||"",o=Lo.cloneArray(t.extraHeaders);if(this._status!==Jo.STATUS_CONFIRMED)return!1;if(n<300||n>=700)throw new TypeError("Invalid status_code: ".concat(n));e.reply(n,r,o)}.bind(this)},i=!1;if(this.emit("update",r),!i)if(e.body){if("application/sdp"!==n)return zo.debug("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then((function(e){t._status!==Jo.STATUS_TERMINATED&&o.call(t,e)})).catch((function(e){zo.warn(e)}))}else o.call(this,null);function o(t){var n=["Contact: ".concat(this._contact)];this._handleSessionTimersInIncomingRequest(e,n),e.reply(200,null,n,t),"function"==typeof r.callback&&r.callback()}}},{key:"_processInDialogSdpOffer",value:function(e){var t=this;zo.debug("_processInDialogSdpOffer()");var n,r=e.parseSDP(),i=!1,o=wo(r.media);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(-1!==Vo.indexOf(s.type)){var a=s.direction||r.direction||"sendrecv";if("sendonly"!==a&&"inactive"!==a){i=!1;break}i=!0}}}catch(e){o.e(e)}finally{o.f()}var u={originator:"remote",type:"offer",sdp:e.body};zo.debug('emit "sdp"'),this.emit("sdp",u);var l=new RTCSessionDescription({type:"offer",sdp:u.sdp});return this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){if(t._status===Jo.STATUS_TERMINATED)throw new Error("terminated");return t._connection.setRemoteDescription(l).catch((function(n){throw e.reply(488),zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n),n}))})).then((function(){if(t._status===Jo.STATUS_TERMINATED)throw new Error("terminated");!0===t._remoteHold&&!1===i?(t._remoteHold=!1,t._onunhold("remote")):!1===t._remoteHold&&!0===i&&(t._remoteHold=!0,t._onhold("remote"))})).then((function(){if(t._status===Jo.STATUS_TERMINATED)throw new Error("terminated");return t._createLocalDescription("answer",t._rtcAnswerConstraints).catch((function(t){throw e.reply(500),zo.warn('emit "peerconnection:createtelocaldescriptionfailed" [error:%o]',t),t}))})).catch((function(e){zo.warn("_processInDialogSdpOffer() failed [error: %o]",e)})),this._connectionPromiseQueue}},{key:"_receiveRefer",value:function(e){var n=this;if(zo.debug("receiveRefer()"),!e.refer_to)return zo.debug("no Refer-To header field present in REFER"),void e.reply(400);if(e.refer_to.uri.scheme!==Uo.SIP)return zo.debug("Refer-To header field points to a non-SIP URI scheme"),void e.reply(416);e.reply(202);var r=new Qo(this,e.cseq);function i(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n="function"==typeof n?n:null,this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_CONFIRMED)return!1;var o=new t(this._ua);if(o.on("progress",(function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)})),o.on("accepted",(function(e){var t=e.response;r.notify(t.status_code,t.reason_phrase)})),o.on("_failed",(function(e){var t=e.message,n=e.cause;t?r.notify(t.status_code,t.reason_phrase):r.notify(487,n)})),e.refer_to.uri.hasHeader("replaces")){var s=decodeURIComponent(e.refer_to.uri.getHeader("replaces"));i.extraHeaders=Lo.cloneArray(i.extraHeaders),i.extraHeaders.push("Replaces: ".concat(s))}o.connect(e.refer_to.uri.toAor(),i,n)}function o(){r.notify(603)}zo.debug('emit "refer"'),this.emit("refer",{request:e,accept:function(e,t){i.call(n,e,t)},reject:function(){o.call(n)}})}},{key:"_receiveNotify",value:function(e){if(zo.debug("receiveNotify()"),e.event||e.reply(400),"refer"===e.event.event){var t,n;if(e.event.params&&e.event.params.id)t=e.event.params.id,n=this._referSubscribers[t];else{if(1!==Object.keys(this._referSubscribers).length)return void e.reply(400,"Missing event id parameter");n=this._referSubscribers[Object.keys(this._referSubscribers)[0]]}if(!n)return void e.reply(481,"Subscription does not exist");n.receiveNotify(e),e.reply(200)}else e.reply(489)}},{key:"_receiveReplaces",value:function(e){var n=this;function r(n){var r=this;if(this._status!==Jo.STATUS_WAITING_FOR_ACK&&this._status!==Jo.STATUS_CONFIRMED)return!1;var i=new t(this._ua);i.on("confirmed",(function(){r.terminate()})),i.init_incoming(e,n)}function i(){zo.debug("Replaced INVITE rejected by the user"),e.reply(486)}zo.debug("receiveReplaces()"),this.emit("replaces",{request:e,accept:function(e){r.call(n,e)},reject:function(){i.call(n)}})}},{key:"_sendInitialRequest",value:function(e,t,n){var r=this,i=new Go(this._ua,this._request,{onRequestTimeout:function(){r.onRequestTimeout()},onTransportError:function(){r.onTransportError()},onAuthenticated:function(e){r._request=e},onReceiveResponse:function(e){r._receiveInviteResponse(e)}});Promise.resolve().then((function(){return n||(e.audio||e.video?(r._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(e).catch((function(e){if(r._status===Jo.STATUS_TERMINATED)throw new Error("terminated");throw r._failed("local",null,Uo.causes.USER_DENIED_MEDIA_ACCESS),zo.warn('emit "getusermediafailed" [error:%o]',e),r.emit("getusermediafailed",e),e}))):void 0)})).then((function(e){if(r._status===Jo.STATUS_TERMINATED)throw new Error("terminated");return r._localMediaStream=e,e&&e.getTracks().forEach((function(t){r._connection.addTrack(t,e)})),r._connecting(r._request),r._createLocalDescription("offer",t).catch((function(e){throw r._failed("local",null,Uo.causes.WEBRTC_ERROR),e}))})).then((function(e){if(r._is_canceled||r._status===Jo.STATUS_TERMINATED)throw new Error("terminated");r._request.body=e,r._status=Jo.STATUS_INVITE_SENT,zo.debug('emit "sending" [request:%o]',r._request),r.emit("sending",{request:r._request}),i.send()})).catch((function(e){r._status!==Jo.STATUS_TERMINATED&&zo.warn(e)}))}},{key:"_getDTMFRTPSender",value:function(){var e=this._connection.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(e&&e.dtmf)return e.dtmf;zo.warn("sendDTMF() | no local audio track to send DTMF with")}},{key:"_receiveInviteResponse",value:function(e){var t=this;if(zo.debug("receiveInviteResponse()"),this._dialog&&e.status_code>=200&&e.status_code<=299){if(this._dialog.id.call_id===e.call_id&&this._dialog.id.local_tag===e.from_tag&&this._dialog.id.remote_tag===e.to_tag)return void this.sendRequest(Uo.ACK);var n=new Ho(this,e,"UAC");return void 0!==n.error?void zo.debug(n.error):(this.sendRequest(Uo.ACK),void this.sendRequest(Uo.BYE))}if(this._is_canceled)e.status_code>=100&&e.status_code<200?this._request.cancel(this._cancel_reason):e.status_code>=200&&e.status_code<299&&this._acceptAndTerminate(e);else if(this._status===Jo.STATUS_INVITE_SENT||this._status===Jo.STATUS_1XX_RECEIVED)switch(!0){case/^100$/.test(e.status_code):this._status=Jo.STATUS_1XX_RECEIVED;break;case/^1[0-9]{2}$/.test(e.status_code):if(!e.to_tag){zo.debug("1xx response received without to tag");break}if(e.hasHeader("contact")&&!this._createDialog(e,"UAC",!0))break;if(this._status=Jo.STATUS_1XX_RECEIVED,!e.body){this._progress("remote",e);break}var r={originator:"remote",type:"answer",sdp:e.body};zo.debug('emit "sdp"'),this.emit("sdp",r);var i=new RTCSessionDescription({type:"answer",sdp:r.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(i)})).then((function(){return t._progress("remote",e)})).catch((function(e){zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}));break;case/^2[0-9]{2}$/.test(e.status_code):if(this._status=Jo.STATUS_CONFIRMED,!e.body){this._acceptAndTerminate(e,400,Uo.causes.MISSING_SDP),this._failed("remote",e,Uo.causes.BAD_MEDIA_DESCRIPTION);break}if(!this._createDialog(e,"UAC"))break;var o={originator:"remote",type:"answer",sdp:e.body};zo.debug('emit "sdp"'),this.emit("sdp",o);var s=new RTCSessionDescription({type:"answer",sdp:o.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){if("stable"===t._connection.signalingState)return t._connection.createOffer(t._rtcOfferConstraints).then((function(e){return t._connection.setLocalDescription(e)})).catch((function(n){t._acceptAndTerminate(e,500,n.toString()),t._failed("local",e,Uo.causes.WEBRTC_ERROR)}))})).then((function(){t._connection.setRemoteDescription(s).then((function(){t._handleSessionTimersInIncomingResponse(e),t._accepted("remote",e),t.sendRequest(Uo.ACK),t._confirmed("local",null)})).catch((function(n){t._acceptAndTerminate(e,488,"Not Acceptable Here"),t._failed("remote",e,Uo.causes.BAD_MEDIA_DESCRIPTION),zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n)}))}));break;default:var a=Lo.sipErrorCause(e.status_code);this._failed("remote",e,a)}}},{key:"_sendReinvite",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zo.debug("sendReinvite()");var n=Lo.cloneArray(t.extraHeaders),r=Lo.cloneObject(t.eventHandlers),i=t.rtcOfferConstraints||this._rtcOfferConstraints||null,o=!1;function s(e){var t=this;if(this._status!==Jo.STATUS_TERMINATED&&(this.sendRequest(Uo.ACK),!o))if(this._handleSessionTimersInIncomingResponse(e),e.body)if(e.hasHeader("Content-Type")&&"application/sdp"===e.getHeader("Content-Type").toLowerCase()){var n={originator:"remote",type:"answer",sdp:e.body};zo.debug('emit "sdp"'),this.emit("sdp",n);var i=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(i)})).then((function(){r.succeeded&&r.succeeded(e)})).catch((function(e){a.call(t),zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}))}else a.call(this);else a.call(this)}function a(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),n.push("Content-Type: application/sdp"),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return e._createLocalDescription("offer",i)})).then((function(t){var r={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};zo.debug('emit "sdp"'),e.emit("sdp",r),e.sendRequest(Uo.INVITE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){s.call(e,t),o=!0},onErrorResponse:function(t){a.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})})).catch((function(){a()}))}},{key:"_sendUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zo.debug("sendUpdate()");var n=Lo.cloneArray(t.extraHeaders),r=Lo.cloneObject(t.eventHandlers),i=t.rtcOfferConstraints||this._rtcOfferConstraints||null,o=t.sdpOffer||!1,s=!1;function a(e){var t=this;if(this._status!==Jo.STATUS_TERMINATED&&!s)if(this._handleSessionTimersInIncomingResponse(e),o){if(!e.body)return void u.call(this);if(!e.hasHeader("Content-Type")||"application/sdp"!==e.getHeader("Content-Type").toLowerCase())return void u.call(this);var n={originator:"remote",type:"answer",sdp:e.body};zo.debug('emit "sdp"'),this.emit("sdp",n);var i=new RTCSessionDescription({type:"answer",sdp:n.sdp});this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return t._connection.setRemoteDescription(i)})).then((function(){r.succeeded&&r.succeeded(e)})).catch((function(e){u.call(t),zo.warn('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)}))}else r.succeeded&&r.succeeded(e)}function u(e){r.failed&&r.failed(e)}n.push("Contact: ".concat(this._contact)),this._sessionTimers.running&&n.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(this._sessionTimers.refresher?"uac":"uas")),o?(n.push("Content-Type: application/sdp"),this._connectionPromiseQueue=this._connectionPromiseQueue.then((function(){return e._createLocalDescription("offer",i)})).then((function(t){var r={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};zo.debug('emit "sdp"'),e.emit("sdp",r),e.sendRequest(Uo.UPDATE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){a.call(e,t),s=!0},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})})).catch((function(){u.call(e)}))):this.sendRequest(Uo.UPDATE,{extraHeaders:n,eventHandlers:{onSuccessResponse:function(t){a.call(e,t)},onErrorResponse:function(t){u.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}},{key:"_acceptAndTerminate",value:function(e,t,n){zo.debug("acceptAndTerminate()");var r=[];t&&(n=n||Uo.REASON_PHRASE[t]||"",r.push("Reason: SIP ;cause=".concat(t,'; text="').concat(n,'"'))),(this._dialog||this._createDialog(e,"UAC"))&&(this.sendRequest(Uo.ACK),this.sendRequest(Uo.BYE,{extraHeaders:r})),this._status=Jo.STATUS_TERMINATED}},{key:"_mangleOffer",value:function(e){if(!this._localHold&&!this._remoteHold)return e;if(e=qo.parse(e),this._localHold&&!this._remoteHold){zo.debug("mangleOffer() | me on hold, mangling offer");var t,n=wo(e.media);try{for(n.s();!(t=n.n()).done;){var r=t.value;-1!==Vo.indexOf(r.type)&&(r.direction?"sendrecv"===r.direction?r.direction="sendonly":"recvonly"===r.direction&&(r.direction="inactive"):r.direction="sendonly")}}catch(e){n.e(e)}finally{n.f()}}else if(this._localHold&&this._remoteHold){zo.debug("mangleOffer() | both on hold, mangling offer");var i,o=wo(e.media);try{for(o.s();!(i=o.n()).done;){var s=i.value;-1!==Vo.indexOf(s.type)&&(s.direction="inactive")}}catch(e){o.e(e)}finally{o.f()}}else if(this._remoteHold){zo.debug("mangleOffer() | remote on hold, mangling offer");var a,u=wo(e.media);try{for(u.s();!(a=u.n()).done;){var l=a.value;-1!==Vo.indexOf(l.type)&&(l.direction?"sendrecv"===l.direction?l.direction="recvonly":"recvonly"===l.direction&&(l.direction="inactive"):l.direction="recvonly")}}catch(e){u.e(e)}finally{u.f()}}return qo.write(e)}},{key:"_setLocalMediaStatus",value:function(){var e=!0,t=!0;(this._localHold||this._remoteHold)&&(e=!1,t=!1),this._audioMuted&&(e=!1),this._videoMuted&&(t=!1),this._toggleMuteAudio(!e),this._toggleMuteVideo(!t)}},{key:"_handleSessionTimersInIncomingRequest",value:function(e,t){var n;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=Uo.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,n=e.session_expires_refresher||"uas"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,n="uas"),t.push("Session-Expires: ".concat(this._sessionTimers.currentExpires,";refresher=").concat(n)),this._sessionTimers.refresher="uas"===n,this._runSessionTimer())}},{key:"_handleSessionTimersInIncomingResponse",value:function(e){var t;this._sessionTimers.enabled&&(e.session_expires&&e.session_expires>=Uo.MIN_SESSION_EXPIRES?(this._sessionTimers.currentExpires=e.session_expires,t=e.session_expires_refresher||"uac"):(this._sessionTimers.currentExpires=this._sessionTimers.defaultExpires,t="uac"),this._sessionTimers.refresher="uac"===t,this._runSessionTimer())}},{key:"_runSessionTimer",value:function(){var e=this,t=this._sessionTimers.currentExpires;this._sessionTimers.running=!0,clearTimeout(this._sessionTimers.timer),this._sessionTimers.refresher?this._sessionTimers.timer=setTimeout((function(){e._status!==Jo.STATUS_TERMINATED&&e._isReadyToReOffer()&&(zo.debug("runSessionTimer() | sending session refresh request"),e._sessionTimers.refreshMethod===Uo.UPDATE?e._sendUpdate():e._sendReinvite())}),500*t):this._sessionTimers.timer=setTimeout((function(){e._status!==Jo.STATUS_TERMINATED&&(zo.warn("runSessionTimer() | timer expired, terminating the session"),e.terminate({cause:Uo.causes.REQUEST_TIMEOUT,status_code:408,reason_phrase:"Session Timer Expired"}))}),1100*t)}},{key:"_toggleMuteAudio",value:function(e){var t,n=this._connection.getSenders().filter((function(e){return e.track&&"audio"===e.track.kind})),r=wo(n);try{for(r.s();!(t=r.n()).done;){t.value.track.enabled=!e}}catch(e){r.e(e)}finally{r.f()}}},{key:"_toggleMuteVideo",value:function(e){var t,n=this._connection.getSenders().filter((function(e){return e.track&&"video"===e.track.kind})),r=wo(n);try{for(r.s();!(t=r.n()).done;){t.value.track.enabled=!e}}catch(e){r.e(e)}finally{r.f()}}},{key:"_newRTCSession",value:function(e,t){zo.debug("newRTCSession()"),this._ua.newRTCSession(this,{originator:e,session:this,request:t})}},{key:"_connecting",value:function(e){zo.debug("session connecting"),zo.debug('emit "connecting"'),this.emit("connecting",{request:e})}},{key:"_progress",value:function(e,t){zo.debug("session progress"),zo.debug('emit "progress"'),this.emit("progress",{originator:e,response:t||null})}},{key:"_accepted",value:function(e,t){zo.debug("session accepted"),this._start_time=new Date,zo.debug('emit "accepted"'),this.emit("accepted",{originator:e,response:t||null})}},{key:"_confirmed",value:function(e,t){zo.debug("session confirmed"),this._is_confirmed=!0,zo.debug('emit "confirmed"'),this.emit("confirmed",{originator:e,ack:t||null})}},{key:"_ended",value:function(e,t,n){zo.debug("session ended"),this._end_time=new Date,this._close(),zo.debug('emit "ended"'),this.emit("ended",{originator:e,message:t||null,cause:n})}},{key:"_failed",value:function(e,t,n){zo.debug("session failed"),zo.debug('emit "_failed"'),this.emit("_failed",{originator:e,message:t||null,cause:n}),this._close(),zo.debug('emit "failed"'),this.emit("failed",{originator:e,message:t||null,cause:n})}},{key:"_onhold",value:function(e){zo.debug("session onhold"),this._setLocalMediaStatus(),zo.debug('emit "hold"'),this.emit("hold",{originator:e})}},{key:"_onunhold",value:function(e){zo.debug("session onunhold"),this._setLocalMediaStatus(),zo.debug('emit "unhold"'),this.emit("unhold",{originator:e})}},{key:"_onmute",value:function(e){var t=e.audio,n=e.video;zo.debug("session onmute"),this._setLocalMediaStatus(),zo.debug('emit "muted"'),this.emit("muted",{audio:t,video:n})}},{key:"_onunmute",value:function(e){var t=e.audio,n=e.video;zo.debug("session onunmute"),this._setLocalMediaStatus(),zo.debug('emit "unmuted"'),this.emit("unmuted",{audio:t,video:n})}},{key:"C",get:function(){return Jo}},{key:"causes",get:function(){return Uo.causes}},{key:"id",get:function(){return this._id}},{key:"connection",get:function(){return this._connection}},{key:"contact",get:function(){return this._contact}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}},{key:"start_time",get:function(){return this._start_time}},{key:"end_time",get:function(){return this._end_time}},{key:"data",get:function(){return this._data},set:function(e){this._data=e}},{key:"status",get:function(){return this._status}}]),t}();function Xo(e){return Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xo(e)}function $o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function es(e,t){return es=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},es(e,t)}function ts(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ns(e);if(t){var i=ns(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Xo(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function ns(e){return ns=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ns(e)}var rs=Y.EventEmitter,is=jn,os=l,ss=Cr,as=U(),us=li,ls=D,cs=N(),hs=new is("Message"),fs=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&es(e,t)}(t,rs);var e=ts(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._ua=n,r._request=null,r._closed=!1,r._direction=null,r._local_identity=null,r._remote_identity=null,r._is_replied=!1,r._data={},r}return $o(t,[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e;if(void 0===e||void 0===t)throw new TypeError("Not enough arguments");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(i));var o=as.cloneArray(r.extraHeaders),s=as.cloneObject(r.eventHandlers),a=r.contentType||"text/plain",u={};for(var l in r.fromUserName&&(u.from_uri=new cs("sip",r.fromUserName,this._ua.configuration.uri.host),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString()))),r.fromDisplayName&&(u.from_display_name=r.fromDisplayName),s)Object.prototype.hasOwnProperty.call(s,l)&&this.on(l,s[l]);o.push("Content-Type: ".concat(a)),this._request=new ss.OutgoingRequest(os.MESSAGE,e,this._ua,u,o),t&&(this._request.body=t);var c=new us(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newMessage("local",this._request),c.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newMessage("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=as.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new ls.NotSupportedError('"accept" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=as.cloneArray(e.extraHeaders),i=e.body;if("incoming"!==this._direction)throw new ls.NotSupportedError('"reject" not supported for outgoing Message');if(this._is_replied)throw new Error("incoming Message already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,i)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=as.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,os.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,os.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newMessage",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newMessage(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){hs.debug("MESSAGE failed"),this._close(),hs.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){hs.debug("MESSAGE succeeded"),this._close(),hs.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}]),t}();function ds(e){return ds="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ds(e)}function ps(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function gs(e,t){return gs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gs(e,t)}function ms(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_s(e);if(t){var i=_s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ds(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function _s(e){return _s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_s(e)}var As=Y.EventEmitter,vs=jn,ys=l,Ts=Cr,Ss=U(),Es=li,Cs=D,ws=new vs("Options"),bs=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gs(e,t)}(t,As);var e=ms(t);function t(n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=e.call(this))._ua=n,r._request=null,r._closed=!1,r._direction=null,r._local_identity=null,r._remote_identity=null,r._is_replied=!1,r._data={},r}return ps(t,[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e;if(void 0===e)throw new TypeError("A target is required for OPTIONS");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(i));var o=Ss.cloneArray(r.extraHeaders),s=Ss.cloneObject(r.eventHandlers),a=r.contentType||"application/sdp";for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&this.on(u,s[u]);o.push("Content-Type: ".concat(a)),this._request=new Ts.OutgoingRequest(ys.OPTIONS,e,this._ua,null,o),t&&(this._request.body=t);var l=new Es(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newOptions("local",this._request),l.send()}},{key:"init_incoming",value:function(e){this._request=e,this._newOptions("remote",e),this._is_replied||(this._is_replied=!0,e.reply(200)),this._close()}},{key:"accept",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ss.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new Cs.NotSupportedError('"accept" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");this._is_replied=!0,this._request.reply(200,null,t,n)}},{key:"reject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.status_code||480,n=e.reason_phrase,r=Ss.cloneArray(e.extraHeaders),i=e.body;if("incoming"!==this._direction)throw new Cs.NotSupportedError('"reject" not supported for outgoing Options');if(this._is_replied)throw new Error("incoming Options already replied");if(t<300||t>=700)throw new TypeError("Invalid status_code: ".concat(t));this._is_replied=!0,this._request.reply(t,n,r,i)}},{key:"_receiveResponse",value:function(e){if(!this._closed)switch(!0){case/^1[0-9]{2}$/.test(e.status_code):break;case/^2[0-9]{2}$/.test(e.status_code):this._succeeded("remote",e);break;default:var t=Ss.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,ys.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,ys.causes.CONNECTION_ERROR)}},{key:"_close",value:function(){this._closed=!0,this._ua.destroyMessage(this)}},{key:"_newOptions",value:function(e,t){"remote"===e?(this._direction="incoming",this._local_identity=t.to,this._remote_identity=t.from):"local"===e&&(this._direction="outgoing",this._local_identity=t.from,this._remote_identity=t.to),this._ua.newOptions(this,{originator:e,message:this,request:t})}},{key:"_failed",value:function(e,t,n){ws.debug("OPTIONS failed"),this._close(),ws.debug('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){ws.debug("OPTIONS succeeded"),this._close(),ws.debug('emit "succeeded"'),this.emit("succeeded",{originator:e,response:t})}},{key:"direction",get:function(){return this._direction}},{key:"local_identity",get:function(){return this._local_identity}},{key:"remote_identity",get:function(){return this._remote_identity}}]),t}(),Is={},Rs=jn,Os=U(),Ds=q(),ks=new Rs("Socket");function Ms(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}Is.isSocket=function(e){if(Array.isArray(e))return!1;if(void 0===e)return ks.warn("undefined JsSIP.Socket instance"),!1;try{if(!Os.isString(e.url))throw ks.warn("missing or invalid JsSIP.Socket url property"),new Error("Missing or invalid JsSIP.Socket url property");if(!Os.isString(e.via_transport))throw ks.warn("missing or invalid JsSIP.Socket via_transport property"),new Error("Missing or invalid JsSIP.Socket via_transport property");if(-1===Ds.parse(e.sip_uri,"SIP_URI"))throw ks.warn("missing or invalid JsSIP.Socket sip_uri property"),new Error("missing or invalid JsSIP.Socket sip_uri property")}catch(e){return!1}try{["connect","disconnect","send"].forEach((function(t){if(!Os.isFunction(e[t]))throw ks.warn("missing or invalid JsSIP.Socket method: ".concat(t)),new Error("Missing or invalid JsSIP.Socket method: ".concat(t))}))}catch(e){return!1}return!0};var qs=Is,Ns=l,Us=new jn("Transport"),xs={STATUS_CONNECTED:0,STATUS_CONNECTING:1,STATUS_DISCONNECTED:2,SOCKET_STATUS_READY:0,SOCKET_STATUS_ERROR:1,recovery_options:{min_interval:Ns.CONNECTION_RECOVERY_MIN_INTERVAL,max_interval:Ns.CONNECTION_RECOVERY_MAX_INTERVAL}},Ps=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xs.recovery_options;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Us.debug("new()"),this.status=xs.STATUS_DISCONNECTED,this.socket=null,this.sockets=[],this.recovery_options=n,this.recover_attempts=0,this.recovery_timer=null,this.close_requested=!1;try{this.textDecoder=new TextDecoder("utf8")}catch(e){Us.warn("cannot use TextDecoder: ".concat(e))}if(void 0===t)throw new TypeError("Invalid argument. undefined 'sockets' argument");t instanceof Array||(t=[t]),t.forEach((function(e){if(!qs.isSocket(e.socket))throw new TypeError("Invalid argument. invalid 'JsSIP.Socket' instance");if(e.weight&&!Number(e.weight))throw new TypeError("Invalid argument. 'weight' attribute is not a number");this.sockets.push({socket:e.socket,weight:e.weight||0,status:xs.SOCKET_STATUS_READY})}),this),this._getSocket()}return Ms(e,[{key:"connect",value:function(){Us.debug("connect()"),this.isConnected()?Us.debug("Transport is already connected"):this.isConnecting()?Us.debug("Transport is connecting"):(this.close_requested=!1,this.status=xs.STATUS_CONNECTING,this.onconnecting({socket:this.socket,attempts:this.recover_attempts}),this.close_requested||(this.socket.onconnect=this._onConnect.bind(this),this.socket.ondisconnect=this._onDisconnect.bind(this),this.socket.ondata=this._onData.bind(this),this.socket.connect()))}},{key:"disconnect",value:function(){Us.debug("close()"),this.close_requested=!0,this.recover_attempts=0,this.status=xs.STATUS_DISCONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.socket.onconnect=function(){},this.socket.ondisconnect=function(){},this.socket.ondata=function(){},this.socket.disconnect(),this.ondisconnect({socket:this.socket,error:!1})}},{key:"send",value:function(e){if(Us.debug("send()"),!this.isConnected())return Us.warn("unable to send message, transport is not connected"),!1;var t=e.toString();return Us.debug("sending message:\n\n".concat(t,"\n")),this.socket.send(t)}},{key:"isConnected",value:function(){return this.status===xs.STATUS_CONNECTED}},{key:"isConnecting",value:function(){return this.status===xs.STATUS_CONNECTING}},{key:"_reconnect",value:function(){var e=this;this.recover_attempts+=1;var t=Math.floor(Math.random()*Math.pow(2,this.recover_attempts)+1);t<this.recovery_options.min_interval?t=this.recovery_options.min_interval:t>this.recovery_options.max_interval&&(t=this.recovery_options.max_interval),Us.debug("reconnection attempt: ".concat(this.recover_attempts,". next connection attempt in ").concat(t," seconds")),this.recovery_timer=setTimeout((function(){e.close_requested||e.isConnected()||e.isConnecting()||(e._getSocket(),e.connect())}),1e3*t)}},{key:"_getSocket",value:function(){var e=[];if(this.sockets.forEach((function(t){t.status!==xs.SOCKET_STATUS_ERROR&&(0===e.length?e.push(t):t.weight>e[0].weight?e=[t]:t.weight===e[0].weight&&e.push(t))})),0===e.length)return this.sockets.forEach((function(e){e.status=xs.SOCKET_STATUS_READY})),void this._getSocket();var t=Math.floor(Math.random()*e.length);this.socket=e[t].socket}},{key:"_onConnect",value:function(){this.recover_attempts=0,this.status=xs.STATUS_CONNECTED,null!==this.recovery_timer&&(clearTimeout(this.recovery_timer),this.recovery_timer=null),this.onconnect({socket:this})}},{key:"_onDisconnect",value:function(e,t,n){this.status=xs.STATUS_DISCONNECTED,this.ondisconnect({socket:this.socket,error:e,code:t,reason:n}),this.close_requested||(this.sockets.forEach((function(e){this.socket===e.socket&&(e.status=xs.SOCKET_STATUS_ERROR)}),this),this._reconnect(e))}},{key:"_onData",value:function(e){if("\r\n\r\n"!==e)if("\r\n"!==e){if("string"!=typeof e){try{e=this.textDecoder?this.textDecoder.decode(e):String.fromCharCode.apply(null,new Uint8Array(e))}catch(e){return void Us.debug("received binary message failed to be converted into string, message discarded")}Us.debug("received binary message:\n\n".concat(e,"\n"))}else Us.debug("received text message:\n\n".concat(e,"\n"));this.ondata({transport:this,message:e})}else Us.debug("received message with CRLF Keep Alive response");else{Us.debug("received message with double-CRLF Keep Alive request");try{this.socket.send("\r\n")}catch(e){Us.warn("error sending Keep Alive response: ".concat(e))}}}},{key:"via_transport",get:function(){return this.socket.via_transport}},{key:"url",get:function(){return this.socket.url}},{key:"sip_uri",get:function(){return this.socket.sip_uri}}]),e}(),Ls={};function Bs(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Fs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fs(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hs=jn,Gs=q(),Ys=Cr,js=new Hs("Parser");function Qs(e,t){var n=t,r=0,i=0;if(e.substring(n,n+2).match(/(^\r\n)/))return-2;for(;0===r;){if(-1===(i=e.indexOf("\r\n",n)))return i;!e.substring(i+2,i+4).match(/(^\r\n)/)&&e.charAt(i+2).match(/(^\s+)/)?n=i+2:r=i}return r}function Ws(e,t,n,r){var i,o=t.indexOf(":",n),s=t.substring(n,o).trim(),a=t.substring(o+1,r).trim();switch(s.toLowerCase()){case"via":case"v":e.addHeader("via",a),1===e.getHeaders("via").length?(i=e.parseHeader("Via"))&&(e.via=i,e.via_branch=i.branch):i=0;break;case"from":case"f":e.setHeader("from",a),(i=e.parseHeader("from"))&&(e.from=i,e.from_tag=i.getParam("tag"));break;case"to":case"t":e.setHeader("to",a),(i=e.parseHeader("to"))&&(e.to=i,e.to_tag=i.getParam("tag"));break;case"record-route":if(-1===(i=Gs.parse(a,"Record_Route")))i=void 0;else{var u,l=Bs(i);try{for(l.s();!(u=l.n()).done;){var c=u.value;e.addHeader("record-route",a.substring(c.possition,c.offset)),e.headers["Record-Route"][e.getHeaders("record-route").length-1].parsed=c.parsed}}catch(e){l.e(e)}finally{l.f()}}break;case"call-id":case"i":e.setHeader("call-id",a),(i=e.parseHeader("call-id"))&&(e.call_id=a);break;case"contact":case"m":if(-1===(i=Gs.parse(a,"Contact")))i=void 0;else{var h,f=Bs(i);try{for(f.s();!(h=f.n()).done;){var d=h.value;e.addHeader("contact",a.substring(d.possition,d.offset)),e.headers.Contact[e.getHeaders("contact").length-1].parsed=d.parsed}}catch(e){f.e(e)}finally{f.f()}}break;case"content-length":case"l":e.setHeader("content-length",a),i=e.parseHeader("content-length");break;case"content-type":case"c":e.setHeader("content-type",a),i=e.parseHeader("content-type");break;case"cseq":e.setHeader("cseq",a),(i=e.parseHeader("cseq"))&&(e.cseq=i.value),e instanceof Ys.IncomingResponse&&(e.method=i.method);break;case"max-forwards":e.setHeader("max-forwards",a),i=e.parseHeader("max-forwards");break;case"www-authenticate":e.setHeader("www-authenticate",a),i=e.parseHeader("www-authenticate");break;case"proxy-authenticate":e.setHeader("proxy-authenticate",a),i=e.parseHeader("proxy-authenticate");break;case"session-expires":case"x":e.setHeader("session-expires",a),(i=e.parseHeader("session-expires"))&&(e.session_expires=i.expires,e.session_expires_refresher=i.refresher);break;case"refer-to":case"r":e.setHeader("refer-to",a),(i=e.parseHeader("refer-to"))&&(e.refer_to=i);break;case"replaces":e.setHeader("replaces",a),(i=e.parseHeader("replaces"))&&(e.replaces=i);break;case"event":case"o":e.setHeader("event",a),(i=e.parseHeader("event"))&&(e.event=i);break;default:e.addHeader(s,a),i=0}return void 0!==i||{error:'error parsing header "'.concat(s,'"')}}function Ks(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return zs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zs(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function zs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ls.parseMessage=function(e,t){var n,r,i=e.indexOf("\r\n");if(-1!==i){var o=e.substring(0,i),s=Gs.parse(o,"Request_Response");if(-1!==s){s.status_code?((n=new Ys.IncomingResponse).status_code=s.status_code,n.reason_phrase=s.reason_phrase):((n=new Ys.IncomingRequest(t)).method=s.method,n.ruri=s.uri),n.data=e;for(var a=i+2;;){if(-2===(i=Qs(e,a))){r=a+2;break}if(-1===i)return void js.warn("parseMessage() | malformed message");if(!0!==(s=Ws(n,e,a,i)))return void js.warn("parseMessage() |",s.error);a=i+2}if(n.hasHeader("content-length")){var u=n.getHeader("content-length");n.body=e.substr(r,u)}else n.body=e.substring(r);return n}js.warn('parseMessage() | error parsing first line of SIP message: "'.concat(o,'"'))}else js.warn("parseMessage() | no CRLF found, not a SIP message")};var Js,Vs,Zs,Xs=jn,$s=l,ea=Cr,ta=U(),na=new Xs("sanityCheck"),ra=[function(){for(var e=0,t=["from","to","call_id","cseq","via"];e<t.length;e++){var n=t[e];if(!Js.hasHeader(n))return na.debug("missing mandatory header field : ".concat(n,", dropping the response")),!1}}],ia=[function(){if("sip"!==Js.s("to").uri.scheme)return sa(416),!1},function(){if(!Js.to_tag&&Js.call_id.substr(0,5)===Vs.configuration.jssip_id)return sa(482),!1},function(){var e=ta.str_utf8_length(Js.body),t=Js.getHeader("content-length");if(e<t)return sa(400),!1},function(){var e,t=Js.from_tag,n=Js.call_id,r=Js.cseq;if(Js.to_tag)return;if(Js.method===$s.INVITE){if(Vs._transactions.ist[Js.via_branch])return!1;for(var i in Vs._transactions.ist)if(Object.prototype.hasOwnProperty.call(Vs._transactions.ist,i)&&(e=Vs._transactions.ist[i]).request.from_tag===t&&e.request.call_id===n&&e.request.cseq===r)return sa(482),!1}else{if(Vs._transactions.nist[Js.via_branch])return!1;for(var o in Vs._transactions.nist)if(Object.prototype.hasOwnProperty.call(Vs._transactions.nist,o)&&(e=Vs._transactions.nist[o]).request.from_tag===t&&e.request.call_id===n&&e.request.cseq===r)return sa(482),!1}}],oa=[function(){if(Js.getHeaders("via").length>1)return na.debug("more than one Via header field present in the response, dropping the response"),!1},function(){var e=ta.str_utf8_length(Js.body),t=Js.getHeader("content-length");if(e<t)return na.debug("message body length is lower than the value in Content-Length header field, dropping the response"),!1}];function sa(e){var t,n,r=Js.getHeaders("via"),i="SIP/2.0 ".concat(e," ").concat($s.REASON_PHRASE[e],"\r\n"),o=Ks(r);try{for(o.s();!(n=o.n()).done;){var s=n.value;i+="Via: ".concat(s,"\r\n")}}catch(e){o.e(e)}finally{o.f()}t=Js.getHeader("To"),Js.to_tag||(t+=";tag=".concat(ta.newTag())),i+="To: ".concat(t,"\r\n"),i+="From: ".concat(Js.getHeader("From"),"\r\n"),i+="Call-ID: ".concat(Js.call_id,"\r\n"),i+="CSeq: ".concat(Js.cseq," ").concat(Js.method,"\r\n"),i+="\r\n",Zs.send(i)}var aa={};function ua(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return la(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return la(e,t)}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function la(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ca=U(),ha=l,fa=q(),da=N(),pa=Is,ga=D;aa.settings={authorization_user:null,password:null,realm:null,ha1:null,authorization_jwt:null,display_name:null,uri:null,contact_uri:null,instance_id:null,use_preloaded_route:!1,session_timers:!0,session_timers_refresh_method:ha.UPDATE,session_timers_force_refresher:!1,no_answer_timeout:60,register:!0,register_expires:600,registrar_server:null,sockets:null,connection_recovery_max_interval:ha.CONNECTION_RECOVERY_MAX_INTERVAL,connection_recovery_min_interval:ha.CONNECTION_RECOVERY_MIN_INTERVAL,extra_headers:null,via_host:"".concat(ca.createRandomToken(12),".invalid")};var ma={mandatory:{sockets:function(e){var t=[];if(pa.isSocket(e))t.push({socket:e});else{if(!Array.isArray(e)||!e.length)return;var n,r=ua(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;Object.prototype.hasOwnProperty.call(i,"socket")&&pa.isSocket(i.socket)?t.push(i):pa.isSocket(i)&&t.push({socket:i})}}catch(e){r.e(e)}finally{r.f()}}return t},uri:function(e){/^sip:/i.test(e)||(e="".concat(ha.SIP,":").concat(e));var t=da.parse(e);return t&&t.user?t:void 0}},optional:{authorization_user:function(e){return-1===fa.parse('"'.concat(e,'"'),"quoted_string")?void 0:e},authorization_jwt:function(e){if("string"==typeof e)return e},user_agent:function(e){if("string"==typeof e)return e},connection_recovery_max_interval:function(e){if(ca.isDecimal(e)){var t=Number(e);if(t>0)return t}},connection_recovery_min_interval:function(e){if(ca.isDecimal(e)){var t=Number(e);if(t>0)return t}},contact_uri:function(e){if("string"==typeof e){var t=fa.parse(e,"SIP_URI");if(-1!==t)return t}},display_name:function(e){return e},instance_id:function(e){return/^uuid:/i.test(e)&&(e=e.substr(5)),-1===fa.parse(e,"uuid")?void 0:e},no_answer_timeout:function(e){if(ca.isDecimal(e)){var t=Number(e);if(t>0)return t}},session_timers:function(e){if("boolean"==typeof e)return e},session_timers_refresh_method:function(e){if("string"==typeof e&&((e=e.toUpperCase())===ha.INVITE||e===ha.UPDATE))return e},session_timers_force_refresher:function(e){if("boolean"==typeof e)return e},password:function(e){return String(e)},realm:function(e){return String(e)},ha1:function(e){return String(e)},register:function(e){if("boolean"==typeof e)return e},register_expires:function(e){if(ca.isDecimal(e)){var t=Number(e);if(t>0)return t}},registrar_server:function(e){/^sip:/i.test(e)||(e="".concat(ha.SIP,":").concat(e));var t=da.parse(e);return t?t.user?void 0:t:void 0},use_preloaded_route:function(e){if("boolean"==typeof e)return e},extra_headers:function(e){var t=[];if(Array.isArray(e)&&e.length){var n,r=ua(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;"string"==typeof i&&t.push(i)}}catch(e){r.e(e)}finally{r.f()}return t}}}};function _a(e){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_a(e)}function Aa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function va(e,t,n){return t&&Aa(e.prototype,t),n&&Aa(e,n),e}function ya(e,t){return ya=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ya(e,t)}function Ta(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ea(e);if(t){var i=Ea(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===_a(t)||"function"==typeof t))return t;return Sa(e)}(this,n)}}function Sa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ea(e){return Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ea(e)}aa.load=function(e,t){for(var n in ma.mandatory){if(!t.hasOwnProperty(n))throw new ga.ConfigurationError(n);var r=t[n],i=ma.mandatory[n](r);if(void 0===i)throw new ga.ConfigurationError(n,r);e[n]=i}for(var o in ma.optional)if(t.hasOwnProperty(o)){var s=t[o];if(ca.isEmpty(s))continue;var a=ma.optional[o](s);if(void 0===a)throw new ga.ConfigurationError(o,s);e[o]=a}};var Ca=Y.EventEmitter,wa=jn,ba=l,Ia=_i,Ra=Zo,Oa=fs,Da=bs,ka=ni,Ma=Ps,qa=U(),Na=D,Ua=N(),xa=Ls,Pa=Cr,La=function(e,t,n){Js=e,Vs=t,Zs=n;var r,i=Ks(ra);try{for(i.s();!(r=i.n()).done;){if(!1===(0,r.value)())return!1}}catch(e){i.e(e)}finally{i.f()}if(Js instanceof ea.IncomingRequest){var o,s=Ks(ia);try{for(s.s();!(o=s.n()).done;){if(!1===(0,o.value)())return!1}}catch(e){s.e(e)}finally{s.f()}}else if(Js instanceof ea.IncomingResponse){var a,u=Ks(oa);try{for(u.s();!(a=u.n()).done;){if(!1===(0,a.value)())return!1}}catch(e){u.e(e)}finally{u.f()}}return!0},Ba=aa,Fa=new wa("UA"),Ha={STATUS_INIT:0,STATUS_READY:1,STATUS_USER_CLOSED:2,STATUS_NOT_READY:3,CONFIGURATION_ERROR:1,NETWORK_ERROR:2},Ga=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ya(e,t)}(t,Ca);var e=Ta(t);function t(n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Fa.debug("new() [configuration:%o]",n),(r=e.call(this))._cache={credentials:{}},r._configuration=Object.assign({},Ba.settings),r._dynConfiguration={},r._dialogs={},r._applicants={},r._sessions={},r._transport=null,r._contact=null,r._status=Ha.STATUS_INIT,r._error=null,r._transactions={nist:{},nict:{},ist:{},ict:{}},r._data={},r._closeTimer=null,void 0===n)throw new TypeError("Not enough arguments");try{r._loadConfig(n)}catch(e){throw r._status=Ha.STATUS_NOT_READY,r._error=Ha.CONFIGURATION_ERROR,e}return r._registrator=new Ia(Sa(r)),r}return va(t,null,[{key:"C",get:function(){return Ha}}]),va(t,[{key:"start",value:function(){Fa.debug("start()"),this._status===Ha.STATUS_INIT?this._transport.connect():this._status===Ha.STATUS_USER_CLOSED?(Fa.debug("restarting UA"),null!==this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null,this._transport.disconnect()),this._status=Ha.STATUS_INIT,this._transport.connect()):this._status===Ha.STATUS_READY?Fa.debug("UA is in READY status, not restarted"):Fa.debug("ERROR: connection is down, Auto-Recovery system is trying to reconnect"),this._dynConfiguration.register=this._configuration.register}},{key:"register",value:function(){Fa.debug("register()"),this._dynConfiguration.register=!0,this._registrator.register()}},{key:"unregister",value:function(e){Fa.debug("unregister()"),this._dynConfiguration.register=!1,this._registrator.unregister(e)}},{key:"registrator",value:function(){return this._registrator}},{key:"isRegistered",value:function(){return this._registrator.registered}},{key:"isConnected",value:function(){return this._transport.isConnected()}},{key:"call",value:function(e,t){Fa.debug("call()");var n=new Ra(this);return n.connect(e,t),n}},{key:"sendMessage",value:function(e,t,n){Fa.debug("sendMessage()");var r=new Oa(this);return r.send(e,t,n),r}},{key:"sendOptions",value:function(e,t,n){Fa.debug("sendOptions()");var r=new Da(this);return r.send(e,t,n),r}},{key:"terminateSessions",value:function(e){for(var t in Fa.debug("terminateSessions()"),this._sessions)this._sessions[t].isEnded()||this._sessions[t].terminate(e)}},{key:"stop",value:function(){var e=this;if(Fa.debug("stop()"),this._dynConfiguration={},this._status!==Ha.STATUS_USER_CLOSED){this._registrator.close();var t=Object.keys(this._sessions).length;for(var n in this._sessions)if(Object.prototype.hasOwnProperty.call(this._sessions,n)){Fa.debug("closing session ".concat(n));try{this._sessions[n].terminate()}catch(e){}}for(var r in this._applicants)if(Object.prototype.hasOwnProperty.call(this._applicants,r))try{this._applicants[r].close()}catch(e){}this._status=Ha.STATUS_USER_CLOSED,0===Object.keys(this._transactions.nict).length+Object.keys(this._transactions.nist).length+Object.keys(this._transactions.ict).length+Object.keys(this._transactions.ist).length&&0===t?this._transport.disconnect():this._closeTimer=setTimeout((function(){e._closeTimer=null,e._transport.disconnect()}),2e3)}else Fa.debug("UA already closed")}},{key:"normalizeTarget",value:function(e){return qa.normalizeTarget(e,this._configuration.hostport_params)}},{key:"get",value:function(e){switch(e){case"authorization_user":return this._configuration.authorization_user;case"realm":return this._configuration.realm;case"ha1":return this._configuration.ha1;case"authorization_jwt":return this._configuration.authorization_jwt;default:return void Fa.warn('get() | cannot get "%s" parameter in runtime',e)}}},{key:"set",value:function(e,t){switch(e){case"authorization_user":this._configuration.authorization_user=String(t);break;case"password":this._configuration.password=String(t);break;case"realm":this._configuration.realm=String(t);break;case"ha1":this._configuration.ha1=String(t),this._configuration.password=null;break;case"authorization_jwt":this._configuration.authorization_jwt=String(t);break;case"display_name":this._configuration.display_name=t;break;case"extra_headers":this._configuration.extra_headers=t;break;default:return Fa.warn('set() | cannot set "%s" parameter in runtime',e),!1}return!0}},{key:"newTransaction",value:function(e){this._transactions[e.type][e.id]=e,this.emit("newTransaction",{transaction:e})}},{key:"destroyTransaction",value:function(e){delete this._transactions[e.type][e.id],this.emit("transactionDestroyed",{transaction:e})}},{key:"newDialog",value:function(e){this._dialogs[e.id]=e}},{key:"destroyDialog",value:function(e){delete this._dialogs[e.id]}},{key:"newMessage",value:function(e,t){this._applicants[e]=e,this.emit("newMessage",t)}},{key:"newOptions",value:function(e,t){this._applicants[e]=e,this.emit("newOptions",t)}},{key:"destroyMessage",value:function(e){delete this._applicants[e]}},{key:"newRTCSession",value:function(e,t){this._sessions[e.id]=e,this.emit("newRTCSession",t)}},{key:"destroyRTCSession",value:function(e){delete this._sessions[e.id]}},{key:"registered",value:function(e){this.emit("registered",e)}},{key:"unregistered",value:function(e){this.emit("unregistered",e)}},{key:"registrationFailed",value:function(e){this.emit("registrationFailed",e)}},{key:"receiveRequest",value:function(e){var t=e.method;if(e.ruri.user!==this._configuration.uri.user&&e.ruri.user!==this._contact.uri.user)return Fa.debug("Request-URI does not point to us"),void(e.method!==ba.ACK&&e.reply_sl(404));if(e.ruri.scheme!==ba.SIPS){if(!ka.checkTransaction(this,e)){if(t===ba.INVITE?new ka.InviteServerTransaction(this,this._transport,e):t!==ba.ACK&&t!==ba.CANCEL&&new ka.NonInviteServerTransaction(this,this._transport,e),t===ba.OPTIONS){if(0===this.listeners("newOptions").length)return void e.reply(200);new Da(this).init_incoming(e)}else if(t===ba.MESSAGE){if(0===this.listeners("newMessage").length)return void e.reply(405);new Oa(this).init_incoming(e)}else if(t===ba.INVITE&&!e.to_tag&&0===this.listeners("newRTCSession").length)return void e.reply(405);var n,r;if(e.to_tag)(n=this._findDialog(e.call_id,e.from_tag,e.to_tag))?n.receiveRequest(e):t===ba.NOTIFY?(r=this._findSession(e))?r.receiveRequest(e):(Fa.debug("received NOTIFY request for a non existent subscription"),e.reply(481,"Subscription does not exist")):t!==ba.ACK&&e.reply(481);else switch(t){case ba.INVITE:if(window.RTCPeerConnection)if(e.hasHeader("replaces")){var i=e.replaces;(n=this._findDialog(i.call_id,i.from_tag,i.to_tag))?(r=n.owner).isEnded()?e.reply(603):r.receiveRequest(e):e.reply(481)}else(r=new Ra(this)).init_incoming(e);else Fa.warn("INVITE received but WebRTC is not supported"),e.reply(488);break;case ba.BYE:e.reply(481);break;case ba.CANCEL:(r=this._findSession(e))?r.receiveRequest(e):Fa.debug("received CANCEL request for a non existent session");break;case ba.ACK:break;case ba.NOTIFY:this.emit("sipEvent",{event:e.event,request:e}),e.reply(200);break;default:e.reply(405)}}}else e.reply_sl(416)}},{key:"_findSession",value:function(e){var t=e.call_id,n=e.from_tag,r=e.to_tag,i=t+n,o=this._sessions[i],s=t+r,a=this._sessions[s];return o||(a||null)}},{key:"_findDialog",value:function(e,t,n){var r=e+t+n,i=this._dialogs[r];return i||(r=e+n+t,(i=this._dialogs[r])||null)}},{key:"_loadConfig",value:function(e){try{Ba.load(this._configuration,e)}catch(e){throw e}0===this._configuration.display_name&&(this._configuration.display_name="0"),this._configuration.instance_id||(this._configuration.instance_id=qa.newUUID()),this._configuration.jssip_id=qa.createRandomToken(5);var t=this._configuration.uri.clone();t.user=null,this._configuration.hostport_params=t.toString().replace(/^sip:/i,"");try{this._transport=new Ma(this._configuration.sockets,{max_interval:this._configuration.connection_recovery_max_interval,min_interval:this._configuration.connection_recovery_min_interval}),this._transport.onconnecting=Ya.bind(this),this._transport.onconnect=ja.bind(this),this._transport.ondisconnect=Qa.bind(this),this._transport.ondata=Wa.bind(this)}catch(e){throw Fa.warn(e),new Na.ConfigurationError("sockets",this._configuration.sockets)}if(delete this._configuration.sockets,this._configuration.authorization_user||(this._configuration.authorization_user=this._configuration.uri.user),!this._configuration.registrar_server){var n=this._configuration.uri.clone();n.user=null,n.clearParams(),n.clearHeaders(),this._configuration.registrar_server=n}this._configuration.no_answer_timeout*=1e3,this._configuration.contact_uri?this._configuration.via_host=this._configuration.contact_uri.host:this._configuration.contact_uri=new Ua("sip",qa.createRandomToken(8),this._configuration.via_host,null,{transport:"ws"}),this._contact={pub_gruu:null,temp_gruu:null,uri:this._configuration.contact_uri,toString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.anonymous||null,n=e.outbound||null,r="<";return r+=t?this.temp_gruu||"sip:anonymous@anonymous.invalid;transport=ws":this.pub_gruu||this.uri.toString(),!n||(t?this.temp_gruu:this.pub_gruu)||(r+=";ob"),r+=">"}};var r=["authorization_user","password","realm","ha1","authorization_jwt","display_name","register","extra_headers"];for(var i in this._configuration)Object.prototype.hasOwnProperty.call(this._configuration,i)&&(-1!==r.indexOf(i)?Object.defineProperty(this._configuration,i,{writable:!0,configurable:!1}):Object.defineProperty(this._configuration,i,{writable:!1,configurable:!1}));for(var o in Fa.debug("configuration parameters after validation:"),this._configuration)if(Object.prototype.hasOwnProperty.call(Ba.settings,o))switch(o){case"uri":case"registrar_server":Fa.debug("- ".concat(o,": ").concat(this._configuration[o]));break;case"password":case"ha1":case"authorization_jwt":Fa.debug("- ".concat(o,": NOT SHOWN"));break;default:Fa.debug("- ".concat(o,": ").concat(JSON.stringify(this._configuration[o])))}}},{key:"C",get:function(){return Ha}},{key:"status",get:function(){return this._status}},{key:"contact",get:function(){return this._contact}},{key:"configuration",get:function(){return this._configuration}},{key:"transport",get:function(){return this._transport}}]),t}();function Ya(e){this.emit("connecting",e)}function ja(e){this._status!==Ha.STATUS_USER_CLOSED&&(this._status=Ha.STATUS_READY,this._error=null,this.emit("connected",e),this._dynConfiguration.register&&this._registrator.register())}function Qa(e){for(var t=0,n=["nict","ict","nist","ist"];t<n.length;t++){var r=n[t];for(var i in this._transactions[r])Object.prototype.hasOwnProperty.call(this._transactions[r],i)&&this._transactions[r][i].onTransportError()}this.emit("disconnected",e),this._registrator.onTransportClosed(),this._status!==Ha.STATUS_USER_CLOSED&&(this._status=Ha.STATUS_NOT_READY,this._error=Ha.NETWORK_ERROR)}function Wa(e){var t=e.transport,n=e.message;if((n=xa.parseMessage(n,this))&&!(this._status===Ha.STATUS_USER_CLOSED&&n instanceof Pa.IncomingRequest)&&La(n,this,t))if(n instanceof Pa.IncomingRequest)n.transport=t,this.receiveRequest(n);else if(n instanceof Pa.IncomingResponse){var r;switch(n.method){case ba.INVITE:(r=this._transactions.ict[n.via_branch])&&r.receiveResponse(n);break;case ba.ACK:break;default:(r=this._transactions.nict[n.via_branch])&&r.receiveResponse(n)}}}function Ka(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var za=jn,Ja=q(),Va=new za("WebSocketInterface"),Za=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Va.debug('new() [url:"%s"]',t),this._url=t,this._sip_uri=null,this._via_transport=null,this._ws=null;var n=Ja.parse(t,"absoluteURI");if(-1===n)throw Va.warn("invalid WebSocket URI: ".concat(t)),new TypeError("Invalid argument: ".concat(t));if("wss"!==n.scheme&&"ws"!==n.scheme)throw Va.warn("invalid WebSocket URI scheme: ".concat(n.scheme)),new TypeError("Invalid argument: ".concat(t));this._sip_uri="sip:".concat(n.host).concat(n.port?":".concat(n.port):"",";transport=ws"),this._via_transport=n.scheme.toUpperCase()}return Ka(e,[{key:"connect",value:function(){if(Va.debug("connect()"),this.isConnected())Va.debug("WebSocket ".concat(this._url," is already connected"));else if(this.isConnecting())Va.debug("WebSocket ".concat(this._url," is connecting"));else{this._ws&&this.disconnect(),Va.debug("connecting to WebSocket ".concat(this._url));try{this._ws=new WebSocket(this._url,"sip"),this._ws.binaryType="arraybuffer",this._ws.onopen=this._onOpen.bind(this),this._ws.onclose=this._onClose.bind(this),this._ws.onmessage=this._onMessage.bind(this),this._ws.onerror=this._onError.bind(this)}catch(e){this._onError(e)}}}},{key:"disconnect",value:function(){Va.debug("disconnect()"),this._ws&&(this._ws.onopen=function(){},this._ws.onclose=function(){},this._ws.onmessage=function(){},this._ws.onerror=function(){},this._ws.close(),this._ws=null)}},{key:"send",value:function(e){return Va.debug("send()"),this.isConnected()?(this._ws.send(e),!0):(Va.warn("unable to send message, WebSocket is not open"),!1)}},{key:"isConnected",value:function(){return this._ws&&this._ws.readyState===this._ws.OPEN}},{key:"isConnecting",value:function(){return this._ws&&this._ws.readyState===this._ws.CONNECTING}},{key:"_onOpen",value:function(){Va.debug("WebSocket ".concat(this._url," connected")),this.onconnect()}},{key:"_onClose",value:function(e){var t=e.wasClean,n=e.code,r=e.reason;Va.debug("WebSocket ".concat(this._url," closed")),!1===t&&Va.debug("WebSocket abrupt disconnection"),this.ondisconnect(!t,n,r)}},{key:"_onMessage",value:function(e){var t=e.data;Va.debug("received WebSocket message"),this.ondata(t)}},{key:"_onError",value:function(e){Va.warn("WebSocket ".concat(this._url," error: "),e)}},{key:"via_transport",get:function(){return this._via_transport},set:function(e){this._via_transport=e.toUpperCase()}},{key:"sip_uri",get:function(){return this._sip_uri}},{key:"url",get:function(){return this._url}}]),e}(),Xa=a,$a=l,eu=D,tu=U(),nu=Ga,ru=N(),iu=M(),ou=q(),su=Za;Fn("JsSIP")("version %s",Xa.version);var au,uu,lu=o({C:$a,Exceptions:eu,Utils:tu,UA:nu,URI:ru,NameAddrHeader:iu,WebSocketInterface:su,Grammar:ou,debug:Fn,get name(){return Xa.title},get version(){return Xa.version}});!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=-1]="FAILED",e[e.TIMEOUT=-2]="TIMEOUT",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE=403]="UNAVAILABLE",e[e.SYSTEMBUSY=450]="SYSTEMBUSY",e[e.NOENOUGNCHARACTER=10001]="NOENOUGNCHARACTER"}(au||(au={})),function(e){e[e.SUCCESS=200]="SUCCESS",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE=403]="UNAVAILABLE",e[e.TIMEOUT=408]="TIMEOUT",e[e.LOCKED=423]="LOCKED",e[e.SYSTEMBUSY=450]="SYSTEMBUSY",e[e.FAILED=500]="FAILED",e[e.NOENOUGNCHARACTER=10001]="NOENOUGNCHARACTER"}(uu||(uu={})),lu.debug.disable();var cu=function(){function e(e){this.callType="",this.ua={},this.socket={},this.isManualStop=!1,this.pingTimerId=0,this.newRTCSession={},this.incomingSession={},this.outgoingSession={},this.stream={},this.audio=new Audio,this.ringAudio=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjEyLjEwMAAAAAAAAAAAAAAA/+NAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAABGAABmoQACAwMDBAgIDBAUFBYaGh4iIiUpLCwvMzM3Ozs/Q0dHS09PU1dXW19kZGhsbHB0dHh8gICEiIiMkJCUmJycoKSkqKyssLO3t7u/v8PHx8vP0tLW2tre4uLm6u7u8fT0+Pv7//8AAAAATGF2YzYwLjI2AAAAAAA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k3AoAYuhMMwWwATA+AMBwAzLYzI+Xrl3LmpuVx52pPCJdB1y92jemTMNlUNs3dx+LkFOctsGgBKAq33n1mH/12Wy2kklmIRmQUMx3609E5TEbCVziXsLPMf//////////////////////////wpKQSAQMBdgA/8Zf6P//e6JbXv8w/nP9NSZD//odoZ0///7f//V//1PMRf///1Ob/////39h8F4BYTk5g3G55656qNxLG43G7gGAxg72Nw81VgzcAAAG4YaRtNy2O+1pOZdTSWBvQtdIZfrir+AAoy28tGZly6phAJghGCRI3B8B1/+OAZDEi+gtXa81skB5L/n53gWkhGYGXDEkTD7vGKghmY8/MernBAyhLaTJlQXA9hdcOwrtTKsu2Mz86iurGgASEZpjrB/Z9udrC7Mww7SgipGmIPpDsnWnO2KS1+isEavnFv7mlQoA2jXH8fhFeplFqt9Bl+qnakA0tSEuJ2zxh7T0wFAG0MGCAcES2WZ2ft8y3hVlW7NzLL916G1bn+9scl9BFCy6jKmiw6Ete/71jyvje7/////OYduSzf8////gNx2CUWocm37TAa5Oaww7///4WrOff///////+//u7S/3+////P/DCn77JFV1ruJY/W7bLILdd3JZwAcargFKUGKzQYAgw2z8R8A4b/sgbqbW2i1upD07L+pvZ63smn6k9/nDQ3T9P71P/W4moc4CgAGgYEOeS/3/WsxSd6/TNy4Ym4wYxBKA5gziVhc/f//99ryo0///KxoF9A+xkZnq/1My9WyK3Xb0GYcjO503HuS7nqK/QHwogcagZMI+AXiihAMxyDrA3ODowDDQ/DmgOrB7gswA10A0mD1hZxHgZ/+OAZCwbLdtaAMpQACocBpQVgJgBIEaFRMFQJEVMNkoDMk6GDWQN1CbGMCiZEGAsbJoiRMlojg2wmSKlg6gI5NC8ipIZEh4fCQIgQuYdJMKRXyy2rGZKA1RSABhMDGmAApozpE8omo7gKmQRESud1nTgWdOrQOJmRFiXHLBI4H1EckVELEaaPmKQIQQ6jxFk1mvmZSIpfIqa0mMS6amJia3a2db+r//6TO6yNFwjuMTyDUSiQUyOomP5Dj66vLzesZ0BlhDdz//////9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dsruw9DkYjDsxS9XiUCR+336kYl9v////////////////uFPU//y/Cxblj/xSRMsdOL77//nc///////lSrlE41Altvn4UJqcvBiPeWLAiKBgHv81/jBg/Ge3zG/+YYqmHnt/ukw+hpcn/7Oiu3///1T///5rfu3/////mD8z5hINyRHYgGI6G4oOPosVZc6GF4CSExoCDJYNj4fHIq/pJAAAAESQSEQkMD3nHg0VAMYNEBgsrgABkoJYqVAYYNAoYOBoKGEQEYpTQWCBmPumYAQZIKQoCjAyAIDhejBrJRMKYvwx0xLzEzBlC4hxgAA2mC4QYZrYAoGBiIgCV6HGOQ/+OAZGMyLgs1L854EAwQEmr/ggAAMYLAJJgPgPGAiBYYTIWBgYAKhAAaWaHeCyIA6+1owMAJGeMffYqgFJzpNoWw0/yEbXobcWCHCFgESsA8kAIAQDrfGAeAMulsm4JRxVahwVUjyeaGqu8FZyzIFAFMCYC0uUqda6lyRRgOADmBGAQMABt+IAAXLhtT6tiNIABMJgModxLrkgALxImFxDAdCGBQLKz34DAE1K1wKNgIA8wJQOQqACs9EfLHOhe9TsqgBNvA3G5z0ZkUWkUigFl0NNbk0Rp4xDyKEhi8vVsV67dHDjcP/////////+559w+7bln75v/agyddayFYGKLTvuO1irO9wpN7/mu2cmv0djsxY7//r9fUpOQyWjcW/PNmn4AkMslFj+51LNO+8RmDAEALlklkcbi0rj9iLSGWSmVrCqxOiAOLhTDAUCgACASdhlPDzgsC4Ne+ciltbqLnx/s/3b/8on//////b////u9C3+Gvy1OzdLcTQc/gYBZYbhjaJjEREgJkhCqKgaiwxmY1pLcHXK1lHkTmfo0w/+OAZC0dVe9aAMxkACPUFpZXgZAANKa+uO278vWKqV6krnC+e2/ml2M4dRItMdk65YTGasEsP/8tvCliDkIJi83T9zEHMVqULvSeUhaqVxnV7v557jcjdx2HUUD5V3OyqGoahphv///+VNbAooYXLKSxD9v86e3SASEy4F5vz8NZcvdyyQ6hoLw1u7/L9fuksS/POGHcnJfn///00qpYdZSX2q3KuNnL////Xa1n///////z7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YocIRhk1xgSIKIITjIh3gCppLEHJFbxGIMYXjyXBeJgywyRqHiljKrLeFvyQHEFBW3zEYEzg6AkxlHYbLQmFWGBcxtn9K6bCzAiQ5qRMkIKZqzbmUjmFNBAdSFllTdy+p7witcqv2YCQACMSoADpig75Q+46aaDhhGYMDpAhcA3J1wYBCwFXCdTwuM4UMF83czo/x5nYGEAQ5CgZAcAha51MkrGb/43Bk/CmJ4zF/zmgSCeAKSlOCAAANJcdmKxVtRJ+oBmYzHq1Nd3n3F44y8tLU1jjz/6/z8OlYZvFmdS2zSU9LPyymx1+W946////+m1z//////9c/7m+3u49wywzx7ruHed/LVWQCAARAMEiCgCACGJYS8OuPZaE3yp9q/1fh54fnf1Pt/93//2///6JMQU1FMy4xMDEgKGJldGEgMimqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/jEGTgAAAB/gDgAAAAAAP8AcAAAKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo="),this.answerEvent=[],this.newMessageEvent=[],this.sessionEvent={},this.callDetails=null,this.getMediaStream=function(){return navigator.mediaDevices.getUserMedia({audio:!0,video:!1})},this.incomingCallCallback=e.incomingCallCallback,(null==e?void 0:e.getMediaStream)&&(this.getMediaStream=e.getMediaStream)}return e.prototype.initMicrophone=function(){var e=this;this.getMediaStream().then((function(t){e.stream=t})).catch((function(){console.error("Error getting microphone stream")}))},e.prototype.destroyMicrophone=function(){var e,t;this.stream&&(null===(t=(e=this.stream).getTracks)||void 0===t||t.call(e).forEach((function(e){return e.stop()})),this.stream={})},e.prototype.reset=function(){this.newRTCSession={},this.incomingSession={},this.outgoingSession={},this.setCallType(""),this.callDetails=null,clearTimeout(this.pingTimerId),this.pingTimerId=0},e.prototype.setCallType=function(e){this.callType=e},e.prototype.getCallType=function(){return this.callType},e.prototype.init=function(e){return t(this,void 0,void 0,(function(){var r,i,o,s,a,u=this;return n(this,(function(l){return r=e.wssuri,i=e.password,o=e.uri,this.socket=new lu.WebSocketInterface(r),s={sockets:[this.socket],uri:o,password:i,register:!0,register_expires:300,session_timers:!0},(a=new lu.UA(s)).on("connected",(function(){u.sendPing()})),a.on("disconnected",(function(){u.isManualStop&&u.stop()})),a.on("registrationFailed",(function(){u.stop()})),a.on("registrationExpiring",(function(){u.ua.register()})),a.on("newMessage",(function(e){var t=JSON.parse(e.request.body);u.emitNewMessageEvent({code:uu.SUCCESS,data:t,message:"success"})})),a.on("newRTCSession",(function(e){return t(u,void 0,void 0,(function(){var t,r,i=this;return n(this,(function(n){switch(n.label){case 0:return this.callDetails=null,this.newRTCSession=e,t=e.session,"remote"!==e.originator?[3,4]:"outboundCall"!==this.callType?[3,1]:(this.answer(),[3,3]);case 1:return this.setCallType("inboundCall"),[4,this.incomingCallCallback(e)];case 2:r=n.sent(),this.callDetails=r.data,this.playRing(),this.emitAnswerEvent(r),n.label=3;case 3:return this.incomingSession=t,this.incomingSession.on("connecting",(function(){})),[3,5];case 4:this.outgoingSession=t,this.outgoingSession.on("connecting",(function(){})),n.label=5;case 5:return t.on("confirmed",(function(e){"outboundCall"!==i.callType&&i.emitSessionEvent("success",{code:uu.SUCCESS,data:i.callDetails,message:"success"})})),t.on("ended",(function(e){i.emitSessionEvent("ended",{code:uu.SUCCESS,data:i.callDetails,message:"success"}),i.reset()})),t.on("failed",(function(e){i.emitSessionEvent("failed",{code:uu.FAILED,data:i.callDetails,message:"failed"}),i.stopRing(),i.reset()})),t.on("peerconnection",(function(e){e.peerconnection.ontrack=function(e){if(e.streams&&e.streams[0])i.audio.srcObject=e.streams[0],i.audio.paused&&i.audio.play();else{var t=new MediaStream;t.addTrack(e.track),i.audio.srcObject=t,i.audio.paused&&i.audio.play()}}})),[2]}}))}))})),this.ua=a,this.ringAudio.loop=!0,[2]}))}))},e.prototype.start=function(){this.isManualStop=!1,this.initMicrophone(),this.ua.start()},e.prototype.stop=function(e){e&&(this.isManualStop=!0),this.destroyMicrophone(),this.reset(),this.ua.stop()},e.prototype.destroy=function(){this.stop(),this.ua={}},e.prototype.getSocketWS=function(){return this.socket._ws},e.prototype.sendPing=function(){var e=this;this.pingTimerId=setTimeout((function(){var t=!1;try{t=e.socket.send("ping")}catch(e){t=!1}var n=e.getSocketWS();if(!t&&![0,1].includes(null==n?void 0:n.readyState))return e.socket.connect(),clearTimeout(e.pingTimerId),void(e.pingTimerId=0);e.sendPing()}),3e3)},e.prototype.playRing=function(){this.ringAudio.play()},e.prototype.stopRing=function(){this.ringAudio.pause(),this.ringAudio.currentTime=0},e.prototype.call=function(e,t,n,r){var i={eventHandlers:t,mediaConstraints:{audio:!0,video:!1},mediaStream:this.stream,sessionTimersExpires:1800};this.ua.call(e,i)},e.prototype.hangup=function(){this.stopRing(),this.ua.terminateSessions()},e.prototype.ignore=function(){this.stopRing(),this.ua.terminateSessions({cause:"Busy",status_code:486})},e.prototype.answer=function(){var e,t,n;this.stopRing(),null===(n=null===(t=null===(e=this.newRTCSession)||void 0===e?void 0:e.session)||void 0===t?void 0:t.answer)||void 0===n||n.call(t,{mediaConstraints:{audio:!0,video:!1},mediaStream:this.stream,sessionTimersExpires:1800})},e.prototype.attachAnswerEvent=function(e){e&&"function"==typeof e&&this.answerEvent.push(e)},e.prototype.removeAnswerEvent=function(e){var t=this.answerEvent;if(t&&t.length)for(var n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}},e.prototype.emitAnswerEvent=function(e){this.answerEvent.forEach((function(t){t(e)}))},e.prototype.attachNewMessageEvent=function(e){var t;e&&"function"==typeof e&&(null===(t=this.newMessageEvent)||void 0===t||t.push(e))},e.prototype.removeNewMessageEvent=function(e){var t=this.newMessageEvent;if(t&&t.length)for(var n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}},e.prototype.emitNewMessageEvent=function(e){this.newMessageEvent.forEach((function(t){t(e)}))},e.prototype.attchSessionEvent=function(e,t){t&&"function"==typeof t&&(this.sessionEvent[e]||(this.sessionEvent[e]=[]),this.sessionEvent[e].push(t))},e.prototype.removeSessionEvent=function(e,t){var n=this.sessionEvent[e];if(n&&n.length)for(var r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}},e.prototype.emitSessionEvent=function(e,t){(this.sessionEvent[e]||[]).forEach((function(e){e(t)}))},e.prototype.on=function(e,t){return this.ua.on(e,t),this},e.prototype.RTCSessionOn=function(e,t){this.newRTCSession.session.on(e,t)},e.prototype.mute=function(){this.newRTCSession.session.mute({audio:!0})},e.prototype.unmute=function(){this.newRTCSession.session.unmute({audio:!0})},e.prototype.isMuted=function(){return this.newRTCSession.session.isMuted()},e.prototype.getIsRegistered=function(){return this.ua.isRegistered()},e}(),hu={exports:{}};
|
|
2
2
|
/** @license
|
|
3
3
|
* eventsource.js
|
|
4
4
|
* Available under MIT License (MIT)
|
|
5
5
|
* https://github.com/Yaffle/EventSource/
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){!function(n){var r=n.setTimeout,i=n.clearTimeout,o=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,u=n.EventSource,l=n.document,c=n.Promise,h=n.fetch,f=n.Response,d=n.TextDecoder,p=n.TextEncoder,g=n.AbortController;if("undefined"==typeof window||void 0===l||"readyState"in l||null!=l.body||(l.readyState="loading",window.addEventListener("load",(function(e){l.readyState="complete"}),!1)),null==o&&null!=a&&(o=function(){return new a("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==g){var m=h;h=function(e,t){var n=t.signal;return m(e,{headers:t.headers,credentials:t.credentials,cache:t.cache}).then((function(e){var t=e.body.getReader();return n._reader=t,n._aborted&&n._reader.cancel(),{status:e.status,statusText:e.statusText,headers:e.headers,body:{getReader:function(){return t}}}}))},g=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function _(){this.bitsNeeded=0,this.codePoint=0}_.prototype.decode=function(e){function t(e,t,n){if(1===n)return e>=128>>t&&e<<t<=2047;if(2===n)return e>=2048>>t&&e<<t<=55295||e>=57344>>t&&e<<t<=65535;if(3===n)return e>=65536>>t&&e<<t<=1114111;throw new Error}function n(e,t){if(6===e)return t>>6>15?3:t>31?2:1;if(12===e)return t>15?3:2;if(18===e)return 3;throw new Error}for(var r=65533,i="",o=this.bitsNeeded,s=this.codePoint,a=0;a<e.length;a+=1){var u=e[a];0!==o&&(u<128||u>191||!t(s<<6|63&u,o-6,n(o,s)))&&(o=0,s=r,i+=String.fromCharCode(s)),0===o?(u>=0&&u<=127?(o=0,s=u):u>=192&&u<=223?(o=6,s=31&u):u>=224&&u<=239?(o=12,s=15&u):u>=240&&u<=247?(o=18,s=7&u):(o=0,s=r),0===o||t(s,o,n(o,s))||(o=0,s=r)):(o-=6,s=s<<6|63&u),0===o&&(s<=65535?i+=String.fromCharCode(s):(i+=String.fromCharCode(55296+(s-65535-1>>10)),i+=String.fromCharCode(56320+(s-65535-1&1023))))}return this.bitsNeeded=o,this.codePoint=s,i};null!=d&&null!=p&&function(){try{return"test"===(new d).decode((new p).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(d=_);var A=function(){};function v(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=A,this.onload=A,this.onerror=A,this.onreadystatechange=A,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=A}function y(e){return e.replace(/[A-Z]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+32)}))}function T(e){for(var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var i=n[r].split(": "),o=i.shift(),s=i.join(": ");t[y(o)]=s}this._map=t}function S(){}function E(e){this._headers=e}function C(){}function w(){this._listeners=Object.create(null)}function b(e){r((function(){throw e}),0)}function I(e){this.type=e,this.target=void 0}function R(e,t){I.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function O(e,t){I.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function D(e,t){I.call(this,e),this.error=t.error}v.prototype.open=function(e,t){this._abort(!0);var n=this,s=this._xhr,a=1,u=0;this._abort=function(e){0!==n._sendTimeout&&(i(n._sendTimeout),n._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,s.onload=A,s.onerror=A,s.onabort=A,s.onprogress=A,s.onreadystatechange=A,s.abort(),0!==u&&(i(u),u=0),e||(n.readyState=4,n.onabort(null),n.onreadystatechange())),a=0};var l=function(){if(1===a){var e=0,t="",r=void 0;if("contentType"in s)e=200,t="OK",r=s.contentType;else try{e=s.status,t=s.statusText,r=s.getResponseHeader("Content-Type")}catch(n){e=0,t="",r=void 0}0!==e&&(a=2,n.readyState=2,n.status=e,n.statusText=t,n._contentType=r,n.onreadystatechange())}},c=function(){if(l(),2===a||3===a){a=3;var e="";try{e=s.responseText}catch(e){}n.readyState=3,n.responseText=e,n.onprogress()}},h=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:A}),c(),1===a||2===a||3===a){if(a=4,0!==u&&(i(u),u=0),n.readyState=4,"load"===e)n.onload(t);else if("error"===e)n.onerror(t);else{if("abort"!==e)throw new TypeError;n.onabort(t)}n.onreadystatechange()}},f=function(){u=r((function(){f()}),500),3===s.readyState&&c()};"onload"in s&&(s.onload=function(e){h("load",e)}),"onerror"in s&&(s.onerror=function(e){h("error",e)}),"onabort"in s&&(s.onabort=function(e){h("abort",e)}),"onprogress"in s&&(s.onprogress=c),"onreadystatechange"in s&&(s.onreadystatechange=function(e){!function(e){null!=s&&(4===s.readyState?"onload"in s&&"onerror"in s&&"onabort"in s||h(""===s.responseText?"error":"load",e):3===s.readyState?"onprogress"in s||c():2===s.readyState&&l())}(e)}),!("contentType"in s)&&"ontimeout"in o.prototype||(t+=(-1===t.indexOf("?")?"?":"&")+"padding=true"),s.open(e,t,!0),"readyState"in s&&(u=r((function(){f()}),0))},v.prototype.abort=function(){this._abort(!1)},v.prototype.getResponseHeader=function(e){return this._contentType},v.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},v.prototype.getAllResponseHeaders=function(){return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},v.prototype.send=function(){if("ontimeout"in o.prototype&&("sendAsBinary"in o.prototype||"mozAnon"in o.prototype)||null==l||null==l.readyState||"complete"===l.readyState){var e=this._xhr;"withCredentials"in e&&(e.withCredentials=this.withCredentials);try{e.send(void 0)}catch(e){throw e}}else{var t=this;t._sendTimeout=r((function(){t._sendTimeout=0,t.send()}),4)}},T.prototype.get=function(e){return this._map[y(e)]},null!=o&&null==o.HEADERS_RECEIVED&&(o.HEADERS_RECEIVED=2),S.prototype.open=function(e,t,n,r,i,s,a){e.open("GET",i);var u=0;for(var l in e.onprogress=function(){var t=e.responseText.slice(u);u+=t.length,n(t)},e.onerror=function(e){e.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===o.HEADERS_RECEIVED){var n=e.status,r=e.statusText,i=e.getResponseHeader("Content-Type"),s=e.getAllResponseHeaders();t(n,r,i,new T(s))}},e.withCredentials=s,a)Object.prototype.hasOwnProperty.call(a,l)&&e.setRequestHeader(l,a[l]);return e.send(),e},E.prototype.get=function(e){return this._headers.get(e)},C.prototype.open=function(e,t,n,r,i,o,s){var a=null,u=new g,l=u.signal,f=new d;return h(i,{headers:s,credentials:o?"include":"same-origin",signal:l,cache:"no-store"}).then((function(e){return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new E(e.headers)),new c((function(e,t){var r=function(){a.read().then((function(t){if(t.done)e(void 0);else{var i=f.decode(t.value,{stream:!0});n(i),r()}})).catch((function(e){t(e)}))};r()}))})).catch((function(e){return"AbortError"===e.name?void 0:e})).then((function(e){r(e)})),{abort:function(){null!=a&&a.cancel(),u.abort()}}},w.prototype.dispatchEvent=function(e){e.target=this;var t=this._listeners[e.type];if(null!=t)for(var n=t.length,r=0;r<n;r+=1){var i=t[r];try{"function"==typeof i.handleEvent?i.handleEvent(e):i.call(this,e)}catch(e){b(e)}}},w.prototype.addEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];null==r&&(r=[],n[e]=r);for(var i=!1,o=0;o<r.length;o+=1)r[o]===t&&(i=!0);i||r.push(t)},w.prototype.removeEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];if(null!=r){for(var i=[],o=0;o<r.length;o+=1)r[o]!==t&&i.push(r[o]);0===i.length?delete n[e]:n[e]=i}},R.prototype=Object.create(I.prototype),O.prototype=Object.create(I.prototype),D.prototype=Object.create(I.prototype);var k=-1,M=0,q=1,N=2,U=-1,x=0,P=1,L=2,B=3,F=/^text\/event\-stream(;.*)?$/i,H=function(e,t){var n=null==e?t:parseInt(e,10);return n!=n&&(n=t),G(n)},G=function(e){return Math.min(Math.max(e,1e3),18e6)},Y=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){b(e)}};function j(e,t){w.call(this),t=t||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,function(e,t,n){t=String(t);var a=Boolean(n.withCredentials),u=n.lastEventIdQueryParameterName||"lastEventId",l=G(1e3),c=H(n.heartbeatTimeout,45e3),h="",f=l,d=!1,p=0,g=n.headers||{},m=n.Transport,_=Q&&null==m?void 0:new v(null!=m?new m:null!=o&&"withCredentials"in o.prototype||null==s?new o:new s),A=null!=m&&"string"!=typeof m?new m:null==_?new C:new S,y=void 0,T=0,E=k,w="",b="",I="",j="",W=x,K=0,z=0,J=function(t,n,r,i){if(E===M)if(200===t&&null!=r&&F.test(r)){E=q,d=Date.now(),f=l,e.readyState=q;var o=new O("open",{status:t,statusText:n,headers:i});e.dispatchEvent(o),Y(e,e.onopen,o)}else{var s="";200!==t?(n&&(n=n.replace(/\s+/g," ")),s="EventSource's response has a status "+t+" "+n+" that is not 200. Aborting the connection."):s="EventSource's response has a Content-Type specifying an unsupported type: "+(null==r?"-":r.replace(/\s+/g," "))+". Aborting the connection.",X();o=new O("error",{status:t,statusText:n,headers:i});e.dispatchEvent(o),Y(e,e.onerror,o),console.error(s)}},V=function(t){if(E===q){for(var n=-1,o=0;o<t.length;o+=1){(u=t.charCodeAt(o))!=="\n".charCodeAt(0)&&u!=="\r".charCodeAt(0)||(n=o)}var s=(-1!==n?j:"")+t.slice(0,n+1);j=(-1===n?j:"")+t.slice(n+1),""!==t&&(d=Date.now(),p+=t.length);for(var a=0;a<s.length;a+=1){var u=s.charCodeAt(a);if(W===U&&u==="\n".charCodeAt(0))W=x;else if(W===U&&(W=x),u==="\r".charCodeAt(0)||u==="\n".charCodeAt(0)){if(W!==x){W===P&&(z=a+1);var g=s.slice(K,z-1),m=s.slice(z+(z<a&&s.charCodeAt(z)===" ".charCodeAt(0)?1:0),a);"data"===g?(w+="\n",w+=m):"id"===g?b=m:"event"===g?I=m:"retry"===g?(l=H(m,l),f=l):"heartbeatTimeout"===g&&(c=H(m,c),0!==T&&(i(T),T=r((function(){$()}),c)))}if(W===x){if(""!==w){h=b,""===I&&(I="message");var _=new R(I,{data:w.slice(1),lastEventId:b});if(e.dispatchEvent(_),"open"===I?Y(e,e.onopen,_):"message"===I?Y(e,e.onmessage,_):"error"===I&&Y(e,e.onerror,_),E===N)return}w="",I=""}W=u==="\r".charCodeAt(0)?U:x}else W===x&&(K=a,W=P),W===P?u===":".charCodeAt(0)&&(z=a+1,W=L):W===L&&(W=B)}}},Z=function(t){if(E===q||E===M){E=k,0!==T&&(i(T),T=0),T=r((function(){$()}),f),f=G(Math.min(16*l,2*f)),e.readyState=M;var n=new D("error",{error:t});e.dispatchEvent(n),Y(e,e.onerror,n),null!=t&&console.error(t)}},X=function(){E=N,null!=y&&(y.abort(),y=void 0),0!==T&&(i(T),T=0),e.readyState=N},$=function(){if(T=0,E===k){d=!1,p=0,T=r((function(){$()}),c),E=M,w="",I="",b=h,j="",K=0,z=0,W=x;var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==h){var i=t.indexOf("?");n=-1===i?t:t.slice(0,i+1)+t.slice(i+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(e,t){return t===u?"":e})),n+=(-1===t.indexOf("?")?"?":"&")+u+"="+encodeURIComponent(h)}var o=e.withCredentials,s={Accept:"text/event-stream"},a=e.headers;if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(s[l]=a[l]);try{y=A.open(_,J,V,Z,n,o,s)}catch(e){throw X(),e}}else if(d||null==y){var f=Math.max((d||Date.now())+c-Date.now(),1);d=!1,T=r((function(){$()}),f)}else Z(new Error("No activity within "+c+" milliseconds. "+(E===M?"No response received.":p+" chars received.")+" Reconnecting.")),null!=y&&(y.abort(),y=void 0)};e.url=t,e.readyState=M,e.withCredentials=a,e.headers=g,e._close=X,$()}(this,e,t)}var Q=null!=h&&null!=f&&"body"in f.prototype;j.prototype=Object.create(w.prototype),j.prototype.CONNECTING=M,j.prototype.OPEN=q,j.prototype.CLOSED=N,j.prototype.close=function(){this._close()},j.CONNECTING=M,j.OPEN=q,j.CLOSED=N,j.prototype.withCredentials=void 0;var W,K=u;null==o||null!=u&&"withCredentials"in u.prototype||(K=j),W=function(e){e.EventSourcePolyfill=j,e.NativeEventSource=u,e.EventSource=K}(t),void 0!==W&&(e.exports=W)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:i:globalThis)}(du,du.exports);var pu,gu,mu=du.exports,_u={exports:{}},Au=o(_u.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",a="day",u="week",l="month",c="quarter",h="year",f="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},A={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+_(r,2,"0")+":"+_(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),o=n-i<0,s=t.clone().add(r+(o?-1:1),l);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:h,w:u,d:a,D:f,h:s,m:o,s:i,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",y={};y[v]=m;var T="$isDayjsObject",S=function(e){return e instanceof b||!(!e||!e[T])},E=function e(t,n,r){var i;if(!t)return v;if("string"==typeof t){var o=t.toLowerCase();y[o]&&(i=o),n&&(y[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;y[a]=t,i=a}return!r&&i&&(v=i),i||!r&&v},C=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new b(n)},w=A;w.l=E,w.i=S,w.w=function(e,t){return C(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var b=function(){function m(e){this.$L=E(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[T]=!0}var _=m.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return w},_.isValid=function(){return!(this.$d.toString()===d)},_.isSame=function(e,t){var n=C(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return C(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<C(e)},_.$g=function(e,t,n){return w.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!w.u(t)||t,c=w.p(e),d=function(e,t){var i=w.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(a)},p=function(e,t){return w.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,m=this.$M,_=this.$D,A="set"+(this.$u?"UTC":"");switch(c){case h:return r?d(1,0):d(31,11);case l:return r?d(1,m):d(0,m+1);case u:var v=this.$locale().weekStart||0,y=(g<v?g+7:g)-v;return d(r?_-y:_+(6-y),m);case a:case f:return p(A+"Hours",0);case s:return p(A+"Minutes",1);case o:return p(A+"Seconds",2);case i:return p(A+"Milliseconds",3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,u=w.p(e),c="set"+(this.$u?"UTC":""),d=(n={},n[a]=c+"Date",n[f]=c+"Date",n[l]=c+"Month",n[h]=c+"FullYear",n[s]=c+"Hours",n[o]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[u],p=u===a?this.$D+(t-this.$W):t;if(u===l||u===h){var g=this.clone().set(f,1);g.$d[d](p),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[w.p(e)]()},_.add=function(r,c){var f,d=this;r=Number(r);var p=w.p(c),g=function(e){var t=C(d);return w.w(t.date(t.date()+Math.round(e*r)),d)};if(p===l)return this.set(l,this.$M+r);if(p===h)return this.set(h,this.$y+r);if(p===a)return g(1);if(p===u)return g(7);var m=(f={},f[o]=t,f[s]=n,f[i]=e,f)[p]||1,_=this.$d.getTime()+r*m;return w.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=w.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,l=n.months,c=n.meridiem,h=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},f=function(e){return w.s(o%12||12,e,"0")},p=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(g,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return w.s(t.$y,4,"0");case"M":return a+1;case"MM":return w.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,l,3);case"MMMM":return h(l,a);case"D":return t.$D;case"DD":return w.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(n.weekdaysMin,t.$W,u,2);case"ddd":return h(n.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(o);case"HH":return w.s(o,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(o,s,!0);case"A":return p(o,s,!1);case"m":return String(s);case"mm":return w.s(s,2,"0");case"s":return String(t.$s);case"ss":return w.s(t.$s,2,"0");case"SSS":return w.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,d){var p,g=this,m=w.p(f),_=C(r),A=(_.utcOffset()-this.utcOffset())*t,v=this-_,y=function(){return w.m(g,_)};switch(m){case h:p=y()/12;break;case l:p=y();break;case c:p=y()/3;break;case u:p=(v-A)/6048e5;break;case a:p=(v-A)/864e5;break;case s:p=v/n;break;case o:p=v/t;break;case i:p=v/e;break;default:p=v}return d?p:w.a(p)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return y[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=E(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return w.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},m}(),I=b.prototype;return C.prototype=I,[["$ms",r],["$s",i],["$m",o],["$H",s],["$W",a],["$M",l],["$y",h],["$D",f]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),C.extend=function(e,t){return e.$i||(e(t,b,C),e.$i=!0),C},C.locale=E,C.isDayjs=S,C.unix=function(e){return C(1e3*e)},C.en=y[v],C.Ls=y,C.p={},C}()),vu="aks_agent_token",yu=function(){function r(e){this.baseUrl="",this.eventSource=null,this.retryCount=0,this.retryMap=new Map,this.token="",this.id=e.id,this.getSystemToken=e.getSystemToken,this.resetSSE=e.resetSSE,this.retryCount=e.retryCount||0,this.baseUrl=e.baseUrl||""}return r.prototype.validateToken=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,fetch("".concat(this.baseUrl,"/iam/token/validate?accountId=").concat(e),{method:"GET",headers:{authentication:r}}).then((function(e){return e.json()}))]}))}))},r.prototype.initToken=function(){return t(this,void 0,void 0,(function(){var e,t,r;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.getSystemToken()];case 1:return(e=n.sent())?[4,this.validateToken(this.id,e)]:[2,{code:lu.FAILED,data:null,message:"get system token failed"}];case 2:return(t=n.sent()).code===lu.SUCCESS?(this.token=e,sessionStorage.setItem(vu,e),this.executePeriodically(this.refreshToken.bind(this),12e5),[2,{code:lu.SUCCESS,data:null,message:t.message}]):[2,{code:lu.FAILED,data:null,message:t.message}];case 3:return r=n.sent(),[2,{code:lu.FAILED,data:null,message:(null==r?void 0:r.toString())||"system error"}];case 4:return[2]}}))}))},r.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var e=this;return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/iam/oauth2/refresh")}).then((function(t){t.token&&(e.token=t.token,sessionStorage.setItem(vu,t.token),e.eventSource&&e.resetSSE())}))]}))}))},r.prototype.getAgentStatusList=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.request({url:"".concat(this.baseUrl,"/voipPlatform/agent/status/list")})]}))}))},r.prototype.getAgentInfo=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.request({url:"".concat(this.baseUrl,"/voipPlatform/agent/getAgentByUserId")})]}))}))},r.prototype.getAgentSetting=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/call_tasks/getAgentSetting"),data:e})]}))}))},r.prototype.updateAgentHangup=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/agent/").concat(e),method:"PUT"})]}))}))},r.prototype.updateAgentTicket=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({method:"POST",url:"".concat(this.baseUrl,"/voipPlatform/agent/ticket"),data:e})]}))}))},r.prototype.registerSSE=function(e){return t(this,void 0,void 0,(function(){var r,i,o,s,a,u=this;return n(this,(function(l){return r=e.agentId,i=e.onMessage,o=function(e){},s=new Promise((function(e){o=e})),a=this.token,this.eventSource=new mu.EventSourcePolyfill("".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_event?agentId=").concat(r),{headers:{Authentication:a,"Cache-Control":"no-cache",Connection:"keep-alive"},heartbeatTimeout:12e6}),this.eventSource.onmessage=i,this.eventSource.onopen=function(){return t(u,void 0,void 0,(function(){return n(this,(function(e){return o(!0),[2]}))}))},this.eventSource.onerror=function(){return t(u,void 0,void 0,(function(){return n(this,(function(e){return o(!1),[2]}))}))},[2,s]}))}))},r.prototype.closeSSE=function(e){return t(this,void 0,void 0,(function(){var t,r,i=this;return n(this,(function(n){return t=e.agentId,r=e.clearTicket,this.eventSource?[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_close?agentId=").concat(t,"&clearTicket=").concat(r)}).then((function(){i.eventSource.close(),i.eventSource=null}))]:[2]}))}))},r.prototype.switchAgentStatus=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({method:"PUT",url:"".concat(this.baseUrl,"/voipPlatform/agent/agentStatusSwitch"),data:e})]}))}))},r.prototype.outboundCall=function(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){return t=e.phone,r=e.line,[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/agentOutBoundCall/dialer/startCall/").concat(t,"/").concat(r),method:"POST"})]}))}))},r.prototype.saveAgentResponseTime=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({method:"POST",url:"".concat(this.baseUrl,"/crm/v1/call_record/callRecordAgent"),data:e})]}))}))},r.prototype.getCallTaskInfo=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/call_tasks/getCallTaskName/").concat(e.callTaskId)})]}))}))},r.prototype.getAfterCallProcessTime=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/predictCall/afterCallProcessTime/").concat(e.callTaskId)})]}))}))},r.prototype.formatFormData=function(e){var t=new FormData;for(var n in e)e[n]&&t.append(n,e[n]);return t},r.prototype.agentAbnormalClose=function(e){e.createTime||(e.createTime=Au().format("yyyy-MM-DD HH:mm:ss")),e.sendTime=Au().format("yyyy-MM-DD HH:mm:ss"),e.Authentication=this.getTokenWithFallback();var t=this.formatFormData(e);return this.request({method:"POST",url:"".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_abnormal_close"),data:t},!0)},r.prototype.sendBeacon=function(e){if("function"==typeof navigator.sendBeacon&&e.url){e.createTime||(e.createTime=Au().format("yyyy-MM-DD HH:mm:ss")),e.sendTime=Au().format("yyyy-MM-DD HH:mm:ss"),e.Authentication=this.getTokenWithFallback();var t=e.url,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["url"]),r=this.formatFormData(n),i=navigator.sendBeacon(t,r);if(!i){e.lastSendResult=i;var o=JSON.parse(localStorage.getItem("aks_beacon_queue")||"[]");o.push(e),localStorage.setItem("aks_beacon_queue",JSON.stringify(o))}}},r.prototype.clearnSendBeaconQueue=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return(e=JSON.parse(localStorage.getItem("aks_beacon_queue")||"[]")).length?[4,this.waitToken()]:[3,4];case 1:return n.sent()?[3,3]:[4,this.initToken()];case 2:if(n.sent().code!==lu.SUCCESS)return[2];n.label=3;case 3:for(t=0;t<e.length-1;t++)this.sendBeacon(e[t]);n.label=4;case 4:return[2]}}))}))},r.prototype.getTokenWithFallback=function(){return this.token?this.token:sessionStorage.getItem(vu)||""},r.prototype.waitToken=function(e,t){var n=this;return void 0===e&&(e=3e3),void 0===t&&(t=200),new Promise((function(r){var i=setInterval((function(){((e-=t)<=0||n.token)&&(clearInterval(i),r(Boolean(n.token)))}),200)}))},r.prototype.request=function(r){return t(this,arguments,void 0,(function(r,i){var o,s,a,u=this;return void 0===i&&(i=!1),n(this,(function(l){switch(l.label){case 0:return!this.retryMap.has(r.url)&&this.retryCount&&this.retryMap.set(r.url,this.retryCount),this.token?[3,3]:[4,this.waitToken()];case 1:return l.sent()?[3,3]:[4,this.initToken()];case 2:if((o=l.sent()).code!==lu.SUCCESS)return[2,{code:o.code,message:o.message,data:null}];l.label=3;case 3:return s={method:r.method||"GET",headers:e({"Content-Type":"application/json",authentication:this.token},r.headers)},i?(s.method=r.method,s.headers={authentication:this.token},s.body=r.data):"GET"!==(null===(a=s.method)||void 0===a?void 0:a.toLocaleUpperCase())&&(s.body=JSON.stringify(r.data)),[2,fetch(r.url,s).then((function(e){return t(u,void 0,void 0,(function(){var t,i;return n(this,(function(n){switch(n.label){case 0:return t=this.retryMap.get(r.url),401!==e.status?[3,3]:t?(this.retryMap.set(r.url,t-1),[4,this.initToken()]):[3,2];case 1:return(i=n.sent()).code===lu.SUCCESS?[2,this.request(r)]:[2,i];case 2:return this.retryCount&&this.retryMap.delete(r.url),[2,{code:lu.UNAUTHORIZED,message:"Unauthorized",data:null}];case 3:return[2,e.json()]}}))}))}))]}}))}))},r.prototype.executePeriodically=function(e,t){var n=Date.now()+t,r=function(){var i=Date.now();i>=n&&(e(),n+=t);var o=Math.max(0,n-i);setTimeout(r,o)};r()},r.getInstance=function(e){return!r.instance&&e&&(r.instance=new r(e)),r.instance},r.instance=null,r}();!function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE",e[e.HANGUP=4]="HANGUP"}(pu||(pu={})),function(e){e[e.ANSWER=1]="ANSWER",e[e.HANGUP=2]="HANGUP"}(gu||(gu={}));var Tu=function(){function i(e){var t=this;this.sip={},this.api={},this.isSipInit=!1,this.agentInfo={},this.initEvent={},this.agentEvent={},this.agentWaitingTime=0,this.agentResponseTime=0,this.timer=null,this.callDetails={},this.unloadingHandled=!1,this.baseUrl="",this.autoFinishACWTimer=null,this.baseUrl=(null==e?void 0:e.baseUrl)||"",this.api=yu.getInstance({id:e.id,getSystemToken:e.getSystemToken,resetSSE:this.resetSSE.bind(this),retryCount:e.retryCount,baseUrl:this.baseUrl}),this.sip=new fu({incomingCallCallback:this.incomingCall.bind(this),getMediaStream:null==e?void 0:e.getMediaStream}),this.sip.attchSessionEvent("ended",this.sessionEnded.bind(this)),this.sip.attchSessionEvent("failed",this.sessionFailed.bind(this)),this.init().then((function(){t.api.clearnSendBeaconQueue()}))}return i.prototype.init=function(){return t(this,void 0,void 0,(function(){var t,r,i,o,s;return n(this,(function(n){switch(n.label){case 0:return[4,this.api.initToken()];case 1:return(t=n.sent()).code!==lu.SUCCESS?(r=e(e({},t),{code:cu.FAILED}),this.emitInitEvent("failed",r),[2,r]):[4,this.getAgentStatus()];case 2:return(i=n.sent()).code!==cu.SUCCESS?(o=e(e({},i),{code:i.code===cu.LOCKED?cu.LOCKED:cu.FAILED}),this.emitInitEvent("failed",o),[2,o]):(s={code:cu.SUCCESS,data:null,message:"success"},this.emitInitEvent("success",s),[2,s])}}))}))},i.prototype.getAgentStatusList=function(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,this.api.getAgentStatusList()];case 1:return(e=t.sent()).code===lu.SUCCESS?[2,{code:cu.SUCCESS,data:e.data||[],message:e.message}]:[2,{code:cu.FAILED,data:null,message:e.message}]}}))}))},i.prototype.getTicket=function(){var e=window.sessionStorage.getItem("wiz-agent-ticket");return e||(e=r(),window.sessionStorage.setItem("wiz-agent-ticket",e)),e},i.prototype.getHostName=function(e){try{return new URL(e).hostname}catch(e){return""}},i.prototype.processSSEMessage=function(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=JSON.parse(null==e?void 0:e.data)||{},r=this.agentInfo.statusName,-1===t.agentId?[3,2]:[4,this.offlineAgent(r)];case 1:n.sent(),1===t.status&&this.onlineAgent(r),n.label=2;case 2:return[2]}}))}))},i.prototype.resetSSE=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.api.closeSSE({agentId:this.agentInfo.id,clearTicket:1})];case 1:return e.sent(),[4,this.api.registerSSE({agentId:this.agentInfo.id,onMessage:this.processSSEMessage.bind(this)})];case 2:return e.sent(),[2]}}))}))},i.prototype.createSSEAndOpensips=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return this.api.registerSSE({agentId:e,onMessage:this.processSSEMessage.bind(this)})?[3,2]:[4,this.api.updateAgentTicket({agentId:e,ticket:r,type:pu.OFFLINE})];case 1:return t.sent().code!==lu.SUCCESS?[2,{code:cu.FAILED,message:"Registration of SSE failed and update Agent Ticket failed"}]:[2,{code:cu.FAILED,message:"Registration of SSE failed"}];case 2:return[4,this.waitSIPRegistered(7e3)];case 3:return t.sent()?[3,5]:[4,this.api.closeSSE({agentId:e,clearTicket:1})];case 4:return t.sent(),[2,{code:cu.FAILED,message:"SIP registration failed"}];case 5:return[2,{code:cu.SUCCESS,message:"success"}]}}))}))},i.prototype.waitSIPRegistered=function(){return t(this,arguments,void 0,(function(e){var t=this;return void 0===e&&(e=7e3),n(this,(function(n){return[2,new Promise((function(n){var r=!1,i=function(e){r||(r=!0,n(e))};t.sip.on("registered",(function(){return i(!0)})),t.sip.on("registrationFailed",(function(){return i(!1)})),setTimeout((function(){return i(!1)}),e),t.sip.start()}))]}))}))},i.prototype.getAgentInfo=function(){return t(this,void 0,void 0,(function(){var e,t,r,i,o,s;return n(this,(function(n){switch(n.label){case 0:return[4,this.api.getAgentInfo()];case 1:return"code"in(e=n.sent())&&e.code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:e.message}]:"data"in e&&(null===(s=e.data)||void 0===s?void 0:s[0])?(t=e.data[0],this.agentInfo=t,r=t.ticket,i=this.getTicket(),r&&r!==i?[2,{code:cu.LOCKED,data:t,message:"Agent ticket occupied, unable to perform agent online or offline."}]:(this.isSipInit||(o="sip:".concat(t.number,"@").concat(this.getHostName(t.realm)),this.sip.init({wssuri:t.realm,password:t.password,uri:o}),this.isSipInit=!0),[2,{code:cu.SUCCESS,data:t,message:e.message}])):[2,{code:cu.FAILED,data:null,message:"Agent not found"}]}}))}))},i.prototype.getAgentStatus=function(){return t(this,void 0,void 0,(function(){var e,t,i,o,s,a,u,l,c,h;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,Promise.allSettled([this.getAgentInfo(),this.api.getAgentSetting({key:"callCenter"})])];case 1:return e=n.sent(),t=e.map((function(e){return"fulfilled"!==e.status?{code:lu.FAILED,data:null,message:"system error"}:e.value})),i=t[0],"agentWaitingTime"in(o=t[1])&&(this.agentWaitingTime=o.agentWaitingTime||0),"code"in i&&i.code!==cu.SUCCESS?[2,{code:i.code===cu.LOCKED?cu.LOCKED:cu.FAILED,data:null,message:i.message}]:"data"in i&&i.data?(s=i.data,a=s.status,u=s.id,l=s.groupId,c={code:cu.SUCCESS,data:{id:u,groupId:l,status:a,subStatus:s.statusName},message:"success"},this.agentInfo=s,a===pu.OFFLINE?[2,c]:a!==pu.ONLINE?[3,4]:i.code===cu.LOCKED?[2,{code:cu.LOCKED,data:null,message:i.message}]:[4,this.api.agentAbnormalClose({id:u,groupId:l,trace:r()})]):[2,{code:cu.FAILED,data:null,message:"Agent not found"}];case 2:return n.sent(),[4,this.api.switchAgentStatus({id:u,groupId:l,status:pu.OFFLINE,subStatus:"offline"})];case 3:return(h=n.sent()).code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:h.message}]:(c.data.status=pu.OFFLINE,c.data.subStatus="Offline",[2,c]);case 4:return[2,{code:cu.FAILED,data:null,message:"system error"}];case 5:return n.sent(),[2,{code:cu.FAILED,data:null,message:"system error"}];case 6:return[2]}}))}))},i.prototype.onlineAgent=function(e){return t(this,void 0,void 0,(function(){var t,r,i,o,s,a,u,l,c,h,f;return n(this,(function(n){switch(n.label){case 0:return t=this.agentInfo,r=t.status,i=t.id,o=t.groupId,r!==pu.ONLINE?[3,2]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:pu.ONLINE,subStatus:e})];case 1:return(u=n.sent()).code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:u.message}]:(f={code:cu.SUCCESS,data:{status:pu.ONLINE,subStatus:e},message:"Agent is already online"},this.agentInfo.statusName=e,this.emitAgentEvent("online",f),[2,f]);case 2:return r!==pu.OFFLINE?[3,6]:(s=this.getTicket(),[4,this.api.updateAgentTicket({agentId:i,ticket:s,type:pu.ONLINE})]);case 3:return(a=n.sent()).code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:a.message}]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:pu.ONLINE,subStatus:e})];case 4:return(u=n.sent()).code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:u.message}]:[4,this.createSSEAndOpensips(i,s)];case 5:return l=n.sent(),c=l.code,h=l.message,c!==cu.SUCCESS?[2,{code:cu.FAILED,data:null,message:h}]:(f={code:c,data:{status:pu.ONLINE,subStatus:e},message:h},this.agentInfo.status=pu.ONLINE,this.agentInfo.statusName=e,this.emitAgentEvent("online",f),[2,f]);case 6:return[2,{code:cu.FAILED,data:null,message:"Agent Status is not valid"}]}}))}))},i.prototype.offlineAgent=function(e){return t(this,void 0,void 0,(function(){var t,r,i,o,s,a;return n(this,(function(n){switch(n.label){case 0:return t=this.agentInfo,r=t.status,i=t.id,o=t.groupId,r!==pu.OFFLINE?[3,2]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:pu.OFFLINE,subStatus:e})];case 1:return(s=n.sent()).code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:s.message}]:(a={code:cu.SUCCESS,data:{status:pu.OFFLINE,subStatus:e},message:"Agent is already offline"},this.agentInfo.statusName=e,this.emitAgentEvent("offline",a),[2,a]);case 2:return r!==pu.ONLINE?[3,4]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:pu.OFFLINE,subStatus:e})];case 3:return(s=n.sent()).code!==lu.SUCCESS?[2,{code:cu.FAILED,data:null,message:s.message}]:(this.api.closeSSE({agentId:i,clearTicket:1}),this.sip.stop(!0),a={code:cu.SUCCESS,data:{status:pu.OFFLINE,subStatus:e},message:"Agent is already offline"},this.emitAgentEvent("offline",a),this.agentInfo.status=pu.OFFLINE,this.agentInfo.statusName=e,[2,a]);case 4:return[2,{code:cu.FAILED,data:null,message:"Agent Status is not valid"}]}}))}))},i.prototype.switchAgentStatus=function(e){return t(this,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return this.sip.getIsRegistered()?[4,this.getAgentInfo()]:[2,{code:cu.FAILED,data:null,message:"SIP Registration failed, Registration failed. Seat online and offline cannot be performed."}];case 1:return(t=n.sent()).code!==cu.SUCCESS?[2,{code:t.code===cu.LOCKED?cu.LOCKED:cu.FAILED,data:null,message:t.message}]:(r=e.status,i=e.subStatus,r===pu.ONLINE?[2,this.onlineAgent(i)]:r===pu.OFFLINE?[2,this.offlineAgent(i)]:[2,{code:cu.FAILED,data:null,message:"system error"}])}}))}))},i.prototype.outboundCall=function(e){return t(this,void 0,void 0,(function(){var t,r=this;return n(this,(function(n){return this.sip.getIsRegistered()?(t=this.agentInfo.outboundLineId)?[2,this.api.outboundCall({phone:e,line:t}).then((function(e){return e.code===lu.SUCCESS?(r.sip.setCallType("outboundCall"),{code:cu.SUCCESS,data:e.data,message:e.message||e.msg}):{code:cu.FAILED,data:null,message:e.message||e.msg}}))]:[2,Promise.resolve({code:cu.FAILED,data:null,message:"Agent has no outbound line"})]:[2,{code:cu.FAILED,data:null,message:"SIP Registration failed, Outbound calls cannot be made."}]}))}))},i.prototype.autoFinishACW=function(){var e=this,t=Number(this.callDetails.afterCallProcessTime),n=function(){t<=0?e.finshACW():(t-=1,e.autoFinishACWTimer=setTimeout(n,1e3))};this.autoFinishACWTimer=setTimeout(n,1e3)},i.prototype.finshACW=function(){return t(this,void 0,void 0,(function(){var e,t,r,i;return n(this,(function(n){switch(n.label){case 0:return this.autoFinishACWTimer&&(clearTimeout(this.autoFinishACWTimer),this.autoFinishACWTimer=null),e=this.agentInfo,t=e.id,r=e.groupId,[4,this.api.switchAgentStatus({id:t,groupId:r,status:pu.HANGUP})];case 1:return[2,{code:(i=n.sent()).code===lu.SUCCESS?cu.SUCCESS:cu.FAILED,data:null,message:i.message}]}}))}))},i.prototype.sessionEnded=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this.autoFinishACW(),[2]}))}))},i.prototype.sessionFailed=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this.api.updateAgentHangup(this.agentInfo.id),[2]}))}))},i.prototype.openOnunload=function(){var e=this;window.onbeforeunload=function(e){e.returnValue="beforeunload"},window.onunload=function(){e.doForceOfflineCleanup()},this.unloadingHandled=!1},i.prototype.cancelOnunload=function(){window.onbeforeunload=function(){},window.onunload=function(){},this.unloadingHandled=!1},i.prototype.doForceOfflineCleanup=function(){if(!this.unloadingHandled){this.unloadingHandled=!0;var e="".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_abnormal_close");this.api.sendBeacon({url:e,id:this.agentInfo.id,groupId:this.agentInfo.groupId,trace:r()})}},i.prototype.saveAgentResponseTime=function(e){this.api.saveAgentResponseTime({callId:this.callDetails.callId,agentId:this.agentInfo.id,agentResponseTime:this.agentResponseTime,agentGroupId:this.agentInfo.groupId,resultType:e}),this.timer&&(clearInterval(this.timer),this.agentResponseTime=0)},i.prototype.hangup=function(){this.sip.hangup()},i.prototype.timingResTime=function(){var e=this;this.timer&&(clearInterval(this.timer),this.timer=null);var t=this.agentWaitingTime;this.agentResponseTime=0,this.timer=setInterval((function(){if(t<=0)return clearInterval((null==e?void 0:e.timer)||0),e.timer=null,void e.ignore();t-=1,e.agentResponseTime+=1}),1e3)},i.prototype.incomingCall=function(e){return t(this,void 0,void 0,(function(){var t,r,i,o,s,a,u,l,c,h,f,d,p,g,m,_,A,v,y,T;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),t=e.request,r=(null===(_=null===(m=t.headers["Call-Param"])||void 0===m?void 0:m[0])||void 0===_?void 0:_.raw)||"",i=r?atob(r):"",o=JSON.parse(i||"{}"),s=(null===(v=null===(A=t.headers["Call-Task"])||void 0===A?void 0:A[0])||void 0===v?void 0:v.raw)||"",a=(null===(T=null===(y=t.headers["Call-Record-Id"])||void 0===y?void 0:y[0])||void 0===T?void 0:T.raw)||null,u=Object.fromEntries(Object.entries(o).filter((function(e){return""!==e[0]}))),l="",c="",s?[4,Promise.allSettled([this.api.getCallTaskInfo({callTaskId:s}),this.api.getAfterCallProcessTime({callTaskId:s})])]:[3,2];case 1:h=n.sent(),f=h[0],d=h[1],"fulfilled"===f.status&&(l=f.value.name||""),"fulfilled"===d.status&&(p=d.value).code===cu.SUCCESS&&(c=String(p.data||"")),n.label=2;case 2:return this.callDetails={callId:a||"",callType:this.sip.getCallType()||"",taskName:l,afterCallProcessTime:c,phone:u.phone||u.Phone||u.PHONE||"",contactId:u.contactId||u.ContactId||u.CONTACT_ID||"",extraJson:u},this.timingResTime(),[2,Promise.resolve({code:cu.SUCCESS,data:this.callDetails,message:"success"})];case 3:return g=n.sent(),[2,Promise.resolve({code:cu.FAILED,data:null,message:(null==g?void 0:g.toString())||"system error"})];case 4:return[2]}}))}))},i.prototype.answer=function(){this.sip.answer(),this.saveAgentResponseTime(gu.ANSWER)},i.prototype.ignore=function(){this.sip.ignore(),this.saveAgentResponseTime(gu.HANGUP)},i.prototype.mute=function(){this.sip.mute()},i.prototype.unmute=function(){this.sip.unmute()},i.prototype.attachInitEvent=function(e,t){t&&"function"==typeof t&&(this.initEvent[e]||(this.initEvent[e]=[]),this.initEvent[e].push(t))},i.prototype.removeInitEvent=function(e,t){var n=this.initEvent[e];if(n&&n.length)for(var r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}},i.prototype.emitInitEvent=function(e,t){(this.initEvent[e]||[]).forEach((function(e){e(t)}))},i.prototype.attachAgentEvent=function(e,t){t&&"function"==typeof t&&(this.agentEvent[e]||(this.agentEvent[e]=[]),this.agentEvent[e].push(t))},i.prototype.removeAgentEvent=function(e,t){var n=this.agentEvent[e];if(n&&n.length)for(var r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}},i.prototype.emitAgentEvent=function(e,t){(this.agentEvent[e]||[]).forEach((function(e){e(t)}))},i.prototype.attachAnswerEvent=function(e){this.sip.attachAnswerEvent(e)},i.prototype.removeAnswerEvent=function(e){this.sip.removeAnswerEvent(e)},i.prototype.attachNewMessageEvent=function(e){this.sip.attachNewMessageEvent(e)},i.prototype.removeNewMessageEvent=function(e){this.sip.removeNewMessageEvent(e)},i.prototype.attchSessionEvent=function(e,t){this.sip.attchSessionEvent(e,t)},i.prototype.removeSessionEvent=function(e,t){this.sip.removeSessionEvent(e,t)},i}();module.exports=Tu;
|
|
7
|
+
!function(e,t){!function(n){var r=n.setTimeout,i=n.clearTimeout,o=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,u=n.EventSource,l=n.document,c=n.Promise,h=n.fetch,f=n.Response,d=n.TextDecoder,p=n.TextEncoder,g=n.AbortController;if("undefined"==typeof window||void 0===l||"readyState"in l||null!=l.body||(l.readyState="loading",window.addEventListener("load",(function(e){l.readyState="complete"}),!1)),null==o&&null!=a&&(o=function(){return new a("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==g){var m=h;h=function(e,t){var n=t.signal;return m(e,{headers:t.headers,credentials:t.credentials,cache:t.cache}).then((function(e){var t=e.body.getReader();return n._reader=t,n._aborted&&n._reader.cancel(),{status:e.status,statusText:e.statusText,headers:e.headers,body:{getReader:function(){return t}}}}))},g=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function _(){this.bitsNeeded=0,this.codePoint=0}_.prototype.decode=function(e){function t(e,t,n){if(1===n)return e>=128>>t&&e<<t<=2047;if(2===n)return e>=2048>>t&&e<<t<=55295||e>=57344>>t&&e<<t<=65535;if(3===n)return e>=65536>>t&&e<<t<=1114111;throw new Error}function n(e,t){if(6===e)return t>>6>15?3:t>31?2:1;if(12===e)return t>15?3:2;if(18===e)return 3;throw new Error}for(var r=65533,i="",o=this.bitsNeeded,s=this.codePoint,a=0;a<e.length;a+=1){var u=e[a];0!==o&&(u<128||u>191||!t(s<<6|63&u,o-6,n(o,s)))&&(o=0,s=r,i+=String.fromCharCode(s)),0===o?(u>=0&&u<=127?(o=0,s=u):u>=192&&u<=223?(o=6,s=31&u):u>=224&&u<=239?(o=12,s=15&u):u>=240&&u<=247?(o=18,s=7&u):(o=0,s=r),0===o||t(s,o,n(o,s))||(o=0,s=r)):(o-=6,s=s<<6|63&u),0===o&&(s<=65535?i+=String.fromCharCode(s):(i+=String.fromCharCode(55296+(s-65535-1>>10)),i+=String.fromCharCode(56320+(s-65535-1&1023))))}return this.bitsNeeded=o,this.codePoint=s,i};null!=d&&null!=p&&function(){try{return"test"===(new d).decode((new p).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(d=_);var A=function(){};function v(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=A,this.onload=A,this.onerror=A,this.onreadystatechange=A,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=A}function y(e){return e.replace(/[A-Z]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+32)}))}function T(e){for(var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var i=n[r].split(": "),o=i.shift(),s=i.join(": ");t[y(o)]=s}this._map=t}function S(){}function E(e){this._headers=e}function C(){}function w(){this._listeners=Object.create(null)}function b(e){r((function(){throw e}),0)}function I(e){this.type=e,this.target=void 0}function R(e,t){I.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function O(e,t){I.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function D(e,t){I.call(this,e),this.error=t.error}v.prototype.open=function(e,t){this._abort(!0);var n=this,s=this._xhr,a=1,u=0;this._abort=function(e){0!==n._sendTimeout&&(i(n._sendTimeout),n._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,s.onload=A,s.onerror=A,s.onabort=A,s.onprogress=A,s.onreadystatechange=A,s.abort(),0!==u&&(i(u),u=0),e||(n.readyState=4,n.onabort(null),n.onreadystatechange())),a=0};var l=function(){if(1===a){var e=0,t="",r=void 0;if("contentType"in s)e=200,t="OK",r=s.contentType;else try{e=s.status,t=s.statusText,r=s.getResponseHeader("Content-Type")}catch(n){e=0,t="",r=void 0}0!==e&&(a=2,n.readyState=2,n.status=e,n.statusText=t,n._contentType=r,n.onreadystatechange())}},c=function(){if(l(),2===a||3===a){a=3;var e="";try{e=s.responseText}catch(e){}n.readyState=3,n.responseText=e,n.onprogress()}},h=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:A}),c(),1===a||2===a||3===a){if(a=4,0!==u&&(i(u),u=0),n.readyState=4,"load"===e)n.onload(t);else if("error"===e)n.onerror(t);else{if("abort"!==e)throw new TypeError;n.onabort(t)}n.onreadystatechange()}},f=function(){u=r((function(){f()}),500),3===s.readyState&&c()};"onload"in s&&(s.onload=function(e){h("load",e)}),"onerror"in s&&(s.onerror=function(e){h("error",e)}),"onabort"in s&&(s.onabort=function(e){h("abort",e)}),"onprogress"in s&&(s.onprogress=c),"onreadystatechange"in s&&(s.onreadystatechange=function(e){!function(e){null!=s&&(4===s.readyState?"onload"in s&&"onerror"in s&&"onabort"in s||h(""===s.responseText?"error":"load",e):3===s.readyState?"onprogress"in s||c():2===s.readyState&&l())}(e)}),!("contentType"in s)&&"ontimeout"in o.prototype||(t+=(-1===t.indexOf("?")?"?":"&")+"padding=true"),s.open(e,t,!0),"readyState"in s&&(u=r((function(){f()}),0))},v.prototype.abort=function(){this._abort(!1)},v.prototype.getResponseHeader=function(e){return this._contentType},v.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},v.prototype.getAllResponseHeaders=function(){return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},v.prototype.send=function(){if("ontimeout"in o.prototype&&("sendAsBinary"in o.prototype||"mozAnon"in o.prototype)||null==l||null==l.readyState||"complete"===l.readyState){var e=this._xhr;"withCredentials"in e&&(e.withCredentials=this.withCredentials);try{e.send(void 0)}catch(e){throw e}}else{var t=this;t._sendTimeout=r((function(){t._sendTimeout=0,t.send()}),4)}},T.prototype.get=function(e){return this._map[y(e)]},null!=o&&null==o.HEADERS_RECEIVED&&(o.HEADERS_RECEIVED=2),S.prototype.open=function(e,t,n,r,i,s,a){e.open("GET",i);var u=0;for(var l in e.onprogress=function(){var t=e.responseText.slice(u);u+=t.length,n(t)},e.onerror=function(e){e.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===o.HEADERS_RECEIVED){var n=e.status,r=e.statusText,i=e.getResponseHeader("Content-Type"),s=e.getAllResponseHeaders();t(n,r,i,new T(s))}},e.withCredentials=s,a)Object.prototype.hasOwnProperty.call(a,l)&&e.setRequestHeader(l,a[l]);return e.send(),e},E.prototype.get=function(e){return this._headers.get(e)},C.prototype.open=function(e,t,n,r,i,o,s){var a=null,u=new g,l=u.signal,f=new d;return h(i,{headers:s,credentials:o?"include":"same-origin",signal:l,cache:"no-store"}).then((function(e){return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new E(e.headers)),new c((function(e,t){var r=function(){a.read().then((function(t){if(t.done)e(void 0);else{var i=f.decode(t.value,{stream:!0});n(i),r()}})).catch((function(e){t(e)}))};r()}))})).catch((function(e){return"AbortError"===e.name?void 0:e})).then((function(e){r(e)})),{abort:function(){null!=a&&a.cancel(),u.abort()}}},w.prototype.dispatchEvent=function(e){e.target=this;var t=this._listeners[e.type];if(null!=t)for(var n=t.length,r=0;r<n;r+=1){var i=t[r];try{"function"==typeof i.handleEvent?i.handleEvent(e):i.call(this,e)}catch(e){b(e)}}},w.prototype.addEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];null==r&&(r=[],n[e]=r);for(var i=!1,o=0;o<r.length;o+=1)r[o]===t&&(i=!0);i||r.push(t)},w.prototype.removeEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];if(null!=r){for(var i=[],o=0;o<r.length;o+=1)r[o]!==t&&i.push(r[o]);0===i.length?delete n[e]:n[e]=i}},R.prototype=Object.create(I.prototype),O.prototype=Object.create(I.prototype),D.prototype=Object.create(I.prototype);var k=-1,M=0,q=1,N=2,U=-1,x=0,P=1,L=2,B=3,F=/^text\/event\-stream(;.*)?$/i,H=function(e,t){var n=null==e?t:parseInt(e,10);return n!=n&&(n=t),G(n)},G=function(e){return Math.min(Math.max(e,1e3),18e6)},Y=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){b(e)}};function j(e,t){w.call(this),t=t||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,function(e,t,n){t=String(t);var a=Boolean(n.withCredentials),u=n.lastEventIdQueryParameterName||"lastEventId",l=G(1e3),c=H(n.heartbeatTimeout,45e3),h="",f=l,d=!1,p=0,g=n.headers||{},m=n.Transport,_=Q&&null==m?void 0:new v(null!=m?new m:null!=o&&"withCredentials"in o.prototype||null==s?new o:new s),A=null!=m&&"string"!=typeof m?new m:null==_?new C:new S,y=void 0,T=0,E=k,w="",b="",I="",j="",W=x,K=0,z=0,J=function(t,n,r,i){if(E===M)if(200===t&&null!=r&&F.test(r)){E=q,d=Date.now(),f=l,e.readyState=q;var o=new O("open",{status:t,statusText:n,headers:i});e.dispatchEvent(o),Y(e,e.onopen,o)}else{var s="";200!==t?(n&&(n=n.replace(/\s+/g," ")),s="EventSource's response has a status "+t+" "+n+" that is not 200. Aborting the connection."):s="EventSource's response has a Content-Type specifying an unsupported type: "+(null==r?"-":r.replace(/\s+/g," "))+". Aborting the connection.",X();o=new O("error",{status:t,statusText:n,headers:i});e.dispatchEvent(o),Y(e,e.onerror,o),console.error(s)}},V=function(t){if(E===q){for(var n=-1,o=0;o<t.length;o+=1){(u=t.charCodeAt(o))!=="\n".charCodeAt(0)&&u!=="\r".charCodeAt(0)||(n=o)}var s=(-1!==n?j:"")+t.slice(0,n+1);j=(-1===n?j:"")+t.slice(n+1),""!==t&&(d=Date.now(),p+=t.length);for(var a=0;a<s.length;a+=1){var u=s.charCodeAt(a);if(W===U&&u==="\n".charCodeAt(0))W=x;else if(W===U&&(W=x),u==="\r".charCodeAt(0)||u==="\n".charCodeAt(0)){if(W!==x){W===P&&(z=a+1);var g=s.slice(K,z-1),m=s.slice(z+(z<a&&s.charCodeAt(z)===" ".charCodeAt(0)?1:0),a);"data"===g?(w+="\n",w+=m):"id"===g?b=m:"event"===g?I=m:"retry"===g?(l=H(m,l),f=l):"heartbeatTimeout"===g&&(c=H(m,c),0!==T&&(i(T),T=r((function(){$()}),c)))}if(W===x){if(""!==w){h=b,""===I&&(I="message");var _=new R(I,{data:w.slice(1),lastEventId:b});if(e.dispatchEvent(_),"open"===I?Y(e,e.onopen,_):"message"===I?Y(e,e.onmessage,_):"error"===I&&Y(e,e.onerror,_),E===N)return}w="",I=""}W=u==="\r".charCodeAt(0)?U:x}else W===x&&(K=a,W=P),W===P?u===":".charCodeAt(0)&&(z=a+1,W=L):W===L&&(W=B)}}},Z=function(t){if(E===q||E===M){E=k,0!==T&&(i(T),T=0),T=r((function(){$()}),f),f=G(Math.min(16*l,2*f)),e.readyState=M;var n=new D("error",{error:t});e.dispatchEvent(n),Y(e,e.onerror,n),null!=t&&console.error(t)}},X=function(){E=N,null!=y&&(y.abort(),y=void 0),0!==T&&(i(T),T=0),e.readyState=N},$=function(){if(T=0,E===k){d=!1,p=0,T=r((function(){$()}),c),E=M,w="",I="",b=h,j="",K=0,z=0,W=x;var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==h){var i=t.indexOf("?");n=-1===i?t:t.slice(0,i+1)+t.slice(i+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(e,t){return t===u?"":e})),n+=(-1===t.indexOf("?")?"?":"&")+u+"="+encodeURIComponent(h)}var o=e.withCredentials,s={Accept:"text/event-stream"},a=e.headers;if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(s[l]=a[l]);try{y=A.open(_,J,V,Z,n,o,s)}catch(e){throw X(),e}}else if(d||null==y){var f=Math.max((d||Date.now())+c-Date.now(),1);d=!1,T=r((function(){$()}),f)}else Z(new Error("No activity within "+c+" milliseconds. "+(E===M?"No response received.":p+" chars received.")+" Reconnecting.")),null!=y&&(y.abort(),y=void 0)};e.url=t,e.readyState=M,e.withCredentials=a,e.headers=g,e._close=X,$()}(this,e,t)}var Q=null!=h&&null!=f&&"body"in f.prototype;j.prototype=Object.create(w.prototype),j.prototype.CONNECTING=M,j.prototype.OPEN=q,j.prototype.CLOSED=N,j.prototype.close=function(){this._close()},j.CONNECTING=M,j.OPEN=q,j.CLOSED=N,j.prototype.withCredentials=void 0;var W,K=u;null==o||null!=u&&"withCredentials"in u.prototype||(K=j),W=function(e){e.EventSourcePolyfill=j,e.NativeEventSource=u,e.EventSource=K}(t),void 0!==W&&(e.exports=W)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:i:globalThis)}(hu,hu.exports);var fu,du,pu=hu.exports,gu={exports:{}},mu=o(gu.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",a="day",u="week",l="month",c="quarter",h="year",f="date",d="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},A={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+_(r,2,"0")+":"+_(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),o=n-i<0,s=t.clone().add(r+(o?-1:1),l);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:h,w:u,d:a,D:f,h:s,m:o,s:i,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",y={};y[v]=m;var T="$isDayjsObject",S=function(e){return e instanceof b||!(!e||!e[T])},E=function e(t,n,r){var i;if(!t)return v;if("string"==typeof t){var o=t.toLowerCase();y[o]&&(i=o),n&&(y[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;y[a]=t,i=a}return!r&&i&&(v=i),i||!r&&v},C=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new b(n)},w=A;w.l=E,w.i=S,w.w=function(e,t){return C(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var b=function(){function m(e){this.$L=E(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[T]=!0}var _=m.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return w},_.isValid=function(){return!(this.$d.toString()===d)},_.isSame=function(e,t){var n=C(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return C(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<C(e)},_.$g=function(e,t,n){return w.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!w.u(t)||t,c=w.p(e),d=function(e,t){var i=w.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(a)},p=function(e,t){return w.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,m=this.$M,_=this.$D,A="set"+(this.$u?"UTC":"");switch(c){case h:return r?d(1,0):d(31,11);case l:return r?d(1,m):d(0,m+1);case u:var v=this.$locale().weekStart||0,y=(g<v?g+7:g)-v;return d(r?_-y:_+(6-y),m);case a:case f:return p(A+"Hours",0);case s:return p(A+"Minutes",1);case o:return p(A+"Seconds",2);case i:return p(A+"Milliseconds",3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,u=w.p(e),c="set"+(this.$u?"UTC":""),d=(n={},n[a]=c+"Date",n[f]=c+"Date",n[l]=c+"Month",n[h]=c+"FullYear",n[s]=c+"Hours",n[o]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[u],p=u===a?this.$D+(t-this.$W):t;if(u===l||u===h){var g=this.clone().set(f,1);g.$d[d](p),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[w.p(e)]()},_.add=function(r,c){var f,d=this;r=Number(r);var p=w.p(c),g=function(e){var t=C(d);return w.w(t.date(t.date()+Math.round(e*r)),d)};if(p===l)return this.set(l,this.$M+r);if(p===h)return this.set(h,this.$y+r);if(p===a)return g(1);if(p===u)return g(7);var m=(f={},f[o]=t,f[s]=n,f[i]=e,f)[p]||1,_=this.$d.getTime()+r*m;return w.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=w.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,l=n.months,c=n.meridiem,h=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},f=function(e){return w.s(o%12||12,e,"0")},p=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(g,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return w.s(t.$y,4,"0");case"M":return a+1;case"MM":return w.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,l,3);case"MMMM":return h(l,a);case"D":return t.$D;case"DD":return w.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(n.weekdaysMin,t.$W,u,2);case"ddd":return h(n.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(o);case"HH":return w.s(o,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(o,s,!0);case"A":return p(o,s,!1);case"m":return String(s);case"mm":return w.s(s,2,"0");case"s":return String(t.$s);case"ss":return w.s(t.$s,2,"0");case"SSS":return w.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,d){var p,g=this,m=w.p(f),_=C(r),A=(_.utcOffset()-this.utcOffset())*t,v=this-_,y=function(){return w.m(g,_)};switch(m){case h:p=y()/12;break;case l:p=y();break;case c:p=y()/3;break;case u:p=(v-A)/6048e5;break;case a:p=(v-A)/864e5;break;case s:p=v/n;break;case o:p=v/t;break;case i:p=v/e;break;default:p=v}return d?p:w.a(p)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return y[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=E(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return w.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},m}(),I=b.prototype;return C.prototype=I,[["$ms",r],["$s",i],["$m",o],["$H",s],["$W",a],["$M",l],["$y",h],["$D",f]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),C.extend=function(e,t){return e.$i||(e(t,b,C),e.$i=!0),C},C.locale=E,C.isDayjs=S,C.unix=function(e){return C(1e3*e)},C.en=y[v],C.Ls=y,C.p={},C}()),_u="aks_agent_token",Au=function(){function r(e){this.baseUrl="",this.eventSource=null,this.retryCount=0,this.retryMap=new Map,this.token="",this.id=e.id,this.getSystemToken=e.getSystemToken,this.resetSSE=e.resetSSE,this.retryCount=e.retryCount||0,this.baseUrl=e.baseUrl||""}return r.prototype.validateToken=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,fetch("".concat(this.baseUrl,"/iam/token/validate?accountId=").concat(e),{method:"GET",headers:{authentication:r}}).then((function(e){return e.json()}))]}))}))},r.prototype.initToken=function(){return t(this,void 0,void 0,(function(){var e,t,r;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.getSystemToken()];case 1:return(e=n.sent())?[4,this.validateToken(this.id,e)]:[2,{code:au.FAILED,data:null,message:"get system token failed"}];case 2:return(t=n.sent()).code===au.SUCCESS?(this.token=e,sessionStorage.setItem(_u,e),this.executePeriodically(this.refreshToken.bind(this),12e5),[2,{code:au.SUCCESS,data:null,message:t.message}]):[2,{code:au.FAILED,data:null,message:t.message}];case 3:return r=n.sent(),[2,{code:au.FAILED,data:null,message:(null==r?void 0:r.toString())||"system error"}];case 4:return[2]}}))}))},r.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var e=this;return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/iam/oauth2/refresh")}).then((function(t){t.token&&(e.token=t.token,sessionStorage.setItem(_u,t.token),e.eventSource&&e.resetSSE())}))]}))}))},r.prototype.getAgentStatusList=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.request({url:"".concat(this.baseUrl,"/voipPlatform/agent/status/list")})]}))}))},r.prototype.getAgentInfo=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.request({url:"".concat(this.baseUrl,"/voipPlatform/agent/getAgentByUserId")})]}))}))},r.prototype.getAgentSetting=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/call_tasks/getAgentSetting"),data:e})]}))}))},r.prototype.updateAgentHangup=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/agent/").concat(e),method:"PUT"})]}))}))},r.prototype.updateAgentTicket=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({method:"POST",url:"".concat(this.baseUrl,"/voipPlatform/agent/ticket"),data:e})]}))}))},r.prototype.registerSSE=function(e){return t(this,void 0,void 0,(function(){var r,i,o,s,a,u=this;return n(this,(function(l){return r=e.agentId,i=e.onMessage,o=function(e){},s=new Promise((function(e){o=e})),a=this.token,this.eventSource=new pu.EventSourcePolyfill("".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_event?agentId=").concat(r),{headers:{Authentication:a,"Cache-Control":"no-cache",Connection:"keep-alive"},heartbeatTimeout:12e6}),this.eventSource.onmessage=i,this.eventSource.onopen=function(){return t(u,void 0,void 0,(function(){return n(this,(function(e){return o(!0),[2]}))}))},this.eventSource.onerror=function(){return t(u,void 0,void 0,(function(){return n(this,(function(e){return o(!1),[2]}))}))},[2,s]}))}))},r.prototype.closeSSE=function(e){return t(this,void 0,void 0,(function(){var t,r,i=this;return n(this,(function(n){return t=e.agentId,r=e.clearTicket,this.eventSource?[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_close?agentId=").concat(t,"&clearTicket=").concat(r)}).then((function(){i.eventSource.close(),i.eventSource=null}))]:[2]}))}))},r.prototype.switchAgentStatus=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({method:"PUT",url:"".concat(this.baseUrl,"/voipPlatform/agent/agentStatusSwitch"),data:e})]}))}))},r.prototype.outboundCall=function(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){return t=e.phone,r=e.line,[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/agentOutBoundCall/dialer/startCall/").concat(t,"/").concat(r),method:"POST"})]}))}))},r.prototype.saveAgentResponseTime=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({method:"POST",url:"".concat(this.baseUrl,"/crm/v1/call_record/callRecordAgent"),data:e})]}))}))},r.prototype.getCallTaskInfo=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/call_tasks/getCallTaskName/").concat(e.callTaskId)})]}))}))},r.prototype.getAfterCallProcessTime=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.request({url:"".concat(this.baseUrl,"/crm/v1/predictCall/afterCallProcessTime/").concat(e.callTaskId)})]}))}))},r.prototype.formatFormData=function(e){var t=new FormData;for(var n in e)e[n]&&t.append(n,e[n]);return t},r.prototype.agentAbnormalClose=function(e){e.createTime||(e.createTime=mu().format("yyyy-MM-DD HH:mm:ss")),e.sendTime=mu().format("yyyy-MM-DD HH:mm:ss"),e.Authentication=this.getTokenWithFallback();var t=this.formatFormData(e);return this.request({method:"POST",url:"".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_abnormal_close"),data:t},!0)},r.prototype.sendBeacon=function(e){if("function"==typeof navigator.sendBeacon&&e.url){e.createTime||(e.createTime=mu().format("yyyy-MM-DD HH:mm:ss")),e.sendTime=mu().format("yyyy-MM-DD HH:mm:ss"),e.Authentication=this.getTokenWithFallback();var t=e.url,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["url"]),r=this.formatFormData(n),i=navigator.sendBeacon(t,r);if(!i){e.lastSendResult=i;var o=JSON.parse(localStorage.getItem("aks_beacon_queue")||"[]");o.push(e),localStorage.setItem("aks_beacon_queue",JSON.stringify(o))}}},r.prototype.clearnSendBeaconQueue=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return(e=JSON.parse(localStorage.getItem("aks_beacon_queue")||"[]")).length?[4,this.waitToken()]:[3,4];case 1:return n.sent()?[3,3]:[4,this.initToken()];case 2:if(n.sent().code!==au.SUCCESS)return[2];n.label=3;case 3:for(t=0;t<e.length-1;t++)this.sendBeacon(e[t]);n.label=4;case 4:return[2]}}))}))},r.prototype.getTokenWithFallback=function(){return this.token?this.token:sessionStorage.getItem(_u)||""},r.prototype.waitToken=function(e,t){var n=this;return void 0===e&&(e=3e3),void 0===t&&(t=200),new Promise((function(r){var i=setInterval((function(){((e-=t)<=0||n.token)&&(clearInterval(i),r(Boolean(n.token)))}),200)}))},r.prototype.request=function(r){return t(this,arguments,void 0,(function(r,i){var o,s,a,u=this;return void 0===i&&(i=!1),n(this,(function(l){switch(l.label){case 0:return!this.retryMap.has(r.url)&&this.retryCount&&this.retryMap.set(r.url,this.retryCount),this.token?[3,3]:[4,this.waitToken()];case 1:return l.sent()?[3,3]:[4,this.initToken()];case 2:if((o=l.sent()).code!==au.SUCCESS)return[2,{code:o.code,message:o.message,data:null}];l.label=3;case 3:return s={method:r.method||"GET",headers:e({"Content-Type":"application/json",authentication:this.token},r.headers)},i?(s.method=r.method,s.headers={authentication:this.token},s.body=r.data):"GET"!==(null===(a=s.method)||void 0===a?void 0:a.toLocaleUpperCase())&&(s.body=JSON.stringify(r.data)),[2,fetch(r.url,s).then((function(e){return t(u,void 0,void 0,(function(){var t,i;return n(this,(function(n){switch(n.label){case 0:return t=this.retryMap.get(r.url),401!==e.status?[3,3]:t?(this.retryMap.set(r.url,t-1),[4,this.initToken()]):[3,2];case 1:return(i=n.sent()).code===au.SUCCESS?[2,this.request(r)]:[2,i];case 2:return this.retryCount&&this.retryMap.delete(r.url),[2,{code:au.UNAUTHORIZED,message:"Unauthorized",data:null}];case 3:return[2,e.json()]}}))}))}))]}}))}))},r.prototype.executePeriodically=function(e,t){var n=Date.now()+t,r=function(){var i=Date.now();i>=n&&(e(),n+=t);var o=Math.max(0,n-i);setTimeout(r,o)};r()},r.getInstance=function(e){return!r.instance&&e&&(r.instance=new r(e)),r.instance},r.instance=null,r}();!function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE",e[e.HANGUP=4]="HANGUP"}(fu||(fu={})),function(e){e[e.ANSWER=1]="ANSWER",e[e.HANGUP=2]="HANGUP"}(du||(du={}));var vu=function(){function i(e){var t=this;this.sip={},this.api={},this.isSipInit=!1,this.isInitSuccess=!1,this.agentInfo={},this.initEvent={},this.agentEvent={},this.agentWaitingTime=0,this.agentResponseTime=0,this.timer=null,this.callDetails={},this.unloadingHandled=!1,this.baseUrl="",this.autoFinishACWTimer=null,this.baseUrl=(null==e?void 0:e.baseUrl)||"",this.api=Au.getInstance({id:e.id,getSystemToken:e.getSystemToken,resetSSE:this.resetSSE.bind(this),retryCount:e.retryCount,baseUrl:this.baseUrl}),this.sip=new cu({incomingCallCallback:this.incomingCall.bind(this),getMediaStream:null==e?void 0:e.getMediaStream}),this.sip.attchSessionEvent("ended",this.sessionEnded.bind(this)),this.sip.attchSessionEvent("failed",this.sessionFailed.bind(this)),this.init().then((function(){t.api.clearnSendBeaconQueue()}))}return i.prototype.init=function(){return t(this,void 0,void 0,(function(){var t,r,i,o,s;return n(this,(function(n){switch(n.label){case 0:return[4,this.api.initToken()];case 1:return(t=n.sent()).code!==au.SUCCESS?(r=e(e({},t),{code:uu.FAILED}),this.emitInitEvent("failed",r),this.isInitSuccess=!1,[2,r]):[4,this.getAgentStatus()];case 2:return(i=n.sent()).code!==uu.SUCCESS?(o=e(e({},i),{code:i.code===uu.LOCKED?uu.LOCKED:uu.FAILED}),this.emitInitEvent("failed",o),this.isInitSuccess=!1,[2,o]):(s={code:uu.SUCCESS,data:null,message:"success"},this.emitInitEvent("success",s),this.isInitSuccess=!0,[2,s])}}))}))},i.prototype.getAgentStatusList=function(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,this.api.getAgentStatusList()];case 1:return(e=t.sent()).code===au.SUCCESS?[2,{code:uu.SUCCESS,data:e.data||[],message:e.message}]:[2,{code:uu.FAILED,data:null,message:e.message}]}}))}))},i.prototype.getTicket=function(){var e=window.sessionStorage.getItem("wiz-agent-ticket");return e||(e=r(),window.sessionStorage.setItem("wiz-agent-ticket",e)),e},i.prototype.getHostName=function(e){try{return new URL(e).hostname}catch(e){return""}},i.prototype.processSSEMessage=function(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=JSON.parse(null==e?void 0:e.data)||{},r=this.agentInfo.statusName,-1===t.agentId?[3,2]:[4,this.offlineAgent(r)];case 1:n.sent(),1===t.status&&this.onlineAgent(r),n.label=2;case 2:return[2]}}))}))},i.prototype.resetSSE=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.api.closeSSE({agentId:this.agentInfo.id,clearTicket:1})];case 1:return e.sent(),[4,this.api.registerSSE({agentId:this.agentInfo.id,onMessage:this.processSSEMessage.bind(this)})];case 2:return e.sent(),[2]}}))}))},i.prototype.createSSEAndOpensips=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return this.api.registerSSE({agentId:e,onMessage:this.processSSEMessage.bind(this)})?[3,2]:[4,this.api.updateAgentTicket({agentId:e,ticket:r,type:fu.OFFLINE})];case 1:return t.sent().code!==au.SUCCESS?[2,{code:uu.FAILED,message:"Registration of SSE failed and update Agent Ticket failed"}]:[2,{code:uu.FAILED,message:"Registration of SSE failed"}];case 2:return[4,this.waitSIPRegistered(7e3)];case 3:return t.sent()?[3,5]:[4,this.api.closeSSE({agentId:e,clearTicket:1})];case 4:return t.sent(),[2,{code:uu.FAILED,message:"SIP registration failed"}];case 5:return[2,{code:uu.SUCCESS,message:"success"}]}}))}))},i.prototype.waitSIPRegistered=function(){return t(this,arguments,void 0,(function(e){var t=this;return void 0===e&&(e=7e3),n(this,(function(n){return[2,new Promise((function(n){var r=!1,i=function(e){r||(r=!0,n(e))};t.sip.on("registered",(function(){return i(!0)})),t.sip.on("registrationFailed",(function(){return i(!1)})),setTimeout((function(){return i(!1)}),e),t.sip.start()}))]}))}))},i.prototype.getAgentInfo=function(){return t(this,void 0,void 0,(function(){var e,t,r,i,o,s;return n(this,(function(n){switch(n.label){case 0:return[4,this.api.getAgentInfo()];case 1:return"code"in(e=n.sent())&&e.code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:e.message}]:"data"in e&&(null===(s=e.data)||void 0===s?void 0:s[0])?(t=e.data[0],this.agentInfo=t,r=t.ticket,i=this.getTicket(),r&&r!==i?[2,{code:uu.LOCKED,data:t,message:"Agent ticket occupied, unable to perform agent online or offline."}]:(this.isSipInit||(o="sip:".concat(t.number,"@").concat(this.getHostName(t.realm)),this.sip.init({wssuri:t.realm,password:t.password,uri:o}),this.isSipInit=!0),[2,{code:uu.SUCCESS,data:t,message:e.message}])):[2,{code:uu.FAILED,data:null,message:"Agent not found"}]}}))}))},i.prototype.getAgentStatus=function(){return t(this,void 0,void 0,(function(){var e,t,i,o,s,a,u,l,c,h;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,Promise.allSettled([this.getAgentInfo(),this.api.getAgentSetting({key:"callCenter"})])];case 1:return e=n.sent(),t=e.map((function(e){return"fulfilled"!==e.status?{code:au.FAILED,data:null,message:"system error"}:e.value})),i=t[0],"agentWaitingTime"in(o=t[1])&&(this.agentWaitingTime=o.agentWaitingTime||0),"code"in i&&i.code!==uu.SUCCESS?[2,{code:i.code===uu.LOCKED?uu.LOCKED:uu.FAILED,data:null,message:i.message}]:"data"in i&&i.data?(s=i.data,a=s.status,u=s.id,l=s.groupId,c={code:uu.SUCCESS,data:{id:u,groupId:l,status:a,subStatus:s.statusName},message:"success"},this.agentInfo=s,a===fu.OFFLINE?[2,c]:a!==fu.ONLINE?[3,4]:i.code===uu.LOCKED?[2,{code:uu.LOCKED,data:null,message:i.message}]:[4,this.api.agentAbnormalClose({id:u,groupId:l,trace:r()})]):[2,{code:uu.FAILED,data:null,message:"Agent not found"}];case 2:return n.sent(),[4,this.api.switchAgentStatus({id:u,groupId:l,status:fu.OFFLINE,subStatus:"offline"})];case 3:return(h=n.sent()).code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:h.message}]:(c.data.status=fu.OFFLINE,c.data.subStatus="Offline",[2,c]);case 4:return[2,{code:uu.FAILED,data:null,message:"system error"}];case 5:return n.sent(),[2,{code:uu.FAILED,data:null,message:"system error"}];case 6:return[2]}}))}))},i.prototype.onlineAgent=function(e){return t(this,void 0,void 0,(function(){var t,r,i,o,s,a,u,l,c,h,f;return n(this,(function(n){switch(n.label){case 0:return t=this.agentInfo,r=t.status,i=t.id,o=t.groupId,r!==fu.ONLINE?[3,2]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:fu.ONLINE,subStatus:e})];case 1:return(u=n.sent()).code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:u.message}]:(f={code:uu.SUCCESS,data:{status:fu.ONLINE,subStatus:e},message:"Agent is already online"},this.agentInfo.statusName=e,this.emitAgentEvent("online",f),[2,f]);case 2:return r!==fu.OFFLINE?[3,6]:(s=this.getTicket(),[4,this.api.updateAgentTicket({agentId:i,ticket:s,type:fu.ONLINE})]);case 3:return(a=n.sent()).code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:a.message}]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:fu.ONLINE,subStatus:e})];case 4:return(u=n.sent()).code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:u.message}]:[4,this.createSSEAndOpensips(i,s)];case 5:return l=n.sent(),c=l.code,h=l.message,c!==uu.SUCCESS?[2,{code:uu.FAILED,data:null,message:h}]:(f={code:c,data:{status:fu.ONLINE,subStatus:e},message:h},this.agentInfo.status=fu.ONLINE,this.agentInfo.statusName=e,this.emitAgentEvent("online",f),[2,f]);case 6:return[2,{code:uu.FAILED,data:null,message:"Agent Status is not valid"}]}}))}))},i.prototype.offlineAgent=function(e){return t(this,void 0,void 0,(function(){var t,r,i,o,s,a;return n(this,(function(n){switch(n.label){case 0:return t=this.agentInfo,r=t.status,i=t.id,o=t.groupId,r!==fu.OFFLINE?[3,2]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:fu.OFFLINE,subStatus:e})];case 1:return(s=n.sent()).code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:s.message}]:(a={code:uu.SUCCESS,data:{status:fu.OFFLINE,subStatus:e},message:"Agent is already offline"},this.agentInfo.statusName=e,this.emitAgentEvent("offline",a),[2,a]);case 2:return r!==fu.ONLINE?[3,4]:[4,this.api.switchAgentStatus({id:i,groupId:o,status:fu.OFFLINE,subStatus:e})];case 3:return(s=n.sent()).code!==au.SUCCESS?[2,{code:uu.FAILED,data:null,message:s.message}]:(this.api.closeSSE({agentId:i,clearTicket:1}),this.sip.stop(!0),a={code:uu.SUCCESS,data:{status:fu.OFFLINE,subStatus:e},message:"Agent is already offline"},this.emitAgentEvent("offline",a),this.agentInfo.status=fu.OFFLINE,this.agentInfo.statusName=e,[2,a]);case 4:return[2,{code:uu.FAILED,data:null,message:"Agent Status is not valid"}]}}))}))},i.prototype.switchAgentStatus=function(e){return t(this,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return this.isInitSuccess?[4,this.getAgentInfo()]:[2,{code:uu.FAILED,data:null,message:"SIP Registration failed, Registration failed. Seat online and offline cannot be performed."}];case 1:return(t=n.sent()).code!==uu.SUCCESS?[2,{code:t.code===uu.LOCKED?uu.LOCKED:uu.FAILED,data:null,message:t.message}]:(r=e.status,i=e.subStatus,r===fu.ONLINE?[2,this.onlineAgent(i)]:r===fu.OFFLINE?[2,this.offlineAgent(i)]:[2,{code:uu.FAILED,data:null,message:"system error"}])}}))}))},i.prototype.outboundCall=function(e){return t(this,void 0,void 0,(function(){var t,r=this;return n(this,(function(n){return this.isInitSuccess?(t=this.agentInfo.outboundLineId)?[2,this.api.outboundCall({phone:e,line:t}).then((function(e){return e.code===au.SUCCESS?(r.sip.setCallType("outboundCall"),{code:uu.SUCCESS,data:e.data,message:e.message||e.msg}):{code:uu.FAILED,data:null,message:e.message||e.msg}}))]:[2,Promise.resolve({code:uu.FAILED,data:null,message:"Agent has no outbound line"})]:[2,{code:uu.FAILED,data:null,message:"SIP Registration failed, Outbound calls cannot be made."}]}))}))},i.prototype.autoFinishACW=function(){var e=this,t=Number(this.callDetails.afterCallProcessTime),n=function(){t<=0?e.finshACW():(t-=1,e.autoFinishACWTimer=setTimeout(n,1e3))};this.autoFinishACWTimer=setTimeout(n,1e3)},i.prototype.finshACW=function(){return t(this,void 0,void 0,(function(){var e,t,r,i;return n(this,(function(n){switch(n.label){case 0:return this.autoFinishACWTimer&&(clearTimeout(this.autoFinishACWTimer),this.autoFinishACWTimer=null),e=this.agentInfo,t=e.id,r=e.groupId,[4,this.api.switchAgentStatus({id:t,groupId:r,status:fu.HANGUP})];case 1:return[2,{code:(i=n.sent()).code===au.SUCCESS?uu.SUCCESS:uu.FAILED,data:null,message:i.message}]}}))}))},i.prototype.sessionEnded=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this.autoFinishACW(),[2]}))}))},i.prototype.sessionFailed=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return this.api.updateAgentHangup(this.agentInfo.id),[2]}))}))},i.prototype.openOnunload=function(){var e=this;window.onbeforeunload=function(e){e.returnValue="beforeunload"},window.onunload=function(){e.doForceOfflineCleanup()},this.unloadingHandled=!1},i.prototype.cancelOnunload=function(){window.onbeforeunload=function(){},window.onunload=function(){},this.unloadingHandled=!1},i.prototype.doForceOfflineCleanup=function(){if(!this.unloadingHandled){this.unloadingHandled=!0;var e="".concat(this.baseUrl,"/crm/v1/agent_command/regist_agent_abnormal_close");this.api.sendBeacon({url:e,id:this.agentInfo.id,groupId:this.agentInfo.groupId,trace:r()})}},i.prototype.saveAgentResponseTime=function(e){this.api.saveAgentResponseTime({callId:this.callDetails.callId,agentId:this.agentInfo.id,agentResponseTime:this.agentResponseTime,agentGroupId:this.agentInfo.groupId,resultType:e}),this.timer&&(clearInterval(this.timer),this.agentResponseTime=0)},i.prototype.hangup=function(){this.sip.hangup()},i.prototype.timingResTime=function(){var e=this;this.timer&&(clearInterval(this.timer),this.timer=null);var t=this.agentWaitingTime;this.agentResponseTime=0,this.timer=setInterval((function(){if(t<=0)return clearInterval((null==e?void 0:e.timer)||0),e.timer=null,void e.ignore();t-=1,e.agentResponseTime+=1}),1e3)},i.prototype.incomingCall=function(e){return t(this,void 0,void 0,(function(){var t,r,i,o,s,a,u,l,c,h,f,d,p,g,m,_,A,v,y,T;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),t=e.request,r=(null===(_=null===(m=t.headers["Call-Param"])||void 0===m?void 0:m[0])||void 0===_?void 0:_.raw)||"",i=r?atob(r):"",o=JSON.parse(i||"{}"),s=(null===(v=null===(A=t.headers["Call-Task"])||void 0===A?void 0:A[0])||void 0===v?void 0:v.raw)||"",a=(null===(T=null===(y=t.headers["Call-Record-Id"])||void 0===y?void 0:y[0])||void 0===T?void 0:T.raw)||null,u=Object.fromEntries(Object.entries(o).filter((function(e){return""!==e[0]}))),l="",c="",s?[4,Promise.allSettled([this.api.getCallTaskInfo({callTaskId:s}),this.api.getAfterCallProcessTime({callTaskId:s})])]:[3,2];case 1:h=n.sent(),f=h[0],d=h[1],"fulfilled"===f.status&&(l=f.value.name||""),"fulfilled"===d.status&&(p=d.value).code===uu.SUCCESS&&(c=String(p.data||"")),n.label=2;case 2:return this.callDetails={callId:a||"",callType:this.sip.getCallType()||"",taskName:l,afterCallProcessTime:c,phone:u.phone||u.Phone||u.PHONE||"",contactId:u.contactId||u.ContactId||u.CONTACT_ID||"",extraJson:u},this.timingResTime(),[2,Promise.resolve({code:uu.SUCCESS,data:this.callDetails,message:"success"})];case 3:return g=n.sent(),[2,Promise.resolve({code:uu.FAILED,data:null,message:(null==g?void 0:g.toString())||"system error"})];case 4:return[2]}}))}))},i.prototype.answer=function(){this.sip.answer(),this.saveAgentResponseTime(du.ANSWER)},i.prototype.ignore=function(){this.sip.ignore(),this.saveAgentResponseTime(du.HANGUP)},i.prototype.mute=function(){this.sip.mute()},i.prototype.unmute=function(){this.sip.unmute()},i.prototype.attachInitEvent=function(e,t){t&&"function"==typeof t&&(this.initEvent[e]||(this.initEvent[e]=[]),this.initEvent[e].push(t))},i.prototype.removeInitEvent=function(e,t){var n=this.initEvent[e];if(n&&n.length)for(var r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}},i.prototype.emitInitEvent=function(e,t){(this.initEvent[e]||[]).forEach((function(e){e(t)}))},i.prototype.attachAgentEvent=function(e,t){t&&"function"==typeof t&&(this.agentEvent[e]||(this.agentEvent[e]=[]),this.agentEvent[e].push(t))},i.prototype.removeAgentEvent=function(e,t){var n=this.agentEvent[e];if(n&&n.length)for(var r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}},i.prototype.emitAgentEvent=function(e,t){(this.agentEvent[e]||[]).forEach((function(e){e(t)}))},i.prototype.attachAnswerEvent=function(e){this.sip.attachAnswerEvent(e)},i.prototype.removeAnswerEvent=function(e){this.sip.removeAnswerEvent(e)},i.prototype.attachNewMessageEvent=function(e){this.sip.attachNewMessageEvent(e)},i.prototype.removeNewMessageEvent=function(e){this.sip.removeNewMessageEvent(e)},i.prototype.attchSessionEvent=function(e,t){this.sip.attchSessionEvent(e,t)},i.prototype.removeSessionEvent=function(e,t){this.sip.removeSessionEvent(e,t)},i}();module.exports=vu;
|