text: (window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(40)},function(e,t,n){(function(r){t.log=function(){var e;return"object"===typeof console&&console.log&&(e=console).log.apply(e,arguments)},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;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(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(n){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!==typeof r&&"env"in r&&(e=Object({NODE_ENV:"production",PUBLIC_URL:""}).DEBUG);return 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;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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),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"],e.exports=n(55)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,n(54))},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(26);e.exports={USER_AGENT:"".concat(r.title," ").concat(r.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",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",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60}},function(e,t){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)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(3),i=n(12),o=n(7);t.str_utf8_length=function(e){return unescape(encodeURIComponent(e)).length};var a=t.isFunction=function(e){return void 0!==e&&"[object Function]"===Object.prototype.toString.call(e)};t.isString=function(e){return void 0!==e&&"[object String]"===Object.prototype.toString.call(e)},t.isDecimal=function(e){return!isNaN(e)&&parseFloat(e)===parseInt(e,10)},t.isEmpty=function(e){return null===e||""===e||void 0===e||Array.isArray(e)&&0===e.length||"number"===typeof e&&isNaN(e)},t.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 s=o[i];if(a(e[s]))return!1}return!0};var s=t.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};t.newTag=function(){return s(10)},t.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)})},t.hostType=function(e){if(e)return-1!==(e=o.parse(e,"host"))?e.host_type:void 0};var l=t.escapeUser=function(e){return encodeURIComponent(decodeURIComponent(e)).replace(/%3A/gi,":").replace(/%2B/gi,"+").replace(/%3F/gi,"?").replace(/%2F/gi,"/")};t.normalizeTarget=function(e,t){if(e){if(e instanceof i)return e;if("string"===typeof e){var n,o,a,s=e.split("@");switch(s.length){case 1:if(!t)return;n=e,o=t;break;case 2:n=s[0],o=s[1];break;default:n=s.slice(0,s.length-1).join("@"),o=s[s.length-1]}return n=n.replace(/^(sips?|tel):/i,""),/^[-.()]*\+?[0-9\-.()]+$/.test(n)&&(n=n.replace(/[-.()]/g,"")),e="".concat(r.SIP,":").concat(l(n),"@").concat(o),(a=i.parse(e))?a:void 0}}else;},t.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},t.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},t.getRandomTestNetIP=function(){return"192.0.2.".concat((e=1,t=254,Math.floor(Math.random()*(t-e+1)+e)));var e,t},t.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,a=(1073741823&e)+(1073741823&t);return i&o?2147483648^a^n^r:i|o?1073741824&a?3221225472^a^n^r:1073741824^a^n^r:a^n^r}function r(e,r,i,o,a,s,l){return e=n(e,n(n(function(e,t,n){return e&t|~e&n}(r,i,o),a),l)),n(t(e,s),r)}function i(e,r,i,o,a,s,l){return e=n(e,n(n(function(e,t,n){return e&n|t&~n}(r,i,o),a),l)),n(t(e,s),r)}function o(e,r,i,o,a,s,l){return e=n(e,n(n(function(e,t,n){return e^t^n}(r,i,o),a),l)),n(t(e,s),r)}function a(e,r,i,o,a,s,l){return e=n(e,n(n(function(e,t,n){return t^(e|~n)}(r,i,o),a),l)),n(t(e,s),r)}function s(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 l,u,c,d,f,p,h,m,v,_;for(l=function(e){for(var t,n=e.length,r=n+8,i=16*((r-r%64)/64+1),o=new Array(i-1),a=0,s=0;s<n;)a=s%4*8,o[t=(s-s%4)/4]=o[t]|e.charCodeAt(s)<<a,s++;return a=s%4*8,o[t=(s-s%4)/4]=o[t]|128<<a,o[i-2]=n<<3,o[i-1]=n>>>29,o}(e=function(e){e=e.replace(/\r\n/g,"\n");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)),h=1732584193,m=4023233417,v=2562383102,_=271733878,u=0;u<l.length;u+=16)c=h,d=m,f=v,p=_,h=r(h,m,v,_,l[u+0],7,3614090360),_=r(_,h,m,v,l[u+1],12,3905402710),v=r(v,_,h,m,l[u+2],17,606105819),m=r(m,v,_,h,l[u+3],22,3250441966),h=r(h,m,v,_,l[u+4],7,4118548399),_=r(_,h,m,v,l[u+5],12,1200080426),v=r(v,_,h,m,l[u+6],17,2821735955),m=r(m,v,_,h,l[u+7],22,4249261313),h=r(h,m,v,_,l[u+8],7,1770035416),_=r(_,h,m,v,l[u+9],12,2336552879),v=r(v,_,h,m,l[u+10],17,4294925233),m=r(m,v,_,h,l[u+11],22,2304563134),h=r(h,m,v,_,l[u+12],7,1804603682),_=r(_,h,m,v,l[u+13],12,4254626195),v=r(v,_,h,m,l[u+14],17,2792965006),h=i(h,m=r(m,v,_,h,l[u+15],22,1236535329),v,_,l[u+1],5,4129170786),_=i(_,h,m,v,l[u+6],9,3225465664),v=i(v,_,h,m,l[u+11],14,643717713),m=i(m,v,_,h,l[u+0],20,3921069994),h=i(h,m,v,_,l[u+5],5,3593408605),_=i(_,h,m,v,l[u+10],9,38016083),v=i(v,_,h,m,l[u+15],14,3634488961),m=i(m,v,_,h,l[u+4],20,3889429448),h=i(h,m,v,_,l[u+9],5,568446438),_=i(_,h,m,v,l[u+14],9,3275163606),v=i(v,_,h,m,l[u+3],14,4107603335),m=i(m,v,_,h,l[u+8],20,1163531501),h=i(h,m,v,_,l[u+13],5,2850285829),_=i(_,h,m,v,l[u+2],9,4243563512),v=i(v,_,h,m,l[u+7],14,1735328473),h=o(h,m=i(m,v,_,h,l[u+12],20,2368359562),v,_,l[u+5],4,4294588738),_=o(_,h,m,v,l[u+8],11,2272392833),v=o(v,_,h,m,l[u+11],16,1839030562),m=o(m,v,_,h,l[u+14],23,4259657740),h=o(h,m,v,_,l[u+1],4,2763975236),_=o(_,h,m,v,l[u+4],11,1272893353),v=o(v,_,h,m,l[u+7],16,4139469664),m=o(m,v,_,h,l[u+10],23,3200236656),h=o(h,m,v,_,l[u+13],4,681279174),_=o(_,h,m,v,l[u+0],11,3936430074),v=o(v,_,h,m,l[u+3],16,3572445317),m=o(m,v,_,h,l[u+6],23,76029189),h=o(h,m,v,_,l[u+9],4,3654602809),_=o(_,h,m,v,l[u+12],11,3873151461),v=o(v,_,h,m,l[u+15],16,530742520),h=a(h,m=o(m,v,_,h,l[u+2],23,3299628645),v,_,l[u+0],6,4096336452),_=a(_,h,m,v,l[u+7],10,1126891415),v=a(v,_,h,m,l[u+14],15,2878612391),m=a(m,v,_,h,l[u+5],21,4237533241),h=a(h,m,v,_,l[u+12],6,1700485571),_=a(_,h,m,v,l[u+3],10,2399980690),v=a(v,_,h,m,l[u+10],15,4293915773),m=a(m,v,_,h,l[u+1],21,2240044497),h=a(h,m,v,_,l[u+8],6,1873313359),_=a(_,h,m,v,l[u+15],10,4264355552),v=a(v,_,h,m,l[u+6],15,2734768916),m=a(m,v,_,h,l[u+13],21,1309151649),h=a(h,m,v,_,l[u+4],6,4149444226),_=a(_,h,m,v,l[u+11],10,3174756917),v=a(v,_,h,m,l[u+2],15,718787259),m=a(m,v,_,h,l[u+9],21,3951481745),h=n(h,c),m=n(m,d),v=n(v,f),_=n(_,p);return(s(h)+s(m)+s(v)+s(_)).toLowerCase()},t.closeMediaStream=function(e){if(e)try{var t;if(e.getTracks){t=e.getTracks();var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.stop()}}catch(_){r=!0,i=_}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}else{t=e.getAudioTracks();var s=!0,l=!1,u=void 0;try{for(var c,d=t[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){c.value.stop()}}catch(_){l=!0,u=_}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}t=e.getVideoTracks();var f=!0,p=!1,h=void 0;try{for(var m,v=t[Symbol.iterator]();!(f=(m=v.next()).done);f=!0){m.value.stop()}}catch(_){p=!0,h=_}finally{try{f||null==v.return||v.return()}finally{if(p)throw h}}}}catch(g){"function"!==typeof e.stop&&"object"!==typeof e.stop||e.stop()}},t.cloneArray=function(e){return e&&e.slice()||[]}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){e.exports=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,r){var i={CRLF:c,DIGIT:d,ALPHA:f,HEXDIG:p,WSP:h,OCTET:m,DQUOTE:v,SP:_,HTAB:g,alphanum:y,reserved:T,unreserved:C,mark:S,escaped:b,LWS:E,SWS:w,HCOLON:R,TEXT_UTF8_TRIM:A,TEXT_UTF8char:k,UTF8_NONASCII:x,UTF8_CONT:I,LHEX:function(){var e;null===(e=d())&&(/^[a-f]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[a-f]")));return e},token:P,token_nodot:O,separators:function(){var e;40===t.charCodeAt(o)?(e="(",o++):(e=null,0===a&&u('"("'));null===e&&(41===t.charCodeAt(o)?(e=")",o++):(e=null,0===a&&u('")"')),null===e&&(60===t.charCodeAt(o)?(e="<",o++):(e=null,0===a&&u('"<"')),null===e&&(62===t.charCodeAt(o)?(e=">",o++):(e=null,0===a&&u('">"')),null===e&&(64===t.charCodeAt(o)?(e="@",o++):(e=null,0===a&&u('"@"')),null===e&&(44===t.charCodeAt(o)?(e=",",o++):(e=null,0===a&&u('","')),null===e&&(59===t.charCodeAt(o)?(e=";",o++):(e=null,0===a&&u('";"')),null===e&&(58===t.charCodeAt(o)?(e=":",o++):(e=null,0===a&&u('":"')),null===e&&(92===t.charCodeAt(o)?(e="\\",o++):(e=null,0===a&&u('"\\\\"')),null===e&&null===(e=v())&&(47===t.charCodeAt(o)?(e="/",o++):(e=null,0===a&&u('"/"')),null===e&&(91===t.charCodeAt(o)?(e="[",o++):(e=null,0===a&&u('"["')),null===e&&(93===t.charCodeAt(o)?(e="]",o++):(e=null,0===a&&u('"]"')),null===e&&(63===t.charCodeAt(o)?(e="?",o++):(e=null,0===a&&u('"?"')),null===e&&(61===t.charCodeAt(o)?(e="=",o++):(e=null,0===a&&u('"="')),null===e&&(123===t.charCodeAt(o)?(e="{",o++):(e=null,0===a&&u('"{"')),null===e&&(125===t.charCodeAt(o)?(e="}",o++):(e=null,0===a&&u('"}"')),null===e&&null===(e=_())&&(e=g()))))))))))))))));return e},word:N,STAR:D,SLASH:M,EQUAL:U,LPAREN:L,RPAREN:F,RAQUOT:q,LAQUOT:H,COMMA:j,SEMI:z,COLON:G,LDQUOT:W,RDQUOT:V,comment:function e(){var t,n,r;var i;i=o;t=L();if(null!==t){for(n=[],null===(r=B())&&null===(r=Y())&&(r=e());null!==r;)n.push(r),null===(r=B())&&null===(r=Y())&&(r=e());null!==n&&null!==(r=F())?t=[t,n,r]:(t=null,o=i)}else t=null,o=i;return t},ctext:B,quoted_string:K,quoted_string_clean:$,qdtext:J,quoted_pair:Y,SIP_URI_noparams:Q,SIP_URI:X,uri_scheme:Z,uri_scheme_sips:ee,uri_scheme_sip:te,userinfo:ne,user:re,user_unreserved:ie,password:oe,hostport:ae,host:se,hostname:le,domainlabel:ue,toplabel:ce,IPv6reference:de,IPv6address:fe,h16:pe,ls32:he,IPv4address:me,dec_octet:ve,port:_e,uri_parameters:ge,uri_parameter:ye,transport_param:Te,user_param:Ce,method_param:Se,ttl_param:be,maddr_param:Ee,lr_param:we,other_param:Re,pname:Ae,pvalue:ke,paramchar:xe,param_unreserved:Ie,headers:Pe,header:Oe,hname:Ne,hvalue:De,hnv_unreserved:Me,Request_Response:function(){var e;null===(e=dt())&&(e=Ue());return e},Request_Line:Ue,Request_URI:Le,absoluteURI:Fe,hier_part:qe,net_path:He,abs_path:je,opaque_part:ze,uric:Ge,uric_no_slash:We,path_segments:Ve,segment:Be,param:Ke,pchar:$e,scheme:Je,authority:Ye,srvr:Qe,reg_name:Xe,query:Ze,SIP_Version:et,INVITEm:tt,ACKm:nt,OPTIONSm:rt,BYEm:it,CANCELm:ot,REGISTERm:at,SUBSCRIBEm:st,NOTIFYm:lt,REFERm:ut,Method:ct,Status_Line:dt,Status_Code:ft,extension_code:pt,Reason_Phrase:ht,Allow_Events:function(){var e,t,n,r,i,a;if(i=o,null!==(e=Ft())){for(t=[],a=o,null!==(n=j())&&null!==(r=Ft())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=Ft())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},Call_ID:function(){var e,n,r,i,s,l;i=o,s=o,null!==(e=N())?(l=o,64===t.charCodeAt(o)?(n="@",o++):(n=null,0===a&&u('"@"')),null!==n&&null!==(r=N())?n=[n,r]:(n=null,o=l),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=s)):(e=null,o=s);null!==e&&(c=i,e=void(Hn=t.substring(o,c)));var c;null===e&&(o=i);return e},Contact:function(){var e,t,n,r,i,a,s;if(i=o,null===(e=D()))if(a=o,null!==(e=mt())){for(t=[],s=o,null!==(n=j())&&null!==(r=mt())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=j())&&null!==(r=mt())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;null!==e&&(e=function(e){var t,n;for(n=Hn.multi_header.length,t=0;t<n;t++)if(null===Hn.multi_header[t].parsed){Hn=null;break}Hn=null!==Hn?Hn.multi_header:-1}());null===e&&(o=i);return e},contact_param:mt,name_addr:vt,display_name:_t,contact_params:gt,c_p_q:yt,c_p_expires:Tt,delta_seconds:Ct,qvalue:St,generic_param:bt,gen_value:Et,Content_Disposition:function(){var e,t,n,r,i,a;if(i=o,null!==(e=wt())){for(t=[],a=o,null!==(n=z())&&null!==(r=Rt())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=z())&&null!==(r=Rt())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},disp_type:wt,disp_param:Rt,handling_param:At,Content_Encoding:function(){var e,t,n,r,i,a;if(i=o,null!==(e=P())){for(t=[],a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},Content_Length:function(){var e,t,n;if(n=o,null!==(t=d()))for(e=[];null!==t;)e.push(t),t=d();else e=null;null!==e&&(e=void(Hn=parseInt(e.join(""))));null===e&&(o=n);return e},Content_Type:function(){var e,n;n=o,null!==(e=kt())&&(r=n,e=void(Hn=t.substring(o,r)));var r;null===e&&(o=n);return e},media_type:kt,m_type:xt,discrete_type:It,composite_type:Pt,extension_token:Ot,x_token:Nt,m_subtype:Dt,m_parameter:Mt,m_value:Ut,CSeq:function(){var e,t,n,r;r=o,null!==(e=Lt())&&null!==(t=E())&&null!==(n=ct())?e=[e,t,n]:(e=null,o=r);return e},CSeq_value:Lt,Expires:function(){var e,t;t=o,null!==(e=Ct())&&(e=void(Hn=e));null===e&&(o=t);return e},Event:function(){var e,t,n,r,i,a,s;if(i=o,a=o,null!==(e=Ft())){for(t=[],s=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;null!==e&&(l=e[0],e=void(Hn.event=l.join("").toLowerCase()));var l;null===e&&(o=i);return e},event_type:Ft,From:function(){var e,t,n,r,i,a,s;i=o,a=o,null===(e=Q())&&(e=vt());if(null!==e){for(t=[],s=o,null!==(n=z())&&null!==(r=qt())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=z())&&null!==(r=qt())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;null!==e&&(e=function(e){var t=Hn.tag;try{Hn=new qn(Hn.uri,Hn.display_name,Hn.params),t&&Hn.setParam("tag",t)}catch(n){Hn=-1}}());null===e&&(o=i);return e},from_param:qt,tag_param:Ht,Max_Forwards:function(){var e,t,n;if(n=o,null!==(t=d()))for(e=[];null!==t;)e.push(t),t=d();else e=null;null!==e&&(e=void(Hn=parseInt(e.join(""))));null===e&&(o=n);return e},Min_Expires:function(){var e,t;t=o,null!==(e=Ct())&&(e=void(Hn=e));null===e&&(o=t);return e},Name_Addr_Header:function(){var e,t,n,r,i,a,s,l,u,c;l=o,u=o,e=[],t=_t();for(;null!==t;)e.push(t),t=_t();if(null!==e)if(null!==(t=H()))if(null!==(n=X()))if(null!==(r=q())){for(i=[],c=o,null!==(a=z())&&null!==(s=bt())?a=[a,s]:(a=null,o=c);null!==a;)i.push(a),c=o,null!==(a=z())&&null!==(s=bt())?a=[a,s]:(a=null,o=c);null!==i?e=[e,t,n,r,i]:(e=null,o=u)}else e=null,o=u;else e=null,o=u;else e=null,o=u;else e=null,o=u;null!==e&&(e=function(e){try{Hn=new qn(Hn.uri,Hn.display_name,Hn.params)}catch(t){Hn=-1}}());null===e&&(o=l);return e},Proxy_Authenticate:function(){return jt()},challenge:jt,other_challenge:zt,auth_param:Gt,digest_cln:Wt,realm:Vt,realm_value:Bt,domain:Kt,URI:$t,nonce:Jt,nonce_value:Yt,opaque:Qt,stale:Xt,algorithm:Zt,qop_options:en,qop_value:tn,Proxy_Require:function(){var e,t,n,r,i,a;if(i=o,null!==(e=P())){for(t=[],a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},Record_Route:function(){var e,t,n,r,i,a,s;if(i=o,a=o,null!==(e=nn())){for(t=[],s=o,null!==(n=j())&&null!==(r=nn())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=j())&&null!==(r=nn())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;null!==e&&(e=function(e){var t,n;for(n=Hn.multi_header.length,t=0;t<n;t++)if(null===Hn.multi_header[t].parsed){Hn=null;break}Hn=null!==Hn?Hn.multi_header:-1}());null===e&&(o=i);return e},rec_route:nn,Reason:function(){var e,n,r,i,s,l,c;s=o,l=o,"sip"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"SIP"'));null===e&&(e=P());if(null!==e){for(n=[],c=o,null!==(r=z())&&null!==(i=rn())?r=[r,i]:(r=null,o=c);null!==r;)n.push(r),c=o,null!==(r=z())&&null!==(i=rn())?r=[r,i]:(r=null,o=c);null!==n?e=[e,n]:(e=null,o=l)}else e=null,o=l;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&&(o=s);return e},reason_param:rn,reason_cause:on,Require:function(){var e,t,n,r,i,a;if(i=o,null!==(e=P())){for(t=[],a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},Route:function(){var e,t,n,r,i,a;if(i=o,null!==(e=an())){for(t=[],a=o,null!==(n=j())&&null!==(r=an())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=an())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},route_param:an,Subscription_State:function(){var e,t,n,r,i,a;if(i=o,null!==(e=sn())){for(t=[],a=o,null!==(n=z())&&null!==(r=ln())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=z())&&null!==(r=ln())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},substate_value:sn,subexp_params:ln,event_reason_value:un,Subject:function(){var e;return e=null!==(e=A())?e:""},Supported:function(){var e,t,n,r,i,a;if(i=o,null!==(e=P())){for(t=[],a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=P())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e=null!==e?e:""},To:function(){var e,t,n,r,i,a,s;i=o,a=o,null===(e=Q())&&(e=vt());if(null!==e){for(t=[],s=o,null!==(n=z())&&null!==(r=cn())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=z())&&null!==(r=cn())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;null!==e&&(e=function(e){var t=Hn.tag;try{Hn=new qn(Hn.uri,Hn.display_name,Hn.params),t&&Hn.setParam("tag",t)}catch(n){Hn=-1}}());null===e&&(o=i);return e},to_param:cn,Via:function(){var e,t,n,r,i,a;if(i=o,null!==(e=dn())){for(t=[],a=o,null!==(n=j())&&null!==(r=dn())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=j())&&null!==(r=dn())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},via_param:dn,via_params:fn,via_ttl:pn,via_maddr:hn,via_received:mn,via_branch:vn,response_port:_n,sent_protocol:gn,protocol_name:yn,transport:Tn,sent_by:Cn,via_host:Sn,via_port:bn,ttl:En,WWW_Authenticate:function(){return jt()},Session_Expires:function(){var e,t,n,r,i,a;if(i=o,null!==(e=wn())){for(t=[],a=o,null!==(n=z())&&null!==(r=Rn())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=z())&&null!==(r=Rn())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},s_e_expires:wn,s_e_params:Rn,s_e_refresher:An,extension_header:function(){var e,t,n,r;r=o,null!==(e=P())&&null!==(t=R())&&null!==(n=kn())?e=[e,t,n]:(e=null,o=r);return e},header_value:kn,message_body:function(){var e,t;e=[],t=m();for(;null!==t;)e.push(t),t=m();return e},uuid_URI:function(){var e,n,r;r=o,"uuid:"===t.substr(o,5)?(e="uuid:",o+=5):(e=null,0===a&&u('"uuid:"'));null!==e&&null!==(n=xn())?e=[e,n]:(e=null,o=r);return e},uuid:xn,hex4:In,hex8:Pn,hex12:On,Refer_To:function(){var e,t,n,r,i,a,s;i=o,a=o,null===(e=Q())&&(e=vt());if(null!==e){for(t=[],s=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;null!==e&&(e=function(e){try{Hn=new qn(Hn.uri,Hn.display_name,Hn.params)}catch(t){Hn=-1}}());null===e&&(o=i);return e},Replaces:function(){var e,t,n,r,i,a;if(i=o,null!==(e=Nn())){for(t=[],a=o,null!==(n=z())&&null!==(r=Dn())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=z())&&null!==(r=Dn())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e},call_id:Nn,replaces_param:Dn,to_tag:Mn,from_tag:Un,early_flag:Ln};if(void 0!==r){if(void 0===i[r])throw new Error("Invalid rule name: "+e(r)+".")}else r="CRLF";var o=0,a=0,s=0,l=[];function u(e){o<s||(o>s&&(s=o,l=[]),l.push(e))}function c(){var e;return"\r\n"===t.substr(o,2)?(e="\r\n",o+=2):(e=null,0===a&&u('"\\r\\n"')),e}function d(){var e;return/^[0-9]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[0-9]")),e}function f(){var e;return/^[a-zA-Z]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[a-zA-Z]")),e}function p(){var e;return/^[0-9a-fA-F]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[0-9a-fA-F]")),e}function h(){var e;return null===(e=_())&&(e=g()),e}function m(){var e;return/^[\0-\xFF]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[\\0-\\xFF]")),e}function v(){var e;return/^["]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u('["]')),e}function _(){var e;return 32===t.charCodeAt(o)?(e=" ",o++):(e=null,0===a&&u('" "')),e}function g(){var e;return 9===t.charCodeAt(o)?(e="\t",o++):(e=null,0===a&&u('"\\t"')),e}function y(){var e;return/^[a-zA-Z0-9]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[a-zA-Z0-9]")),e}function T(){var e;return 59===t.charCodeAt(o)?(e=";",o++):(e=null,0===a&&u('";"')),null===e&&(47===t.charCodeAt(o)?(e="/",o++):(e=null,0===a&&u('"/"')),null===e&&(63===t.charCodeAt(o)?(e="?",o++):(e=null,0===a&&u('"?"')),null===e&&(58===t.charCodeAt(o)?(e=":",o++):(e=null,0===a&&u('":"')),null===e&&(64===t.charCodeAt(o)?(e="@",o++):(e=null,0===a&&u('"@"')),null===e&&(38===t.charCodeAt(o)?(e="&",o++):(e=null,0===a&&u('"&"')),null===e&&(61===t.charCodeAt(o)?(e="=",o++):(e=null,0===a&&u('"="')),null===e&&(43===t.charCodeAt(o)?(e="+",o++):(e=null,0===a&&u('"+"')),null===e&&(36===t.charCodeAt(o)?(e="$",o++):(e=null,0===a&&u('"$"')),null===e&&(44===t.charCodeAt(o)?(e=",",o++):(e=null,0===a&&u('","'))))))))))),e}function C(){var e;return null===(e=y())&&(e=S()),e}function S(){var e;return 45===t.charCodeAt(o)?(e="-",o++):(e=null,0===a&&u('"-"')),null===e&&(95===t.charCodeAt(o)?(e="_",o++):(e=null,0===a&&u('"_"')),null===e&&(46===t.charCodeAt(o)?(e=".",o++):(e=null,0===a&&u('"."')),null===e&&(33===t.charCodeAt(o)?(e="!",o++):(e=null,0===a&&u('"!"')),null===e&&(126===t.charCodeAt(o)?(e="~",o++):(e=null,0===a&&u('"~"')),null===e&&(42===t.charCodeAt(o)?(e="*",o++):(e=null,0===a&&u('"*"')),null===e&&(39===t.charCodeAt(o)?(e="'",o++):(e=null,0===a&&u('"\'"')),null===e&&(40===t.charCodeAt(o)?(e="(",o++):(e=null,0===a&&u('"("')),null===e&&(41===t.charCodeAt(o)?(e=")",o++):(e=null,0===a&&u('")"')))))))))),e}function b(){var e,n,r,i,s;return i=o,s=o,37===t.charCodeAt(o)?(e="%",o++):(e=null,0===a&&u('"%"')),null!==e&&null!==(n=p())&&null!==(r=p())?e=[e,n,r]:(e=null,o=s),null!==e&&(e=e.join("")),null===e&&(o=i),e}function E(){var e,t,n,r,i,a;for(r=o,i=o,a=o,e=[],t=h();null!==t;)e.push(t),t=h();if(null!==e&&null!==(t=c())?e=[e,t]:(e=null,o=a),null!==(e=null!==e?e:"")){if(null!==(n=h()))for(t=[];null!==n;)t.push(n),n=h();else t=null;null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return null!==e&&(e=" "),null===e&&(o=r),e}function w(){var e;return e=null!==(e=E())?e:""}function R(){var e,n,r,i,s;for(i=o,s=o,e=[],null===(n=_())&&(n=g());null!==n;)e.push(n),null===(n=_())&&(n=g());return null!==e?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e=":"),null===e&&(o=i),e}function A(){var e,n,r,i,a,s,l,u;if(a=o,s=o,null!==(n=k()))for(e=[];null!==n;)e.push(n),n=k();else e=null;if(null!==e){for(n=[],l=o,r=[],i=E();null!==i;)r.push(i),i=E();for(null!==r&&null!==(i=k())?r=[r,i]:(r=null,o=l);null!==r;){for(n.push(r),l=o,r=[],i=E();null!==i;)r.push(i),i=E();null!==r&&null!==(i=k())?r=[r,i]:(r=null,o=l)}null!==n?e=[e,n]:(e=null,o=s)}else e=null,o=s;return null!==e&&(u=a,e=t.substring(o,u)),null===e&&(o=a),e}function k(){var e;return/^[!-~]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[!-~]")),null===e&&(e=x()),e}function x(){var e;return/^[\x80-\uFFFF]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[\\x80-\\uFFFF]")),e}function I(){var e;return/^[\x80-\xBF]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[\\x80-\\xBF]")),e}function P(){var e,n,r,i;if(r=o,null===(n=y())&&(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null===n&&(46===t.charCodeAt(o)?(n=".",o++):(n=null,0===a&&u('"."')),null===n&&(33===t.charCodeAt(o)?(n="!",o++):(n=null,0===a&&u('"!"')),null===n&&(37===t.charCodeAt(o)?(n="%",o++):(n=null,0===a&&u('"%"')),null===n&&(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null===n&&(95===t.charCodeAt(o)?(n="_",o++):(n=null,0===a&&u('"_"')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(96===t.charCodeAt(o)?(n="`",o++):(n=null,0===a&&u('"`"')),null===n&&(39===t.charCodeAt(o)?(n="'",o++):(n=null,0===a&&u('"\'"')),null===n&&(126===t.charCodeAt(o)?(n="~",o++):(n=null,0===a&&u('"~"')))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=y())&&(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null===n&&(46===t.charCodeAt(o)?(n=".",o++):(n=null,0===a&&u('"."')),null===n&&(33===t.charCodeAt(o)?(n="!",o++):(n=null,0===a&&u('"!"')),null===n&&(37===t.charCodeAt(o)?(n="%",o++):(n=null,0===a&&u('"%"')),null===n&&(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null===n&&(95===t.charCodeAt(o)?(n="_",o++):(n=null,0===a&&u('"_"')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(96===t.charCodeAt(o)?(n="`",o++):(n=null,0===a&&u('"`"')),null===n&&(39===t.charCodeAt(o)?(n="'",o++):(n=null,0===a&&u('"\'"')),null===n&&(126===t.charCodeAt(o)?(n="~",o++):(n=null,0===a&&u('"~"'))))))))))));else e=null;return null!==e&&(i=r,e=t.substring(o,i)),null===e&&(o=r),e}function O(){var e,n,r,i;if(r=o,null===(n=y())&&(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null===n&&(33===t.charCodeAt(o)?(n="!",o++):(n=null,0===a&&u('"!"')),null===n&&(37===t.charCodeAt(o)?(n="%",o++):(n=null,0===a&&u('"%"')),null===n&&(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null===n&&(95===t.charCodeAt(o)?(n="_",o++):(n=null,0===a&&u('"_"')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(96===t.charCodeAt(o)?(n="`",o++):(n=null,0===a&&u('"`"')),null===n&&(39===t.charCodeAt(o)?(n="'",o++):(n=null,0===a&&u('"\'"')),null===n&&(126===t.charCodeAt(o)?(n="~",o++):(n=null,0===a&&u('"~"'))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=y())&&(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null===n&&(33===t.charCodeAt(o)?(n="!",o++):(n=null,0===a&&u('"!"')),null===n&&(37===t.charCodeAt(o)?(n="%",o++):(n=null,0===a&&u('"%"')),null===n&&(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null===n&&(95===t.charCodeAt(o)?(n="_",o++):(n=null,0===a&&u('"_"')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(96===t.charCodeAt(o)?(n="`",o++):(n=null,0===a&&u('"`"')),null===n&&(39===t.charCodeAt(o)?(n="'",o++):(n=null,0===a&&u('"\'"')),null===n&&(126===t.charCodeAt(o)?(n="~",o++):(n=null,0===a&&u('"~"')))))))))));else e=null;return null!==e&&(i=r,e=t.substring(o,i)),null===e&&(o=r),e}function N(){var e,n,r,i;if(r=o,null===(n=y())&&(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null===n&&(46===t.charCodeAt(o)?(n=".",o++):(n=null,0===a&&u('"."')),null===n&&(33===t.charCodeAt(o)?(n="!",o++):(n=null,0===a&&u('"!"')),null===n&&(37===t.charCodeAt(o)?(n="%",o++):(n=null,0===a&&u('"%"')),null===n&&(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null===n&&(95===t.charCodeAt(o)?(n="_",o++):(n=null,0===a&&u('"_"')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(96===t.charCodeAt(o)?(n="`",o++):(n=null,0===a&&u('"`"')),null===n&&(39===t.charCodeAt(o)?(n="'",o++):(n=null,0===a&&u('"\'"')),null===n&&(126===t.charCodeAt(o)?(n="~",o++):(n=null,0===a&&u('"~"')),null===n&&(40===t.charCodeAt(o)?(n="(",o++):(n=null,0===a&&u('"("')),null===n&&(41===t.charCodeAt(o)?(n=")",o++):(n=null,0===a&&u('")"')),null===n&&(60===t.charCodeAt(o)?(n="<",o++):(n=null,0===a&&u('"<"')),null===n&&(62===t.charCodeAt(o)?(n=">",o++):(n=null,0===a&&u('">"')),null===n&&(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null===n&&(92===t.charCodeAt(o)?(n="\\",o++):(n=null,0===a&&u('"\\\\"')),null===n&&null===(n=v())&&(47===t.charCodeAt(o)?(n="/",o++):(n=null,0===a&&u('"/"')),null===n&&(91===t.charCodeAt(o)?(n="[",o++):(n=null,0===a&&u('"["')),null===n&&(93===t.charCodeAt(o)?(n="]",o++):(n=null,0===a&&u('"]"')),null===n&&(63===t.charCodeAt(o)?(n="?",o++):(n=null,0===a&&u('"?"')),null===n&&(123===t.charCodeAt(o)?(n="{",o++):(n=null,0===a&&u('"{"')),null===n&&(125===t.charCodeAt(o)?(n="}",o++):(n=null,0===a&&u('"}"')))))))))))))))))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=y())&&(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null===n&&(46===t.charCodeAt(o)?(n=".",o++):(n=null,0===a&&u('"."')),null===n&&(33===t.charCodeAt(o)?(n="!",o++):(n=null,0===a&&u('"!"')),null===n&&(37===t.charCodeAt(o)?(n="%",o++):(n=null,0===a&&u('"%"')),null===n&&(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null===n&&(95===t.charCodeAt(o)?(n="_",o++):(n=null,0===a&&u('"_"')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(96===t.charCodeAt(o)?(n="`",o++):(n=null,0===a&&u('"`"')),null===n&&(39===t.charCodeAt(o)?(n="'",o++):(n=null,0===a&&u('"\'"')),null===n&&(126===t.charCodeAt(o)?(n="~",o++):(n=null,0===a&&u('"~"')),null===n&&(40===t.charCodeAt(o)?(n="(",o++):(n=null,0===a&&u('"("')),null===n&&(41===t.charCodeAt(o)?(n=")",o++):(n=null,0===a&&u('")"')),null===n&&(60===t.charCodeAt(o)?(n="<",o++):(n=null,0===a&&u('"<"')),null===n&&(62===t.charCodeAt(o)?(n=">",o++):(n=null,0===a&&u('">"')),null===n&&(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null===n&&(92===t.charCodeAt(o)?(n="\\",o++):(n=null,0===a&&u('"\\\\"')),null===n&&null===(n=v())&&(47===t.charCodeAt(o)?(n="/",o++):(n=null,0===a&&u('"/"')),null===n&&(91===t.charCodeAt(o)?(n="[",o++):(n=null,0===a&&u('"["')),null===n&&(93===t.charCodeAt(o)?(n="]",o++):(n=null,0===a&&u('"]"')),null===n&&(63===t.charCodeAt(o)?(n="?",o++):(n=null,0===a&&u('"?"')),null===n&&(123===t.charCodeAt(o)?(n="{",o++):(n=null,0===a&&u('"{"')),null===n&&(125===t.charCodeAt(o)?(n="}",o++):(n=null,0===a&&u('"}"'))))))))))))))))))))))));else e=null;return null!==e&&(i=r,e=t.substring(o,i)),null===e&&(o=r),e}function D(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(42===t.charCodeAt(o)?(n="*",o++):(n=null,0===a&&u('"*"')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e="*"),null===e&&(o=i),e}function M(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(47===t.charCodeAt(o)?(n="/",o++):(n=null,0===a&&u('"/"')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e="/"),null===e&&(o=i),e}function U(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e="="),null===e&&(o=i),e}function L(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(40===t.charCodeAt(o)?(n="(",o++):(n=null,0===a&&u('"("')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e="("),null===e&&(o=i),e}function F(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(41===t.charCodeAt(o)?(n=")",o++):(n=null,0===a&&u('")"')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e=")"),null===e&&(o=i),e}function q(){var e,n,r,i;return r=o,i=o,62===t.charCodeAt(o)?(e=">",o++):(e=null,0===a&&u('">"')),null!==e&&null!==(n=w())?e=[e,n]:(e=null,o=i),null!==e&&(e=">"),null===e&&(o=r),e}function H(){var e,n,r,i;return r=o,i=o,null!==(e=w())?(60===t.charCodeAt(o)?(n="<",o++):(n=null,0===a&&u('"<"')),null!==n?e=[e,n]:(e=null,o=i)):(e=null,o=i),null!==e&&(e="<"),null===e&&(o=r),e}function j(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(44===t.charCodeAt(o)?(n=",",o++):(n=null,0===a&&u('","')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e=","),null===e&&(o=i),e}function z(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(59===t.charCodeAt(o)?(n=";",o++):(n=null,0===a&&u('";"')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e=";"),null===e&&(o=i),e}function G(){var e,n,r,i,s;return i=o,s=o,null!==(e=w())?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=w())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(e=":"),null===e&&(o=i),e}function W(){var e,t,n,r;return n=o,r=o,null!==(e=w())&&null!==(t=v())?e=[e,t]:(e=null,o=r),null!==e&&(e='"'),null===e&&(o=n),e}function V(){var e,t,n,r;return n=o,r=o,null!==(e=v())&&null!==(t=w())?e=[e,t]:(e=null,o=r),null!==e&&(e='"'),null===e&&(o=n),e}function B(){var e;return/^[!-']/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[!-']")),null===e&&(/^[*-[]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[*-[]")),null===e&&(/^[\]-~]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[\\]-~]")),null===e&&null===(e=x())&&(e=E()))),e}function K(){var e,n,r,i,a,s,l;if(a=o,s=o,null!==(e=w()))if(null!==(n=v())){for(r=[],null===(i=J())&&(i=Y());null!==i;)r.push(i),null===(i=J())&&(i=Y());null!==r&&null!==(i=v())?e=[e,n,r,i]:(e=null,o=s)}else e=null,o=s;else e=null,o=s;return null!==e&&(l=a,e=t.substring(o,l)),null===e&&(o=a),e}function $(){var e,n,r,i,a,s;if(a=o,s=o,null!==(e=w()))if(null!==(n=v())){for(r=[],null===(i=J())&&(i=Y());null!==i;)r.push(i),null===(i=J())&&(i=Y());null!==r&&null!==(i=v())?e=[e,n,r,i]:(e=null,o=s)}else e=null,o=s;else e=null,o=s;return null!==e&&(e=function(e){var n=t.substring(o,e).trim();return n.substring(1,n.length-1).replace(/\\([\x00-\x09\x0b-\x0c\x0e-\x7f])/g,"$1")}(a)),null===e&&(o=a),e}function J(){var e;return null===(e=E())&&(33===t.charCodeAt(o)?(e="!",o++):(e=null,0===a&&u('"!"')),null===e&&(/^[#-[]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[#-[]")),null===e&&(/^[\]-~]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[\\]-~]")),null===e&&(e=x())))),e}function Y(){var e,n,r;return r=o,92===t.charCodeAt(o)?(e="\\",o++):(e=null,0===a&&u('"\\\\"')),null!==e?(/^[\0-\t]/.test(t.charAt(o))?(n=t.charAt(o),o++):(n=null,0===a&&u("[\\0-\\t]")),null===n&&(/^[\x0B-\f]/.test(t.charAt(o))?(n=t.charAt(o),o++):(n=null,0===a&&u("[\\x0B-\\f]")),null===n&&(/^[\x0E-\x7f]/.test(t.charAt(o))?(n=t.charAt(o),o++):(n=null,0===a&&u("[\\x0E-\x7f]")))),null!==n?e=[e,n]:(e=null,o=r)):(e=null,o=r),e}function Q(){var e,n,r,i,s,l;return s=o,l=o,null!==(e=Z())?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=null!==(r=ne())?r:"")&&null!==(i=ae())?e=[e,n,r,i]:(e=null,o=l)):(e=null,o=l),null!==e&&(e=function(e){try{Hn.uri=new Fn(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(t){Hn=-1}}()),null===e&&(o=s),e}function X(){var e,n,i,s,l,c,d,f;return d=o,f=o,null!==(e=Z())?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(i=null!==(i=ne())?i:"")&&null!==(s=ae())&&null!==(l=ge())&&null!==(c=null!==(c=Pe())?c:"")?e=[e,n,i,s,l,c]:(e=null,o=f)):(e=null,o=f),null!==e&&(e=function(e){try{Hn.uri=new Fn(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"===r&&(Hn=Hn.uri)}catch(t){Hn=-1}}()),null===e&&(o=d),e}function Z(){var e;return null===(e=ee())&&(e=te()),e}function ee(){var e,n,r;return n=o,"sips"===t.substr(o,4).toLowerCase()?(e=t.substr(o,4),o+=4):(e=null,0===a&&u('"sips"')),null!==e&&(r=e,e=void(Hn.scheme=r.toLowerCase())),null===e&&(o=n),e}function te(){var e,n,r;return n=o,"sip"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"sip"')),null!==e&&(r=e,e=void(Hn.scheme=r.toLowerCase())),null===e&&(o=n),e}function ne(){var e,n,r,i,s,l,c;return i=o,s=o,null!==(e=re())?(l=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=oe())?n=[n,r]:(n=null,o=l),null!==(n=null!==n?n:"")?(64===t.charCodeAt(o)?(r="@",o++):(r=null,0===a&&u('"@"')),null!==r?e=[e,n,r]:(e=null,o=s)):(e=null,o=s)):(e=null,o=s),null!==e&&(c=i,e=void(Hn.user=decodeURIComponent(t.substring(o-1,c)))),null===e&&(o=i),e}function re(){var e,t;if(null===(t=C())&&null===(t=b())&&(t=ie()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=C())&&null===(t=b())&&(t=ie());else e=null;return e}function ie(){var e;return 38===t.charCodeAt(o)?(e="&",o++):(e=null,0===a&&u('"&"')),null===e&&(61===t.charCodeAt(o)?(e="=",o++):(e=null,0===a&&u('"="')),null===e&&(43===t.charCodeAt(o)?(e="+",o++):(e=null,0===a&&u('"+"')),null===e&&(36===t.charCodeAt(o)?(e="$",o++):(e=null,0===a&&u('"$"')),null===e&&(44===t.charCodeAt(o)?(e=",",o++):(e=null,0===a&&u('","')),null===e&&(59===t.charCodeAt(o)?(e=";",o++):(e=null,0===a&&u('";"')),null===e&&(63===t.charCodeAt(o)?(e="?",o++):(e=null,0===a&&u('"?"')),null===e&&(47===t.charCodeAt(o)?(e="/",o++):(e=null,0===a&&u('"/"'))))))))),e}function oe(){var e,n,r,i;for(r=o,e=[],null===(n=C())&&null===(n=b())&&(38===t.charCodeAt(o)?(n="&",o++):(n=null,0===a&&u('"&"')),null===n&&(61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(36===t.charCodeAt(o)?(n="$",o++):(n=null,0===a&&u('"$"')),null===n&&(44===t.charCodeAt(o)?(n=",",o++):(n=null,0===a&&u('","')))))));null!==n;)e.push(n),null===(n=C())&&null===(n=b())&&(38===t.charCodeAt(o)?(n="&",o++):(n=null,0===a&&u('"&"')),null===n&&(61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')),null===n&&(36===t.charCodeAt(o)?(n="$",o++):(n=null,0===a&&u('"$"')),null===n&&(44===t.charCodeAt(o)?(n=",",o++):(n=null,0===a&&u('","')))))));return null!==e&&(i=r,e=void(Hn.password=t.substring(o,i))),null===e&&(o=r),e}function ae(){var e,n,r,i,s;return i=o,null!==(e=se())?(s=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=_e())?n=[n,r]:(n=null,o=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=i)):(e=null,o=i),e}function se(){var e,n,r;return n=o,null===(e=le())&&null===(e=me())&&(e=de()),null!==e&&(r=n,Hn.host=t.substring(o,r).toLowerCase(),e=Hn.host),null===e&&(o=n),e}function le(){var e,n,r,i,s,l,c;for(i=o,s=o,e=[],l=o,null!==(n=ue())?(46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')),null!==r?n=[n,r]:(n=null,o=l)):(n=null,o=l);null!==n;)e.push(n),l=o,null!==(n=ue())?(46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')),null!==r?n=[n,r]:(n=null,o=l)):(n=null,o=l);return null!==e&&null!==(n=ce())?(46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')),null!==(r=null!==r?r:"")?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(c=i,Hn.host_type="domain",e=t.substring(o,c)),null===e&&(o=i),e}function ue(){var e,n,r,i;if(i=o,null!==(e=y())){for(n=[],null===(r=y())&&(45===t.charCodeAt(o)?(r="-",o++):(r=null,0===a&&u('"-"')),null===r&&(95===t.charCodeAt(o)?(r="_",o++):(r=null,0===a&&u('"_"'))));null!==r;)n.push(r),null===(r=y())&&(45===t.charCodeAt(o)?(r="-",o++):(r=null,0===a&&u('"-"')),null===r&&(95===t.charCodeAt(o)?(r="_",o++):(r=null,0===a&&u('"_"'))));null!==n?e=[e,n]:(e=null,o=i)}else e=null,o=i;return e}function ce(){var e,n,r,i;if(i=o,null!==(e=f())){for(n=[],null===(r=y())&&(45===t.charCodeAt(o)?(r="-",o++):(r=null,0===a&&u('"-"')),null===r&&(95===t.charCodeAt(o)?(r="_",o++):(r=null,0===a&&u('"_"'))));null!==r;)n.push(r),null===(r=y())&&(45===t.charCodeAt(o)?(r="-",o++):(r=null,0===a&&u('"-"')),null===r&&(95===t.charCodeAt(o)?(r="_",o++):(r=null,0===a&&u('"_"'))));null!==n?e=[e,n]:(e=null,o=i)}else e=null,o=i;return e}function de(){var e,n,r,i,s,l;return i=o,s=o,91===t.charCodeAt(o)?(e="[",o++):(e=null,0===a&&u('"["')),null!==e&&null!==(n=fe())?(93===t.charCodeAt(o)?(r="]",o++):(r=null,0===a&&u('"]"')),null!==r?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(l=i,Hn.host_type="IPv6",e=t.substring(o,l)),null===e&&(o=i),e}function fe(){var e,n,r,i,s,l,c,d,f,p,h,m,v,_,g,y,T;return _=o,g=o,null!==(e=pe())?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?(58===t.charCodeAt(o)?(i=":",o++):(i=null,0===a&&u('":"')),null!==i&&null!==(s=pe())?(58===t.charCodeAt(o)?(l=":",o++):(l=null,0===a&&u('":"')),null!==l&&null!==(c=pe())?(58===t.charCodeAt(o)?(d=":",o++):(d=null,0===a&&u('":"')),null!==d&&null!==(f=pe())?(58===t.charCodeAt(o)?(p=":",o++):(p=null,0===a&&u('":"')),null!==p&&null!==(h=pe())?(58===t.charCodeAt(o)?(m=":",o++):(m=null,0===a&&u('":"')),null!==m&&null!==(v=he())?e=[e,n,r,i,s,l,c,d,f,p,h,m,v]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=pe())?(58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?(58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?(58===t.charCodeAt(o)?(c=":",o++):(c=null,0===a&&u('":"')),null!==c&&null!==(d=pe())?(58===t.charCodeAt(o)?(f=":",o++):(f=null,0===a&&u('":"')),null!==f&&null!==(p=pe())?(58===t.charCodeAt(o)?(h=":",o++):(h=null,0===a&&u('":"')),null!==h&&null!==(m=he())?e=[e,n,r,i,s,l,c,d,f,p,h,m]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=pe())?(58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?(58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?(58===t.charCodeAt(o)?(c=":",o++):(c=null,0===a&&u('":"')),null!==c&&null!==(d=pe())?(58===t.charCodeAt(o)?(f=":",o++):(f=null,0===a&&u('":"')),null!==f&&null!==(p=he())?e=[e,n,r,i,s,l,c,d,f,p]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=pe())?(58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?(58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?(58===t.charCodeAt(o)?(c=":",o++):(c=null,0===a&&u('":"')),null!==c&&null!==(d=he())?e=[e,n,r,i,s,l,c,d]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=pe())?(58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?(58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=he())?e=[e,n,r,i,s,l]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=pe())?(58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=he())?e=[e,n,r,i]:(e=null,o=g)):(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=he())?e=[e,n]:(e=null,o=g),null===e&&(g=o,"::"===t.substr(o,2)?(e="::",o+=2):(e=null,0===a&&u('"::"')),null!==e&&null!==(n=pe())?e=[e,n]:(e=null,o=g),null===e&&(g=o,null!==(e=pe())?("::"===t.substr(o,2)?(n="::",o+=2):(n=null,0===a&&u('"::"')),null!==n&&null!==(r=pe())?(58===t.charCodeAt(o)?(i=":",o++):(i=null,0===a&&u('":"')),null!==i&&null!==(s=pe())?(58===t.charCodeAt(o)?(l=":",o++):(l=null,0===a&&u('":"')),null!==l&&null!==(c=pe())?(58===t.charCodeAt(o)?(d=":",o++):(d=null,0===a&&u('":"')),null!==d&&null!==(f=pe())?(58===t.charCodeAt(o)?(p=":",o++):(p=null,0===a&&u('":"')),null!==p&&null!==(h=he())?e=[e,n,r,i,s,l,c,d,f,p,h]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,null!==(e=pe())?(y=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?n=[n,r]:(n=null,o=y),null!==(n=null!==n?n:"")?("::"===t.substr(o,2)?(r="::",o+=2):(r=null,0===a&&u('"::"')),null!==r&&null!==(i=pe())?(58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?(58===t.charCodeAt(o)?(c=":",o++):(c=null,0===a&&u('":"')),null!==c&&null!==(d=pe())?(58===t.charCodeAt(o)?(f=":",o++):(f=null,0===a&&u('":"')),null!==f&&null!==(p=he())?e=[e,n,r,i,s,l,c,d,f,p]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,null!==(e=pe())?(y=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?n=[n,r]:(n=null,o=y),null!==(n=null!==n?n:"")?(y=o,58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?r=[r,i]:(r=null,o=y),null!==(r=null!==r?r:"")?("::"===t.substr(o,2)?(i="::",o+=2):(i=null,0===a&&u('"::"')),null!==i&&null!==(s=pe())?(58===t.charCodeAt(o)?(l=":",o++):(l=null,0===a&&u('":"')),null!==l&&null!==(c=pe())?(58===t.charCodeAt(o)?(d=":",o++):(d=null,0===a&&u('":"')),null!==d&&null!==(f=he())?e=[e,n,r,i,s,l,c,d,f]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,null!==(e=pe())?(y=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?n=[n,r]:(n=null,o=y),null!==(n=null!==n?n:"")?(y=o,58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?r=[r,i]:(r=null,o=y),null!==(r=null!==r?r:"")?(y=o,58===t.charCodeAt(o)?(i=":",o++):(i=null,0===a&&u('":"')),null!==i&&null!==(s=pe())?i=[i,s]:(i=null,o=y),null!==(i=null!==i?i:"")?("::"===t.substr(o,2)?(s="::",o+=2):(s=null,0===a&&u('"::"')),null!==s&&null!==(l=pe())?(58===t.charCodeAt(o)?(c=":",o++):(c=null,0===a&&u('":"')),null!==c&&null!==(d=he())?e=[e,n,r,i,s,l,c,d]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,null!==(e=pe())?(y=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?n=[n,r]:(n=null,o=y),null!==(n=null!==n?n:"")?(y=o,58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?r=[r,i]:(r=null,o=y),null!==(r=null!==r?r:"")?(y=o,58===t.charCodeAt(o)?(i=":",o++):(i=null,0===a&&u('":"')),null!==i&&null!==(s=pe())?i=[i,s]:(i=null,o=y),null!==(i=null!==i?i:"")?(y=o,58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?s=[s,l]:(s=null,o=y),null!==(s=null!==s?s:"")?("::"===t.substr(o,2)?(l="::",o+=2):(l=null,0===a&&u('"::"')),null!==l&&null!==(c=he())?e=[e,n,r,i,s,l,c]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,null!==(e=pe())?(y=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?n=[n,r]:(n=null,o=y),null!==(n=null!==n?n:"")?(y=o,58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?r=[r,i]:(r=null,o=y),null!==(r=null!==r?r:"")?(y=o,58===t.charCodeAt(o)?(i=":",o++):(i=null,0===a&&u('":"')),null!==i&&null!==(s=pe())?i=[i,s]:(i=null,o=y),null!==(i=null!==i?i:"")?(y=o,58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?s=[s,l]:(s=null,o=y),null!==(s=null!==s?s:"")?(y=o,58===t.charCodeAt(o)?(l=":",o++):(l=null,0===a&&u('":"')),null!==l&&null!==(c=pe())?l=[l,c]:(l=null,o=y),null!==(l=null!==l?l:"")?("::"===t.substr(o,2)?(c="::",o+=2):(c=null,0===a&&u('"::"')),null!==c&&null!==(d=pe())?e=[e,n,r,i,s,l,c,d]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g),null===e&&(g=o,null!==(e=pe())?(y=o,58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?n=[n,r]:(n=null,o=y),null!==(n=null!==n?n:"")?(y=o,58===t.charCodeAt(o)?(r=":",o++):(r=null,0===a&&u('":"')),null!==r&&null!==(i=pe())?r=[r,i]:(r=null,o=y),null!==(r=null!==r?r:"")?(y=o,58===t.charCodeAt(o)?(i=":",o++):(i=null,0===a&&u('":"')),null!==i&&null!==(s=pe())?i=[i,s]:(i=null,o=y),null!==(i=null!==i?i:"")?(y=o,58===t.charCodeAt(o)?(s=":",o++):(s=null,0===a&&u('":"')),null!==s&&null!==(l=pe())?s=[s,l]:(s=null,o=y),null!==(s=null!==s?s:"")?(y=o,58===t.charCodeAt(o)?(l=":",o++):(l=null,0===a&&u('":"')),null!==l&&null!==(c=pe())?l=[l,c]:(l=null,o=y),null!==(l=null!==l?l:"")?(y=o,58===t.charCodeAt(o)?(c=":",o++):(c=null,0===a&&u('":"')),null!==c&&null!==(d=pe())?c=[c,d]:(c=null,o=y),null!==(c=null!==c?c:"")?("::"===t.substr(o,2)?(d="::",o+=2):(d=null,0===a&&u('"::"')),null!==d?e=[e,n,r,i,s,l,c,d]:(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g)):(e=null,o=g))))))))))))))),null!==e&&(T=_,Hn.host_type="IPv6",e=t.substring(o,T)),null===e&&(o=_),e}function pe(){var e,t,n,r,i;return i=o,null!==(e=p())&&null!==(t=null!==(t=p())?t:"")&&null!==(n=null!==(n=p())?n:"")&&null!==(r=null!==(r=p())?r:"")?e=[e,t,n,r]:(e=null,o=i),e}function he(){var e,n,r,i;return i=o,null!==(e=pe())?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n&&null!==(r=pe())?e=[e,n,r]:(e=null,o=i)):(e=null,o=i),null===e&&(e=me()),e}function me(){var e,n,r,i,s,l,c,d,f,p;return d=o,f=o,null!==(e=ve())?(46===t.charCodeAt(o)?(n=".",o++):(n=null,0===a&&u('"."')),null!==n&&null!==(r=ve())?(46===t.charCodeAt(o)?(i=".",o++):(i=null,0===a&&u('"."')),null!==i&&null!==(s=ve())?(46===t.charCodeAt(o)?(l=".",o++):(l=null,0===a&&u('"."')),null!==l&&null!==(c=ve())?e=[e,n,r,i,s,l,c]:(e=null,o=f)):(e=null,o=f)):(e=null,o=f)):(e=null,o=f),null!==e&&(p=d,Hn.host_type="IPv4",e=t.substring(o,p)),null===e&&(o=d),e}function ve(){var e,n,r,i;return i=o,"25"===t.substr(o,2)?(e="25",o+=2):(e=null,0===a&&u('"25"')),null!==e?(/^[0-5]/.test(t.charAt(o))?(n=t.charAt(o),o++):(n=null,0===a&&u("[0-5]")),null!==n?e=[e,n]:(e=null,o=i)):(e=null,o=i),null===e&&(i=o,50===t.charCodeAt(o)?(e="2",o++):(e=null,0===a&&u('"2"')),null!==e?(/^[0-4]/.test(t.charAt(o))?(n=t.charAt(o),o++):(n=null,0===a&&u("[0-4]")),null!==n&&null!==(r=d())?e=[e,n,r]:(e=null,o=i)):(e=null,o=i),null===e&&(i=o,49===t.charCodeAt(o)?(e="1",o++):(e=null,0===a&&u('"1"')),null!==e&&null!==(n=d())&&null!==(r=d())?e=[e,n,r]:(e=null,o=i),null===e&&(i=o,/^[1-9]/.test(t.charAt(o))?(e=t.charAt(o),o++):(e=null,0===a&&u("[1-9]")),null!==e&&null!==(n=d())?e=[e,n]:(e=null,o=i),null===e&&(e=d())))),e}function _e(){var e,t,n,r,i,a,s,l;return a=o,s=o,null!==(e=null!==(e=d())?e:"")&&null!==(t=null!==(t=d())?t:"")&&null!==(n=null!==(n=d())?n:"")&&null!==(r=null!==(r=d())?r:"")&&null!==(i=null!==(i=d())?i:"")?e=[e,t,n,r,i]:(e=null,o=s),null!==e&&(l=e,l=parseInt(l.join("")),Hn.port=l,e=l),null===e&&(o=a),e}function ge(){var e,n,r,i;for(e=[],i=o,59===t.charCodeAt(o)?(n=";",o++):(n=null,0===a&&u('";"')),null!==n&&null!==(r=ye())?n=[n,r]:(n=null,o=i);null!==n;)e.push(n),i=o,59===t.charCodeAt(o)?(n=";",o++):(n=null,0===a&&u('";"')),null!==n&&null!==(r=ye())?n=[n,r]:(n=null,o=i);return e}function ye(){var e;return null===(e=Te())&&null===(e=Ce())&&null===(e=Se())&&null===(e=be())&&null===(e=Ee())&&null===(e=we())&&(e=Re()),e}function Te(){var e,n,r,i,s;return r=o,i=o,"transport="===t.substr(o,10).toLowerCase()?(e=t.substr(o,10),o+=10):(e=null,0===a&&u('"transport="')),null!==e?("udp"===t.substr(o,3).toLowerCase()?(n=t.substr(o,3),o+=3):(n=null,0===a&&u('"udp"')),null===n&&("tcp"===t.substr(o,3).toLowerCase()?(n=t.substr(o,3),o+=3):(n=null,0===a&&u('"tcp"')),null===n&&("sctp"===t.substr(o,4).toLowerCase()?(n=t.substr(o,4),o+=4):(n=null,0===a&&u('"sctp"')),null===n&&("tls"===t.substr(o,3).toLowerCase()?(n=t.substr(o,3),o+=3):(n=null,0===a&&u('"tls"')),null===n&&(n=P())))),null!==n?e=[e,n]:(e=null,o=i)):(e=null,o=i),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.transport=s.toLowerCase())),null===e&&(o=r),e}function Ce(){var e,n,r,i,s;return r=o,i=o,"user="===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"user="')),null!==e?("phone"===t.substr(o,5).toLowerCase()?(n=t.substr(o,5),o+=5):(n=null,0===a&&u('"phone"')),null===n&&("ip"===t.substr(o,2).toLowerCase()?(n=t.substr(o,2),o+=2):(n=null,0===a&&u('"ip"')),null===n&&(n=P())),null!==n?e=[e,n]:(e=null,o=i)):(e=null,o=i),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.user=s.toLowerCase())),null===e&&(o=r),e}function Se(){var e,n,r,i,s;return r=o,i=o,"method="===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"method="')),null!==e&&null!==(n=ct())?e=[e,n]:(e=null,o=i),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.method=s)),null===e&&(o=r),e}function be(){var e,n,r,i,s;return r=o,i=o,"ttl="===t.substr(o,4).toLowerCase()?(e=t.substr(o,4),o+=4):(e=null,0===a&&u('"ttl="')),null!==e&&null!==(n=En())?e=[e,n]:(e=null,o=i),null!==e&&(s=e[1],Hn.params||(Hn.params={}),e=void(Hn.params.ttl=s)),null===e&&(o=r),e}function Ee(){var e,n,r,i,s;return r=o,i=o,"maddr="===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"maddr="')),null!==e&&null!==(n=se())?e=[e,n]:(e=null,o=i),null!==e&&(s=e[1],Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.maddr=s)),null===e&&(o=r),e}function we(){var e,n,r,i,s,l;return i=o,s=o,"lr"===t.substr(o,2).toLowerCase()?(e=t.substr(o,2),o+=2):(e=null,0===a&&u('"lr"')),null!==e?(l=o,61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null!==n&&null!==(r=P())?n=[n,r]:(n=null,o=l),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=s)):(e=null,o=s),null!==e&&(Hn.uri_params||(Hn.uri_params={}),e=void(Hn.uri_params.lr=void 0)),null===e&&(o=i),e}function Re(){var e,n,r,i,s,l,c,d;return i=o,s=o,null!==(e=Ae())?(l=o,61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null!==n&&null!==(r=ke())?n=[n,r]:(n=null,o=l),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=s)):(e=null,o=s),null!==e&&(c=e[0],d=e[1],Hn.uri_params||(Hn.uri_params={}),d="undefined"===typeof d?void 0:d[1],e=void(Hn.uri_params[c.toLowerCase()]=d)),null===e&&(o=i),e}function Ae(){var e,t,n;if(n=o,null!==(t=xe()))for(e=[];null!==t;)e.push(t),t=xe();else e=null;return null!==e&&(e=e.join("")),null===e&&(o=n),e}function ke(){var e,t,n;if(n=o,null!==(t=xe()))for(e=[];null!==t;)e.push(t),t=xe();else e=null;return null!==e&&(e=e.join("")),null===e&&(o=n),e}function xe(){var e;return null===(e=Ie())&&null===(e=C())&&(e=b()),e}function Ie(){var e;return 91===t.charCodeAt(o)?(e="[",o++):(e=null,0===a&&u('"["')),null===e&&(93===t.charCodeAt(o)?(e="]",o++):(e=null,0===a&&u('"]"')),null===e&&(47===t.charCodeAt(o)?(e="/",o++):(e=null,0===a&&u('"/"')),null===e&&(58===t.charCodeAt(o)?(e=":",o++):(e=null,0===a&&u('":"')),null===e&&(38===t.charCodeAt(o)?(e="&",o++):(e=null,0===a&&u('"&"')),null===e&&(43===t.charCodeAt(o)?(e="+",o++):(e=null,0===a&&u('"+"')),null===e&&(36===t.charCodeAt(o)?(e="$",o++):(e=null,0===a&&u('"$"')))))))),e}function Pe(){var e,n,r,i,s,l,c;if(l=o,63===t.charCodeAt(o)?(e="?",o++):(e=null,0===a&&u('"?"')),null!==e)if(null!==(n=Oe())){for(r=[],c=o,38===t.charCodeAt(o)?(i="&",o++):(i=null,0===a&&u('"&"')),null!==i&&null!==(s=Oe())?i=[i,s]:(i=null,o=c);null!==i;)r.push(i),c=o,38===t.charCodeAt(o)?(i="&",o++):(i=null,0===a&&u('"&"')),null!==i&&null!==(s=Oe())?i=[i,s]:(i=null,o=c);null!==r?e=[e,n,r]:(e=null,o=l)}else e=null,o=l;else e=null,o=l;return e}function Oe(){var e,n,r,i,s,l,c;return i=o,s=o,null!==(e=Ne())?(61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null!==n&&null!==(r=De())?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(l=e[0],c=e[2],l=l.join("").toLowerCase(),c=c.join(""),Hn.uri_headers||(Hn.uri_headers={}),e=void(Hn.uri_headers[l]?Hn.uri_headers[l].push(c):Hn.uri_headers[l]=[c])),null===e&&(o=i),e}function Ne(){var e,t;if(null===(t=Me())&&null===(t=C())&&(t=b()),null!==t)for(e=[];null!==t;)e.push(t),null===(t=Me())&&null===(t=C())&&(t=b());else e=null;return e}function De(){var e,t;for(e=[],null===(t=Me())&&null===(t=C())&&(t=b());null!==t;)e.push(t),null===(t=Me())&&null===(t=C())&&(t=b());return e}function Me(){var e;return 91===t.charCodeAt(o)?(e="[",o++):(e=null,0===a&&u('"["')),null===e&&(93===t.charCodeAt(o)?(e="]",o++):(e=null,0===a&&u('"]"')),null===e&&(47===t.charCodeAt(o)?(e="/",o++):(e=null,0===a&&u('"/"')),null===e&&(63===t.charCodeAt(o)?(e="?",o++):(e=null,0===a&&u('"?"')),null===e&&(58===t.charCodeAt(o)?(e=":",o++):(e=null,0===a&&u('":"')),null===e&&(43===t.charCodeAt(o)?(e="+",o++):(e=null,0===a&&u('"+"')),null===e&&(36===t.charCodeAt(o)?(e="$",o++):(e=null,0===a&&u('"$"')))))))),e}function Ue(){var e,t,n,r,i,a;return a=o,null!==(e=ct())&&null!==(t=_())&&null!==(n=Le())&&null!==(r=_())&&null!==(i=et())?e=[e,t,n,r,i]:(e=null,o=a),e}function Le(){var e;return null===(e=X())&&(e=Fe()),e}function Fe(){var e,n,r,i;return i=o,null!==(e=Je())?(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null!==n?(null===(r=qe())&&(r=ze()),null!==r?e=[e,n,r]:(e=null,o=i)):(e=null,o=i)):(e=null,o=i),e}function qe(){var e,n,r,i,s;return i=o,null===(e=He())&&(e=je()),null!==e?(s=o,63===t.charCodeAt(o)?(n="?",o++):(n=null,0===a&&u('"?"')),null!==n&&null!==(r=Ze())?n=[n,r]:(n=null,o=s),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=i)):(e=null,o=i),e}function He(){var e,n,r,i;return i=o,"//"===t.substr(o,2)?(e="//",o+=2):(e=null,0===a&&u('"//"')),null!==e&&null!==(n=Ye())&&null!==(r=null!==(r=je())?r:"")?e=[e,n,r]:(e=null,o=i),e}function je(){var e,n,r;return r=o,47===t.charCodeAt(o)?(e="/",o++):(e=null,0===a&&u('"/"')),null!==e&&null!==(n=Ve())?e=[e,n]:(e=null,o=r),e}function ze(){var e,t,n,r;if(r=o,null!==(e=We())){for(t=[],n=Ge();null!==n;)t.push(n),n=Ge();null!==t?e=[e,t]:(e=null,o=r)}else e=null,o=r;return e}function Ge(){var e;return null===(e=T())&&null===(e=C())&&(e=b()),e}function We(){var e;return null===(e=C())&&null===(e=b())&&(59===t.charCodeAt(o)?(e=";",o++):(e=null,0===a&&u('";"')),null===e&&(63===t.charCodeAt(o)?(e="?",o++):(e=null,0===a&&u('"?"')),null===e&&(58===t.charCodeAt(o)?(e=":",o++):(e=null,0===a&&u('":"')),null===e&&(64===t.charCodeAt(o)?(e="@",o++):(e=null,0===a&&u('"@"')),null===e&&(38===t.charCodeAt(o)?(e="&",o++):(e=null,0===a&&u('"&"')),null===e&&(61===t.charCodeAt(o)?(e="=",o++):(e=null,0===a&&u('"="')),null===e&&(43===t.charCodeAt(o)?(e="+",o++):(e=null,0===a&&u('"+"')),null===e&&(36===t.charCodeAt(o)?(e="$",o++):(e=null,0===a&&u('"$"')),null===e&&(44===t.charCodeAt(o)?(e=",",o++):(e=null,0===a&&u('","'))))))))))),e}function Ve(){var e,n,r,i,s,l;if(s=o,null!==(e=Be())){for(n=[],l=o,47===t.charCodeAt(o)?(r="/",o++):(r=null,0===a&&u('"/"')),null!==r&&null!==(i=Be())?r=[r,i]:(r=null,o=l);null!==r;)n.push(r),l=o,47===t.charCodeAt(o)?(r="/",o++):(r=null,0===a&&u('"/"')),null!==r&&null!==(i=Be())?r=[r,i]:(r=null,o=l);null!==n?e=[e,n]:(e=null,o=s)}else e=null,o=s;return e}function Be(){var e,n,r,i,s,l;for(s=o,e=[],n=$e();null!==n;)e.push(n),n=$e();if(null!==e){for(n=[],l=o,59===t.charCodeAt(o)?(r=";",o++):(r=null,0===a&&u('";"')),null!==r&&null!==(i=Ke())?r=[r,i]:(r=null,o=l);null!==r;)n.push(r),l=o,59===t.charCodeAt(o)?(r=";",o++):(r=null,0===a&&u('";"')),null!==r&&null!==(i=Ke())?r=[r,i]:(r=null,o=l);null!==n?e=[e,n]:(e=null,o=s)}else e=null,o=s;return e}function Ke(){var e,t;for(e=[],t=$e();null!==t;)e.push(t),t=$e();return e}function $e(){var e;return null===(e=C())&&null===(e=b())&&(58===t.charCodeAt(o)?(e=":",o++):(e=null,0===a&&u('":"')),null===e&&(64===t.charCodeAt(o)?(e="@",o++):(e=null,0===a&&u('"@"')),null===e&&(38===t.charCodeAt(o)?(e="&",o++):(e=null,0===a&&u('"&"')),null===e&&(61===t.charCodeAt(o)?(e="=",o++):(e=null,0===a&&u('"="')),null===e&&(43===t.charCodeAt(o)?(e="+",o++):(e=null,0===a&&u('"+"')),null===e&&(36===t.charCodeAt(o)?(e="$",o++):(e=null,0===a&&u('"$"')),null===e&&(44===t.charCodeAt(o)?(e=",",o++):(e=null,0===a&&u('","'))))))))),e}function Je(){var e,n,r,i,s,l;if(i=o,s=o,null!==(e=f())){for(n=[],null===(r=f())&&null===(r=d())&&(43===t.charCodeAt(o)?(r="+",o++):(r=null,0===a&&u('"+"')),null===r&&(45===t.charCodeAt(o)?(r="-",o++):(r=null,0===a&&u('"-"')),null===r&&(46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')))));null!==r;)n.push(r),null===(r=f())&&null===(r=d())&&(43===t.charCodeAt(o)?(r="+",o++):(r=null,0===a&&u('"+"')),null===r&&(45===t.charCodeAt(o)?(r="-",o++):(r=null,0===a&&u('"-"')),null===r&&(46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')))));null!==n?e=[e,n]:(e=null,o=s)}else e=null,o=s;return null!==e&&(l=i,e=void(Hn.scheme=t.substring(o,l))),null===e&&(o=i),e}function Ye(){var e;return null===(e=Qe())&&(e=Xe()),e}function Qe(){var e,n,r,i;return r=o,i=o,null!==(e=ne())?(64===t.charCodeAt(o)?(n="@",o++):(n=null,0===a&&u('"@"')),null!==n?e=[e,n]:(e=null,o=i)):(e=null,o=i),null!==(e=null!==e?e:"")&&null!==(n=ae())?e=[e,n]:(e=null,o=r),e=null!==e?e:""}function Xe(){var e,n;if(null===(n=C())&&null===(n=b())&&(36===t.charCodeAt(o)?(n="$",o++):(n=null,0===a&&u('"$"')),null===n&&(44===t.charCodeAt(o)?(n=",",o++):(n=null,0===a&&u('","')),null===n&&(59===t.charCodeAt(o)?(n=";",o++):(n=null,0===a&&u('";"')),null===n&&(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null===n&&(64===t.charCodeAt(o)?(n="@",o++):(n=null,0===a&&u('"@"')),null===n&&(38===t.charCodeAt(o)?(n="&",o++):(n=null,0===a&&u('"&"')),null===n&&(61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"')))))))))),null!==n)for(e=[];null!==n;)e.push(n),null===(n=C())&&null===(n=b())&&(36===t.charCodeAt(o)?(n="$",o++):(n=null,0===a&&u('"$"')),null===n&&(44===t.charCodeAt(o)?(n=",",o++):(n=null,0===a&&u('","')),null===n&&(59===t.charCodeAt(o)?(n=";",o++):(n=null,0===a&&u('";"')),null===n&&(58===t.charCodeAt(o)?(n=":",o++):(n=null,0===a&&u('":"')),null===n&&(64===t.charCodeAt(o)?(n="@",o++):(n=null,0===a&&u('"@"')),null===n&&(38===t.charCodeAt(o)?(n="&",o++):(n=null,0===a&&u('"&"')),null===n&&(61===t.charCodeAt(o)?(n="=",o++):(n=null,0===a&&u('"="')),null===n&&(43===t.charCodeAt(o)?(n="+",o++):(n=null,0===a&&u('"+"'))))))))));else e=null;return e}function Ze(){var e,t;for(e=[],t=Ge();null!==t;)e.push(t),t=Ge();return e}function et(){var e,n,r,i,s,l,c,f,p;if(c=o,f=o,"sip"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"SIP"')),null!==e)if(47===t.charCodeAt(o)?(n="/",o++):(n=null,0===a&&u('"/"')),null!==n){if(null!==(i=d()))for(r=[];null!==i;)r.push(i),i=d();else r=null;if(null!==r)if(46===t.charCodeAt(o)?(i=".",o++):(i=null,0===a&&u('"."')),null!==i){if(null!==(l=d()))for(s=[];null!==l;)s.push(l),l=d();else s=null;null!==s?e=[e,n,r,i,s]:(e=null,o=f)}else e=null,o=f;else e=null,o=f}else e=null,o=f;else e=null,o=f;return null!==e&&(p=c,e=void(Hn.sip_version=t.substring(o,p))),null===e&&(o=c),e}function tt(){var e;return"INVITE"===t.substr(o,6)?(e="INVITE",o+=6):(e=null,0===a&&u('"INVITE"')),e}function nt(){var e;return"ACK"===t.substr(o,3)?(e="ACK",o+=3):(e=null,0===a&&u('"ACK"')),e}function rt(){var e;return"OPTIONS"===t.substr(o,7)?(e="OPTIONS",o+=7):(e=null,0===a&&u('"OPTIONS"')),e}function it(){var e;return"BYE"===t.substr(o,3)?(e="BYE",o+=3):(e=null,0===a&&u('"BYE"')),e}function ot(){var e;return"CANCEL"===t.substr(o,6)?(e="CANCEL",o+=6):(e=null,0===a&&u('"CANCEL"')),e}function at(){var e;return"REGISTER"===t.substr(o,8)?(e="REGISTER",o+=8):(e=null,0===a&&u('"REGISTER"')),e}function st(){var e;return"SUBSCRIBE"===t.substr(o,9)?(e="SUBSCRIBE",o+=9):(e=null,0===a&&u('"SUBSCRIBE"')),e}function lt(){var e;return"NOTIFY"===t.substr(o,6)?(e="NOTIFY",o+=6):(e=null,0===a&&u('"NOTIFY"')),e}function ut(){var e;return"REFER"===t.substr(o,5)?(e="REFER",o+=5):(e=null,0===a&&u('"REFER"')),e}function ct(){var e,n,r;return n=o,null===(e=tt())&&null===(e=nt())&&null===(e=rt())&&null===(e=it())&&null===(e=ot())&&null===(e=at())&&null===(e=st())&&null===(e=lt())&&null===(e=ut())&&(e=P()),null!==e&&(r=n,Hn.method=t.substring(o,r),e=Hn.method),null===e&&(o=n),e}function dt(){var e,t,n,r,i,a;return a=o,null!==(e=et())&&null!==(t=_())&&null!==(n=ft())&&null!==(r=_())&&null!==(i=ht())?e=[e,t,n,r,i]:(e=null,o=a),e}function ft(){var e,t,n;return t=o,null!==(e=pt())&&(n=e,e=void(Hn.status_code=parseInt(n.join("")))),null===e&&(o=t),e}function pt(){var e,t,n,r;return r=o,null!==(e=d())&&null!==(t=d())&&null!==(n=d())?e=[e,t,n]:(e=null,o=r),e}function ht(){var e,n,r,i;for(r=o,e=[],null===(n=T())&&null===(n=C())&&null===(n=b())&&null===(n=x())&&null===(n=I())&&null===(n=_())&&(n=g());null!==n;)e.push(n),null===(n=T())&&null===(n=C())&&null===(n=b())&&null===(n=x())&&null===(n=I())&&null===(n=_())&&(n=g());return null!==e&&(i=r,e=void(Hn.reason_phrase=t.substring(o,i))),null===e&&(o=r),e}function mt(){var e,t,n,r,i,a,s;if(i=o,a=o,null===(e=Q())&&(e=vt()),null!==e){for(t=[],s=o,null!==(n=z())&&null!==(r=gt())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=z())&&null!==(r=gt())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;return null!==e&&(e=function(e){var t;Hn.multi_header||(Hn.multi_header=[]);try{t=new qn(Hn.uri,Hn.display_name,Hn.params),delete Hn.uri,delete Hn.display_name,delete Hn.params}catch(n){t=null}Hn.multi_header.push({possition:o,offset:e,parsed:t})}(i)),null===e&&(o=i),e}function vt(){var e,t,n,r,i;return i=o,null!==(e=null!==(e=_t())?e:"")&&null!==(t=H())&&null!==(n=X())&&null!==(r=q())?e=[e,t,n,r]:(e=null,o=i),e}function _t(){var e,t,n,r,i,a,s,l;if(i=o,a=o,null!==(e=P())){for(t=[],s=o,null!==(n=E())&&null!==(r=P())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=E())&&null!==(r=P())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;return null===e&&(e=$()),null!==e&&(l=e,e=void(Hn.display_name="string"===typeof l?l:l[1].reduce(function(e,t){return e+t[0]+t[1]},l[0]))),null===e&&(o=i),e}function gt(){var e;return null===(e=yt())&&null===(e=Tt())&&(e=bt()),e}function yt(){var e,n,r,i,s,l;return i=o,s=o,"q"===t.substr(o,1).toLowerCase()?(e=t.substr(o,1),o++):(e=null,0===a&&u('"q"')),null!==e&&null!==(n=U())&&null!==(r=St())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],Hn.params||(Hn.params={}),e=void(Hn.params.q=l)),null===e&&(o=i),e}function Tt(){var e,n,r,i,s,l;return i=o,s=o,"expires"===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"expires"')),null!==e&&null!==(n=U())&&null!==(r=Ct())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],Hn.params||(Hn.params={}),e=void(Hn.params.expires=l)),null===e&&(o=i),e}function Ct(){var e,t,n;if(n=o,null!==(t=d()))for(e=[];null!==t;)e.push(t),t=d();else e=null;return null!==e&&(e=parseInt(e.join(""))),null===e&&(o=n),e}function St(){var e,n,r,i,s,l,c,f,p;return l=o,c=o,48===t.charCodeAt(o)?(e="0",o++):(e=null,0===a&&u('"0"')),null!==e?(f=o,46===t.charCodeAt(o)?(n=".",o++):(n=null,0===a&&u('"."')),null!==n&&null!==(r=null!==(r=d())?r:"")&&null!==(i=null!==(i=d())?i:"")&&null!==(s=null!==(s=d())?s:"")?n=[n,r,i,s]:(n=null,o=f),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=c)):(e=null,o=c),null!==e&&(p=l,e=parseFloat(t.substring(o,p))),null===e&&(o=l),e}function bt(){var e,t,n,r,i,a,s,l;return r=o,i=o,null!==(e=P())?(a=o,null!==(t=U())&&null!==(n=Et())?t=[t,n]:(t=null,o=a),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,o=i)):(e=null,o=i),null!==e&&(s=e[0],l=e[1],Hn.params||(Hn.params={}),l="undefined"===typeof l?void 0:l[1],e=void(Hn.params[s.toLowerCase()]=l)),null===e&&(o=r),e}function Et(){var e;return null===(e=P())&&null===(e=se())&&(e=K()),e}function wt(){var e;return"render"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"render"')),null===e&&("session"===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"session"')),null===e&&("icon"===t.substr(o,4).toLowerCase()?(e=t.substr(o,4),o+=4):(e=null,0===a&&u('"icon"')),null===e&&("alert"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"alert"')),null===e&&(e=P())))),e}function Rt(){var e;return null===(e=At())&&(e=bt()),e}function At(){var e,n,r,i;return i=o,"handling"===t.substr(o,8).toLowerCase()?(e=t.substr(o,8),o+=8):(e=null,0===a&&u('"handling"')),null!==e&&null!==(n=U())?("optional"===t.substr(o,8).toLowerCase()?(r=t.substr(o,8),o+=8):(r=null,0===a&&u('"optional"')),null===r&&("required"===t.substr(o,8).toLowerCase()?(r=t.substr(o,8),o+=8):(r=null,0===a&&u('"required"')),null===r&&(r=P())),null!==r?e=[e,n,r]:(e=null,o=i)):(e=null,o=i),e}function kt(){var e,t,n,r,i,a,s,l;if(s=o,null!==(e=xt()))if(null!==(t=M()))if(null!==(n=Dt())){for(r=[],l=o,null!==(i=z())&&null!==(a=Mt())?i=[i,a]:(i=null,o=l);null!==i;)r.push(i),l=o,null!==(i=z())&&null!==(a=Mt())?i=[i,a]:(i=null,o=l);null!==r?e=[e,t,n,r]:(e=null,o=s)}else e=null,o=s;else e=null,o=s;else e=null,o=s;return e}function xt(){var e;return null===(e=It())&&(e=Pt()),e}function It(){var e;return"text"===t.substr(o,4).toLowerCase()?(e=t.substr(o,4),o+=4):(e=null,0===a&&u('"text"')),null===e&&("image"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"image"')),null===e&&("audio"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"audio"')),null===e&&("video"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"video"')),null===e&&("application"===t.substr(o,11).toLowerCase()?(e=t.substr(o,11),o+=11):(e=null,0===a&&u('"application"')),null===e&&(e=Ot()))))),e}function Pt(){var e;return"message"===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"message"')),null===e&&("multipart"===t.substr(o,9).toLowerCase()?(e=t.substr(o,9),o+=9):(e=null,0===a&&u('"multipart"')),null===e&&(e=Ot())),e}function Ot(){var e;return null===(e=P())&&(e=Nt()),e}function Nt(){var e,n,r;return r=o,"x-"===t.substr(o,2).toLowerCase()?(e=t.substr(o,2),o+=2):(e=null,0===a&&u('"x-"')),null!==e&&null!==(n=P())?e=[e,n]:(e=null,o=r),e}function Dt(){var e;return null===(e=Ot())&&(e=P()),e}function Mt(){var e,t,n,r;return r=o,null!==(e=P())&&null!==(t=U())&&null!==(n=Ut())?e=[e,t,n]:(e=null,o=r),e}function Ut(){var e;return null===(e=P())&&(e=K()),e}function Lt(){var e,t,n,r;if(n=o,null!==(t=d()))for(e=[];null!==t;)e.push(t),t=d();else e=null;return null!==e&&(r=e,e=void(Hn.value=parseInt(r.join("")))),null===e&&(o=n),e}function Ft(){var e,n,r,i,s,l;if(s=o,null!==(e=O())){for(n=[],l=o,46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')),null!==r&&null!==(i=O())?r=[r,i]:(r=null,o=l);null!==r;)n.push(r),l=o,46===t.charCodeAt(o)?(r=".",o++):(r=null,0===a&&u('"."')),null!==r&&null!==(i=O())?r=[r,i]:(r=null,o=l);null!==n?e=[e,n]:(e=null,o=s)}else e=null,o=s;return e}function qt(){var e;return null===(e=Ht())&&(e=bt()),e}function Ht(){var e,n,r,i,s,l;return i=o,s=o,"tag"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"tag"')),null!==e&&null!==(n=U())&&null!==(r=P())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.tag=l)),null===e&&(o=i),e}function jt(){var e,n,r,i,s,l,c,d;if(c=o,"digest"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"Digest"')),null!==e)if(null!==(n=E()))if(null!==(r=Wt())){for(i=[],d=o,null!==(s=j())&&null!==(l=Wt())?s=[s,l]:(s=null,o=d);null!==s;)i.push(s),d=o,null!==(s=j())&&null!==(l=Wt())?s=[s,l]:(s=null,o=d);null!==i?e=[e,n,r,i]:(e=null,o=c)}else e=null,o=c;else e=null,o=c;else e=null,o=c;return null===e&&(e=zt()),e}function zt(){var e,t,n,r,i,a,s,l;if(s=o,null!==(e=P()))if(null!==(t=E()))if(null!==(n=Gt())){for(r=[],l=o,null!==(i=j())&&null!==(a=Gt())?i=[i,a]:(i=null,o=l);null!==i;)r.push(i),l=o,null!==(i=j())&&null!==(a=Gt())?i=[i,a]:(i=null,o=l);null!==r?e=[e,t,n,r]:(e=null,o=s)}else e=null,o=s;else e=null,o=s;else e=null,o=s;return e}function Gt(){var e,t,n,r;return r=o,null!==(e=P())&&null!==(t=U())?(null===(n=P())&&(n=K()),null!==n?e=[e,t,n]:(e=null,o=r)):(e=null,o=r),e}function Wt(){var e;return null===(e=Vt())&&null===(e=Kt())&&null===(e=Jt())&&null===(e=Qt())&&null===(e=Xt())&&null===(e=Zt())&&null===(e=en())&&(e=Gt()),e}function Vt(){var e,n,r,i;return i=o,"realm"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"realm"')),null!==e&&null!==(n=U())&&null!==(r=Bt())?e=[e,n,r]:(e=null,o=i),e}function Bt(){var e,t,n;return t=o,null!==(e=$())&&(n=e,e=void(Hn.realm=n)),null===e&&(o=t),e}function Kt(){var e,n,r,i,s,l,c,d,f;if(d=o,"domain"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"domain"')),null!==e)if(null!==(n=U()))if(null!==(r=W()))if(null!==(i=$t())){if(s=[],f=o,null!==(c=_()))for(l=[];null!==c;)l.push(c),c=_();else l=null;for(null!==l&&null!==(c=$t())?l=[l,c]:(l=null,o=f);null!==l;){if(s.push(l),f=o,null!==(c=_()))for(l=[];null!==c;)l.push(c),c=_();else l=null;null!==l&&null!==(c=$t())?l=[l,c]:(l=null,o=f)}null!==s&&null!==(l=V())?e=[e,n,r,i,s,l]:(e=null,o=d)}else e=null,o=d;else e=null,o=d;else e=null,o=d;else e=null,o=d;return e}function $t(){var e;return null===(e=Fe())&&(e=je()),e}function Jt(){var e,n,r,i;return i=o,"nonce"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"nonce"')),null!==e&&null!==(n=U())&&null!==(r=Yt())?e=[e,n,r]:(e=null,o=i),e}function Yt(){var e,t,n;return t=o,null!==(e=$())&&(n=e,e=void(Hn.nonce=n)),null===e&&(o=t),e}function Qt(){var e,n,r,i,s,l;return i=o,s=o,"opaque"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"opaque"')),null!==e&&null!==(n=U())&&null!==(r=$())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.opaque=l)),null===e&&(o=i),e}function Xt(){var e,n,r,i,s;return i=o,"stale"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"stale"')),null!==e&&null!==(n=U())?(s=o,"true"===t.substr(o,4).toLowerCase()?(r=t.substr(o,4),o+=4):(r=null,0===a&&u('"true"')),null!==r&&(r=void(Hn.stale=!0)),null===r&&(o=s),null===r&&(s=o,"false"===t.substr(o,5).toLowerCase()?(r=t.substr(o,5),o+=5):(r=null,0===a&&u('"false"')),null!==r&&(r=void(Hn.stale=!1)),null===r&&(o=s)),null!==r?e=[e,n,r]:(e=null,o=i)):(e=null,o=i),e}function Zt(){var e,n,r,i,s,l;return i=o,s=o,"algorithm"===t.substr(o,9).toLowerCase()?(e=t.substr(o,9),o+=9):(e=null,0===a&&u('"algorithm"')),null!==e&&null!==(n=U())?("md5"===t.substr(o,3).toLowerCase()?(r=t.substr(o,3),o+=3):(r=null,0===a&&u('"MD5"')),null===r&&("md5-sess"===t.substr(o,8).toLowerCase()?(r=t.substr(o,8),o+=8):(r=null,0===a&&u('"MD5-sess"')),null===r&&(r=P())),null!==r?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.algorithm=l.toUpperCase())),null===e&&(o=i),e}function en(){var e,n,r,i,s,l,c,d,f,p;if(d=o,"qop"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"qop"')),null!==e)if(null!==(n=U()))if(null!==(r=W())){if(f=o,null!==(i=tn())){for(s=[],p=o,44===t.charCodeAt(o)?(l=",",o++):(l=null,0===a&&u('","')),null!==l&&null!==(c=tn())?l=[l,c]:(l=null,o=p);null!==l;)s.push(l),p=o,44===t.charCodeAt(o)?(l=",",o++):(l=null,0===a&&u('","')),null!==l&&null!==(c=tn())?l=[l,c]:(l=null,o=p);null!==s?i=[i,s]:(i=null,o=f)}else i=null,o=f;null!==i&&null!==(s=V())?e=[e,n,r,i,s]:(e=null,o=d)}else e=null,o=d;else e=null,o=d;else e=null,o=d;return e}function tn(){var e,n,r;return n=o,"auth-int"===t.substr(o,8).toLowerCase()?(e=t.substr(o,8),o+=8):(e=null,0===a&&u('"auth-int"')),null===e&&("auth"===t.substr(o,4).toLowerCase()?(e=t.substr(o,4),o+=4):(e=null,0===a&&u('"auth"')),null===e&&(e=P())),null!==e&&(r=e,Hn.qop||(Hn.qop=[]),e=void Hn.qop.push(r.toLowerCase())),null===e&&(o=n),e}function nn(){var e,t,n,r,i,a,s;if(i=o,a=o,null!==(e=vt())){for(t=[],s=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=s);null!==n;)t.push(n),s=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=s);null!==t?e=[e,t]:(e=null,o=a)}else e=null,o=a;return null!==e&&(e=function(e){var t;Hn.multi_header||(Hn.multi_header=[]);try{t=new qn(Hn.uri,Hn.display_name,Hn.params),delete Hn.uri,delete Hn.display_name,delete Hn.params}catch(n){t=null}Hn.multi_header.push({possition:o,offset:e,parsed:t})}(i)),null===e&&(o=i),e}function rn(){var e;return null===(e=on())&&(e=bt()),e}function on(){var e,n,r,i,s,l,c;if(s=o,l=o,"cause"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"cause"')),null!==e)if(null!==(n=U())){if(null!==(i=d()))for(r=[];null!==i;)r.push(i),i=d();else r=null;null!==r?e=[e,n,r]:(e=null,o=l)}else e=null,o=l;else e=null,o=l;return null!==e&&(c=e[2],e=void(Hn.cause=parseInt(c.join("")))),null===e&&(o=s),e}function an(){var e,t,n,r,i,a;if(i=o,null!==(e=vt())){for(t=[],a=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=a);null!==n;)t.push(n),a=o,null!==(n=z())&&null!==(r=bt())?n=[n,r]:(n=null,o=a);null!==t?e=[e,t]:(e=null,o=i)}else e=null,o=i;return e}function sn(){var e,n,r;return n=o,"active"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"active"')),null===e&&("pending"===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"pending"')),null===e&&("terminated"===t.substr(o,10).toLowerCase()?(e=t.substr(o,10),o+=10):(e=null,0===a&&u('"terminated"')),null===e&&(e=P()))),null!==e&&(r=n,e=void(Hn.state=t.substring(o,r))),null===e&&(o=n),e}function ln(){var e,n,r,i,s,l,c,d;return i=o,s=o,"reason"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"reason"')),null!==e&&null!==(n=U())&&null!==(r=un())?e=[e,n,r]:(e=null,o=s),null!==e&&(e=void("undefined"!==typeof(l=e[2])&&(Hn.reason=l))),null===e&&(o=i),null===e&&(i=o,s=o,"expires"===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"expires"')),null!==e&&null!==(n=U())&&null!==(r=Ct())?e=[e,n,r]:(e=null,o=s),null!==e&&(e=void("undefined"!==typeof(d=e[2])&&(Hn.expires=d))),null===e&&(o=i),null===e&&(i=o,s=o,"retry_after"===t.substr(o,11).toLowerCase()?(e=t.substr(o,11),o+=11):(e=null,0===a&&u('"retry_after"')),null!==e&&null!==(n=U())&&null!==(r=Ct())?e=[e,n,r]:(e=null,o=s),null!==e&&(e=void("undefined"!==typeof(c=e[2])&&(Hn.retry_after=c))),null===e&&(o=i),null===e&&(e=bt()))),e}function un(){var e;return"deactivated"===t.substr(o,11).toLowerCase()?(e=t.substr(o,11),o+=11):(e=null,0===a&&u('"deactivated"')),null===e&&("probation"===t.substr(o,9).toLowerCase()?(e=t.substr(o,9),o+=9):(e=null,0===a&&u('"probation"')),null===e&&("rejected"===t.substr(o,8).toLowerCase()?(e=t.substr(o,8),o+=8):(e=null,0===a&&u('"rejected"')),null===e&&("timeout"===t.substr(o,7).toLowerCase()?(e=t.substr(o,7),o+=7):(e=null,0===a&&u('"timeout"')),null===e&&("giveup"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"giveup"')),null===e&&("noresource"===t.substr(o,10).toLowerCase()?(e=t.substr(o,10),o+=10):(e=null,0===a&&u('"noresource"')),null===e&&("invariant"===t.substr(o,9).toLowerCase()?(e=t.substr(o,9),o+=9):(e=null,0===a&&u('"invariant"')),null===e&&(e=P()))))))),e}function cn(){var e;return null===(e=Ht())&&(e=bt()),e}function dn(){var e,t,n,r,i,a,s,l;if(s=o,null!==(e=gn()))if(null!==(t=E()))if(null!==(n=Cn())){for(r=[],l=o,null!==(i=z())&&null!==(a=fn())?i=[i,a]:(i=null,o=l);null!==i;)r.push(i),l=o,null!==(i=z())&&null!==(a=fn())?i=[i,a]:(i=null,o=l);null!==r?e=[e,t,n,r]:(e=null,o=s)}else e=null,o=s;else e=null,o=s;else e=null,o=s;return e}function fn(){var e;return null===(e=pn())&&null===(e=hn())&&null===(e=mn())&&null===(e=vn())&&null===(e=_n())&&(e=bt()),e}function pn(){var e,n,r,i,s,l;return i=o,s=o,"ttl"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"ttl"')),null!==e&&null!==(n=U())&&null!==(r=En())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.ttl=l)),null===e&&(o=i),e}function hn(){var e,n,r,i,s,l;return i=o,s=o,"maddr"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"maddr"')),null!==e&&null!==(n=U())&&null!==(r=se())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.maddr=l)),null===e&&(o=i),e}function mn(){var e,n,r,i,s,l;return i=o,s=o,"received"===t.substr(o,8).toLowerCase()?(e=t.substr(o,8),o+=8):(e=null,0===a&&u('"received"')),null!==e&&null!==(n=U())?(null===(r=me())&&(r=fe()),null!==r?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.received=l)),null===e&&(o=i),e}function vn(){var e,n,r,i,s,l;return i=o,s=o,"branch"===t.substr(o,6).toLowerCase()?(e=t.substr(o,6),o+=6):(e=null,0===a&&u('"branch"')),null!==e&&null!==(n=U())&&null!==(r=P())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.branch=l)),null===e&&(o=i),e}function _n(){var e,n,r,i,s,l,c;if(s=o,l=o,"rport"===t.substr(o,5).toLowerCase()?(e=t.substr(o,5),o+=5):(e=null,0===a&&u('"rport"')),null!==e){if(c=o,null!==(n=U())){for(r=[],i=d();null!==i;)r.push(i),i=d();null!==r?n=[n,r]:(n=null,o=c)}else n=null,o=c;null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=l)}else e=null,o=l;return null!==e&&(e=void("undefined"!==typeof response_port&&(Hn.rport=response_port.join("")))),null===e&&(o=s),e}function gn(){var e,t,n,r,i,a;return a=o,null!==(e=yn())&&null!==(t=M())&&null!==(n=P())&&null!==(r=M())&&null!==(i=Tn())?e=[e,t,n,r,i]:(e=null,o=a),e}function yn(){var e,n,r;return n=o,"sip"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"SIP"')),null===e&&(e=P()),null!==e&&(r=e,e=void(Hn.protocol=r)),null===e&&(o=n),e}function Tn(){var e,n,r;return n=o,"udp"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"UDP"')),null===e&&("tcp"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"TCP"')),null===e&&("tls"===t.substr(o,3).toLowerCase()?(e=t.substr(o,3),o+=3):(e=null,0===a&&u('"TLS"')),null===e&&("sctp"===t.substr(o,4).toLowerCase()?(e=t.substr(o,4),o+=4):(e=null,0===a&&u('"SCTP"')),null===e&&(e=P())))),null!==e&&(r=e,e=void(Hn.transport=r)),null===e&&(o=n),e}function Cn(){var e,t,n,r,i;return r=o,null!==(e=Sn())?(i=o,null!==(t=G())&&null!==(n=bn())?t=[t,n]:(t=null,o=i),null!==(t=null!==t?t:"")?e=[e,t]:(e=null,o=r)):(e=null,o=r),e}function Sn(){var e,n,r;return n=o,null===(e=me())&&null===(e=de())&&(e=le()),null!==e&&(r=n,e=void(Hn.host=t.substring(o,r))),null===e&&(o=n),e}function bn(){var e,t,n,r,i,a,s,l;return a=o,s=o,null!==(e=null!==(e=d())?e:"")&&null!==(t=null!==(t=d())?t:"")&&null!==(n=null!==(n=d())?n:"")&&null!==(r=null!==(r=d())?r:"")&&null!==(i=null!==(i=d())?i:"")?e=[e,t,n,r,i]:(e=null,o=s),null!==e&&(l=e,e=void(Hn.port=parseInt(l.join("")))),null===e&&(o=a),e}function En(){var e,t,n,r,i;return r=o,i=o,null!==(e=d())&&null!==(t=null!==(t=d())?t:"")&&null!==(n=null!==(n=d())?n:"")?e=[e,t,n]:(e=null,o=i),null!==e&&(e=parseInt(e.join(""))),null===e&&(o=r),e}function wn(){var e,t,n;return t=o,null!==(e=Ct())&&(n=e,e=void(Hn.expires=n)),null===e&&(o=t),e}function Rn(){var e;return null===(e=An())&&(e=bt()),e}function An(){var e,n,r,i,s,l;return i=o,s=o,"refresher"===t.substr(o,9).toLowerCase()?(e=t.substr(o,9),o+=9):(e=null,0===a&&u('"refresher"')),null!==e&&null!==(n=U())?("uac"===t.substr(o,3).toLowerCase()?(r=t.substr(o,3),o+=3):(r=null,0===a&&u('"uac"')),null===r&&("uas"===t.substr(o,3).toLowerCase()?(r=t.substr(o,3),o+=3):(r=null,0===a&&u('"uas"'))),null!==r?e=[e,n,r]:(e=null,o=s)):(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.refresher=l.toLowerCase())),null===e&&(o=i),e}function kn(){var e,t;for(e=[],null===(t=k())&&null===(t=I())&&(t=E());null!==t;)e.push(t),null===(t=k())&&null===(t=I())&&(t=E());return e}function xn(){var e,n,r,i,s,l,c,d,f,p,h,m;return p=o,h=o,null!==(e=Pn())?(45===t.charCodeAt(o)?(n="-",o++):(n=null,0===a&&u('"-"')),null!==n&&null!==(r=In())?(45===t.charCodeAt(o)?(i="-",o++):(i=null,0===a&&u('"-"')),null!==i&&null!==(s=In())?(45===t.charCodeAt(o)?(l="-",o++):(l=null,0===a&&u('"-"')),null!==l&&null!==(c=In())?(45===t.charCodeAt(o)?(d="-",o++):(d=null,0===a&&u('"-"')),null!==d&&null!==(f=On())?e=[e,n,r,i,s,l,c,d,f]:(e=null,o=h)):(e=null,o=h)):(e=null,o=h)):(e=null,o=h)):(e=null,o=h),null!==e&&(m=p,e[0],e=void(Hn=t.substring(o+5,m))),null===e&&(o=p),e}function In(){var e,t,n,r,i;return i=o,null!==(e=p())&&null!==(t=p())&&null!==(n=p())&&null!==(r=p())?e=[e,t,n,r]:(e=null,o=i),e}function Pn(){var e,t,n;return n=o,null!==(e=In())&&null!==(t=In())?e=[e,t]:(e=null,o=n),e}function On(){var e,t,n,r;return r=o,null!==(e=In())&&null!==(t=In())&&null!==(n=In())?e=[e,t,n]:(e=null,o=r),e}function Nn(){var e,n,r,i,s,l,c;return i=o,s=o,null!==(e=N())?(l=o,64===t.charCodeAt(o)?(n="@",o++):(n=null,0===a&&u('"@"')),null!==n&&null!==(r=N())?n=[n,r]:(n=null,o=l),null!==(n=null!==n?n:"")?e=[e,n]:(e=null,o=s)):(e=null,o=s),null!==e&&(c=i,e=void(Hn.call_id=t.substring(o,c))),null===e&&(o=i),e}function Dn(){var e;return null===(e=Mn())&&null===(e=Un())&&null===(e=Ln())&&(e=bt()),e}function Mn(){var e,n,r,i,s,l;return i=o,s=o,"to-tag"===t.substr(o,6)?(e="to-tag",o+=6):(e=null,0===a&&u('"to-tag"')),null!==e&&null!==(n=U())&&null!==(r=P())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.to_tag=l)),null===e&&(o=i),e}function Un(){var e,n,r,i,s,l;return i=o,s=o,"from-tag"===t.substr(o,8)?(e="from-tag",o+=8):(e=null,0===a&&u('"from-tag"')),null!==e&&null!==(n=U())&&null!==(r=P())?e=[e,n,r]:(e=null,o=s),null!==e&&(l=e[2],e=void(Hn.from_tag=l)),null===e&&(o=i),e}function Ln(){var e,n;return n=o,"early-only"===t.substr(o,10)?(e="early-only",o+=10):(e=null,0===a&&u('"early-only"')),null!==e&&(e=void(Hn.early_only=!0)),null===e&&(o=n),e}var Fn=n(12),qn=n(22),Hn={};if(null===i[r]()||o!==t.length){var jn=Math.max(o,s),zn=jn<t.length?t.charAt(jn):null,Gn=function(){for(var e=1,n=1,r=!1,i=0;i<Math.max(o,s);i++){var a=t.charAt(i);"\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}(l),zn,jn,Gn.line,Gn.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}()},function(e,t,n){var r=n(46),i=n(20);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?i(e):t}},function(e,t,n){var r=n(21);e.exports=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&&r(e,t)}},function(e,t,n){var r=n(8),i=n(6),o=n(9),a=n(2),s=n(4),l=n(27),u=n(3),c=n(5),d=n(22),f=n(7),p=n(1)("JsSIP:SIPMessage"),h=function(){"use strict";function e(t,n,r,i,o,s){if(a(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=c.cloneArray(o),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",u.MAX_FORWARDS);var l=i.to_uri||n,f=i.to_tag?{tag:i.to_tag}:null,p="undefined"!==typeof i.to_display_name?i.to_display_name:null;this.to=new d(l,p,f),this.setHeader("to",this.to.toString());var h,m=i.from_uri||r.configuration.uri,v={tag:i.from_tag||c.newTag()};h="undefined"!==typeof i.from_display_name?i.from_display_name:r.configuration.display_name?r.configuration.display_name:null,this.from=new d(m,h,v),this.setHeader("from",this.from.toString());var _=i.call_id||r.configuration.jssip_id+c.createRandomToken(15);this.call_id=_,this.setHeader("call-id",_);var g=i.cseq||Math.floor(1e4*Math.random());this.cseq=g,this.setHeader("cseq","".concat(g," ").concat(t))}return s(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[c.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){var t=this.headers[c.headerize(e)];if(t){if(t[0])return t[0]}else{var n=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),r=!0,i=!1,o=void 0;try{for(var a,s=this.extraHeaders[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(n.test(l))return l.substring(l.indexOf(":")+1).trim()}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}}},{key:"getHeaders",value:function(e){var t=this.headers[c.headerize(e)],n=[];if(t){var r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;n.push(l)}}catch(_){i=!0,o=_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}var u=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),d=!0,f=!1,p=void 0;try{for(var h,m=this.extraHeaders[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){var v=h.value;u.test(v)&&n.push(v.substring(v.indexOf(":")+1).trim())}}catch(_){f=!0,p=_}finally{try{d||null==m.return||m.return()}finally{if(f)throw p}}return n}},{key:"hasHeader",value:function(e){if(this.headers[c.headerize(e)])return!0;var t=new RegExp("^\\s*".concat(e,"\\s*:"),"i"),n=!0,r=!1,i=void 0;try{for(var o,a=this.extraHeaders[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(t.test(s))return!0}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!1}},{key:"parseSDP",value:function(e){return!e&&this.sdp?this.sdp:(this.sdp=l.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=!0,r=!1,i=void 0;try{for(var o,a=this.headers[t][Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;e+="".concat(t,": ").concat(s,"\r\n")}}catch(y){r=!0,i=y}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}var l=!0,d=!1,f=void 0;try{for(var p,h=this.extraHeaders[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var m=p.value;e+="".concat(m.trim(),"\r\n")}}catch(y){d=!0,f=y}finally{try{l||null==h.return||h.return()}finally{if(d)throw f}}var v=[];switch(this.method){case u.REGISTER:v.push("path","gruu");break;case u.INVITE:this.ua.configuration.session_timers&&v.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&v.push("gruu"),v.push("ice","replaces");break;case u.UPDATE:this.ua.configuration.session_timers&&v.push("timer"),v.push("ice")}v.push("outbound");var _=this.ua.configuration.user_agent||u.USER_AGENT;if(e+="Allow: ".concat(u.ALLOWED_METHODS,"\r\n"),e+="Supported: ".concat(v,"\r\n"),e+="User-Agent: ".concat(_,"\r\n"),this.body){var g=c.str_utf8_length(this.body);e+="Content-Length: ".concat(g,"\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=c.cloneArray(this.extraHeaders),t.to=this.to,t.from=this.from,t.call_id=this.call_id,t.cseq=this.cseq,t}}]),e}(),m=function(e){"use strict";function t(e,n,o,s,l){var c;return a(this,t),(c=r(this,i(t).call(this,u.INVITE,e,n,o,s,l))).transaction=null,c}return o(t,h),s(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=c.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}(),v=function(){"use strict";function e(){a(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 s(e,[{key:"addHeader",value:function(e,t){var n={raw:t};e=c.headerize(e),this.headers[e]?this.headers[e].push(n):this.headers[e]=[n]}},{key:"getHeader",value:function(e){var t=this.headers[c.headerize(e)];if(t)return t[0]?t[0].raw:void 0}},{key:"getHeaders",value:function(e){var t=this.headers[c.headerize(e)],n=[];if(!t)return[];var r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;n.push(l.raw)}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"hasHeader",value:function(e){return!!this.headers[c.headerize(e)]}},{key:"parseHeader",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e=c.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=f.parse(r,e.replace(/-/g,"_"));return-1===i?(this.headers[e].splice(t,1),void p('error parsing "'.concat(e,'" header field with value "').concat(r,'"'))):(n.parsed=i,i)}p('not so many "'.concat(e,'" headers present'))}else p('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[c.headerize(e)]=[n]}},{key:"parseSDP",value:function(e){return!e&&this.sdp?this.sdp:(this.sdp=l.parse(this.body||""),this.sdp)}},{key:"toString",value:function(){return this.data}}]),e}(),_=function(e){"use strict";function t(e){var n;return a(this,t),(n=r(this,i(t).call(this))).ua=e,n.headers={},n.ruri=null,n.transport=null,n.server_transaction=null,n}return o(t,v),s(t,[{key:"reply",value:function(e,t,n,r,i,o){var a=[],s=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||u.REASON_PHRASE[e]||"",n=c.cloneArray(n);var l="SIP/2.0 ".concat(e," ").concat(t,"\r\n");if(this.method===u.INVITE&&e>100&&e<=200){var d=this.getHeaders("record-route"),f=!0,p=!1,h=void 0;try{for(var m,v=d[Symbol.iterator]();!(f=(m=v.next()).done);f=!0){var _=m.value;l+="Record-Route: ".concat(_,"\r\n")}}catch(O){p=!0,h=O}finally{try{f||null==v.return||v.return()}finally{if(p)throw h}}}var g=this.getHeaders("via"),y=!0,T=!1,C=void 0;try{for(var S,b=g[Symbol.iterator]();!(y=(S=b.next()).done);y=!0){var E=S.value;l+="Via: ".concat(E,"\r\n")}}catch(O){T=!0,C=O}finally{try{y||null==b.return||b.return()}finally{if(T)throw C}}!this.to_tag&&e>100?s+=";tag=".concat(c.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(s+=";tag=".concat(this.to_tag)),l+="To: ".concat(s,"\r\n"),l+="From: ".concat(this.getHeader("From"),"\r\n"),l+="Call-ID: ".concat(this.call_id,"\r\n"),l+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n");var w=!0,R=!1,A=void 0;try{for(var k,x=n[Symbol.iterator]();!(w=(k=x.next()).done);w=!0){var I=k.value;l+="".concat(I.trim(),"\r\n")}}catch(O){R=!0,A=O}finally{try{w||null==x.return||x.return()}finally{if(R)throw A}}switch(this.method){case u.INVITE:this.ua.configuration.session_timers&&a.push("timer"),(this.ua.contact.pub_gruu||this.ua.contact.temp_gruu)&&a.push("gruu"),a.push("ice","replaces");break;case u.UPDATE:this.ua.configuration.session_timers&&a.push("timer"),r&&a.push("ice"),a.push("replaces")}if(a.push("outbound"),this.method===u.OPTIONS?(l+="Allow: ".concat(u.ALLOWED_METHODS,"\r\n"),l+="Accept: ".concat(u.ACCEPTED_BODY_TYPES,"\r\n")):405===e?l+="Allow: ".concat(u.ALLOWED_METHODS,"\r\n"):415===e&&(l+="Accept: ".concat(u.ACCEPTED_BODY_TYPES,"\r\n")),l+="Supported: ".concat(a,"\r\n"),r){var P=c.str_utf8_length(r);l+="Content-Type: application/sdp\r\n",l+="Content-Length: ".concat(P,"\r\n\r\n"),l+=r}else l+="Content-Length: ".concat(0,"\r\n\r\n");this.server_transaction.receiveResponse(e,l,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||u.REASON_PHRASE[e]||"";var r="SIP/2.0 ".concat(e," ").concat(t,"\r\n"),i=!0,o=!1,a=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var d=s.value;r+="Via: ".concat(d,"\r\n")}}catch(p){o=!0,a=p}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}var f=this.getHeader("To");!this.to_tag&&e>100?f+=";tag=".concat(c.newTag()):this.to_tag&&!this.s("to").hasParam("tag")&&(f+=";tag=".concat(this.to_tag)),r+="To: ".concat(f,"\r\n"),r+="From: ".concat(this.getHeader("From"),"\r\n"),r+="Call-ID: ".concat(this.call_id,"\r\n"),r+="CSeq: ".concat(this.cseq," ").concat(this.method,"\r\n"),r+="Content-Length: ".concat(0,"\r\n\r\n"),this.transport.send(r)}}]),t}(),g=function(e){"use strict";function t(){var e;return a(this,t),(e=r(this,i(t).call(this))).headers={},e.status_code=null,e.reason_phrase=null,e}return o(t,v),t}();e.exports={OutgoingRequest:h,InitialOutgoingInviteRequest:m,IncomingRequest:_,IncomingResponse:g}},function(e,t,n){var r=n(2),i=n(8),o=n(6),a=n(9),s=n(47),l=function(e){"use strict";function t(e,n){var a;return r(this,t),(a=i(this,o(t).call(this))).code=1,a.name="CONFIGURATION_ERROR",a.parameter=e,a.value=n,a.message=a.value?"Invalid value ".concat(JSON.stringify(a.value),' for parameter "').concat(a.parameter,'"'):"Missing parameter: ".concat(a.parameter),a}return a(t,e),t}(s(Error)),u=function(e){"use strict";function t(e){var n;return r(this,t),(n=i(this,o(t).call(this))).code=2,n.name="INVALID_STATE_ERROR",n.status=e,n.message="Invalid status: ".concat(e),n}return a(t,e),t}(s(Error)),c=function(e){"use strict";function t(e){var n;return r(this,t),(n=i(this,o(t).call(this))).code=3,n.name="NOT_SUPPORTED_ERROR",n.message=e,n}return a(t,e),t}(s(Error)),d=function(e){"use strict";function t(e){var n;return r(this,t),(n=i(this,o(t).call(this))).code=4,n.name="NOT_READY_ERROR",n.message=e,n}return a(t,e),t}(s(Error));e.exports={ConfigurationError:l,InvalidStateError:u,NotSupportedError:c,NotReadyError:d}},function(e,t,n){var r=n(2),i=n(4),o=n(3),a=n(5),s=n(7);e.exports=function(){"use strict";function e(t,n,i,a){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(r(this,e),!i)throw new TypeError('missing or invalid "host" parameter');for(var u in this._parameters={},this._headers={},this._scheme=t||o.SIP,this._user=n,this._host=i,this._port=a,s)Object.prototype.hasOwnProperty.call(s,u)&&this.setParam(u,s[u]);for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&this.setHeader(c,l[c])}return i(e,null,[{key:"parse",value:function(e){return-1!==(e=s.parse(e,"SIP_URI"))?e:void 0}}]),i(e,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]="undefined"===typeof t||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[a.headerize(e)]=Array.isArray(t)?t:[t]}},{key:"getHeader",value:function(e){if(e)return this._headers[a.headerize(e)]}},{key:"hasHeader",value:function(e){if(e)return!!this._headers.hasOwnProperty(a.headerize(e))}},{key:"deleteHeader",value:function(e){if(e=a.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 e(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 e=[],t="".concat(this._scheme,":");for(var n in this._user&&(t+="".concat(a.escapeUser(this._user),"@")),t+=this._host,(this._port||0===this._port)&&(t+=":".concat(this._port)),this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,n)&&(t+=";".concat(n),null!==this._parameters[n]&&(t+="=".concat(this._parameters[n])));for(var r in this._headers)if(Object.prototype.hasOwnProperty.call(this._headers,r)){var i=!0,o=!1,s=void 0;try{for(var l,u=this._headers[r][Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;e.push("".concat(r,"=").concat(c))}}catch(d){o=!0,s=d}finally{try{i||null==u.return||u.return()}finally{if(o)throw s}}}return e.length>0&&(t+="?".concat(e.join("&"))),t}},{key:"toAor",value:function(e){var t="".concat(this._scheme,":");return this._user&&(t+="".concat(a.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}}]),e}()},function(e,t,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,a,s;if("function"!==typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"===typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,e))}.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"===typeof l)o(l,this,t);else{var u=l.length,c=h(l,u);for(n=0;n<u;++n)o(c[n],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!==typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";function r(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 i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},r.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach(function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(function(e){return parseInt(e,10)})}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);return{usernameFragment:(n=n.concat(r.splitLines(t))).filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i<n.length;i++){var o=n[i],a=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){var s=r.parseRtpMap(a),l=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(s.parameters=l.length?r.parseFmtp(l[0]):{},s.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))}),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)});var i=0;return t.codecs.forEach(function(e){e.maxptime>i&&(i=e.maxptime)}),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach(function(e){n+=r.writeExtmap(e)}),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),l=s.length>0&&s[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){return e.substr(17).split(" ").map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===l&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:l,codecPayloadType:parseInt(e.parameters.apt,10)};l&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:l,mechanism:a?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&l&&n.push({ssrc:l});var c=r.matchPrefix(e,"b=");return c.length&&(c=0===c[0].indexOf("b=TIAS:")?parseInt(c[0].substr(7),10):0===c[0].indexOf("b=AS:")?1e3*parseInt(c[0].substr(5),10)*.95-16e3:void 0,n.forEach(function(e){e.maxBitrate=c})),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var a=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!==typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},e.exports=r},function(e,t,n){var r=n(26),i=n(3),o=n(11),a=n(5),s=n(50),l=n(12),u=n(22),c=n(7),d=n(73);n(1)("JsSIP")("version %s",r.version),e.exports={C:i,Exceptions:o,Utils:a,UA:s,URI:l,NameAddrHeader:u,WebSocketInterface:d,Grammar:c,debug:n(1),get name(){return r.title},get version(){return r.version}}},function(e,t,n){var r=n(2),i=n(4),o=n(8),a=n(6),s=n(20),l=n(9),u=n(13).EventEmitter,c=n(3),d=n(10),f=n(29),p=n(1)("JsSIP:NonInviteClientTransaction"),h=n(1)("JsSIP:InviteClientTransaction"),m=n(1)("JsSIP:AckClientTransaction"),v=n(1)("JsSIP:NonInviteServerTransaction"),_=n(1)("JsSIP:InviteServerTransaction"),g={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"},y=function(e){"use strict";function t(e,n,i,l){var u;r(this,t),(u=o(this,a(t).call(this))).type=g.NON_INVITE_CLIENT,u.id="z9hG4bK".concat(Math.floor(1e7*Math.random())),u.ua=e,u.transport=n,u.request=i,u.eventHandlers=l;var c="SIP/2.0/".concat(n.via_transport);return c+=" ".concat(e.configuration.via_host,";branch=").concat(u.id),u.request.setHeader("via",c),u.ua.newTransaction(s(u)),u}return l(t,u),i(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"send",value:function(){var e=this;this.stateChanged(g.STATUS_TRYING),this.F=setTimeout(function(){e.timer_F()},f.TIMER_F),this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){p("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.F),clearTimeout(this.K),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onTransportError()}},{key:"timer_F",value:function(){p("Timer F expired for transaction ".concat(this.id)),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onRequestTimeout()}},{key:"timer_K",value:function(){this.stateChanged(g.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 g.STATUS_TRYING:case g.STATUS_PROCEEDING:this.stateChanged(g.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e)}else switch(this.state){case g.STATUS_TRYING:case g.STATUS_PROCEEDING:this.stateChanged(g.STATUS_COMPLETED),clearTimeout(this.F),408===n?this.eventHandlers.onRequestTimeout():this.eventHandlers.onReceiveResponse(e),this.K=setTimeout(function(){t.timer_K()},f.TIMER_K);break;case g.STATUS_COMPLETED:}}},{key:"C",get:function(){return g}}]),t}(),T=function(e){"use strict";function t(e,n,i,l){var u;r(this,t),(u=o(this,a(t).call(this))).type=g.INVITE_CLIENT,u.id="z9hG4bK".concat(Math.floor(1e7*Math.random())),u.ua=e,u.transport=n,u.request=i,u.eventHandlers=l,i.transaction=s(u);var c="SIP/2.0/".concat(n.via_transport);return c+=" ".concat(e.configuration.via_host,";branch=").concat(u.id),u.request.setHeader("via",c),u.ua.newTransaction(s(u)),u}return l(t,u),i(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"send",value:function(){var e=this;this.stateChanged(g.STATUS_CALLING),this.B=setTimeout(function(){e.timer_B()},f.TIMER_B),this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){clearTimeout(this.B),clearTimeout(this.D),clearTimeout(this.M),this.state!==g.STATUS_ACCEPTED&&(h("transport error occurred, deleting transaction ".concat(this.id)),this.eventHandlers.onTransportError()),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_M",value:function(){h("Timer M expired for transaction ".concat(this.id)),this.state===g.STATUS_ACCEPTED&&(clearTimeout(this.B),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"timer_B",value:function(){h("Timer B expired for transaction ".concat(this.id)),this.state===g.STATUS_CALLING&&(this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this),this.eventHandlers.onRequestTimeout())}},{key:"timer_D",value:function(){h("Timer D expired for transaction ".concat(this.id)),clearTimeout(this.B),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"sendACK",value:function(e){var t=this,n=new d.OutgoingRequest(c.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()},f.TIMER_D),this.transport.send(n)}},{key:"cancel",value:function(e){if(this.state===g.STATUS_PROCEEDING){var t=new d.OutgoingRequest(c.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 g.STATUS_CALLING:this.stateChanged(g.STATUS_PROCEEDING),this.eventHandlers.onReceiveResponse(e);break;case g.STATUS_PROCEEDING:this.eventHandlers.onReceiveResponse(e)}else if(n>=200&&n<=299)switch(this.state){case g.STATUS_CALLING:case g.STATUS_PROCEEDING:this.stateChanged(g.STATUS_ACCEPTED),this.M=setTimeout(function(){t.timer_M()},f.TIMER_M),this.eventHandlers.onReceiveResponse(e);break;case g.STATUS_ACCEPTED:this.eventHandlers.onReceiveResponse(e)}else if(n>=300&&n<=699)switch(this.state){case g.STATUS_CALLING:case g.STATUS_PROCEEDING:this.stateChanged(g.STATUS_COMPLETED),this.sendACK(e),this.eventHandlers.onReceiveResponse(e);break;case g.STATUS_COMPLETED:this.sendACK(e)}}},{key:"C",get:function(){return g}}]),t}(),C=function(e){"use strict";function t(e,n,i,s){var l;r(this,t),(l=o(this,a(t).call(this))).id="z9hG4bK".concat(Math.floor(1e7*Math.random())),l.transport=n,l.request=i,l.eventHandlers=s;var u="SIP/2.0/".concat(n.via_transport);return u+=" ".concat(e.configuration.via_host,";branch=").concat(l.id),l.request.setHeader("via",u),l}return l(t,u),i(t,[{key:"send",value:function(){this.transport.send(this.request)||this.onTransportError()}},{key:"onTransportError",value:function(){m("transport error occurred for transaction ".concat(this.id)),this.eventHandlers.onTransportError()}},{key:"C",get:function(){return g}}]),t}(),S=function(e){"use strict";function t(e,n,i){var l;return r(this,t),(l=o(this,a(t).call(this))).type=g.NON_INVITE_SERVER,l.id=i.via_branch,l.ua=e,l.transport=n,l.request=i,l.last_response="",i.server_transaction=s(l),l.state=g.STATUS_TRYING,e.newTransaction(s(l)),l}return l(t,u),i(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_J",value:function(){v("Timer J expired for transaction ".concat(this.id)),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,v("transport error occurred, deleting transaction ".concat(this.id)),clearTimeout(this.J),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"receiveResponse",value:function(e,t,n,r){var i=this;if(100===e)switch(this.state){case g.STATUS_TRYING:this.stateChanged(g.STATUS_PROCEEDING),this.transport.send(t)||this.onTransportError();break;case g.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 g.STATUS_TRYING:case g.STATUS_PROCEEDING:this.stateChanged(g.STATUS_COMPLETED),this.last_response=t,this.J=setTimeout(function(){i.timer_J()},f.TIMER_J),this.transport.send(t)?n&&n():(this.onTransportError(),r&&r());break;case g.STATUS_COMPLETED:}}},{key:"C",get:function(){return g}}]),t}(),b=function(e){"use strict";function t(e,n,i){var l;return r(this,t),(l=o(this,a(t).call(this))).type=g.INVITE_SERVER,l.id=i.via_branch,l.ua=e,l.transport=n,l.request=i,l.last_response="",i.server_transaction=s(l),l.state=g.STATUS_PROCEEDING,e.newTransaction(s(l)),l.resendProvisionalTimer=null,i.reply(100),l}return l(t,u),i(t,[{key:"stateChanged",value:function(e){this.state=e,this.emit("stateChanged")}},{key:"timer_H",value:function(){_("Timer H expired for transaction ".concat(this.id)),this.state===g.STATUS_COMPLETED&&_("ACK not received, dialog will be terminated"),this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this)}},{key:"timer_I",value:function(){this.stateChanged(g.STATUS_TERMINATED)}},{key:"timer_L",value:function(){_("Timer L expired for transaction ".concat(this.id)),this.state===g.STATUS_ACCEPTED&&(this.stateChanged(g.STATUS_TERMINATED),this.ua.destroyTransaction(this))}},{key:"onTransportError",value:function(){this.transportError||(this.transportError=!0,_("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(g.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)switch(this.state){case g.STATUS_PROCEEDING:this.transport.send(t)||this.onTransportError(),this.last_response=t}if(e>100&&e<=199&&this.state===g.STATUS_PROCEEDING)null===this.resendProvisionalTimer&&(this.resendProvisionalTimer=setInterval(function(){i.resend_provisional()},f.PROVISIONAL_RESPONSE_INTERVAL));else if(e>=200&&e<=299)switch(this.state){case g.STATUS_PROCEEDING:this.stateChanged(g.STATUS_ACCEPTED),this.last_response=t,this.L=setTimeout(function(){i.timer_L()},f.TIMER_L),null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null);case g.STATUS_ACCEPTED:this.transport.send(t)?n&&n():(this.onTransportError(),r&&r())}else if(e>=300&&e<=699)switch(this.state){case g.STATUS_PROCEEDING:null!==this.resendProvisionalTimer&&(clearInterval(this.resendProvisionalTimer),this.resendProvisionalTimer=null),this.transport.send(t)?(this.stateChanged(g.STATUS_COMPLETED),this.H=setTimeout(function(){i.timer_H()},f.TIMER_H),n&&n()):(this.onTransportError(),r&&r())}}},{key:"C",get:function(){return g}}]),t}();e.exports={C:g,NonInviteClientTransaction:y,InviteClientTransaction:T,AckClientTransaction:C,NonInviteServerTransaction:S,InviteServerTransaction:b,checkTransaction:function(e,t){var n,r=e._transactions;switch(t.method){case c.INVITE:if(n=r.ist[t.via_branch]){switch(n.state){case g.STATUS_PROCEEDING:n.transport.send(n.last_response);break;case g.STATUS_ACCEPTED:}return!0}break;case c.ACK:if(!(n=r.ist[t.via_branch]))return!1;if(n.state===g.STATUS_ACCEPTED)return!1;if(n.state===g.STATUS_COMPLETED)return n.state=g.STATUS_CONFIRMED,n.I=setTimeout(function(){n.timer_I()},f.TIMER_I),!0;break;case c.CANCEL:return(n=r.ist[t.via_branch])?(t.reply_sl(200),n.state!==g.STATUS_PROCEEDING):(t.reply_sl(481),!0);default:if(n=r.nist[t.via_branch]){switch(n.state){case g.STATUS_TRYING:break;case g.STATUS_PROCEEDING:case g.STATUS_COMPLETED:n.transport.send(n.last_response)}return!0}}}}},function(e,t,n){var r=n(2),i=n(4),o=n(3),a=n(61),s=n(18),l=n(1)("JsSIP:RequestSender"),u={onRequestTimeout:function(){},onTransportError:function(){},onReceiveResponse:function(){},onAuthenticated:function(){}};e.exports=function(){"use strict";function e(t,n,i){for(var a in r(this,e),this._ua=t,this._eventHandlers=i,this._method=n.method,this._request=n,this._auth=null,this._challenged=!1,this._staled=!1,u)Object.prototype.hasOwnProperty.call(u,a)&&(this._eventHandlers[a]||(this._eventHandlers[a]=u[a]));t.status!==t.C.STATUS_USER_CLOSED||this._method===o.BYE&&this._method===o.ACK||this._eventHandlers.onTransportError()}return i(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 s.InviteClientTransaction(this._ua,this._ua.transport,this._request,t);break;case"ACK":this.clientTransaction=new s.AckClientTransaction(this._ua,this._ua.transport,this._request,t);break;default:this.clientTransaction=new s.NonInviteClientTransaction(this._ua,this._ua.transport,this._request,t)}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 l("".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 a({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(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(2),i=n(4),o=n(12),a=n(7);e.exports=function(){"use strict";function e(t,n,i){if(r(this,e),!t||!(t instanceof o))throw new TypeError('missing or invalid "uri" parameter');for(var a in this._uri=t,this._parameters={},this.display_name=n,i)Object.prototype.hasOwnProperty.call(i,a)&&this.setParam(a,i[a])}return i(e,null,[{key:"parse",value:function(e){return-1!==(e=a.parse(e,"Name_Addr_Header"))?e:void 0}}]),i(e,[{key:"setParam",value:function(e,t){e&&(this._parameters[e.toLowerCase()]="undefined"===typeof t||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(e,t){e.exports=function(e){return e?e[0]:void 0}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var u in n=Object(arguments[l]))i.call(n,u)&&(s[u]=n[u]);if(r){a=r(n);for(var c=0;c<a.length;c++)o.call(n,a[c])&&(s[a[c]]=n[a[c]])}}return s}},function(e){e.exports={_from:"jssip@^3.3.6",_id:"jssip@3.3.6",_inBundle:!1,_integrity:"sha512-kyLxEQ7GBVlEi1PIWToAob7mH8WPtdUE51382vtjYC4ZUEa6qCXB4i9EwysX2bvpJUPbieZ1UPY8C6tLXQeBbA==",_location:"/jssip",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"jssip@^3.3.6",name:"jssip",escapedName:"jssip",rawSpec:"^3.3.6",saveSpec:null,fetchSpec:"^3.3.6"},_requiredBy:["/jssip_client"],_resolved:"https://registry.npmjs.org/jssip/-/jssip-3.3.6.tgz",_shasum:"53889624437ad386578159cc267fcefb06290a57",_spec:"jssip@^3.3.6",_where:"/Users/davidcosta/workplace/jssip_ui/node_modules/jssip_client",author:{name:"Jos\xe9 Luis Mill\xe1n",email:"jmillan@aliax.net",url:"https://github.com/jmillan"},bugs:{url:"https://github.com/versatica/JsSIP/issues"},bundleDependencies:!1,contributors:[{name:"I\xf1aki Baz Castillo",email:"ibc@aliax.net",url:"https://github.com/ibc"}],dependencies:{debug:"^4.1.1",events:"^3.0.0","sdp-transform":"^2.7.0"},deprecated:!1,description:"the Javascript SIP library",devDependencies:{"@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","ansi-colors":"^3.2.4",browserify:"^16.2.3",eslint:"^5.16.0","fancy-log":"^1.3.3",gulp:"^4.0.0","gulp-babel":"^8.0.0","gulp-eslint":"^5.0.0","gulp-expect-file":"^1.0.1","gulp-header":"^2.0.7","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"},homepage:"https://jssip.net",keywords:["sip","websocket","webrtc","node","browser","library"],license:"MIT",main:"lib-es5/JsSIP.js",name:"jssip",repository:{type:"git",url:"git+https://github.com/versatica/JsSIP.git"},scripts:{lint:"gulp lint",prepublishOnly:"gulp babel",test:"gulp test"},title:"JsSIP",version:"3.3.6"}},function(e,t,n){var r=n(52),i=n(53);t.write=i,t.parse=r.parse,t.parseFmtpConfig=r.parseFmtpConfig,t.parseParams=r.parseParams,t.parsePayloads=r.parsePayloads,t.parseRemoteCandidates=r.parseRemoteCandidates,t.parseImageAttributes=r.parseImageAttributes,t.parseSimulcastStreamList=r.parseSimulcastStreamList},function(e,t){var n=e.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:%d 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*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\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"},{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(n).forEach(function(e){n[e].forEach(function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")})})},function(e,t){var n=500;e.exports={T1:n,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(e,t,n){var r=n(2),i=n(8),o=n(6),a=n(4),s=n(9),l=n(13).EventEmitter,u=n(27),c=n(3),d=n(11),f=n(18),p=n(5),h=n(29),m=n(10),v=n(62),_=n(19),g=n(64),y=n(65),T=n(66),C=n(67),S=n(12),b=n(1)("JsSIP:RTCSession"),E=n(1)("JsSIP:ERROR:RTCSession");E.log=console.warn.bind(console);var w={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},R=["audio","video"];e.exports=function(e){"use strict";function t(e){var n;return r(this,t),b("new"),(n=i(this,o(t).call(this)))._id=null,n._ua=e,n._status=w.STATUS_NULL,n._dialog=null,n._earlyDialogs={},n._contact=null,n._from_tag=null,n._to_tag=null,n._connection=null,n._connectionPromiseQueue=Promise.resolve(),n._request=null,n._is_canceled=!1,n._cancel_reason="",n._is_confirmed=!1,n._late_sdp=!1,n._rtcOfferConstraints=null,n._rtcAnswerConstraints=null,n._localMediaStream=null,n._localMediaStreamLocallyGenerated=!1,n._rtcReady=!0,n._timers={ackTimer:null,expiresTimer:null,invite2xxTimer:null,userNoAnswerTimer:null},n._direction=null,n._local_identity=null,n._remote_identity=null,n._start_time=null,n._end_time=null,n._tones=null,n._audioMuted=!1,n._videoMuted=!1,n._localHold=!1,n._remoteHold=!1,n._sessionTimers={enabled:n._ua.configuration.session_timers,refreshMethod:n._ua.configuration.session_timers_refresh_method,defaultExpires:c.SESSION_EXPIRES,currentExpires:null,running:!1,refresher:!1,timer:null},n._referSubscribers={},n._data={},n}return s(t,l),a(t,null,[{key:"C",get:function(){return w}}]),a(t,[{key:"isInProgress",value:function(){switch(this._status){case w.STATUS_NULL:case w.STATUS_INVITE_SENT:case w.STATUS_1XX_RECEIVED:case w.STATUS_INVITE_RECEIVED:case w.STATUS_WAITING_FOR_ANSWER:return!0;default:return!1}}},{key:"isEstablished",value:function(){switch(this._status){case w.STATUS_ANSWERED:case w.STATUS_WAITING_FOR_ACK:case w.STATUS_CONFIRMED:return!0;default:return!1}}},{key:"isEnded",value:function(){switch(this._status){case w.STATUS_CANCELED:case w.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;b("connect()");var r=e,i=t.eventHandlers||{},o=p.cloneArray(t.extraHeaders),a=t.mediaConstraints||{audio:!0,video:!0},s=t.mediaStream||null,l=t.pcConfig||{iceServers:[]},u=t.rtcConstraints||null,f=t.rtcOfferConstraints||null;if(this._rtcOfferConstraints=f,this._rtcAnswerConstraints=t.rtcAnswerConstraints||null,this._data=t.data||this._data,void 0===e)throw new TypeError("Not enough arguments");if(this._status!==w.STATUS_NULL)throw new d.InvalidStateError(this._status);if(!window.RTCPeerConnection)throw new d.NotSupportedError("WebRTC not supported");if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));for(var h in this._sessionTimers.enabled&&p.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=c.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=c.SESSION_EXPIRES),i)Object.prototype.hasOwnProperty.call(i,h)&&this.on(h,i[h]);this._from_tag=p.newTag();var v=t.anonymous||!1,_={from_tag:this._from_tag};this._contact=this._ua.contact.toString({anonymous:v,outbound:!0}),v&&(_.from_display_name="Anonymous",_.from_uri=new S("sip","anonymous","anonymous.invalid"),o.push("P-Preferred-Identity: ".concat(this._ua.configuration.uri.toString())),o.push("Privacy: id")),o.push("Contact: ".concat(this._contact)),o.push("Content-Type: application/sdp"),this._sessionTimers.enabled&&o.push("Session-Expires: ".concat(this._sessionTimers.defaultExpires)),this._request=new m.InitialOutgoingInviteRequest(e,this._ua,_,o),this._id=this._request.call_id+this._from_tag,this._createRTCConnection(l,u),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(a,f,s)}},{key:"init_incoming",value:function(e,t){var n,r=this;b("init_incoming()");var i=e.getHeader("Content-Type");e.body&&"application/sdp"!==i?e.reply(415):(this._status=w.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=p.newTag(),this._createDialog(e,"UAS",!0)?(e.body?this._late_sdp=!1:this._late_sdp=!0,this._status=w.STATUS_WAITING_FOR_ANSWER,this._timers.userNoAnswerTimer=setTimeout(function(){e.reply(408),r._failed("local",null,c.causes.NO_ANSWER)},this._ua.configuration.no_answer_timeout),n&&(this._timers.expiresTimer=setTimeout(function(){r._status===w.STATUS_WAITING_FOR_ANSWER&&(e.reply(487),r._failed("system",null,c.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!==w.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]:{};b("answer()");var n,r=this._request,i=p.cloneArray(t.extraHeaders),o=t.mediaConstraints||{},a=t.mediaStream||null,s=t.pcConfig||{iceServers:[]},l=t.rtcConstraints||null,u=t.rtcAnswerConstraints||null,f=!1,h=!1,m=!1,v=!1;if(this._rtcAnswerConstraints=u,this._rtcOfferConstraints=t.rtcOfferConstraints||null,this._data=t.data||this._data,"incoming"!==this._direction)throw new d.NotSupportedError('"answer" not supported for outgoing RTCSession');if(this._status!==w.STATUS_WAITING_FOR_ANSWER)throw new d.InvalidStateError(this._status);if(this._sessionTimers.enabled&&p.isDecimal(t.sessionTimersExpires)&&(t.sessionTimersExpires>=c.MIN_SESSION_EXPIRES?this._sessionTimers.defaultExpires=t.sessionTimersExpires:this._sessionTimers.defaultExpires=c.SESSION_EXPIRES),this._status=w.STATUS_ANSWERED,this._createDialog(r,"UAS")){clearTimeout(this._timers.userNoAnswerTimer),i.unshift("Contact: ".concat(this._contact));var _=r.parseSDP();Array.isArray(_.media)||(_.media=[_.media]);var g=!0,y=!1,T=void 0;try{for(var C,S=_.media[Symbol.iterator]();!(g=(C=S.next()).done);g=!0){var R=C.value;"audio"===R.type&&(f=!0,R.direction&&"sendrecv"!==R.direction||(m=!0)),"video"===R.type&&(h=!0,R.direction&&"sendrecv"!==R.direction||(v=!0))}}catch(q){y=!0,T=q}finally{try{g||null==S.return||S.return()}finally{if(y)throw T}}if(a&&!1===o.audio){n=a.getAudioTracks();var A=!0,k=!1,x=void 0;try{for(var I,P=n[Symbol.iterator]();!(A=(I=P.next()).done);A=!0){var O=I.value;a.removeTrack(O)}}catch(q){k=!0,x=q}finally{try{A||null==P.return||P.return()}finally{if(k)throw x}}}if(a&&!1===o.video){n=a.getVideoTracks();var N=!0,D=!1,M=void 0;try{for(var U,L=n[Symbol.iterator]();!(N=(U=L.next()).done);N=!0){var F=U.value;a.removeTrack(F)}}catch(q){D=!0,M=q}finally{try{N||null==L.return||L.return()}finally{if(D)throw M}}}a||void 0!==o.audio||(o.audio=m),a||void 0!==o.video||(o.video=v),a||f||(o.audio=!1),a||h||(o.video=!1),this._createRTCConnection(s,l),Promise.resolve().then(function(){return a||(o.audio||o.video?(e._localMediaStreamLocallyGenerated=!0,navigator.mediaDevices.getUserMedia(o).catch(function(t){if(e._status===w.STATUS_TERMINATED)throw new Error("terminated");throw r.reply(480),e._failed("local",null,c.causes.USER_DENIED_MEDIA_ACCESS),E('emit "getusermediafailed" [error:%o]',t),e.emit("getusermediafailed",t),new Error("getUserMedia() failed")})):void 0)}).then(function(t){if(e._status===w.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:r.body};b('emit "sdp"'),e.emit("sdp",t);var n=new RTCSessionDescription({type:"offer",sdp:t.sdp});return e._connectionPromiseQueue=e._connectionPromiseQueue.then(function(){return e._connection.setRemoteDescription(n)}).catch(function(t){throw r.reply(488),e._failed("system",null,c.causes.WEBRTC_ERROR),E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',t),e.emit("peerconnection:setremotedescriptionfailed",t),new Error("peerconnection.setRemoteDescription() failed")}),e._connectionPromiseQueue}}).then(function(){if(e._status===w.STATUS_TERMINATED)throw new Error("terminated");return e._connecting(r),e._late_sdp?e._createLocalDescription("offer",e._rtcOfferConstraints).catch(function(){throw r.reply(500),new Error("_createLocalDescription() failed")}):e._createLocalDescription("answer",u).catch(function(){throw r.reply(500),new Error("_createLocalDescription() failed")})}).then(function(t){if(e._status===w.STATUS_TERMINATED)throw new Error("terminated");e._handleSessionTimersInIncomingRequest(r,i),r.reply(200,null,i,t,function(){e._status=w.STATUS_WAITING_FOR_ACK,e._setInvite2xxTimer(r,t),e._setACKTimer(),e._accepted("local")},function(){e._failed("system",null,c.causes.CONNECTION_ERROR)})}).catch(function(t){e._status!==w.STATUS_TERMINATED&&E(t)})}else r.reply(500,"Error creating dialog")}},{key:"terminate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b("terminate()");var n,r=t.cause||c.causes.BYE,i=p.cloneArray(t.extraHeaders),o=t.body,a=t.status_code,s=t.reason_phrase;if(this._status===w.STATUS_TERMINATED)throw new d.InvalidStateError(this._status);switch(this._status){case w.STATUS_NULL:case w.STATUS_INVITE_SENT:case w.STATUS_1XX_RECEIVED:if(b("canceling session"),a&&(a<200||a>=700))throw new TypeError("Invalid status_code: ".concat(a));a&&(s=s||c.REASON_PHRASE[a]||"",n="SIP ;cause=".concat(a,' ;text="').concat(s,'"')),this._status===w.STATUS_NULL||this._status===w.STATUS_INVITE_SENT?(this._is_canceled=!0,this._cancel_reason=n):this._status===w.STATUS_1XX_RECEIVED&&this._request.cancel(n),this._status=w.STATUS_CANCELED,this._failed("local",null,c.causes.CANCELED);break;case w.STATUS_WAITING_FOR_ANSWER:case w.STATUS_ANSWERED:if(b("rejecting session"),(a=a||480)<300||a>=700)throw new TypeError("Invalid status_code: ".concat(a));this._request.reply(a,s,i,o),this._failed("local",null,c.causes.REJECTED);break;case w.STATUS_WAITING_FOR_ACK:case w.STATUS_CONFIRMED:if(b("terminating session"),s=t.reason_phrase||c.REASON_PHRASE[a]||"",a&&(a<200||a>=700))throw new TypeError("Invalid status_code: ".concat(a));if(a&&i.push("Reason: SIP ;cause=".concat(a,'; text="').concat(s,'"')),this._status===w.STATUS_WAITING_FOR_ACK&&"incoming"===this._direction&&this._request.server_transaction.state!==f.C.STATUS_TERMINATED){var l=this._dialog;this.receiveRequest=function(t){t.method===c.ACK&&(e.sendRequest(c.BYE,{extraHeaders:i,body:o}),l.terminate())},this._request.server_transaction.on("stateChanged",function(){e._request.server_transaction.state===f.C.STATUS_TERMINATED&&(e.sendRequest(c.BYE,{extraHeaders:i,body:o}),l.terminate())}),this._ended("local",null,r),this._dialog=l,this._ua.newDialog(l)}else this.sendRequest(c.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]:{};b("sendDTMF() | tones: %s",e);var n=0,r=t.duration||null,i=t.interToneGap||null;if(void 0===e)throw new TypeError("Not enough arguments");if(this._status!==w.STATUS_CONFIRMED&&this._status!==w.STATUS_WAITING_FOR_ACK)throw new d.InvalidStateError(this._status);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&&!p.isDecimal(r))throw new TypeError("Invalid tone duration: ".concat(r));if(r?r<g.C.MIN_DURATION?(b('"duration" value is lower than the minimum allowed, setting it to '.concat(g.C.MIN_DURATION," milliseconds")),r=g.C.MIN_DURATION):r>g.C.MAX_DURATION?(b('"duration" value is greater than the maximum allowed, setting it to '.concat(g.C.MAX_DURATION," milliseconds")),r=g.C.MAX_DURATION):r=Math.abs(r):r=g.C.DEFAULT_DURATION,t.duration=r,i&&!p.isDecimal(i))throw new TypeError("Invalid interToneGap: ".concat(i));i?i<g.C.MIN_INTER_TONE_GAP?(b('"interToneGap" value is lower than the minimum allowed, setting it to '.concat(g.C.MIN_INTER_TONE_GAP," milliseconds")),i=g.C.MIN_INTER_TONE_GAP):i=Math.abs(i):i=g.C.DEFAULT_INTER_TONE_GAP,this._tones?this._tones+=e:(this._tones=e,function e(){var o=this;var a;if(this._status===w.STATUS_TERMINATED||!this._tones||n>=this._tones.length)return void(this._tones=null);var s=this._tones[n];n+=1;if(","===s)a=2e3;else{var l=new g(this);t.eventHandlers={onFailed:function(){o._tones=null}},l.send(s,t),a=r+i}setTimeout(e.bind(this),a)}.call(this))}},{key:"sendInfo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(b("sendInfo()"),this._status!==w.STATUS_CONFIRMED&&this._status!==w.STATUS_WAITING_FOR_ACK)throw new d.InvalidStateError(this._status);new y(this).send(e,t,n)}},{key:"mute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{audio:!0,video:!1};b("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};b("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(b("hold()"),this._status!==w.STATUS_WAITING_FOR_ACK&&this._status!==w.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:c.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(b("unhold()"),this._status!==w.STATUS_WAITING_FOR_ACK&&this._status!==w.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:c.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;b("renegotiate()");var r=t.rtcOfferConstraints||null;if(this._status!==w.STATUS_WAITING_FOR_ACK&&this._status!==w.STATUS_CONFIRMED)return!1;if(!this._isReadyToReOffer())return!1;var i={succeeded:function(){n&&n()},failed:function(){e.terminate({cause:c.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;b("refer()");var r=e;if(this._status!==w.STATUS_WAITING_FOR_ACK&&this._status!==w.STATUS_CONFIRMED)return!1;if(!(e=this._ua.normalizeTarget(e)))throw new TypeError("Invalid target: ".concat(r));var i=new C(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 b("sendRequest()"),this._dialog.sendRequest(e,t)}},{key:"receiveRequest",value:function(e){var t=this;if(b("receiveRequest()"),e.method===c.CANCEL)this._status!==w.STATUS_WAITING_FOR_ANSWER&&this._status!==w.STATUS_ANSWERED||(this._status=w.STATUS_CANCELED,this._request.reply(487),this._failed("remote",e,c.causes.CANCELED));else switch(e.method){case c.ACK:if(this._status!==w.STATUS_WAITING_FOR_ACK)return;if(this._status=w.STATUS_CONFIRMED,clearTimeout(this._timers.ackTimer),clearTimeout(this._timers.invite2xxTimer),this._late_sdp){if(!e.body){this.terminate({cause:c.causes.MISSING_SDP,status_code:400});break}var n={originator:"remote",type:"answer",sdp:e.body};b('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:c.causes.BAD_MEDIA_DESCRIPTION,status_code:488}),E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}else this._is_confirmed||this._confirmed("remote",e);break;case c.BYE:this._status===w.STATUS_CONFIRMED?(e.reply(200),this._ended("remote",e,c.causes.BYE)):this._status===w.STATUS_INVITE_RECEIVED?(e.reply(200),this._request.reply(487,"BYE Received"),this._ended("remote",e,c.causes.BYE)):e.reply(403,"Wrong Status");break;case c.INVITE:this._status===w.STATUS_CONFIRMED?e.hasHeader("replaces")?this._receiveReplaces(e):this._receiveReinvite(e):e.reply(403,"Wrong Status");break;case c.INFO:if(this._status===w.STATUS_1XX_RECEIVED||this._status===w.STATUS_WAITING_FOR_ANSWER||this._status===w.STATUS_ANSWERED||this._status===w.STATUS_WAITING_FOR_ACK||this._status===w.STATUS_CONFIRMED){var i=e.getHeader("content-type");i&&i.match(/^application\/dtmf-relay/i)?new g(this).init_incoming(e):void 0!==i?new y(this).init_incoming(e):e.reply(415)}else e.reply(403,"Wrong Status");break;case c.UPDATE:this._status===w.STATUS_CONFIRMED?this._receiveUpdate(e):e.reply(403,"Wrong Status");break;case c.REFER:this._status===w.STATUS_CONFIRMED?this._receiveRefer(e):e.reply(403,"Wrong Status");break;case c.NOTIFY:this._status===w.STATUS_CONFIRMED?this._receiveNotify(e):e.reply(403,"Wrong Status");break;default:e.reply(501)}}},{key:"onTransportError",value:function(){E("onTransportError()"),this._status!==w.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:c.causes.CONNECTION_ERROR,cause:c.causes.CONNECTION_ERROR})}},{key:"onRequestTimeout",value:function(){E("onRequestTimeout()"),this._status!==w.STATUS_TERMINATED&&this.terminate({status_code:408,reason_phrase:c.causes.REQUEST_TIMEOUT,cause:c.causes.REQUEST_TIMEOUT})}},{key:"onDialogError",value:function(){E("onDialogError()"),this._status!==w.STATUS_TERMINATED&&this.terminate({status_code:500,reason_phrase:c.causes.DIALOG_ERROR,cause:c.causes.DIALOG_ERROR})}},{key:"newDTMF",value:function(e){b("newDTMF()"),this.emit("newDTMF",e)}},{key:"newInfo",value:function(e){b("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||(b("_isReadyToReOffer() | there is another INVITE/UPDATE transaction in progress"),!1):(b("_isReadyToReOffer() | session not established yet"),!1):(b("_isReadyToReOffer() | internal WebRTC status not ready"),!1)}},{key:"_close",value:function(){if(b("close()"),this._status!==w.STATUS_TERMINATED){if(this._status=w.STATUS_TERMINATED,this._connection)try{this._connection.close()}catch(r){E("close() | error closing the RTCPeerConnection: %o",r)}for(var e in this._localMediaStream&&this._localMediaStreamLocallyGenerated&&(b("close() | closing local MediaStream"),p.closeMediaStream(this._localMediaStream)),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=h.T1;this._timers.invite2xxTimer=setTimeout(function r(){this._status===w.STATUS_WAITING_FOR_ACK&&(e.reply(200,null,["Contact: ".concat(this._contact)],t),n<h.T2&&(n*=2)>h.T2&&(n=h.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===w.STATUS_WAITING_FOR_ACK&&(b("no ACK received, terminating the session"),clearTimeout(e._timers.invite2xxTimer),e.sendRequest(c.BYE),e._ended("remote",null,c.causes.NO_ACK))},h.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:c.causes.RTP_TIMEOUT,status_code:408,reason_phrase:c.causes.RTP_TIMEOUT})}),b('emit "peerconnection"'),this.emit("peerconnection",{peerconnection:this._connection})}},{key:"_createLocalDescription",value:function(e,t){var n=this;if(b("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 E('emit "peerconnection:createofferfailed" [error:%o]',e),n.emit("peerconnection:createofferfailed",e),Promise.reject(e)}):r.createAnswer(t).catch(function(e){return E('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,E('emit "peerconnection:setlocaldescriptionfailed" [error:%o]',e),n.emit("peerconnection:setlocaldescriptionfailed",e),Promise.reject(e)})}).then(function(){if("complete"===r.iceGatheringState){n._rtcReady=!0;var t={originator:"local",type:e,sdp:r.localDescription.sdp};return b('emit "sdp"'),n.emit("sdp",t),Promise.resolve(t.sdp)}return new Promise(function(t){var i,o=!1,a=function(){r.removeEventListener("icecandidate",i),o=!0,n._rtcReady=!0;var a={originator:"local",type:e,sdp:r.localDescription.sdp};b('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}):o||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,a=this._earlyDialogs[o];if(n)return!!a||((a=new v(this,e,t,v.C.STATUS_EARLY)).error?(b(a.error),this._failed("remote",e,c.causes.INTERNAL_ERROR),!1):(this._earlyDialogs[o]=a,!0));if(this._from_tag=e.from_tag,this._to_tag=e.to_tag,a)return a.update(e,t),this._dialog=a,delete this._earlyDialogs[o],!0;var s=new v(this,e,t);return s.error?(b(s.error),this._failed("remote",e,c.causes.INTERNAL_ERROR),!1):(this._dialog=s,!0)}},{key:"_receiveReinvite",value:function(e){var t=this;b("receiveReinvite()");var n=e.getHeader("Content-Type"),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=p.cloneArray(t.extraHeaders);if(this._status!==w.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,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 b("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then(function(e){t._status!==w.STATUS_TERMINATED&&o.call(t,e)}).catch(function(e){E(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=w.STATUS_WAITING_FOR_ACK,n._setInvite2xxTimer(e,t),n._setACKTimer()}),"function"===typeof r.callback&&r.callback()}}},{key:"_receiveUpdate",value:function(e){var t=this;b("receiveUpdate()");var n=e.getHeader("Content-Type"),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=p.cloneArray(t.extraHeaders);if(this._status!==w.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 b("invalid Content-Type"),void e.reply(415);this._processInDialogSdpOffer(e).then(function(e){t._status!==w.STATUS_TERMINATED&&o.call(t,e)}).catch(function(e){E(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;b("_processInDialogSdpOffer()");var n=e.parseSDP(),r=!1,i=!0,o=!1,a=void 0;try{for(var s,l=n.media[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if(-1!==R.indexOf(u.type)){var c=u.direction||n.direction||"sendrecv";if("sendonly"!==c&&"inactive"!==c){r=!1;break}r=!0}}}catch(p){o=!0,a=p}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}var d={originator:"remote",type:"offer",sdp:e.body};b('emit "sdp"'),this.emit("sdp",d);var f=new RTCSessionDescription({type:"offer",sdp:d.sdp});return this._connectionPromiseQueue=this._connectionPromiseQueue.then(function(){if(t._status===w.STATUS_TERMINATED)throw new Error("terminated");return t._connection.setRemoteDescription(f).catch(function(n){throw e.reply(488),E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n),new Error("peerconnection.setRemoteDescription() failed")})}).then(function(){if(t._status===w.STATUS_TERMINATED)throw new Error("terminated");!0===t._remoteHold&&!1===r?(t._remoteHold=!1,t._onunhold("remote")):!1===t._remoteHold&&!0===r&&(t._remoteHold=!0,t._onhold("remote"))}).then(function(){if(t._status===w.STATUS_TERMINATED)throw new Error("terminated");return t._createLocalDescription("answer",t._rtcAnswerConstraints).catch(function(){throw e.reply(500),new Error("_createLocalDescription() failed")})}),this._connectionPromiseQueue}},{key:"_receiveRefer",value:function(e){var n=this;if(b("receiveRefer()"),!e.refer_to)return b("no Refer-To header field present in REFER"),void e.reply(400);if(e.refer_to.uri.scheme!==c.SIP)return b("Refer-To header field points to a non-SIP URI scheme"),void e.reply(416);e.reply(202);var r=new T(this,e.cseq);b('emit "refer"'),this.emit("refer",{request:e,accept:function(i,o){(function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n="function"===typeof n?n:null,this._status!==w.STATUS_WAITING_FOR_ACK&&this._status!==w.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 a=decodeURIComponent(e.refer_to.uri.getHeader("replaces"));i.extraHeaders=p.cloneArray(i.extraHeaders),i.extraHeaders.push("Replaces: ".concat(a))}o.connect(e.refer_to.uri.toAor(),i,n)}).call(n,i,o)},reject:function(){(function(){r.notify(603)}).call(n)}})}},{key:"_receiveNotify",value:function(e){switch(b("receiveNotify()"),e.event||e.reply(400),e.event.event){case"refer":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);break;default:e.reply(489)}}},{key:"_receiveReplaces",value:function(e){var n=this;b("receiveReplaces()"),this.emit("replaces",{request:e,accept:function(r){(function(n){var r=this;if(this._status!==w.STATUS_WAITING_FOR_ACK&&this._status!==w.STATUS_CONFIRMED)return!1;var i=new t(this._ua);i.on("confirmed",function(){r.terminate()}),i.init_incoming(e,n)}).call(n,r)},reject:function(){(function(){b("Replaced INVITE rejected by the user"),e.reply(486)}).call(n)}})}},{key:"_sendInitialRequest",value:function(e,t,n){var r=this,i=new _(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===w.STATUS_TERMINATED)throw new Error("terminated");throw r._failed("local",null,c.causes.USER_DENIED_MEDIA_ACCESS),E('emit "getusermediafailed" [error:%o]',e),r.emit("getusermediafailed",e),e})):void 0)}).then(function(e){if(r._status===w.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,c.causes.WEBRTC_ERROR),e})}).then(function(e){if(r._is_canceled||r._status===w.STATUS_TERMINATED)throw new Error("terminated");r._request.body=e,r._status=w.STATUS_INVITE_SENT,b('emit "sending" [request:%o]',r._request),r.emit("sending",{request:r._request}),i.send()}).catch(function(e){r._status!==w.STATUS_TERMINATED&&E(e)})}},{key:"_receiveInviteResponse",value:function(e){var t=this;if(b("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(c.ACK);var n=new v(this,e,"UAC");return void 0!==n.error?void b(n.error):(this.sendRequest(c.ACK),void this.sendRequest(c.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===w.STATUS_INVITE_SENT||this._status===w.STATUS_1XX_RECEIVED)switch(!0){case/^100$/.test(e.status_code):this._status=w.STATUS_1XX_RECEIVED;break;case/^1[0-9]{2}$/.test(e.status_code):if(!e.to_tag){b("1xx response received without to tag");break}if(e.hasHeader("contact")&&!this._createDialog(e,"UAC",!0))break;if(this._status=w.STATUS_1XX_RECEIVED,this._progress("remote",e),!e.body)break;var r={originator:"remote",type:"answer",sdp:e.body};b('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)}).catch(function(e){E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)});break;case/^2[0-9]{2}$/.test(e.status_code):if(this._status=w.STATUS_CONFIRMED,!e.body){this._acceptAndTerminate(e,400,c.causes.MISSING_SDP),this._failed("remote",e,c.causes.BAD_MEDIA_DESCRIPTION);break}if(!this._createDialog(e,"UAC"))break;var o={originator:"remote",type:"answer",sdp:e.body};b('emit "sdp"'),this.emit("sdp",o);var a=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,c.causes.WEBRTC_ERROR)})}).then(function(){t._connection.setRemoteDescription(a).then(function(){t._handleSessionTimersInIncomingResponse(e),t._accepted("remote",e),t.sendRequest(c.ACK),t._confirmed("local",null)}).catch(function(n){t._acceptAndTerminate(e,488,"Not Acceptable Here"),t._failed("remote",e,c.causes.BAD_MEDIA_DESCRIPTION),E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',n),t.emit("peerconnection:setremotedescriptionfailed",n)})});break;default:var s=p.sipErrorCause(e.status_code);this._failed("remote",e,s)}}},{key:"_sendReinvite",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b("sendReinvite()");var n=p.cloneArray(t.extraHeaders),r=t.eventHandlers||{},i=t.rtcOfferConstraints||this._rtcOfferConstraints||null,o=!1;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 i={originator:"local",type:"offer",sdp:t=e._mangleOffer(t)};b('emit "sdp"'),e.emit("sdp",i),e.sendRequest(c.INVITE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){(function(e){var t=this;if(this._status===w.STATUS_TERMINATED)return;if(this.sendRequest(c.ACK),o)return;if(this._handleSessionTimersInIncomingResponse(e),!e.body)return void a.call(this);if("application/sdp"!==e.getHeader("Content-Type"))return void a.call(this);var n={originator:"remote",type:"answer",sdp:e.body};b('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),E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}).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]:{};b("sendUpdate()");var n=p.cloneArray(t.extraHeaders),r=t.eventHandlers||{},i=t.rtcOfferConstraints||this._rtcOfferConstraints||null,o=t.sdpOffer||!1,a=!1;function s(e){var t=this;if(this._status!==w.STATUS_TERMINATED&&!a)if(this._handleSessionTimersInIncomingResponse(e),o){if(!e.body)return void l.call(this);if("application/sdp"!==e.getHeader("Content-Type"))return void l.call(this);var n={originator:"remote",type:"answer",sdp:e.body};b('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){l.call(t),E('emit "peerconnection:setremotedescriptionfailed" [error:%o]',e),t.emit("peerconnection:setremotedescriptionfailed",e)})}else r.succeeded&&r.succeeded(e)}function l(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)};b('emit "sdp"'),e.emit("sdp",r),e.sendRequest(c.UPDATE,{extraHeaders:n,body:t,eventHandlers:{onSuccessResponse:function(t){s.call(e,t),a=!0},onErrorResponse:function(t){l.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}).catch(function(){l.call(e)})):this.sendRequest(c.UPDATE,{extraHeaders:n,eventHandlers:{onSuccessResponse:function(t){s.call(e,t)},onErrorResponse:function(t){l.call(e,t)},onTransportError:function(){e.onTransportError()},onRequestTimeout:function(){e.onRequestTimeout()},onDialogError:function(){e.onDialogError()}}})}},{key:"_acceptAndTerminate",value:function(e,t,n){b("acceptAndTerminate()");var r=[];t&&(n=n||c.REASON_PHRASE[t]||"",r.push("Reason: SIP ;cause=".concat(t,'; text="').concat(n,'"'))),(this._dialog||this._createDialog(e,"UAC"))&&(this.sendRequest(c.ACK),this.sendRequest(c.BYE,{extraHeaders:r})),this._status=w.STATUS_TERMINATED}},{key:"_mangleOffer",value:function(e){if(!this._localHold&&!this._remoteHold)return e;if(e=u.parse(e),this._localHold&&!this._remoteHold){b("mangleOffer() | me on hold, mangling offer");var t=!0,n=!1,r=void 0;try{for(var i,o=e.media[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;-1!==R.indexOf(a.type)&&(a.direction?"sendrecv"===a.direction?a.direction="sendonly":"recvonly"===a.direction&&(a.direction="inactive"):a.direction="sendonly")}}catch(T){n=!0,r=T}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}else if(this._localHold&&this._remoteHold){b("mangleOffer() | both on hold, mangling offer");var s=!0,l=!1,c=void 0;try{for(var d,f=e.media[Symbol.iterator]();!(s=(d=f.next()).done);s=!0){var p=d.value;-1!==R.indexOf(p.type)&&(p.direction="inactive")}}catch(T){l=!0,c=T}finally{try{s||null==f.return||f.return()}finally{if(l)throw c}}}else if(this._remoteHold){b("mangleOffer() | remote on hold, mangling offer");var h=!0,m=!1,v=void 0;try{for(var _,g=e.media[Symbol.iterator]();!(h=(_=g.next()).done);h=!0){var y=_.value;-1!==R.indexOf(y.type)&&(y.direction?"sendrecv"===y.direction?y.direction="recvonly":"recvonly"===y.direction&&(y.direction="inactive"):y.direction="recvonly")}}catch(T){m=!0,v=T}finally{try{h||null==g.return||g.return()}finally{if(m)throw v}}}return u.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>=c.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>=c.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!==w.STATUS_TERMINATED&&(b("runSessionTimer() | sending session refresh request"),e._sessionTimers.refreshMethod===c.UPDATE?e._sendUpdate():e._sendReinvite())},500*t):this._sessionTimers.timer=setTimeout(function(){e._status!==w.STATUS_TERMINATED&&(E("runSessionTimer() | timer expired, terminating the session"),e.terminate({cause:c.causes.REQUEST_TIMEOUT,status_code:408,reason_phrase:"Session Timer Expired"}))},1100*t)}},{key:"_toggleMuteAudio",value:function(e){var t=this._connection.getSenders().filter(function(e){return e.track&&"audio"===e.track.kind}),n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.track.enabled=!e}}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"_toggleMuteVideo",value:function(e){var t=this._connection.getSenders().filter(function(e){return e.track&&"video"===e.track.kind}),n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.track.enabled=!e}}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"_newRTCSession",value:function(e,t){b("newRTCSession()"),this._ua.newRTCSession(this,{originator:e,session:this,request:t})}},{key:"_connecting",value:function(e){b("session connecting"),b('emit "connecting"'),this.emit("connecting",{request:e})}},{key:"_progress",value:function(e,t){b("session progress"),b('emit "progress"'),this.emit("progress",{originator:e,response:t||null})}},{key:"_accepted",value:function(e,t){b("session accepted"),this._start_time=new Date,b('emit "accepted"'),this.emit("accepted",{originator:e,response:t||null})}},{key:"_confirmed",value:function(e,t){b("session confirmed"),this._is_confirmed=!0,b('emit "confirmed"'),this.emit("confirmed",{originator:e,ack:t||null})}},{key:"_ended",value:function(e,t,n){b("session ended"),this._end_time=new Date,this._close(),b('emit "ended"'),this.emit("ended",{originator:e,message:t||null,cause:n})}},{key:"_failed",value:function(e,t,n){b("session failed"),b('emit "_failed"'),this.emit("_failed",{originator:e,message:t||null,cause:n}),this._close(),b('emit "failed"'),this.emit("failed",{originator:e,message:t||null,cause:n})}},{key:"_onhold",value:function(e){b("session onhold"),this._setLocalMediaStatus(),b('emit "hold"'),this.emit("hold",{originator:e})}},{key:"_onunhold",value:function(e){b("session onunhold"),this._setLocalMediaStatus(),b('emit "unhold"'),this.emit("unhold",{originator:e})}},{key:"_onmute",value:function(e){var t=e.audio,n=e.video;b("session onmute"),this._setLocalMediaStatus(),b('emit "muted"'),this.emit("muted",{audio:t,video:n})}},{key:"_onunmute",value:function(e){var t=e.audio,n=e.video;b("session onunmute"),this._setLocalMediaStatus(),b('emit "unmuted"'),this.emit("unmuted",{audio:t,video:n})}},{key:"C",get:function(){return w}},{key:"causes",get:function(){return c.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(e,t,n){var r=n(5),i=n(7),o=n(1)("JsSIP:ERROR:Socket");o.log=console.warn.bind(console),t.isSocket=function(e){if(Array.isArray(e))return!1;if("undefined"===typeof e)return o("undefined JsSIP.Socket instance"),!1;try{if(!r.isString(e.url))throw o("missing or invalid JsSIP.Socket url property"),new Error;if(!r.isString(e.via_transport))throw o("missing or invalid JsSIP.Socket via_transport property"),new Error;if(-1===i.parse(e.sip_uri,"SIP_URI"))throw o("missing or invalid JsSIP.Socket sip_uri property"),new Error}catch(t){return!1}try{["connect","disconnect","send"].forEach(function(t){if(!r.isFunction(e[t]))throw o("missing or invalid JsSIP.Socket method: ".concat(t)),new Error})}catch(t){return!1}return!0}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(41)},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r=n(16);function i(e,t,n,i,o){var a=r.writeRtpDescription(e.kind,t);if(a+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var l="msid:"+(i?i.id:"-")+" "+s+"\r\n";a+="a="+l,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+l,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+l,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),a}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},i=function(e,t,n,i){var o=r(e.parameters.apt,n),a=r(t.parameters.apt,i);return o&&a&&o.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach(function(r){for(var o=0;o<t.codecs.length;o++){var a=t.codecs[o];if(r.name.toLowerCase()===a.name.toLowerCase()&&r.clockRate===a.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&a.parameters.apt&&!i(r,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(r.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter(function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1});break}}}),e.headerExtensions.forEach(function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}}),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function s(e,t){var n=e.getRemoteCandidates().find(function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type});return n||e.addRemoteCandidate(t),!n}function l(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function u(t,n,r,i){var o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=i,e.setTimeout(function(){t._dispatchEvent("track",o)})}var c=function(n){var i=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){i[e]=o[e].bind(o)}),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw l("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"===typeof r;return i&&(r=[r]),r=r.filter(function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)}),delete e.url,e.urls=i?r[0]:r,!!r.length}})}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(c.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(c.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),c.prototype.onicecandidate=null,c.prototype.onaddstream=null,c.prototype.ontrack=null,c.prototype.onremovestream=null,c.prototype.onsignalingstatechange=null,c.prototype.oniceconnectionstatechange=null,c.prototype.onconnectionstatechange=null,c.prototype.onicegatheringstatechange=null,c.prototype.onnegotiationneeded=null,c.prototype.ondatachannel=null,c.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"===typeof this["on"+e]&&this["on"+e](t))},c.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},c.prototype.getConfiguration=function(){return this._config},c.prototype.getLocalStreams=function(){return this.localStreams},c.prototype.getRemoteStreams=function(){return this.remoteStreams},c.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},c.prototype.addTrack=function(t,n){if(this._isClosed)throw l("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find(function(e){return e.track===t}))throw l("InvalidAccessError","Track already exists.");for(var i=0;i<this.transceivers.length;i++)this.transceivers[i].track||this.transceivers[i].kind!==t.kind||(r=this.transceivers[i]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},c.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach(function(t){n.addTrack(t,e)});else{var r=e.clone();e.getTracks().forEach(function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",function(e){n.enabled=e.enabled})}),r.getTracks().forEach(function(e){n.addTrack(e,r)})}},c.prototype.removeTrack=function(t){if(this._isClosed)throw l("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find(function(e){return e.rtpSender===t});if(!n)throw l("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map(function(e){return e.stream}).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},c.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var n=t.getSenders().find(function(t){return t.track===e});n&&t.removeTrack(n)})},c.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},c.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},c.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},c.prototype._gather=function(t,n){var i=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,l=!s||0===Object.keys(s).length;if(l)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),s.component=1,s.ufrag=o.getLocalParameters().usernameFragment;var u=r.writeCandidate(s);a.candidate=Object.assign(a.candidate,r.parseCandidate(u)),a.candidate.candidate=u,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var c=r.getMediaSections(i._localDescription.sdp);c[a.candidate.sdpMLineIndex]+=l?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",i._localDescription.sdp=r.getDescription(i._localDescription.sdp)+c.join("");var d=i.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),l||i._dispatchEvent("icecandidate",a),d&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout(function(){a.forEach(function(e){o.onlocalcandidate(e)})},0)}},c.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},c.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},c.prototype._transceive=function(e,n,i){var a=o(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),i&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach(function(e){delete e.rtx}),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},c.prototype.setLocalDescription=function(e){var t,n,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(l("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(l("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=r.splitSections(e.sdp),n=t.shift(),t.forEach(function(e,t){var n=r.parseRtpParameters(e);i.transceivers[t].localCapabilities=n}),i.transceivers.forEach(function(e,t){i._gather(e.mid,t)});else if("answer"===e.type){t=r.splitSections(i._remoteDescription.sdp),n=t.shift();var s=r.matchPrefix(n,"a=ice-lite").length>0;t.forEach(function(e,t){var a=i.transceivers[t],l=a.iceGatherer,u=a.iceTransport,c=a.dtlsTransport,d=a.localCapabilities,f=a.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var p=r.getIceParameters(e,n),h=r.getDtlsParameters(e,n);s&&(h.role="server"),i.usingBundle&&0!==t||(i._gather(a.mid,t),"new"===u.state&&u.start(l,p,s?"controlling":"controlled"),"new"===c.state&&c.start(h));var m=o(d,f);i._transceive(a,m.codecs.length>0,!1)}})}return i._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},c.prototype.setRemoteDescription=function(i){var c=this;if(-1===["offer","answer"].indexOf(i.type))return Promise.reject(l("TypeError",'Unsupported type "'+i.type+'"'));if(!a("setRemoteDescription",i.type,c.signalingState)||c._isClosed)return Promise.reject(l("InvalidStateError","Can not set remote "+i.type+" in state "+c.signalingState));var d={};c.remoteStreams.forEach(function(e){d[e.id]=e});var f=[],p=r.splitSections(i.sdp),h=p.shift(),m=r.matchPrefix(h,"a=ice-lite").length>0,v=r.matchPrefix(h,"a=group:BUNDLE ").length>0;c.usingBundle=v;var _=r.matchPrefix(h,"a=ice-options:")[0];return c.canTrickleIceCandidates=!!_&&_.substr(14).split(" ").indexOf("trickle")>=0,p.forEach(function(a,l){var u=r.splitLines(a),p=r.getKind(a),_=r.isRejected(a)&&0===r.matchPrefix(a,"a=bundle-only").length,g=u[0].substr(2).split(" ")[2],y=r.getDirection(a,h),T=r.parseMsid(a),C=r.getMid(a)||r.generateIdentifier();if(_||"application"===p&&("DTLS/SCTP"===g||"UDP/DTLS/SCTP"===g))c.transceivers[l]={mid:C,kind:p,protocol:g,rejected:!0};else{var S,b,E,w,R,A,k,x,I;!_&&c.transceivers[l]&&c.transceivers[l].rejected&&(c.transceivers[l]=c._createTransceiver(p,!0));var P,O,N=r.parseRtpParameters(a);_||(P=r.getIceParameters(a,h),(O=r.getDtlsParameters(a,h)).role="client"),k=r.parseRtpEncodingParameters(a);var D=r.parseRtcpParameters(a),M=r.matchPrefix(a,"a=end-of-candidates",h).length>0,U=r.matchPrefix(a,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===i.type||"answer"===i.type)&&!_&&v&&l>0&&c.transceivers[l]&&(c._disposeIceAndDtlsTransports(l),c.transceivers[l].iceGatherer=c.transceivers[0].iceGatherer,c.transceivers[l].iceTransport=c.transceivers[0].iceTransport,c.transceivers[l].dtlsTransport=c.transceivers[0].dtlsTransport,c.transceivers[l].rtpSender&&c.transceivers[l].rtpSender.setTransport(c.transceivers[0].dtlsTransport),c.transceivers[l].rtpReceiver&&c.transceivers[l].rtpReceiver.setTransport(c.transceivers[0].dtlsTransport)),"offer"!==i.type||_){if("answer"===i.type&&!_){b=(S=c.transceivers[l]).iceGatherer,E=S.iceTransport,w=S.dtlsTransport,R=S.rtpReceiver,A=S.sendEncodingParameters,x=S.localCapabilities,c.transceivers[l].recvEncodingParameters=k,c.transceivers[l].remoteCapabilities=N,c.transceivers[l].rtcpParameters=D,U.length&&"new"===E.state&&(!m&&!M||v&&0!==l?U.forEach(function(e){s(S.iceTransport,e)}):E.setRemoteCandidates(U)),v&&0!==l||("new"===E.state&&E.start(b,P,"controlling"),"new"===w.state&&w.start(O)),!o(S.localCapabilities,S.remoteCapabilities).codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&S.sendEncodingParameters[0].rtx&&delete S.sendEncodingParameters[0].rtx,c._transceive(S,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!R||"sendrecv"!==y&&"sendonly"!==y?delete S.rtpReceiver:(I=R.track,T?(d[T.stream]||(d[T.stream]=new e.MediaStream),n(I,d[T.stream]),f.push([I,R,d[T.stream]])):(d.default||(d.default=new e.MediaStream),n(I,d.default),f.push([I,R,d.default])))}}else{(S=c.transceivers[l]||c._createTransceiver(p)).mid=C,S.iceGatherer||(S.iceGatherer=c._createIceGatherer(l,v)),U.length&&"new"===S.iceTransport.state&&(!M||v&&0!==l?U.forEach(function(e){s(S.iceTransport,e)}):S.iceTransport.setRemoteCandidates(U)),x=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(x.codecs=x.codecs.filter(function(e){return"rtx"!==e.name})),A=S.sendEncodingParameters||[{ssrc:1001*(2*l+2)}];var L,F=!1;if("sendrecv"===y||"sendonly"===y){if(F=!S.rtpReceiver,R=S.rtpReceiver||new e.RTCRtpReceiver(S.dtlsTransport,p),F)I=R.track,T&&"-"===T.stream||(T?(d[T.stream]||(d[T.stream]=new e.MediaStream,Object.defineProperty(d[T.stream],"id",{get:function(){return T.stream}})),Object.defineProperty(I,"id",{get:function(){return T.track}}),L=d[T.stream]):(d.default||(d.default=new e.MediaStream),L=d.default)),L&&(n(I,L),S.associatedRemoteMediaStreams.push(L)),f.push([I,R,L])}else S.rtpReceiver&&S.rtpReceiver.track&&(S.associatedRemoteMediaStreams.forEach(function(t){var n,r,i=t.getTracks().find(function(e){return e.id===S.rtpReceiver.track.id});i&&(n=i,(r=t).removeTrack(n),r.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:n})))}),S.associatedRemoteMediaStreams=[]);S.localCapabilities=x,S.remoteCapabilities=N,S.rtpReceiver=R,S.rtcpParameters=D,S.sendEncodingParameters=A,S.recvEncodingParameters=k,c._transceive(c.transceivers[l],!1,F)}}}),void 0===c._dtlsRole&&(c._dtlsRole="offer"===i.type?"active":"passive"),c._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?c._updateSignalingState("have-remote-offer"):c._updateSignalingState("stable"),Object.keys(d).forEach(function(t){var n=d[t];if(n.getTracks().length){if(-1===c.remoteStreams.indexOf(n)){c.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout(function(){c._dispatchEvent("addstream",r)})}f.forEach(function(e){var t=e[0],r=e[1];n.id===e[2].id&&u(c,t,r,[n])})}}),f.forEach(function(e){e[2]||u(c,e[0],e[1],[])}),e.setTimeout(function(){c&&c.transceivers&&c.transceivers.forEach(function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},c.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},c.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},c.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout(function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0))},c.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++}),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},c.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)}),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},c.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(l("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter(function(e){return"audio"===e.kind}).length,a=n.transceivers.filter(function(e){return"video"===e.kind}).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach(function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)});o>0||a>0;)o>0&&(n._createTransceiver("audio"),o--),a>0&&(n._createTransceiver("video"),a--);var u=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach(function(i,o){var a=i.track,s=i.kind,l=i.mid||r.generateIdentifier();i.mid=l,i.iceGatherer||(i.iceGatherer=n._createIceGatherer(o,n.usingBundle));var u=e.RTCRtpSender.getCapabilities(s);t<15019&&(u.codecs=u.codecs.filter(function(e){return"rtx"!==e.name})),u.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach(function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)})}),u.headerExtensions.forEach(function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach(function(t){e.uri===t.uri&&(e.id=t.id)})});var c=i.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];a&&t>=15019&&"video"===s&&!c[0].rtx&&(c[0].rtx={ssrc:c[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,s)),i.localCapabilities=u,i.sendEncodingParameters=c}),"max-compat"!==n._config.bundlePolicy&&(u+="a=group:BUNDLE "+n.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),u+="a=ice-options:trickle\r\n",n.transceivers.forEach(function(e,t){u+=i(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),u+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1,u+="a="+r.writeCandidate(e)+"\r\n"}),"completed"===e.iceGatherer.state&&(u+="a=end-of-candidates\r\n"))});var c=new e.RTCSessionDescription({type:"offer",sdp:u});return Promise.resolve(c)},c.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(l("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(l("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=r.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=r.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach(function(e,r){if(!(r+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var l;if(e.stream)"audio"===e.kind?l=e.stream.getAudioTracks()[0]:"video"===e.kind&&(l=e.stream.getVideoTracks()[0]),l&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var u=o(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=i(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}});var u=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(u)},c.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(i,o){if(!n._remoteDescription)return o(l("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<n.transceivers.length;u++)if(n.transceivers[u].mid===e.sdpMid){a=u;break}var c=n.transceivers[a];if(!c)return o(l("OperationError","Can not add ICE candidate"));if(c.rejected)return i();var d=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return i();if(d.component&&1!==d.component)return i();if((0===a||a>0&&c.iceTransport!==n.transceivers[0].iceTransport)&&!s(c.iceTransport,d))return o(l("OperationError","Can not add ICE candidate"));var f=e.candidate.trim();0===f.indexOf("a=")&&(f=f.substr(2)),(t=r.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(d.type?f:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var p=0;p<n.transceivers.length&&(n.transceivers[p].rejected||(n.transceivers[p].iceTransport.addRemoteCandidate({}),(t=r.getMediaSections(n._remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=r.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));p++);i()})},c.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach(function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)}),!n)throw l("InvalidAccessError","Invalid selector.");return n.getStats()}var r=[];return this.transceivers.forEach(function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(t){e[t]&&r.push(e[t].getStats())})}),Promise.all(r).then(function(e){var t=new Map;return e.forEach(function(e){e.forEach(function(e){t.set(e.id,e)})}),t})};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach(function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then(function(e){var t=new Map;return Object.keys(e).forEach(function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])}),t})}}});var d=["createOffer","createAnswer"];return d.forEach(function(e){var t=c.prototype[e];c.prototype[e]=function(){var e=arguments;return"function"===typeof e[0]||"function"===typeof e[1]?t.apply(this,[arguments[2]]).then(function(t){"function"===typeof e[0]&&e[0].apply(null,[t])},function(t){"function"===typeof e[1]&&e[1].apply(null,[t])}):t.apply(this,arguments)}}),(d=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach(function(e){var t=c.prototype[e];c.prototype[e]=function(){var e=arguments;return"function"===typeof e[1]||"function"===typeof e[2]?t.apply(this,arguments).then(function(){"function"===typeof e[1]&&e[1].apply(null)},function(t){"function"===typeof e[2]&&e[2].apply(null,[t])}):t.apply(this,arguments)}}),["getStats"].forEach(function(e){var t=c.prototype[e];c.prototype[e]=function(){var e=arguments;return"function"===typeof e[1]?t.apply(this,arguments).then(function(){"function"===typeof e[1]&&e[1].apply(null)}):t.apply(this,arguments)}}),c}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&e.push(a)}else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"shimGetUserMedia",function(){return w}),n.d(r,"shimGetDisplayMedia",function(){return R}),n.d(r,"shimMediaStream",function(){return A}),n.d(r,"shimOnTrack",function(){return k}),n.d(r,"shimGetSendersWithDtmf",function(){return x}),n.d(r,"shimGetStats",function(){return I}),n.d(r,"shimSenderReceiverGetStats",function(){return P}),n.d(r,"shimAddTrackRemoveTrackWithNative",function(){return O}),n.d(r,"shimAddTrackRemoveTrack",function(){return N}),n.d(r,"shimPeerConnection",function(){return D}),n.d(r,"fixNegotiationNeeded",function(){return M});var i={};n.r(i),n.d(i,"shimGetUserMedia",function(){return F}),n.d(i,"shimGetDisplayMedia",function(){return q}),n.d(i,"shimPeerConnection",function(){return H}),n.d(i,"shimReplaceTrack",function(){return j});var o={};n.r(o),n.d(o,"shimGetUserMedia",function(){return z}),n.d(o,"shimGetDisplayMedia",function(){return G}),n.d(o,"shimOnTrack",function(){return W}),n.d(o,"shimPeerConnection",function(){return V}),n.d(o,"shimSenderGetStats",function(){return B}),n.d(o,"shimReceiverGetStats",function(){return K}),n.d(o,"shimRemoveStream",function(){return $}),n.d(o,"shimRTCDataChannel",function(){return J});var a={};n.r(a),n.d(a,"shimLocalStreamsAPI",function(){return Y}),n.d(a,"shimRemoteStreamsAPI",function(){return Q}),n.d(a,"shimCallbacksAPI",function(){return X}),n.d(a,"shimGetUserMedia",function(){return Z}),n.d(a,"shimConstraints",function(){return ee}),n.d(a,"shimRTCIceServerUrls",function(){return te}),n.d(a,"shimTrackEventTransceiver",function(){return ne}),n.d(a,"shimCreateOfferLegacy",function(){return re});var s={};function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){l(e,t,n[t])})}return e}n.r(s),n.d(s,"shimRTCIceCandidate",function(){return ae}),n.d(s,"shimMaxMessageSize",function(){return se}),n.d(s,"shimSendThrowTypeError",function(){return le}),n.d(s,"shimConnectionState",function(){return ue}),n.d(s,"removeAllowExtmapMixed",function(){return ce});var c=n(15),d=n(14),f=!0,p=!0;function h(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function m(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}}function v(e){return"boolean"!==typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(f=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function _(e){return"boolean"!==typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(p=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function g(){if("object"===typeof window){if(f)return;"undefined"!==typeof console&&"function"===typeof console.log&&console.log.apply(console,arguments)}}function y(e,t){p&&console.warn(e+" is deprecated, please use "+t+" instead.")}function T(e){var t=e.navigator,n={browser:null,version:null};if("undefined"===typeof e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=h(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)n.browser="chrome",n.version=h(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=h(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=h(t.userAgent,/AppleWebKit\/(\d+)\./,1),n.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return n}function C(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){return C(e)?Object.keys(e).reduce(function(t,n){var r=C(e[n]),i=r?S(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,l({},n,i))},{}):e}function b(e,t,n){var r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var o=[];return e.forEach(function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(function(t){e.forEach(function(n){n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(function(i){i.endsWith("Id")?e(t,t.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(function(n){e(t,t.get(n),r)})}))}(e,n,i)})}),i}var E=g;function w(e){var t=e&&e.navigator;if(t.mediaDevices){var n=T(e),r=function(e){if("object"!==typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"===typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"===typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"===typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),(o={})[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!==typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(n.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===typeof e.audio){var o=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};o((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),o(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"===typeof e.video){var a=e.video.facingMode;a=a&&("object"===typeof a?a:{ideal:a});var s,l=n.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||l))if(delete e.video.facingMode,"environment"===a.exact||"environment"===a.ideal?s=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(s=["front"]),s)return t.mediaDevices.enumerateDevices().then(function(t){var n=(t=t.filter(function(e){return"videoinput"===e.kind})).find(function(e){return s.some(function(t){return e.label.toLowerCase().includes(t)})});return!n&&t.length&&s.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=a.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=r(e.video),E("chrome: "+JSON.stringify(e)),i(e)});e.video=r(e.video)}return E("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,r){i(e,function(e){t.webkitGetUserMedia(e,n,function(e){r&&r(o(e))})})}.bind(t),t.mediaDevices.getUserMedia){var a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e,function(e){return a(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(e){return Promise.reject(o(e))})})}}}}function R(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"===typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(function(t){var r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function A(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function k(e){if("object"!==typeof e||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)m(e,"track",function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e});else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.track.id}):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)}),t.stream.getTracks().forEach(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.id}):{track:r};var o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}}function x(e){if("object"===typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach(function(e){n._senders.push(t(n,e))})};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach(function(e){var n=t._senders.find(function(t){return t.track===e});n&&t._senders.splice(t._senders.indexOf(n),1)})}}else if("object"===typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var a=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=a.apply(this,[]);return t.forEach(function(t){return t._pc=e}),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function I(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),r=n[0],i=n[1],o=n[2];if(arguments.length>0&&"function"===typeof r)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!==typeof r))return t.apply(this,[]);var a=function(e){var t={};return e.result().forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(arguments.length>=2){return t.apply(this,[function(e){i(s(a(e)))},r])}return new Promise(function(n,r){t.apply(e,[function(e){n(s(a(e)))},r])}).then(i,o)}}}function P(e){if("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach(function(t){return t._pc=e}),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return b(t,e.track,!0)})}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var r=e.RTCPeerConnection.prototype.getReceivers;r&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=r.apply(this,[]);return t.forEach(function(t){return t._pc=e}),t}),m(e,"track",function(e){return e.receiver._pc=e.srcElement,e}),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return b(t,e.track,!1)})}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t,n,r,o=arguments[0];return this.getSenders().forEach(function(e){e.track===o&&(t?r=!0:t=e)}),this.getReceivers().forEach(function(e){return e.track===o&&(n?r=!0:n=e),e.track===o}),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return i.apply(this,arguments)}}}}function O(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(t){return e._shimmedLocalStreams[t][0]})};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(function(e){if(t.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")});var r=this.getSenders();n.apply(this,arguments);var i=this.getSenders().filter(function(e){return-1===r.indexOf(e)});this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]}),i.apply(this,arguments)}}function N(e){if(e.RTCPeerConnection){var t=T(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return O(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map(function(t){return e._reverseStreams[t.id]})};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(function(e){if(n.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){var i=new e.MediaStream(t.getTracks());this._streams[t.id]=i,this._reverseStreams[i.id]=t,t=i}r.apply(this,[t])};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(function(e){return e===t}))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(function(e){return e.track===t}))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(function(){r.dispatchEvent(new Event("negotiationneeded"))});else{var a=new e.MediaStream([t]);this._streams[n.id]=a,this._reverseStreams[a.id]=n,this.addStream(a)}return this.getSenders().find(function(e){return e.track===t})},["createOffer","createAnswer"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t],r=l({},t,function(){var e=this,t=arguments;return arguments.length&&"function"===typeof arguments[0]?n.apply(this,[function(n){var r=s(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then(function(t){return s(e,t)})});e.RTCPeerConnection.prototype[t]=r[t]});var o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};var a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=a.get.apply(this);return""===e.type?e:s(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,n=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{},Object.keys(this._streams).forEach(function(r){n._streams[r].getTracks().find(function(t){return e.track===t})&&(t=n._streams[r])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function s(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}}function D(e){var t=T(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t],r=l({},t,function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)});e.RTCPeerConnection.prototype[t]=r[t]});var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}function M(e){m(e,"negotiationneeded",function(e){if("stable"===e.target.signalingState)return e})}var U=n(34),L=n.n(U);function F(e){var t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch(function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))})}}function q(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function H(e){var t=T(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var r=L()(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter(function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&y("RTCIceServer.url","RTCIceServer.urls");var r="string"===typeof t;return r&&(t=[t]),t=t.filter(function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n}),delete e.url,e.urls=r?t[0]:t,!!t.length}})}(e.iceServers,t.version),g("ICE servers after filtering:",e.iceServers)),new r(e)},e.RTCPeerConnection.prototype=r.prototype}function j(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}function z(e){var t=T(e),n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){y("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var i=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===typeof e&&"object"===typeof e.audio&&(e=JSON.parse(JSON.stringify(e)),i(e.audio,"autoGainControl","mozAutoGainControl"),i(e.audio,"noiseSuppression","mozNoiseSuppression")),o(e)},r&&r.prototype.getSettings){var a=r.prototype.getSettings;r.prototype.getSettings=function(){var e=a.apply(this,arguments);return i(e,"mozAutoGainControl","autoGainControl"),i(e,"mozNoiseSuppression","noiseSuppression"),e}}if(r&&r.prototype.applyConstraints){var s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===typeof e&&(e=JSON.parse(JSON.stringify(e)),i(e,"autoGainControl","mozAutoGainControl"),i(e,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[e])}}}}function G(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){var r=new DOMException("getDisplayMedia without video constraints is undefined");return r.name="NotFoundError",r.code=8,Promise.reject(r)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function W(e){"object"===typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function V(e){var t=T(e);if("object"===typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t],r=l({},t,function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)});e.RTCPeerConnection.prototype[t]=r[t]}),t.version<68){var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),n=e[0],o=e[1],a=e[2];return i.apply(this,[n||null]).then(function(e){if(t.version<53&&!o)try{e.forEach(function(e){e.type=r[e.type]||e.type})}catch(n){if("TypeError"!==n.name)throw n;e.forEach(function(t,n){e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))})}return e}).then(o,a)}}}function B(e){if("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach(function(t){return t._pc=e}),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function K(e){if("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&!(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(this,[]);return n.forEach(function(t){return t._pc=e}),n}),m(e,"track",function(e){return e.receiver._pc=e.srcElement,e}),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function $(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;y("removeStream","removeTrack"),this.getSenders().forEach(function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)})})}function J(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Y(e){if("object"===typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(function(r){return t.call(n,r,e)}),e.getVideoTracks().forEach(function(r){return t.call(n,r,e)})},e.RTCPeerConnection.prototype.addTrack=function(e){var n=arguments[1];return n&&(this._localStreams?this._localStreams.includes(n)||this._localStreams.push(n):this._localStreams=[n]),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var n=this._localStreams.indexOf(e);if(-1!==n){this._localStreams.splice(n,1);var r=e.getTracks();this.getSenders().forEach(function(e){r.includes(e.track)&&t.removeTrack(e)})}})}}function Q(e){if("object"===typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}})})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}})}),t.apply(e,arguments)}}}function X(e){if("object"===typeof e&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};var s=function(e,t,n){var r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){var r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){var r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}}function Z(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var n=t.mediaDevices,r=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=function(e){return r(ee(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function ee(e){return e&&void 0!==e.video?Object.assign({},e,{video:S(e.video)}):e}function te(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var r=[],i=0;i<e.iceServers.length;i++){var o=e.iceServers[i];!o.hasOwnProperty("urls")&&o.hasOwnProperty("url")?(y("RTCIceServer.url","RTCIceServer.urls"),(o=JSON.parse(JSON.stringify(o))).urls=o.url,delete o.url,r.push(o)):r.push(e.iceServers[i])}e.iceServers=r}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}function ne(e){"object"===typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function re(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){"undefined"!==typeof e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var n=this.getTransceivers().find(function(e){return"audio"===e.receiver.track.kind});!1===e.offerToReceiveAudio&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveAudio||n||this.addTransceiver("audio"),"undefined"!==typeof e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var r=this.getTransceivers().find(function(e){return"video"===e.receiver.track.kind});!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video")}return t.apply(this,arguments)}}var ie=n(16),oe=n.n(ie);function ae(e){if(e.RTCIceCandidate&&!(e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),r=oe.a.parseCandidate(e.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,m(e,"icecandidate",function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t})}}function se(e){if(e.RTCPeerConnection){var t=T(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return"undefined"===typeof this._sctp?null:this._sctp}});var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){(this._sctp=null,"chrome"===t.browser&&t.version>=76)&&("plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return"undefined"===typeof this._sctp?null:this._sctp},enumerable:!0,configurable:!0}));if(function(e){if(!e||!e.sdp)return!1;var t=oe.a.splitSections(e.sdp);return t.shift(),t.some(function(e){var t=oe.a.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})}(arguments[0])){var e,r=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!==n?-1:n}(arguments[0]),i=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n}(r),o=function(e,n){var r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);var i=oe.a.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r}(arguments[0],r);e=0===i&&0===o?Number.POSITIVE_INFINITY:0===i||0===o?Math.max(i,o):Math.min(i,o);var a={};Object.defineProperty(a,"maxMessageSize",{get:function(){return e}}),this._sctp=a}return n.apply(this,arguments)}}}function le(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return n(e,this),e},m(e,"datachannel",function(e){return n(e.channel,e.target),e})}function n(e,t){var n=e.send;e.send=function(){var r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}function ue(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}}function ce(e){if(e.RTCPeerConnection){var t=T(e);if(!("chrome"===t.browser&&t.version>=71)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter(function(e){return"a=extmap-allow-mixed"!==e.trim()}).join("\n")),n.apply(this,arguments)}}}}!function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},n=g,l=T(e),u={browserDetails:l,commonShim:s,extractVersion:h,disableLog:v,disableWarnings:_};switch(l.browser){case"chrome":if(!r||!D||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;n("adapter.js shimming chrome."),u.browserShim=r,w(e),A(e),D(e),k(e),N(e),x(e),I(e),P(e),M(e),ae(e),ue(e),se(e),le(e),ce(e);break;case"firefox":if(!o||!V||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=o,z(e),V(e),W(e),$(e),B(e),K(e),J(e),ae(e),ue(e),se(e),le(e);break;case"edge":if(!i||!H||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),u;n("adapter.js shimming edge."),u.browserShim=i,F(e),q(e),H(e),j(e),se(e),le(e);break;case"safari":if(!a||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=a,te(e),re(e),X(e),Y(e),Q(e),ne(e),Z(e),ae(e),se(e),le(e),ce(e);break;default:n("Unsupported browser!")}}({window:window});var de=n(23),fe=n.n(de),pe=n(17),he=function(){function e(t,n,r,i,o,a){Object(c.a)(this,e),this.sipUserAgent=t,this.realtimeSessionConnection=n,this.callId=r,this.did=i,this.interval=o&&o>1e3&&o<6e4?o:5e3,this.realtimeProtocolReceiverData=null,this.realtimeProtocolTransmitterData=null,this.mediaReceiverData=null,this.mediaTransmitterData=null,this.isActive=!1,this.version="0.0.1",this.debug=a}return Object(d.a)(e,[{key:"start",value:function(){this.isActive||(this.isActive=!0,this.keepGatheringStats())}},{key:"stop",value:function(){this.isActive=!1}},{key:"addStat",value:function(e){this.debug&&console.log(e);var t=e.id;t&&(t.includes("inbound_rtp_audio")||t.includes("RTCInboundRTPAudioStream")?this.realtimeProtocolReceiverData=e:t.includes("outbound_rtp_audio")||t.includes("RTCOutboundRTPAudioStream")?this.realtimeProtocolTransmitterData=e:t.includes("RTCMediaStreamTrack_receiver")?this.mediaReceiverData=e:t.includes("RTCMediaStreamTrack_sender")&&(this.mediaTransmitterData=e))}},{key:"sendAddedStats",value:function(){if(this.realtimeProtocolReceiverData&&this.realtimeProtocolTransmitterData){var e={v:this.version,qos_data:{rx:this.realtimeProtocolReceiverData,tx:this.realtimeProtocolTransmitterData}};this.mediaTransmitterData&&(e.qos_data.tx_media=this.mediaTransmitterData),this.mediaReceiverData&&(e.qos_data.rx_media=this.mediaReceiverData);var t="".concat(this.did,"@sip.flowroute.com");this.sipUserAgent.sendMessage(t,JSON.stringify(e,null,2),{extraHeaders:["P-QoS-Call-ID:".concat(this.callId)]}),this.realtimeProtocolReceiverData=null,this.realtimeProtocolTransmitterData=null,this.mediaReceiverData=null,this.mediaTransmitterData=null}}},{key:"keepGatheringStats",value:function(){var e=this;this.realtimeSessionConnection.getStats().then(function(t){e.isActive&&(t.forEach(e.addStat.bind(e)),e.sendAddedStats(),setTimeout(e.keepGatheringStats.bind(e),e.interval))})}}]),e}();n.d(t,"a",function(){return ve});var me={"us-east-nj":["wr-us-east-nj-01.webrtc.flowroute.com","wr-us-east-va-01.webrtc.flowroute.com"],"us-west-or":["wr-us-west-or-01.webrtc.flowroute.com","wr-us-west-sjc-01.webrtc.flowroute.com"],"us-east-va":["wr-us-east-va-01.webrtc.flowroute.com","wr-us-east-nj-01.webrtc.flowroute.com"],"us-west-sjc":["wr-us-west-sjc-01.webrtc.flowroute.com","wr-us-west-or-01.webrtc.flowroute.com"],"eu-west-ldn":["wr-eu-west-ldn-01.webrtc.flowroute.com","wr-eu-west-ams-01.webrtc.flowroute.com"],"eu-west-ams":["wr-eu-west-ams-01.webrtc.flowroute.com","wr-eu-west-ldn-01.webrtc.flowroute.com"]},ve=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.params=u({pointOfPresence:"us-west-or",callerId:"anonymous",displayName:"Flowroute Client Demo",password:"nopassword",extraHeaders:[],debug:!1,intervalOfQualityReport:void 0,onUserAgentAction:function(){}},n);var r=me[this.params.pointOfPresence],i=[{socket:new pe.WebSocketInterface("wss://".concat(r[0],":4443")),weight:20},{socket:new pe.WebSocketInterface("wss://".concat(r[1],":4443")),weight:10}];this.micMuted=!1,this.qualityOfServiceEmitter=null,this.outputVolume=1,this.isRegistered=!1,this.onCallAction=function(){},this.onUserAgentAction=this.params.onUserAgentAction,this.sipUserAgent=new pe.UA({sockets:i,uri:"sip:".concat(this.params.callerId,"@wss.flowroute.com"),password:this.params.password,display_name:this.params.displayName}),this.sipUserAgent.on("newRTCSession",this.handleNewRTCSession.bind(this)),this.sipUserAgent.on("registered",function(e){t.isRegistered=!0,t.onUserAgentAction({type:"registered",payload:e})});["connecting","connected","disconnected","unregistered","registrationFailed","registrationExpiring","newMessage","sipEvent"].forEach(function(e){t.sipUserAgent.on(e,function(n){t.onUserAgentAction({type:e,payload:n})})})}return Object(d.a)(e,[{key:"start",value:function(){this.params.debug?pe.debug.enable("JsSIP:*"):pe.debug.disable("JsSIP:*"),this.sipUserAgent.start()}},{key:"stop",value:function(){this.sipUserAgent.stop()}},{key:"setDID",value:function(e){if("string"!==typeof e)throw new Error("Expected DID to be a string");if(11!==e.length)throw new Error("Currently only DIDs with 11 length are supported");this.params=u({},this.params,{did:e})}},{key:"call",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isRegistered)throw new Error("User agent not registered yet");if(this.activeCall)throw new Error("Already has active call");this.activeCall={};var t=e.to,n=e.onCallAction,r=void 0===n?function(){}:n,i=t||this.params.did;if(!i)throw new Error("No DID provided");this.setDID(i),this.audioPlayerElement||this.setAudioElement(),this.onCallAction=r,this.sipUserAgent.call("sip:".concat(i,"@sip.flowroute.com"),{mediaConstraints:{audio:e.audioConstraints||!0,video:!1},extraHeaders:this.params.extraHeaders,RTCConstraints:{optional:[{DtlsSrtpKeyAgreement:"true"}]},sessionTimersExpires:600})}},{key:"getActiveCall",value:function(){return this.activeCall}},{key:"hangup",value:function(){if(!this.activeCall)throw new Error("There is no active call to hangup");this.activeCall.terminate(),this.activeCall=null}},{key:"setOutputVolume",value:function(e){var t=parseInt(e,10)/100;this.outputVolume=t<0?0:t>1?1:t,this.audioPlayerElement&&(this.audioPlayerElement.volume=this.outputVolume)}},{key:"setMicMuted",value:function(e){e?(this.micMuted=!0,this.activeCall&&this.activeCall.mute()):(this.micMuted=!1,this.activeCall&&this.activeCall.unmute())}},{key:"getOutputVolume",value:function(){return 100*this.outputVolume}},{key:"pushExtraPrivateCallHeader",value:function(e,t){if(!e||!t)throw new Error("Provide name and value for adding P-header");this.params.extraHeaders.push("P-".concat(e,": ").concat(t))}},{key:"getExtraCallHeaders",value:function(){return this.params.extraHeaders}},{key:"sendRtpDTMF",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=this.activeCall;if(!n)throw new Error("No call instance available for sending DTMFs.");var r=fe()(n.connection.getSenders());if(!r)throw new Error("Failed to get an instance of RTP track sender for this call.");r.dtmf.insertDTMF(e,t),this.onCallAction({type:"sentRtpDTMF",payload:{tone:e,duration:t}})}},{key:"setAudioElement",value:function(e){if(void 0===e){var t=document.createElement("audio");this.audioPlayerElement=t}else if("string"===typeof e){var n=document.querySelector(e);if(!n||"audio"!==n.tagName.toLowerCase())throw new Error("Invalid DOM selector provided for audio element");this.audioPlayerElement=n}else this.audioPlayerElement=e;this.audioPlayerElement.defaultMuted=!1,this.audioPlayerElement.autoplay=!0,this.audioPlayerElement.controls=!0,this.audioPlayerElement.volume=this.outputVolume}},{key:"handleNewRTCSession",value:function(e){var t=this,n=e.session,r=e.request;this.activeCall=n;["peerconnection","connecting","sending","progress","accepted","newDTMF","newInfo","hold","unhold","muted","unmuted","reinvite","update","refer","replaces","sdp","icecandidate","getusermediafailed"].forEach(function(e){n.on(e,function(n){t.onCallAction({type:e,payload:n})})}),n.on("confirmed",function(e){t.connectAudio(n),t.onCallAction({type:"confirmed",payload:e})}),n.on("ended",function(e){t.disconnectAudio(),t.activeCall=null,t.onCallAction({type:"ended",payload:e})}),n.on("failed",function(e){t.disconnectAudio(),t.activeCall=null,t.onCallAction({type:"failed",payload:e})}),this.qualityOfServiceEmitter=new he(this.sipUserAgent,n.connection,r.call_id,this.params.did,this.params.intervalOfQualityReport,this.params.debug),this.onUserAgentAction({type:"newRTCSession",payload:e})}},{key:"connectAudio",value:function(e){if(!this.audioPlayerElement)throw new Error("Tried to connect audio but no player element provided");this.disconnectAudio();var t=e.connection.getRemoteStreams();this.audioPlayerElement.srcObject=fe()(t),this.qualityOfServiceEmitter.start(),this.setMicMuted(this.micMuted)}},{key:"disconnectAudio",value:function(){this.audioPlayerElement&&this.audioPlayerElement.srcObject&&(this.audioPlayerElement.srcObject.getTracks().forEach(function(e){return e.stop()}),this.audioPlayerElement.srcObject=null,this.qualityOfServiceEmitter.stop())}}]),e}();window.FlowrouteClient=ve},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}function o(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}n.d(t,"a",function(){return o})},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(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&&r(e,t)}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var r=n(25),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,l=i?Symbol.for("react.strict_mode"):60108,u=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,d=i?Symbol.for("react.context"):60110,f=i?Symbol.for("react.concurrent_mode"):60111,p=i?Symbol.for("react.forward_ref"):60112,h=i?Symbol.for("react.suspense"):60113,m=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,_="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(e,t,n,r,i,o,a,s){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],u=0;(e=Error(t.replace(/%s/g,function(){return l[u++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T={};function C(e,t,n){this.props=e,this.context=t,this.refs=T,this.updater=n||y}function S(){}function b(e,t,n){this.props=e,this.context=t,this.refs=T,this.updater=n||y}C.prototype.isReactComponent={},C.prototype.setState=function(e,t){"object"!==typeof e&&"function"!==typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=C.prototype;var E=b.prototype=new S;E.constructor=b,r(E,C.prototype),E.isPureReactComponent=!0;var w={current:null},R={current:null},A=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function x(e,t,n){var r=void 0,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)A.call(t,r)&&!k.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===i[r]&&(i[r]=l[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:R.current}}function I(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var P=/\/+/g,O=[];function N(e,t,n,r){if(O.length){var i=O.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function D(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>O.length&&O.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case a:l=!0}}if(l)return r(i,t,""===n?"."+U(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u<t.length;u++){var c=n+U(s=t[u],u);l+=e(s,c,r,i)}else if(c=null===t||"object"!==typeof t?null:"function"===typeof(c=_&&t[_]||t["@@iterator"])?c:null,"function"===typeof c)for(t=c.call(t),u=0;!(s=t.next()).done;)l+=e(s=s.value,c=n+U(s,u++),r,i);else"object"===s&&g("31","[object Object]"===(r=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":r,"");return l}(e,"",t,n)}function U(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function L(e,t){e.func.call(e.context,t,e.count++)}function F(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?q(e,r,n,function(e){return e}):null!=e&&(I(e)&&(e=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(P,"$&/")+"/")+n)),r.push(e))}function q(e,t,n,r,i){var o="";null!=n&&(o=(""+n).replace(P,"$&/")+"/"),M(e,F,t=N(t,o,r,i)),D(t)}function H(){var e=w.current;return null===e&&g("321"),e}var j={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return q(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;M(e,L,t=N(null,null,t,n)),D(t)},count:function(e){return M(e,function(){return null},null)},toArray:function(e){var t=[];return q(e,t,null,function(e){return e}),t},only:function(e){return I(e)||g("143"),e}},createRef:function(){return{current:null}},Component:C,PureComponent:b,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:d,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:p,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return H().useCallback(e,t)},useContext:function(e,t){return H().useContext(e,t)},useEffect:function(e,t){return H().useEffect(e,t)},useImperativeHandle:function(e,t,n){return H().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return H().useLayoutEffect(e,t)},useMemo:function(e,t){return H().useMemo(e,t)},useReducer:function(e,t,n){return H().useReducer(e,t,n)},useRef:function(e){return H().useRef(e)},useState:function(e){return H().useState(e)},Fragment:s,StrictMode:l,Suspense:h,createElement:x,cloneElement:function(e,t,n){(null===e||void 0===e)&&g("267",e);var i=void 0,a=r({},e.props),s=e.key,l=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,u=R.current),void 0!==t.key&&(s=""+t.key);var c=void 0;for(i in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)A.call(t,i)&&!k.hasOwnProperty(i)&&(a[i]=void 0===t[i]&&void 0!==c?c[i]:t[i])}if(1===(i=arguments.length-2))a.children=n;else if(1<i){c=Array(i);for(var d=0;d<i;d++)c[d]=arguments[d+2];a.children=c}return{$$typeof:o,type:e.type,key:s,ref:l,props:a,_owner:u}},createFactory:function(e){var t=x.bind(null,e);return t.type=e,t},isValidElement:I,version:"16.8.6",unstable_ConcurrentMode:f,unstable_Profiler:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:w,ReactCurrentOwner:R,assign:r}},z={default:j},G=z&&j||z;e.exports=G.default||G},function(e,t,n){"use strict";var r=n(0),i=n(25),o=n(42);function a(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(e,t,n,r,i,o,a,s){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],u=0;(e=Error(t.replace(/%s/g,function(){return l[u++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}r||a("227");var s=!1,l=null,u=!1,c=null,d={onError:function(e){s=!0,l=e}};function f(e,t,n,r,i,o,a,u,c){s=!1,l=null,function(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}.apply(d,arguments)}var p=null,h={};function m(){if(p)for(var e in h){var t=h[e],n=p.indexOf(e);if(-1<n||a("96",e),!_[n])for(var r in t.extractEvents||a("97",e),_[n]=t,n=t.eventTypes){var i=void 0,o=n[r],s=t,l=r;g.hasOwnProperty(l)&&a("99",l),g[l]=o;var u=o.phasedRegistrationNames;if(u){for(i in u)u.hasOwnProperty(i)&&v(u[i],s,l);i=!0}else o.registrationName?(v(o.registrationName,s,l),i=!0):i=!1;i||a("98",r,e)}}}function v(e,t,n){y[e]&&a("100",e),y[e]=t,T[e]=t.eventTypes[n].dependencies}var _=[],g={},y={},T={},C=null,S=null,b=null;function E(e,t,n){var r=e.type||"unknown-event";e.currentTarget=b(n),function(e,t,n,r,i,o,d,p,h){if(f.apply(this,arguments),s){if(s){var m=l;s=!1,l=null}else a("198"),m=void 0;u||(u=!0,c=m)}}(r,t,void 0,e),e.currentTarget=null}function w(e,t){return null==t&&a("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function R(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var A=null;function k(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)E(e,t[r],n[r]);else t&&E(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}var x={injectEventPluginOrder:function(e){p&&a("101"),p=Array.prototype.slice.call(e),m()},injectEventPluginsByName:function(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];h.hasOwnProperty(t)&&h[t]===r||(h[t]&&a("102",t),h[t]=r,n=!0)}n&&m()}};function I(e,t){var n=e.stateNode;if(!n)return null;var r=C(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}return e?null:(n&&"function"!==typeof n&&a("231",t,typeof n),n)}function P(e){if(null!==e&&(A=w(A,e)),e=A,A=null,e&&(R(e,k),A&&a("95"),u))throw e=c,u=!1,c=null,e}var O=Math.random().toString(36).slice(2),N="__reactInternalInstance$"+O,D="__reactEventHandlers$"+O;function M(e){if(e[N])return e[N];for(;!e[N];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[N]).tag||6===e.tag?e:null}function U(e){return!(e=e[N])||5!==e.tag&&6!==e.tag?null:e}function L(e){if(5===e.tag||6===e.tag)return e.stateNode;a("33")}function F(e){return e[D]||null}function q(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function H(e,t,n){(t=I(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=w(n._dispatchListeners,t),n._dispatchInstances=w(n._dispatchInstances,e))}function j(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=q(t);for(t=n.length;0<t--;)H(n[t],"captured",e);for(t=0;t<n.length;t++)H(n[t],"bubbled",e)}}function z(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=I(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=w(n._dispatchListeners,t),n._dispatchInstances=w(n._dispatchInstances,e))}function G(e){e&&e.dispatchConfig.registrationName&&z(e._targetInst,null,e)}function W(e){R(e,j)}var V=!("undefined"===typeof window||!window.document||!window.document.createElement);function B(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var K={animationend:B("Animation","AnimationEnd"),animationiteration:B("Animation","AnimationIteration"),animationstart:B("Animation","AnimationStart"),transitionend:B("Transition","TransitionEnd")},$={},J={};function Y(e){if($[e])return $[e];if(!K[e])return e;var t,n=K[e];for(t in n)if(n.hasOwnProperty(t)&&t in J)return $[e]=n[t];return e}V&&(J=document.createElement("div").style,"AnimationEvent"in window||(delete K.animationend.animation,delete K.animationiteration.animation,delete K.animationstart.animation),"TransitionEvent"in window||delete K.transitionend.transition);var Q=Y("animationend"),X=Y("animationiteration"),Z=Y("animationstart"),ee=Y("transitionend"),te="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ne=null,re=null,ie=null;function oe(){if(ie)return ie;var e,t,n=re,r=n.length,i="value"in ne?ne.value:ne.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return ie=i.slice(e,1<t?1-t:void 0)}function ae(){return!0}function se(){return!1}function le(e,t,n,r){for(var i in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?ae:se,this.isPropagationStopped=se,this}function ue(e,t,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,n,r),i}return new this(e,t,n,r)}function ce(e){e instanceof this||a("279"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function de(e){e.eventPool=[],e.getPooled=ue,e.release=ce}i(le.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:se,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=se,this._dispatchInstances=this._dispatchListeners=null}}),le.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},le.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,e),n.extend=r.extend,de(n),n},de(le);var fe=le.extend({data:null}),pe=le.extend({data:null}),he=[9,13,27,32],me=V&&"CompositionEvent"in window,ve=null;V&&"documentMode"in document&&(ve=document.documentMode);var _e=V&&"TextEvent"in window&&!ve,ge=V&&(!me||ve&&8<ve&&11>=ve),ye=String.fromCharCode(32),Te={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Ce=!1;function Se(e,t){switch(e){case"keyup":return-1!==he.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function be(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Ee=!1;var we={eventTypes:Te,extractEvents:function(e,t,n,r){var i=void 0,o=void 0;if(me)e:{switch(e){case"compositionstart":i=Te.compositionStart;break e;case"compositionend":i=Te.compositionEnd;break e;case"compositionupdate":i=Te.compositionUpdate;break e}i=void 0}else Ee?Se(e,n)&&(i=Te.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=Te.compositionStart);return i?(ge&&"ko"!==n.locale&&(Ee||i!==Te.compositionStart?i===Te.compositionEnd&&Ee&&(o=oe()):(re="value"in(ne=r)?ne.value:ne.textContent,Ee=!0)),i=fe.getPooled(i,t,n,r),o?i.data=o:null!==(o=be(n))&&(i.data=o),W(i),o=i):o=null,(e=_e?function(e,t){switch(e){case"compositionend":return be(t);case"keypress":return 32!==t.which?null:(Ce=!0,ye);case"textInput":return(e=t.data)===ye&&Ce?null:e;default:return null}}(e,n):function(e,t){if(Ee)return"compositionend"===e||!me&&Se(e,t)?(e=oe(),ie=re=ne=null,Ee=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ge&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=pe.getPooled(Te.beforeInput,t,n,r)).data=e,W(t)):t=null,null===o?t:null===t?o:[o,t]}},Re=null,Ae=null,ke=null;function xe(e){if(e=S(e)){"function"!==typeof Re&&a("280");var t=C(e.stateNode);Re(e.stateNode,e.type,t)}}function Ie(e){Ae?ke?ke.push(e):ke=[e]:Ae=e}function Pe(){if(Ae){var e=Ae,t=ke;if(ke=Ae=null,xe(e),t)for(e=0;e<t.length;e++)xe(t[e])}}function Oe(e,t){return e(t)}function Ne(e,t,n){return e(t,n)}function De(){}var Me=!1;function Ue(e,t){if(Me)return e(t);Me=!0;try{return Oe(e,t)}finally{Me=!1,(null!==Ae||null!==ke)&&(De(),Pe())}}var Le={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fe(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Le[e.type]:"textarea"===t}function qe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function He(e){if(!V)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}function je(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ze(e){e._valueTracker||(e._valueTracker=function(e){var t=je(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ge(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=je(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}var We=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;We.hasOwnProperty("ReactCurrentDispatcher")||(We.ReactCurrentDispatcher={current:null});var Ve=/^(.*)[\\\/]/,Be="function"===typeof Symbol&&Symbol.for,Ke=Be?Symbol.for("react.element"):60103,$e=Be?Symbol.for("react.portal"):60106,Je=Be?Symbol.for("react.fragment"):60107,Ye=Be?Symbol.for("react.strict_mode"):60108,Qe=Be?Symbol.for("react.profiler"):60114,Xe=Be?Symbol.for("react.provider"):60109,Ze=Be?Symbol.for("react.context"):60110,et=Be?Symbol.for("react.concurrent_mode"):60111,tt=Be?Symbol.for("react.forward_ref"):60112,nt=Be?Symbol.for("react.suspense"):60113,rt=Be?Symbol.for("react.memo"):60115,it=Be?Symbol.for("react.lazy"):60116,ot="function"===typeof Symbol&&Symbol.iterator;function at(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=ot&&e[ot]||e["@@iterator"])?e:null}function st(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case et:return"ConcurrentMode";case Je:return"Fragment";case $e:return"Portal";case Qe:return"Profiler";case Ye:return"StrictMode";case nt:return"Suspense"}if("object"===typeof e)switch(e.$$typeof){case Ze:return"Context.Consumer";case Xe:return"Context.Provider";case tt:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case rt:return st(e.type);case it:if(e=1===e._status?e._result:null)return st(e)}return null}function lt(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,i=e._debugSource,o=st(e.type);n=null,r&&(n=st(r.type)),r=o,o="",i?o=" (at "+i.fileName.replace(Ve,"")+":"+i.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n    in "+(r||"Unknown")+o}t+=n,e=e.return}while(e);return t}var ut=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ct=Object.prototype.hasOwnProperty,dt={},ft={};function pt(e,t,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t}var ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ht[e]=new pt(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ht[t]=new pt(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ht[e]=new pt(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ht[e]=new pt(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ht[e]=new pt(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){ht[e]=new pt(e,3,!0,e,null)}),["capture","download"].forEach(function(e){ht[e]=new pt(e,4,!1,e,null)}),["cols","rows","size","span"].forEach(function(e){ht[e]=new pt(e,6,!1,e,null)}),["rowSpan","start"].forEach(function(e){ht[e]=new pt(e,5,!1,e.toLowerCase(),null)});var mt=/[\-:]([a-z])/g;function vt(e){return e[1].toUpperCase()}function _t(e,t,n,r){var i=ht.hasOwnProperty(t)?ht[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!ct.call(ft,e)||!ct.call(dt,e)&&(ut.test(e)?ft[e]=!0:(dt[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function gt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function yt(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Tt(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=gt(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Ct(e,t){null!=(t=t.checked)&&_t(e,"checked",t,!1)}function St(e,t){Ct(e,t);var n=gt(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Et(e,t.type,n):t.hasOwnProperty("defaultValue")&&Et(e,t.type,gt(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function bt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Et(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mt,vt);ht[t]=new pt(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mt,vt);ht[t]=new pt(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mt,vt);ht[t]=new pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),["tabIndex","crossOrigin"].forEach(function(e){ht[e]=new pt(e,1,!1,e.toLowerCase(),null)});var wt={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Rt(e,t,n){return(e=le.getPooled(wt.change,e,t,n)).type="change",Ie(n),W(e),e}var At=null,kt=null;function xt(e){P(e)}function It(e){if(Ge(L(e)))return e}function Pt(e,t){if("change"===e)return t}var Ot=!1;function Nt(){At&&(At.detachEvent("onpropertychange",Dt),kt=At=null)}function Dt(e){"value"===e.propertyName&&It(kt)&&Ue(xt,e=Rt(kt,e,qe(e)))}function Mt(e,t,n){"focus"===e?(Nt(),kt=n,(At=t).attachEvent("onpropertychange",Dt)):"blur"===e&&Nt()}function Ut(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return It(kt)}function Lt(e,t){if("click"===e)return It(t)}function Ft(e,t){if("input"===e||"change"===e)return It(t)}V&&(Ot=He("input")&&(!document.documentMode||9<document.documentMode));var qt={eventTypes:wt,_isInputEventSupported:Ot,extractEvents:function(e,t,n,r){var i=t?L(t):window,o=void 0,a=void 0,s=i.nodeName&&i.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===i.type?o=Pt:Fe(i)?Ot?o=Ft:(o=Ut,a=Mt):(s=i.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(o=Lt),o&&(o=o(e,t)))return Rt(o,n,r);a&&a(e,i,t),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&Et(i,"number",i.value)}},Ht=le.extend({view:null,detail:null}),jt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zt(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=jt[e])&&!!t[e]}function Gt(){return zt}var Wt=0,Vt=0,Bt=!1,Kt=!1,$t=Ht.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Gt,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Wt;return Wt=e.screenX,Bt?"mousemove"===e.type?e.screenX-t:0:(Bt=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Vt;return Vt=e.screenY,Kt?"mousemove"===e.type?e.screenY-t:0:(Kt=!0,0)}}),Jt=$t.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Yt={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Qt={eventTypes:Yt,extractEvents:function(e,t,n,r){var i="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(i&&(n.relatedTarget||n.fromElement)||!o&&!i)return null;if(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,o?(o=t,t=(t=n.relatedTarget||n.toElement)?M(t):null):o=null,o===t)return null;var a=void 0,s=void 0,l=void 0,u=void 0;"mouseout"===e||"mouseover"===e?(a=$t,s=Yt.mouseLeave,l=Yt.mouseEnter,u="mouse"):"pointerout"!==e&&"pointerover"!==e||(a=Jt,s=Yt.pointerLeave,l=Yt.pointerEnter,u="pointer");var c=null==o?i:L(o);if(i=null==t?i:L(t),(e=a.getPooled(s,o,n,r)).type=u+"leave",e.target=c,e.relatedTarget=i,(n=a.getPooled(l,t,n,r)).type=u+"enter",n.target=i,n.relatedTarget=c,r=t,o&&r)e:{for(i=r,u=0,a=t=o;a;a=q(a))u++;for(a=0,l=i;l;l=q(l))a++;for(;0<u-a;)t=q(t),u--;for(;0<a-u;)i=q(i),a--;for(;u--;){if(t===i||t===i.alternate)break e;t=q(t),i=q(i)}t=null}else t=null;for(i=t,t=[];o&&o!==i&&(null===(u=o.alternate)||u!==i);)t.push(o),o=q(o);for(o=[];r&&r!==i&&(null===(u=r.alternate)||u!==i);)o.push(r),r=q(r);for(r=0;r<t.length;r++)z(t[r],"bubbled",e);for(r=o.length;0<r--;)z(o[r],"captured",n);return[e,n]}};function Xt(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var Zt=Object.prototype.hasOwnProperty;function en(e,t){if(Xt(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Zt.call(t,n[r])||!Xt(e[n[r]],t[n[r]]))return!1;return!0}function tn(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!==(2&t.effectTag))return 1;for(;t.return;)if(0!==(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function nn(e){2!==tn(e)&&a("188")}function rn(e){if(!(e=function(e){var t=e.alternate;if(!t)return 3===(t=tn(e))&&a("188"),1===t?null:e;for(var n=e,r=t;;){var i=n.return,o=i?i.alternate:null;if(!i||!o)break;if(i.child===o.child){for(var s=i.child;s;){if(s===n)return nn(i),e;if(s===r)return nn(i),t;s=s.sibling}a("188")}if(n.return!==r.return)n=i,r=o;else{s=!1;for(var l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}s||a("189")}}n.alternate!==r&&a("190")}return 3!==n.tag&&a("188"),n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}var on=le.extend({animationName:null,elapsedTime:null,pseudoElement:null}),an=le.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sn=Ht.extend({relatedTarget:null});function ln(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var un={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},dn=Ht.extend({key:function(e){if(e.key){var t=un[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=ln(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cn[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Gt,charCode:function(e){return"keypress"===e.type?ln(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?ln(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),fn=$t.extend({dataTransfer:null}),pn=Ht.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Gt}),hn=le.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),mn=$t.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),vn=[["abort","abort"],[Q,"animationEnd"],[X,"animationIteration"],[Z,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"],["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[ee,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],_n={},gn={};function yn(e,t){var n=e[0],r="on"+((e=e[1])[0].toUpperCase()+e.slice(1));t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},_n[e]=t,gn[n]=t}[["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["auxclick","auxClick"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"],["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(e){yn(e,!0)}),vn.forEach(function(e){yn(e,!1)});var Tn={eventTypes:_n,isInteractiveTopLevelEventType:function(e){return void 0!==(e=gn[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var i=gn[e];if(!i)return null;switch(e){case"keypress":if(0===ln(n))return null;case"keydown":case"keyup":e=dn;break;case"blur":case"focus":e=sn;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=$t;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=fn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=pn;break;case Q:case X:case Z:e=on;break;case ee:e=hn;break;case"scroll":e=Ht;break;case"wheel":e=mn;break;case"copy":case"cut":case"paste":e=an;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Jt;break;default:e=le}return W(t=e.getPooled(i,t,n,r)),t}},Cn=Tn.isInteractiveTopLevelEventType,Sn=[];function bn(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r;for(r=n;r.return;)r=r.return;if(!(r=3!==r.tag?null:r.stateNode.containerInfo))break;e.ancestors.push(n),n=M(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var i=qe(e.nativeEvent);r=e.topLevelType;for(var o=e.nativeEvent,a=null,s=0;s<_.length;s++){var l=_[s];l&&(l=l.extractEvents(r,t,o,i))&&(a=w(a,l))}P(a)}}var En=!0;function wn(e,t){if(!t)return null;var n=(Cn(e)?An:kn).bind(null,e);t.addEventListener(e,n,!1)}function Rn(e,t){if(!t)return null;var n=(Cn(e)?An:kn).bind(null,e);t.addEventListener(e,n,!0)}function An(e,t){Ne(kn,e,t)}function kn(e,t){if(En){var n=qe(t);if(null===(n=M(n))||"number"!==typeof n.tag||2===tn(n)||(n=null),Sn.length){var r=Sn.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{Ue(bn,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>Sn.length&&Sn.push(e)}}}var xn={},In=0,Pn="_reactListenersID"+(""+Math.random()).slice(2);function On(e){return Object.prototype.hasOwnProperty.call(e,Pn)||(e[Pn]=In++,xn[e[Pn]]={}),xn[e[Pn]]}function Nn(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Dn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mn(e,t){var n,r=Dn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Dn(r)}}function Un(){for(var e=window,t=Nn();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Nn((e=t.contentWindow).document)}return t}function Ln(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Fn(e){var t=Un(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(n.ownerDocument.documentElement,n)){if(null!==r&&Ln(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Mn(n,o);var a=Mn(n,r);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qn=V&&"documentMode"in document&&11>=document.documentMode,Hn={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},jn=null,zn=null,Gn=null,Wn=!1;function Vn(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Wn||null==jn||jn!==Nn(n)?null:("selectionStart"in(n=jn)&&Ln(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Gn&&en(Gn,n)?null:(Gn=n,(e=le.getPooled(Hn.select,zn,e,t)).type="select",e.target=jn,W(e),e))}var Bn={eventTypes:Hn,extractEvents:function(e,t,n,r){var i,o=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!o)){e:{o=On(o),i=T.onSelect;for(var a=0;a<i.length;a++){var s=i[a];if(!o.hasOwnProperty(s)||!o[s]){o=!1;break e}}o=!0}i=!o}if(i)return null;switch(o=t?L(t):window,e){case"focus":(Fe(o)||"true"===o.contentEditable)&&(jn=o,zn=t,Gn=null);break;case"blur":Gn=zn=jn=null;break;case"mousedown":Wn=!0;break;case"contextmenu":case"mouseup":case"dragend":return Wn=!1,Vn(n,r);case"selectionchange":if(qn)break;case"keydown":case"keyup":return Vn(n,r)}return null}};function Kn(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function $n(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function Jn(e,t){return null!=t.dangerouslySetInnerHTML&&a("91"),i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yn(e,t){var n=t.value;null==n&&(n=t.defaultValue,null!=(t=t.children)&&(null!=n&&a("92"),Array.isArray(t)&&(1>=t.length||a("93"),t=t[0]),n=t),null==n&&(n="")),e._wrapperState={initialValue:gt(n)}}function Qn(e,t){var n=gt(t.value),r=gt(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Xn(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}x.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),C=F,S=U,b=L,x.injectEventPluginsByName({SimpleEventPlugin:Tn,EnterLeaveEventPlugin:Qt,ChangeEventPlugin:qt,SelectEventPlugin:Bn,BeforeInputEventPlugin:we});var Zn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function er(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function tr(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?er(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var nr,rr=void 0,ir=(nr=function(e,t){if(e.namespaceURI!==Zn.svg||"innerHTML"in e)e.innerHTML=t;else{for((rr=rr||document.createElement("div")).innerHTML="<svg>"+t+"</svg>",t=rr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return nr(e,t)})}:nr);function or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ar={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sr=["Webkit","ms","Moz","O"];function lr(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||ar.hasOwnProperty(e)&&ar[e]?(""+t).trim():t+"px"}function ur(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=lr(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(ar).forEach(function(e){sr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ar[t]=ar[e]})});var cr=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dr(e,t){t&&(cr[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&a("137",e,""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&a("60"),"object"===typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||a("61")),null!=t.style&&"object"!==typeof t.style&&a("62",""))}function fr(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function pr(e,t){var n=On(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=T[t];for(var r=0;r<t.length;r++){var i=t[r];if(!n.hasOwnProperty(i)||!n[i]){switch(i){case"scroll":Rn("scroll",e);break;case"focus":case"blur":Rn("focus",e),Rn("blur",e),n.blur=!0,n.focus=!0;break;case"cancel":case"close":He(i)&&Rn(i,e);break;case"invalid":case"submit":case"reset":break;default:-1===te.indexOf(i)&&wn(i,e)}n[i]=!0}}}function hr(){}var mr=null,vr=null;function _r(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function gr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var yr="function"===typeof setTimeout?setTimeout:void 0,Tr="function"===typeof clearTimeout?clearTimeout:void 0,Cr=o.unstable_scheduleCallback,Sr=o.unstable_cancelCallback;function br(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function Er(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}new Set;var wr=[],Rr=-1;function Ar(e){0>Rr||(e.current=wr[Rr],wr[Rr]=null,Rr--)}function kr(e,t){wr[++Rr]=e.current,e.current=t}var xr={},Ir={current:xr},Pr={current:!1},Or=xr;function Nr(e,t){var n=e.type.contextTypes;if(!n)return xr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Dr(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Mr(e){Ar(Pr),Ar(Ir)}function Ur(e){Ar(Pr),Ar(Ir)}function Lr(e,t,n){Ir.current!==xr&&a("168"),kr(Ir,t),kr(Pr,n)}function Fr(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())o in e||a("108",st(t)||"Unknown",o);return i({},n,r)}function qr(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||xr,Or=Ir.current,kr(Ir,t),kr(Pr,Pr.current),!0}function Hr(e,t,n){var r=e.stateNode;r||a("169"),n?(t=Fr(e,t,Or),r.__reactInternalMemoizedMergedChildContext=t,Ar(Pr),Ar(Ir),kr(Ir,t)):Ar(Pr),kr(Pr,n)}var jr=null,zr=null;function Gr(e){return function(t){try{return e(t)}catch(n){}}}function Wr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Vr(e,t,n,r){return new Wr(e,t,n,r)}function Br(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Kr(e,t){var n=e.alternate;return null===n?((n=Vr(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.contextDependencies=e.contextDependencies,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $r(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Br(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case Je:return Jr(n.children,i,o,t);case et:return Yr(n,3|i,o,t);case Ye:return Yr(n,2|i,o,t);case Qe:return(e=Vr(12,n,t,4|i)).elementType=Qe,e.type=Qe,e.expirationTime=o,e;case nt:return(e=Vr(13,n,t,i)).elementType=nt,e.type=nt,e.expirationTime=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case Xe:s=10;break e;case Ze:s=9;break e;case tt:s=11;break e;case rt:s=14;break e;case it:s=16,r=null;break e}a("130",null==e?e:typeof e,"")}return(t=Vr(s,n,t,i)).elementType=e,t.type=r,t.expirationTime=o,t}function Jr(e,t,n,r){return(e=Vr(7,e,r,t)).expirationTime=n,e}function Yr(e,t,n,r){return e=Vr(8,e,r,t),t=0===(1&t)?Ye:et,e.elementType=t,e.type=t,e.expirationTime=n,e}function Qr(e,t,n){return(e=Vr(6,e,null,t)).expirationTime=n,e}function Xr(e,t,n){return(t=Vr(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zr(e,t){e.didError=!1;var n=e.earliestPendingTime;0===n?e.earliestPendingTime=e.latestPendingTime=t:n<t?e.earliestPendingTime=t:e.latestPendingTime>t&&(e.latestPendingTime=t),ni(t,e)}function ei(e,t){e.didError=!1,e.latestPingedTime>=t&&(e.latestPingedTime=0);var n=e.earliestPendingTime,r=e.latestPendingTime;n===t?e.earliestPendingTime=r===t?e.latestPendingTime=0:r:r===t&&(e.latestPendingTime=n),n=e.earliestSuspendedTime,r=e.latestSuspendedTime,0===n?e.earliestSuspendedTime=e.latestSuspendedTime=t:n<t?e.earliestSuspendedTime=t:r>t&&(e.latestSuspendedTime=t),ni(t,e)}function ti(e,t){var n=e.earliestPendingTime;return n>t&&(t=n),(e=e.earliestSuspendedTime)>t&&(t=e),t}function ni(e,t){var n=t.earliestSuspendedTime,r=t.latestSuspendedTime,i=t.earliestPendingTime,o=t.latestPingedTime;0===(i=0!==i?i:o)&&(0===e||r<e)&&(i=r),0!==(e=i)&&n>e&&(e=n),t.nextExpirationTimeToWorkOn=i,t.expirationTime=e}function ri(e,t){if(e&&e.defaultProps)for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var ii=(new r.Component).refs;function oi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:i({},t,n),e.memoizedState=n,null!==(r=e.updateQueue)&&0===e.expirationTime&&(r.baseState=n)}var ai={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===tn(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=Ss(),i=Yo(r=Ja(r,e));i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Ga(),Xo(e,i),Xa(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=Ss(),i=Yo(r=Ja(r,e));i.tag=Wo,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Ga(),Xo(e,i),Xa(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=Ss(),r=Yo(n=Ja(n,e));r.tag=Vo,void 0!==t&&null!==t&&(r.callback=t),Ga(),Xo(e,r),Xa(e,n)}};function si(e,t,n,r,i,o,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!en(n,r)||!en(i,o))}function li(e,t,n){var r=!1,i=xr,o=t.contextType;return"object"===typeof o&&null!==o?o=zo(o):(i=Dr(t)?Or:Ir.current,o=(r=null!==(r=t.contextTypes)&&void 0!==r)?Nr(e,i):xr),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ai,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function ui(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ai.enqueueReplaceState(t,t.state,null)}function ci(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ii;var o=t.contextType;"object"===typeof o&&null!==o?i.context=zo(o):(o=Dr(t)?Or:Ir.current,i.context=Nr(e,o)),null!==(o=e.updateQueue)&&(na(e,o,n,i,r),i.state=e.memoizedState),"function"===typeof(o=t.getDerivedStateFromProps)&&(oi(e,t,o,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ai.enqueueReplaceState(i,i.state,null),null!==(o=e.updateQueue)&&(na(e,o,n,i,r),i.state=e.memoizedState)),"function"===typeof i.componentDidMount&&(e.effectTag|=4)}var di=Array.isArray;function fi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){n=n._owner;var r=void 0;n&&(1!==n.tag&&a("309"),r=n.stateNode),r||a("147",e);var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=r.refs;t===ii&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}"string"!==typeof e&&a("284"),n._owner||a("290",e)}return e}function pi(e,t){"textarea"!==e.type&&a("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function hi(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return(e=Kr(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function s(t){return e&&null===t.alternate&&(t.effectTag=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Qr(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=fi(e,t,n),r.return=e,r):((r=$r(n.type,n.key,n.props,null,e.mode,r)).ref=fi(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Xr(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Jr(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Qr(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case Ke:return(n=$r(t.type,t.key,t.props,null,e.mode,n)).ref=fi(e,null,t),n.return=e,n;case $e:return(t=Xr(t,e.mode,n)).return=e,t}if(di(t)||at(t))return(t=Jr(t,e.mode,n,null)).return=e,t;pi(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case Ke:return n.key===i?n.type===Je?d(e,t,n.props.children,r,i):u(e,t,n,r):null;case $e:return n.key===i?c(e,t,n,r):null}if(di(n)||at(n))return null!==i?null:d(e,t,n,r,null);pi(e,n)}return null}function h(e,t,n,r,i){if("string"===typeof r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case Ke:return e=e.get(null===r.key?n:r.key)||null,r.type===Je?d(t,e,r.props.children,i,r.key):u(t,e,r,i);case $e:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(di(r)||at(r))return d(t,e=e.get(n)||null,r,i,null);pi(t,r)}return null}function m(i,a,s,l){for(var u=null,c=null,d=a,m=a=0,v=null;null!==d&&m<s.length;m++){d.index>m?(v=d,d=null):v=d.sibling;var _=p(i,d,s[m],l);if(null===_){null===d&&(d=v);break}e&&d&&null===_.alternate&&t(i,d),a=o(_,a,m),null===c?u=_:c.sibling=_,c=_,d=v}if(m===s.length)return n(i,d),u;if(null===d){for(;m<s.length;m++)(d=f(i,s[m],l))&&(a=o(d,a,m),null===c?u=d:c.sibling=d,c=d);return u}for(d=r(i,d);m<s.length;m++)(v=h(d,i,m,s[m],l))&&(e&&null!==v.alternate&&d.delete(null===v.key?m:v.key),a=o(v,a,m),null===c?u=v:c.sibling=v,c=v);return e&&d.forEach(function(e){return t(i,e)}),u}function v(i,s,l,u){var c=at(l);"function"!==typeof c&&a("150"),null==(l=c.call(l))&&a("151");for(var d=c=null,m=s,v=s=0,_=null,g=l.next();null!==m&&!g.done;v++,g=l.next()){m.index>v?(_=m,m=null):_=m.sibling;var y=p(i,m,g.value,u);if(null===y){m||(m=_);break}e&&m&&null===y.alternate&&t(i,m),s=o(y,s,v),null===d?c=y:d.sibling=y,d=y,m=_}if(g.done)return n(i,m),c;if(null===m){for(;!g.done;v++,g=l.next())null!==(g=f(i,g.value,u))&&(s=o(g,s,v),null===d?c=g:d.sibling=g,d=g);return c}for(m=r(i,m);!g.done;v++,g=l.next())null!==(g=h(m,i,v,g.value,u))&&(e&&null!==g.alternate&&m.delete(null===g.key?v:g.key),s=o(g,s,v),null===d?c=g:d.sibling=g,d=g);return e&&m.forEach(function(e){return t(i,e)}),c}return function(e,r,o,l){var u="object"===typeof o&&null!==o&&o.type===Je&&null===o.key;u&&(o=o.props.children);var c="object"===typeof o&&null!==o;if(c)switch(o.$$typeof){case Ke:e:{for(c=o.key,u=r;null!==u;){if(u.key===c){if(7===u.tag?o.type===Je:u.elementType===o.type){n(e,u.sibling),(r=i(u,o.type===Je?o.props.children:o.props)).ref=fi(e,u,o),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}o.type===Je?((r=Jr(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=$r(o.type,o.key,o.props,null,e.mode,l)).ref=fi(e,r,o),l.return=e,e=l)}return s(e);case $e:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Xr(o,e.mode,l)).return=e,e=r}return s(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Qr(o,e.mode,l)).return=e,e=r),s(e);if(di(o))return m(e,r,o,l);if(at(o))return v(e,r,o,l);if(c&&pi(e,o),"undefined"===typeof o&&!u)switch(e.tag){case 1:case 0:a("152",(l=e.type).displayName||l.name||"Component")}return n(e,r)}}var mi=hi(!0),vi=hi(!1),_i={},gi={current:_i},yi={current:_i},Ti={current:_i};function Ci(e){return e===_i&&a("174"),e}function Si(e,t){kr(Ti,t),kr(yi,e),kr(gi,_i);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:tr(null,"");break;default:t=tr(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}Ar(gi),kr(gi,t)}function bi(e){Ar(gi),Ar(yi),Ar(Ti)}function Ei(e){Ci(Ti.current);var t=Ci(gi.current),n=tr(t,e.type);t!==n&&(kr(yi,e),kr(gi,n))}function wi(e){yi.current===e&&(Ar(gi),Ar(yi))}var Ri=0,Ai=2,ki=4,xi=8,Ii=16,Pi=32,Oi=64,Ni=128,Di=We.ReactCurrentDispatcher,Mi=0,Ui=null,Li=null,Fi=null,qi=null,Hi=null,ji=null,zi=0,Gi=null,Wi=0,Vi=!1,Bi=null,Ki=0;function $i(){a("321")}function Ji(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Xt(e[n],t[n]))return!1;return!0}function Yi(e,t,n,r,i,o){if(Mi=o,Ui=t,Fi=null!==e?e.memoizedState:null,Di.current=null===Fi?uo:co,t=n(r,i),Vi){do{Vi=!1,Ki+=1,Fi=null!==e?e.memoizedState:null,ji=qi,Gi=Hi=Li=null,Di.current=co,t=n(r,i)}while(Vi);Bi=null,Ki=0}return Di.current=lo,(e=Ui).memoizedState=qi,e.expirationTime=zi,e.updateQueue=Gi,e.effectTag|=Wi,e=null!==Li&&null!==Li.next,Mi=0,ji=Hi=qi=Fi=Li=Ui=null,zi=0,Gi=null,Wi=0,e&&a("300"),t}function Qi(){Di.current=lo,Mi=0,ji=Hi=qi=Fi=Li=Ui=null,zi=0,Gi=null,Wi=0,Vi=!1,Bi=null,Ki=0}function Xi(){var e={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return null===Hi?qi=Hi=e:Hi=Hi.next=e,Hi}function Zi(){if(null!==ji)ji=(Hi=ji).next,Fi=null!==(Li=Fi)?Li.next:null;else{null===Fi&&a("310");var e={memoizedState:(Li=Fi).memoizedState,baseState:Li.baseState,queue:Li.queue,baseUpdate:Li.baseUpdate,next:null};Hi=null===Hi?qi=e:Hi.next=e,Fi=Li.next}return Hi}function eo(e,t){return"function"===typeof t?t(e):t}function to(e){var t=Zi(),n=t.queue;if(null===n&&a("311"),n.lastRenderedReducer=e,0<Ki){var r=n.dispatch;if(null!==Bi){var i=Bi.get(n);if(void 0!==i){Bi.delete(n);var o=t.memoizedState;do{o=e(o,i.action),i=i.next}while(null!==i);return Xt(o,t.memoizedState)||(So=!0),t.memoizedState=o,t.baseUpdate===n.last&&(t.baseState=o),n.lastRenderedState=o,[o,r]}}return[t.memoizedState,r]}r=n.last;var s=t.baseUpdate;if(o=t.baseState,null!==s?(null!==r&&(r.next=null),r=s.next):r=null!==r?r.next:null,null!==r){var l=i=null,u=r,c=!1;do{var d=u.expirationTime;d<Mi?(c||(c=!0,l=s,i=o),d>zi&&(zi=d)):o=u.eagerReducer===e?u.eagerState:e(o,u.action),s=u,u=u.next}while(null!==u&&u!==r);c||(l=s,i=o),Xt(o,t.memoizedState)||(So=!0),t.memoizedState=o,t.baseUpdate=l,t.baseState=i,n.lastRenderedState=o}return[t.memoizedState,n.dispatch]}function no(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===Gi?(Gi={lastEffect:null}).lastEffect=e.next=e:null===(t=Gi.lastEffect)?Gi.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,Gi.lastEffect=e),e}function ro(e,t,n,r){var i=Xi();Wi|=e,i.memoizedState=no(t,n,void 0,void 0===r?null:r)}function io(e,t,n,r){var i=Zi();r=void 0===r?null:r;var o=void 0;if(null!==Li){var a=Li.memoizedState;if(o=a.destroy,null!==r&&Ji(r,a.deps))return void no(Ri,n,o,r)}Wi|=e,i.memoizedState=no(t,n,o,r)}function oo(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ao(){}function so(e,t,n){25>Ki||a("301");var r=e.alternate;if(e===Ui||null!==r&&r===Ui)if(Vi=!0,e={expirationTime:Mi,action:n,eagerReducer:null,eagerState:null,next:null},null===Bi&&(Bi=new Map),void 0===(n=Bi.get(t)))Bi.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{Ga();var i=Ss(),o={expirationTime:i=Ja(i,e),action:n,eagerReducer:null,eagerState:null,next:null},s=t.last;if(null===s)o.next=o;else{var l=s.next;null!==l&&(o.next=l),s.next=o}if(t.last=o,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var u=t.lastRenderedState,c=r(u,n);if(o.eagerReducer=r,o.eagerState=c,Xt(c,u))return}catch(d){}Xa(e,i)}}var lo={readContext:zo,useCallback:$i,useContext:$i,useEffect:$i,useImperativeHandle:$i,useLayoutEffect:$i,useMemo:$i,useReducer:$i,useRef:$i,useState:$i,useDebugValue:$i},uo={readContext:zo,useCallback:function(e,t){return Xi().memoizedState=[e,void 0===t?null:t],e},useContext:zo,useEffect:function(e,t){return ro(516,Ni|Oi,e,t)},useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ro(4,ki|Pi,oo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4,ki|Pi,e,t)},useMemo:function(e,t){var n=Xi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=so.bind(null,Ui,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Xi().memoizedState=e},useState:function(e){var t=Xi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:eo,lastRenderedState:e}).dispatch=so.bind(null,Ui,e),[t.memoizedState,e]},useDebugValue:ao},co={readContext:zo,useCallback:function(e,t){var n=Zi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ji(t,r[1])?r[0]:(n.memoizedState=[e,t],e)},useContext:zo,useEffect:function(e,t){return io(516,Ni|Oi,e,t)},useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,io(4,ki|Pi,oo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return io(4,ki|Pi,e,t)},useMemo:function(e,t){var n=Zi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ji(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:to,useRef:function(){return Zi().memoizedState},useState:function(e){return to(eo)},useDebugValue:ao},fo=null,po=null,ho=!1;function mo(e,t){var n=Vr(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function vo(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function _o(e){if(ho){var t=po;if(t){var n=t;if(!vo(e,t)){if(!(t=br(n))||!vo(e,t))return e.effectTag|=2,ho=!1,void(fo=e);mo(fo,n)}fo=e,po=Er(t)}else e.effectTag|=2,ho=!1,fo=e}}function go(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&18!==e.tag;)e=e.return;fo=e}function yo(e){if(e!==fo)return!1;if(!ho)return go(e),ho=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!gr(t,e.memoizedProps))for(t=po;t;)mo(e,t),t=br(t);return go(e),po=fo?br(e.stateNode):null,!0}function To(){po=fo=null,ho=!1}var Co=We.ReactCurrentOwner,So=!1;function bo(e,t,n,r){t.child=null===e?vi(t,null,n,r):mi(t,e.child,n,r)}function Eo(e,t,n,r,i){n=n.render;var o=t.ref;return jo(t,i),r=Yi(e,t,n,r,o,i),null===e||So?(t.effectTag|=1,bo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),No(e,t,i))}function wo(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!==typeof a||Br(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=$r(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ro(e,t,a,r,i,o))}return a=e.child,i<o&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:en)(i,r)&&e.ref===t.ref)?No(e,t,o):(t.effectTag|=1,(e=Kr(a,r)).ref=t.ref,e.return=t,t.child=e)}function Ro(e,t,n,r,i,o){return null!==e&&en(e.memoizedProps,r)&&e.ref===t.ref&&(So=!1,i<o)?No(e,t,o):ko(e,t,n,r,o)}function Ao(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function ko(e,t,n,r,i){var o=Dr(n)?Or:Ir.current;return o=Nr(t,o),jo(t,i),n=Yi(e,t,n,r,o,i),null===e||So?(t.effectTag|=1,bo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),No(e,t,i))}function xo(e,t,n,r,i){if(Dr(n)){var o=!0;qr(t)}else o=!1;if(jo(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),li(t,n,r),ci(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===typeof u&&null!==u?u=zo(u):u=Nr(t,u=Dr(n)?Or:Ir.current);var c=n.getDerivedStateFromProps,d="function"===typeof c||"function"===typeof a.getSnapshotBeforeUpdate;d||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==u)&&ui(t,a,r,u),Ko=!1;var f=t.memoizedState;l=a.state=f;var p=t.updateQueue;null!==p&&(na(t,p,r,a,i),l=t.memoizedState),s!==r||f!==l||Pr.current||Ko?("function"===typeof c&&(oi(t,n,c,r),l=t.memoizedState),(s=Ko||si(t,n,s,r,f,l,u))?(d||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.effectTag|=4)):("function"===typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"===typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,s=t.memoizedProps,a.props=t.type===t.elementType?s:ri(t.type,s),l=a.context,"object"===typeof(u=n.contextType)&&null!==u?u=zo(u):u=Nr(t,u=Dr(n)?Or:Ir.current),(d="function"===typeof(c=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==u)&&ui(t,a,r,u),Ko=!1,l=t.memoizedState,f=a.state=l,null!==(p=t.updateQueue)&&(na(t,p,r,a,i),f=t.memoizedState),s!==r||l!==f||Pr.current||Ko?("function"===typeof c&&(oi(t,n,c,r),f=t.memoizedState),(c=Ko||si(t,n,s,r,l,f,u))?(d||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,f,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,f,u)),"function"===typeof a.componentDidUpdate&&(t.effectTag|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=f),a.props=r,a.state=f,a.context=u,r=c):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),r=!1);return Io(e,t,n,r,o,i)}function Io(e,t,n,r,i,o){Ao(e,t);var a=0!==(64&t.effectTag);if(!r&&!a)return i&&Hr(t,n,!1),No(e,t,o);r=t.stateNode,Co.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=mi(t,e.child,null,o),t.child=mi(t,null,s,o)):bo(e,t,s,o),t.memoizedState=r.state,i&&Hr(t,n,!0),t.child}function Po(e){var t=e.stateNode;t.pendingContext?Lr(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Lr(0,t.context,!1),Si(e,t.containerInfo)}function Oo(e,t,n){var r=t.mode,i=t.pendingProps,o=t.memoizedState;if(0===(64&t.effectTag)){o=null;var a=!1}else o={timedOutAt:null!==o?o.timedOutAt:0},a=!0,t.effectTag&=-65;if(null===e)if(a){var s=i.fallback;e=Jr(null,r,0,null),0===(1&t.mode)&&(e.child=null!==t.memoizedState?t.child.child:t.child),r=Jr(s,r,n,null),e.sibling=r,(n=e).return=r.return=t}else n=r=vi(t,null,i.children,n);else null!==e.memoizedState?(s=(r=e.child).sibling,a?(n=i.fallback,i=Kr(r,r.pendingProps),0===(1&t.mode)&&((a=null!==t.memoizedState?t.child.child:t.child)!==r.child&&(i.child=a)),r=i.sibling=Kr(s,n,s.expirationTime),n=i,i.childExpirationTime=0,n.return=r.return=t):n=r=mi(t,r.child,i.children,n)):(s=e.child,a?(a=i.fallback,(i=Jr(null,r,0,null)).child=s,0===(1&t.mode)&&(i.child=null!==t.memoizedState?t.child.child:t.child),(r=i.sibling=Jr(a,r,n,null)).effectTag|=2,n=i,i.childExpirationTime=0,n.return=r.return=t):r=n=mi(t,s,i.children,n)),t.stateNode=e.stateNode;return t.memoizedState=o,t.child=n,r}function No(e,t,n){if(null!==e&&(t.contextDependencies=e.contextDependencies),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child&&a("153"),null!==t.child){for(n=Kr(e=t.child,e.pendingProps,e.expirationTime),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Kr(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function Do(e,t,n){var r=t.expirationTime;if(null!==e){if(e.memoizedProps!==t.pendingProps||Pr.current)So=!0;else if(r<n){switch(So=!1,t.tag){case 3:Po(t),To();break;case 5:Ei(t);break;case 1:Dr(t.type)&&qr(t);break;case 4:Si(t,t.stateNode.containerInfo);break;case 10:qo(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Oo(e,t,n):null!==(t=No(e,t,n))?t.sibling:null}return No(e,t,n)}}else So=!1;switch(t.expirationTime=0,t.tag){case 2:r=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps;var i=Nr(t,Ir.current);if(jo(t,n),i=Yi(null,t,r,e,i,n),t.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Qi(),Dr(r)){var o=!0;qr(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var s=r.getDerivedStateFromProps;"function"===typeof s&&oi(t,r,s,e),i.updater=ai,t.stateNode=i,i._reactInternalFiber=t,ci(t,r,e,n),t=Io(null,t,r,!0,o,n)}else t.tag=0,bo(null,t,i,n),t=t.child;return t;case 16:switch(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),o=t.pendingProps,e=function(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:switch(e._status=0,(t=(t=e._ctor)()).then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)}),e._status){case 1:return e._result;case 2:throw e._result}throw e._result=t,t}}(i),t.type=e,i=t.tag=function(e){if("function"===typeof e)return Br(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===tt)return 11;if(e===rt)return 14}return 2}(e),o=ri(e,o),s=void 0,i){case 0:s=ko(null,t,e,o,n);break;case 1:s=xo(null,t,e,o,n);break;case 11:s=Eo(null,t,e,o,n);break;case 14:s=wo(null,t,e,ri(e.type,o),r,n);break;default:a("306",e,"")}return s;case 0:return r=t.type,i=t.pendingProps,ko(e,t,r,i=t.elementType===r?i:ri(r,i),n);case 1:return r=t.type,i=t.pendingProps,xo(e,t,r,i=t.elementType===r?i:ri(r,i),n);case 3:return Po(t),null===(r=t.updateQueue)&&a("282"),i=null!==(i=t.memoizedState)?i.element:null,na(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i?(To(),t=No(e,t,n)):(i=t.stateNode,(i=(null===e||null===e.child)&&i.hydrate)&&(po=Er(t.stateNode.containerInfo),fo=t,i=ho=!0),i?(t.effectTag|=2,t.child=vi(t,null,r,n)):(bo(e,t,r,n),To()),t=t.child),t;case 5:return Ei(t),null===e&&_o(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,gr(r,i)?s=null:null!==o&&gr(r,o)&&(t.effectTag|=16),Ao(e,t),1!==n&&1&t.mode&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(bo(e,t,s,n),t=t.child),t;case 6:return null===e&&_o(t),null;case 13:return Oo(e,t,n);case 4:return Si(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=mi(t,null,r,n):bo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Eo(e,t,r,i=t.elementType===r?i:ri(r,i),n);case 7:return bo(e,t,t.pendingProps,n),t.child;case 8:case 12:return bo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,qo(t,o=i.value),null!==s){var l=s.value;if(0===(o=Xt(l,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(s.children===i.children&&!Pr.current){t=No(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.contextDependencies;if(null!==u){s=l.child;for(var c=u.first;null!==c;){if(c.context===r&&0!==(c.observedBits&o)){1===l.tag&&((c=Yo(n)).tag=Vo,Xo(l,c)),l.expirationTime<n&&(l.expirationTime=n),null!==(c=l.alternate)&&c.expirationTime<n&&(c.expirationTime=n),c=n;for(var d=l.return;null!==d;){var f=d.alternate;if(d.childExpirationTime<c)d.childExpirationTime=c,null!==f&&f.childExpirationTime<c&&(f.childExpirationTime=c);else{if(!(null!==f&&f.childExpirationTime<c))break;f.childExpirationTime=c}d=d.return}u.expirationTime<n&&(u.expirationTime=n);break}c=c.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}}bo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,jo(t,n),r=r(i=zo(i,o.unstable_observedBits)),t.effectTag|=1,bo(e,t,r,n),t.child;case 14:return o=ri(i=t.type,t.pendingProps),wo(e,t,i,o=ri(i.type,o),r,n);case 15:return Ro(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Dr(r)?(e=!0,qr(t)):e=!1,jo(t,n),li(t,r,i),ci(t,r,i,n),Io(null,t,r,!0,e,n)}a("156")}var Mo={current:null},Uo=null,Lo=null,Fo=null;function qo(e,t){var n=e.type._context;kr(Mo,n._currentValue),n._currentValue=t}function Ho(e){var t=Mo.current;Ar(Mo),e.type._context._currentValue=t}function jo(e,t){Uo=e,Fo=Lo=null;var n=e.contextDependencies;null!==n&&n.expirationTime>=t&&(So=!0),e.contextDependencies=null}function zo(e,t){return Fo!==e&&!1!==t&&0!==t&&("number"===typeof t&&1073741823!==t||(Fo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Lo?(null===Uo&&a("308"),Lo=t,Uo.contextDependencies={first:t,expirationTime:0}):Lo=Lo.next=t),e._currentValue}var Go=0,Wo=1,Vo=2,Bo=3,Ko=!1;function $o(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Jo(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Yo(e){return{expirationTime:e,tag:Go,payload:null,callback:null,next:null,nextEffect:null}}function Qo(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Xo(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=$o(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=$o(e.memoizedState),i=n.updateQueue=$o(n.memoizedState)):r=e.updateQueue=Jo(i):null===i&&(i=n.updateQueue=Jo(r));null===i||r===i?Qo(r,t):null===r.lastUpdate||null===i.lastUpdate?(Qo(r,t),Qo(i,t)):(Qo(r,t),i.lastUpdate=t)}function Zo(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=$o(e.memoizedState):ea(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function ea(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Jo(t)),t}function ta(e,t,n,r,o,a){switch(n.tag){case Wo:return"function"===typeof(e=n.payload)?e.call(a,r,o):e;case Bo:e.effectTag=-2049&e.effectTag|64;case Go:if(null===(o="function"===typeof(e=n.payload)?e.call(a,r,o):e)||void 0===o)break;return i({},r,o);case Vo:Ko=!0}return r}function na(e,t,n,r,i){Ko=!1;for(var o=(t=ea(e,t)).baseState,a=null,s=0,l=t.firstUpdate,u=o;null!==l;){var c=l.expirationTime;c<i?(null===a&&(a=l,o=u),s<c&&(s=c)):(u=ta(e,0,l,u,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=l:(t.lastEffect.nextEffect=l,t.lastEffect=l))),l=l.next}for(c=null,l=t.firstCapturedUpdate;null!==l;){var d=l.expirationTime;d<i?(null===c&&(c=l,null===a&&(o=u)),s<d&&(s=d)):(u=ta(e,0,l,u,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=l:(t.lastCapturedEffect.nextEffect=l,t.lastCapturedEffect=l))),l=l.next}null===a&&(t.lastUpdate=null),null===c?t.lastCapturedUpdate=null:e.effectTag|=32,null===a&&null===c&&(o=u),t.baseState=o,t.firstUpdate=a,t.firstCapturedUpdate=c,e.expirationTime=s,e.memoizedState=u}function ra(e,t,n){null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),ia(t.firstEffect,n),t.firstEffect=t.lastEffect=null,ia(t.firstCapturedEffect,n),t.firstCapturedEffect=t.lastCapturedEffect=null}function ia(e,t){for(;null!==e;){var n=e.callback;if(null!==n){e.callback=null;var r=t;"function"!==typeof n&&a("191",n),n.call(r)}e=e.nextEffect}}function oa(e,t){return{value:e,source:t,stack:lt(t)}}function aa(e){e.effectTag|=4}var sa=void 0,la=void 0,ua=void 0,ca=void 0;sa=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},la=function(){},ua=function(e,t,n,r,o){var a=e.memoizedProps;if(a!==r){var s=t.stateNode;switch(Ci(gi.current),e=null,n){case"input":a=yt(s,a),r=yt(s,r),e=[];break;case"option":a=Kn(s,a),r=Kn(s,r),e=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),e=[];break;case"textarea":a=Jn(s,a),r=Jn(s,r),e=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(s.onclick=hr)}dr(n,r),s=n=void 0;var l=null;for(n in a)if(!r.hasOwnProperty(n)&&a.hasOwnProperty(n)&&null!=a[n])if("style"===n){var u=a[n];for(s in u)u.hasOwnProperty(s)&&(l||(l={}),l[s]="")}else"dangerouslySetInnerHTML"!==n&&"children"!==n&&"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&"autoFocus"!==n&&(y.hasOwnProperty(n)?e||(e=[]):(e=e||[]).push(n,null));for(n in r){var c=r[n];if(u=null!=a?a[n]:void 0,r.hasOwnProperty(n)&&c!==u&&(null!=c||null!=u))if("style"===n)if(u){for(s in u)!u.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(l||(l={}),l[s]="");for(s in c)c.hasOwnProperty(s)&&u[s]!==c[s]&&(l||(l={}),l[s]=c[s])}else l||(e||(e=[]),e.push(n,l)),l=c;else"dangerouslySetInnerHTML"===n?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(e=e||[]).push(n,""+c)):"children"===n?u===c||"string"!==typeof c&&"number"!==typeof c||(e=e||[]).push(n,""+c):"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&(y.hasOwnProperty(n)?(null!=c&&pr(o,n),e||u===c||(e=[])):(e=e||[]).push(n,c))}l&&(e=e||[]).push("style",l),o=e,(t.updateQueue=o)&&aa(t)}},ca=function(e,t,n,r){n!==r&&aa(t)};var da="function"===typeof WeakSet?WeakSet:Set;function fa(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=lt(n)),null!==n&&st(n.type),t=t.value,null!==e&&1===e.tag&&st(e.type);try{console.error(t)}catch(i){setTimeout(function(){throw i})}}function pa(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){$a(e,n)}else t.current=null}function ha(e,t,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var r=n=n.next;do{if((r.tag&e)!==Ri){var i=r.destroy;r.destroy=void 0,void 0!==i&&i()}(r.tag&t)!==Ri&&(i=r.create,r.destroy=i()),r=r.next}while(r!==n)}}function ma(e){switch("function"===typeof zr&&zr(e),e.tag){case 0:case 11:case 14:case 15:var t=e.updateQueue;if(null!==t&&null!==(t=t.lastEffect)){var n=t=t.next;do{var r=n.destroy;if(void 0!==r){var i=e;try{r()}catch(o){$a(i,o)}}n=n.next}while(n!==t)}break;case 1:if(pa(e),"function"===typeof(t=e.stateNode).componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){$a(e,o)}break;case 5:pa(e);break;case 4:ga(e)}}function va(e){return 5===e.tag||3===e.tag||4===e.tag}function _a(e){e:{for(var t=e.return;null!==t;){if(va(t)){var n=t;break e}t=t.return}a("160"),n=void 0}var r=t=void 0;switch(n.tag){case 5:t=n.stateNode,r=!1;break;case 3:case 4:t=n.stateNode.containerInfo,r=!0;break;default:a("161")}16&n.effectTag&&(or(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||va(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){if(5===i.tag||6===i.tag)if(n)if(r){var o=t,s=i.stateNode,l=n;8===o.nodeType?o.parentNode.insertBefore(s,l):o.insertBefore(s,l)}else t.insertBefore(i.stateNode,n);else r?(s=t,l=i.stateNode,8===s.nodeType?(o=s.parentNode).insertBefore(l,s):(o=s).appendChild(l),null!==(s=s._reactRootContainer)&&void 0!==s||null!==o.onclick||(o.onclick=hr)):t.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function ga(e){for(var t=e,n=!1,r=void 0,i=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&a("160"),n.tag){case 5:r=n.stateNode,i=!1;break e;case 3:case 4:r=n.stateNode.containerInfo,i=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var o=t,s=o;;)if(ma(s),null!==s.child&&4!==s.tag)s.child.return=s,s=s.child;else{if(s===o)break;for(;null===s.sibling;){if(null===s.return||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}i?(o=r,s=t.stateNode,8===o.nodeType?o.parentNode.removeChild(s):o.removeChild(s)):r.removeChild(t.stateNode)}else if(4===t.tag){if(null!==t.child){r=t.stateNode.containerInfo,i=!0,t.child.return=t,t=t.child;continue}}else if(ma(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function ya(e,t){switch(t.tag){case 0:case 11:case 14:case 15:ha(ki,xi,t);break;case 1:break;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,o=t.updateQueue;t.updateQueue=null,null!==o&&function(e,t,n,r,i){e[D]=i,"input"===n&&"radio"===i.type&&null!=i.name&&Ct(e,i),fr(n,r),r=fr(n,i);for(var o=0;o<t.length;o+=2){var a=t[o],s=t[o+1];"style"===a?ur(e,s):"dangerouslySetInnerHTML"===a?ir(e,s):"children"===a?or(e,s):_t(e,a,s,r)}switch(n){case"input":St(e,i);break;case"textarea":Qn(e,i);break;case"select":t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!i.multiple,null!=(n=i.value)?$n(e,!!i.multiple,n,!1):t!==!!i.multiple&&(null!=i.defaultValue?$n(e,!!i.multiple,i.defaultValue,!0):$n(e,!!i.multiple,i.multiple?[]:"",!1))}}(n,o,i,e,r)}break;case 6:null===t.stateNode&&a("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 12:break;case 13:if(n=t.memoizedState,r=void 0,e=t,null===n?r=!1:(r=!0,e=t.child,0===n.timedOutAt&&(n.timedOutAt=Ss())),null!==e&&function(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)r.style.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=void 0!==i&&null!==i&&i.hasOwnProperty("display")?i.display:null,r.style.display=lr("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else{if(13===n.tag&&null!==n.memoizedState){(r=n.child.sibling).return=n,n=r;continue}if(null!==n.child){n.child.return=n,n=n.child;continue}}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}(e,r),null!==(n=t.updateQueue)){t.updateQueue=null;var s=t.stateNode;null===s&&(s=t.stateNode=new da),n.forEach(function(e){var n=function(e,t){var n=e.stateNode;null!==n&&n.delete(t),t=Ja(t=Ss(),e),null!==(e=Qa(e,t))&&(Zr(e,t),0!==(t=e.expirationTime)&&bs(e,t))}.bind(null,t,e);s.has(e)||(s.add(e),e.then(n,n))})}break;case 17:break;default:a("163")}}var Ta="function"===typeof WeakMap?WeakMap:Map;function Ca(e,t,n){(n=Yo(n)).tag=Bo,n.payload={element:null};var r=t.value;return n.callback=function(){Os(r),fa(e,t)},n}function Sa(e,t,n){(n=Yo(n)).tag=Bo;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Fa?Fa=new Set([this]):Fa.add(this));var n=t.value,i=t.stack;fa(e,t),this.componentDidCatch(n,{componentStack:null!==i?i:""})}),n}function ba(e){switch(e.tag){case 1:Dr(e.type)&&Mr();var t=e.effectTag;return 2048&t?(e.effectTag=-2049&t|64,e):null;case 3:return bi(),Ur(),0!==(64&(t=e.effectTag))&&a("285"),e.effectTag=-2049&t|64,e;case 5:return wi(e),null;case 13:return 2048&(t=e.effectTag)?(e.effectTag=-2049&t|64,e):null;case 18:return null;case 4:return bi(),null;case 10:return Ho(e),null;default:return null}}var Ea=We.ReactCurrentDispatcher,wa=We.ReactCurrentOwner,Ra=1073741822,Aa=!1,ka=null,xa=null,Ia=0,Pa=-1,Oa=!1,Na=null,Da=!1,Ma=null,Ua=null,La=null,Fa=null;function qa(){if(null!==ka)for(var e=ka.return;null!==e;){var t=e;switch(t.tag){case 1:var n=t.type.childContextTypes;null!==n&&void 0!==n&&Mr();break;case 3:bi(),Ur();break;case 5:wi(t);break;case 4:bi();break;case 10:Ho(t)}e=e.return}xa=null,Ia=0,Pa=-1,Oa=!1,ka=null}function Ha(){for(;null!==Na;){var e=Na.effectTag;if(16&e&&or(Na.stateNode,""),128&e){var t=Na.alternate;null!==t&&(null!==(t=t.ref)&&("function"===typeof t?t(null):t.current=null))}switch(14&e){case 2:_a(Na),Na.effectTag&=-3;break;case 6:_a(Na),Na.effectTag&=-3,ya(Na.alternate,Na);break;case 4:ya(Na.alternate,Na);break;case 8:ga(e=Na),e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,null!==(e=e.alternate)&&(e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null)}Na=Na.nextEffect}}function ja(){for(;null!==Na;){if(256&Na.effectTag)e:{var e=Na.alternate,t=Na;switch(t.tag){case 0:case 11:case 15:ha(Ai,Ri,t);break e;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:ri(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}break e;case 3:case 5:case 6:case 4:case 17:break e;default:a("163")}}Na=Na.nextEffect}}function za(e,t){for(;null!==Na;){var n=Na.effectTag;if(36&n){var r=Na.alternate,i=Na,o=t;switch(i.tag){case 0:case 11:case 15:ha(Ii,Pi,i);break;case 1:var s=i.stateNode;if(4&i.effectTag)if(null===r)s.componentDidMount();else{var l=i.elementType===i.type?r.memoizedProps:ri(i.type,r.memoizedProps);s.componentDidUpdate(l,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}null!==(r=i.updateQueue)&&ra(0,r,s);break;case 3:if(null!==(r=i.updateQueue)){if(s=null,null!==i.child)switch(i.child.tag){case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}ra(0,r,s)}break;case 5:o=i.stateNode,null===r&&4&i.effectTag&&_r(i.type,i.memoizedProps)&&o.focus();break;case 6:case 4:case 12:case 13:case 17:break;default:a("163")}}128&n&&(null!==(i=Na.ref)&&(o=Na.stateNode,"function"===typeof i?i(o):i.current=o)),512&n&&(Ma=e),Na=Na.nextEffect}}function Ga(){null!==Ua&&Sr(Ua),null!==La&&La()}function Wa(e,t){Da=Aa=!0,e.current===t&&a("177");var n=e.pendingCommitExpirationTime;0===n&&a("261"),e.pendingCommitExpirationTime=0;var r=t.expirationTime,i=t.childExpirationTime;for(function(e,t){if(e.didError=!1,0===t)e.earliestPendingTime=0,e.latestPendingTime=0,e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0;else{t<e.latestPingedTime&&(e.latestPingedTime=0);var n=e.latestPendingTime;0!==n&&(n>t?e.earliestPendingTime=e.latestPendingTime=0:e.earliestPendingTime>t&&(e.earliestPendingTime=e.latestPendingTime)),0===(n=e.earliestSuspendedTime)?Zr(e,t):t<e.latestSuspendedTime?(e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0,Zr(e,t)):t>n&&Zr(e,t)}ni(0,e)}(e,i>r?i:r),wa.current=null,r=void 0,1<t.effectTag?null!==t.lastEffect?(t.lastEffect.nextEffect=t,r=t.firstEffect):r=t:r=t.firstEffect,mr=En,vr=function(){var e=Un();if(Ln(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(t=(t=e.ownerDocument)&&t.defaultView||window).getSelection&&t.getSelection();if(n&&0!==n.rangeCount){t=n.anchorNode;var r=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{t.nodeType,i.nodeType}catch(p){t=null;break e}var o=0,a=-1,s=-1,l=0,u=0,c=e,d=null;t:for(;;){for(var f;c!==t||0!==r&&3!==c.nodeType||(a=o+r),c!==i||0!==n&&3!==c.nodeType||(s=o+n),3===c.nodeType&&(o+=c.nodeValue.length),null!==(f=c.firstChild);)d=c,c=f;for(;;){if(c===e)break t;if(d===t&&++l===r&&(a=o),d===i&&++u===n&&(s=o),null!==(f=c.nextSibling))break;d=(c=d).parentNode}c=f}t=-1===a||-1===s?null:{start:a,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;return{focusedElem:e,selectionRange:t}}(),En=!1,Na=r;null!==Na;){i=!1;var s=void 0;try{ja()}catch(u){i=!0,s=u}i&&(null===Na&&a("178"),$a(Na,s),null!==Na&&(Na=Na.nextEffect))}for(Na=r;null!==Na;){i=!1,s=void 0;try{Ha()}catch(u){i=!0,s=u}i&&(null===Na&&a("178"),$a(Na,s),null!==Na&&(Na=Na.nextEffect))}for(Fn(vr),vr=null,En=!!mr,mr=null,e.current=t,Na=r;null!==Na;){i=!1,s=void 0;try{za(e,n)}catch(u){i=!0,s=u}i&&(null===Na&&a("178"),$a(Na,s),null!==Na&&(Na=Na.nextEffect))}if(null!==r&&null!==Ma){var l=function(e,t){La=Ua=Ma=null;var n=is;is=!0;do{if(512&t.effectTag){var r=!1,i=void 0;try{var o=t;ha(Ni,Ri,o),ha(Ri,Oi,o)}catch(l){r=!0,i=l}r&&$a(t,i)}t=t.nextEffect}while(null!==t);is=n,0!==(n=e.expirationTime)&&bs(e,n),cs||is||ks(1073741823,!1)}.bind(null,e,r);Ua=o.unstable_runWithPriority(o.unstable_NormalPriority,function(){return Cr(l)}),La=l}Aa=Da=!1,"function"===typeof jr&&jr(t.stateNode),n=t.expirationTime,0===(t=(t=t.childExpirationTime)>n?t:n)&&(Fa=null),function(e,t){e.expirationTime=t,e.finishedWork=null}(e,t)}function Va(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0===(1024&e.effectTag)){ka=e;e:{var o=t,s=Ia,l=(t=e).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:Dr(t.type)&&Mr();break;case 3:bi(),Ur(),(l=t.stateNode).pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),null!==o&&null!==o.child||(yo(t),t.effectTag&=-3),la(t);break;case 5:wi(t);var u=Ci(Ti.current);if(s=t.type,null!==o&&null!=t.stateNode)ua(o,t,s,l,u),o.ref!==t.ref&&(t.effectTag|=128);else if(l){var c=Ci(gi.current);if(yo(t)){o=(l=t).stateNode;var d=l.type,f=l.memoizedProps,p=u;switch(o[N]=l,o[D]=f,s=void 0,u=d){case"iframe":case"object":wn("load",o);break;case"video":case"audio":for(d=0;d<te.length;d++)wn(te[d],o);break;case"source":wn("error",o);break;case"img":case"image":case"link":wn("error",o),wn("load",o);break;case"form":wn("reset",o),wn("submit",o);break;case"details":wn("toggle",o);break;case"input":Tt(o,f),wn("invalid",o),pr(p,"onChange");break;case"select":o._wrapperState={wasMultiple:!!f.multiple},wn("invalid",o),pr(p,"onChange");break;case"textarea":Yn(o,f),wn("invalid",o),pr(p,"onChange")}for(s in dr(u,f),d=null,f)f.hasOwnProperty(s)&&(c=f[s],"children"===s?"string"===typeof c?o.textContent!==c&&(d=["children",c]):"number"===typeof c&&o.textContent!==""+c&&(d=["children",""+c]):y.hasOwnProperty(s)&&null!=c&&pr(p,s));switch(u){case"input":ze(o),bt(o,f,!0);break;case"textarea":ze(o),Xn(o);break;case"select":case"option":break;default:"function"===typeof f.onClick&&(o.onclick=hr)}s=d,l.updateQueue=s,(l=null!==s)&&aa(t)}else{f=t,p=s,o=l,d=9===u.nodeType?u:u.ownerDocument,c===Zn.html&&(c=er(p)),c===Zn.html?"script"===p?((o=d.createElement("div")).innerHTML="<script><\/script>",d=o.removeChild(o.firstChild)):"string"===typeof o.is?d=d.createElement(p,{is:o.is}):(d=d.createElement(p),"select"===p&&(p=d,o.multiple?p.multiple=!0:o.size&&(p.size=o.size))):d=d.createElementNS(c,p),(o=d)[N]=f,o[D]=l,sa(o,t,!1,!1),p=o;var h=u,m=fr(d=s,f=l);switch(d){case"iframe":case"object":wn("load",p),u=f;break;case"video":case"audio":for(u=0;u<te.length;u++)wn(te[u],p);u=f;break;case"source":wn("error",p),u=f;break;case"img":case"image":case"link":wn("error",p),wn("load",p),u=f;break;case"form":wn("reset",p),wn("submit",p),u=f;break;case"details":wn("toggle",p),u=f;break;case"input":Tt(p,f),u=yt(p,f),wn("invalid",p),pr(h,"onChange");break;case"option":u=Kn(p,f);break;case"select":p._wrapperState={wasMultiple:!!f.multiple},u=i({},f,{value:void 0}),wn("invalid",p),pr(h,"onChange");break;case"textarea":Yn(p,f),u=Jn(p,f),wn("invalid",p),pr(h,"onChange");break;default:u=f}dr(d,u),c=void 0;var v=d,_=p,g=u;for(c in g)if(g.hasOwnProperty(c)){var T=g[c];"style"===c?ur(_,T):"dangerouslySetInnerHTML"===c?null!=(T=T?T.__html:void 0)&&ir(_,T):"children"===c?"string"===typeof T?("textarea"!==v||""!==T)&&or(_,T):"number"===typeof T&&or(_,""+T):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(y.hasOwnProperty(c)?null!=T&&pr(h,c):null!=T&&_t(_,c,T,m))}switch(d){case"input":ze(p),bt(p,f,!1);break;case"textarea":ze(p),Xn(p);break;case"option":null!=f.value&&p.setAttribute("value",""+gt(f.value));break;case"select":(u=p).multiple=!!f.multiple,null!=(p=f.value)?$n(u,!!f.multiple,p,!1):null!=f.defaultValue&&$n(u,!!f.multiple,f.defaultValue,!0);break;default:"function"===typeof u.onClick&&(p.onclick=hr)}(l=_r(s,l))&&aa(t),t.stateNode=o}null!==t.ref&&(t.effectTag|=128)}else null===t.stateNode&&a("166");break;case 6:o&&null!=t.stateNode?ca(o,t,o.memoizedProps,l):("string"!==typeof l&&(null===t.stateNode&&a("166")),o=Ci(Ti.current),Ci(gi.current),yo(t)?(s=(l=t).stateNode,o=l.memoizedProps,s[N]=l,(l=s.nodeValue!==o)&&aa(t)):(s=t,(l=(9===o.nodeType?o:o.ownerDocument).createTextNode(l))[N]=t,s.stateNode=l));break;case 11:break;case 13:if(l=t.memoizedState,0!==(64&t.effectTag)){t.expirationTime=s,ka=t;break e}l=null!==l,s=null!==o&&null!==o.memoizedState,null!==o&&!l&&s&&(null!==(o=o.child.sibling)&&(null!==(u=t.firstEffect)?(t.firstEffect=o,o.nextEffect=u):(t.firstEffect=t.lastEffect=o,o.nextEffect=null),o.effectTag=8)),(l||s)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:bi(),la(t);break;case 10:Ho(t);break;case 9:case 14:break;case 17:Dr(t.type)&&Mr();break;case 18:break;default:a("156")}ka=null}if(t=e,1===Ia||1!==t.childExpirationTime){for(l=0,s=t.child;null!==s;)(o=s.expirationTime)>l&&(l=o),(u=s.childExpirationTime)>l&&(l=u),s=s.sibling;t.childExpirationTime=l}if(null!==ka)return ka;null!==n&&0===(1024&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e))}else{if(null!==(e=ba(e)))return e.effectTag&=1023,e;null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=1024)}if(null!==r)return r;if(null===n)break;e=n}return null}function Ba(e){var t=Do(e.alternate,e,Ia);return e.memoizedProps=e.pendingProps,null===t&&(t=Va(e)),wa.current=null,t}function Ka(e,t){Aa&&a("243"),Ga(),Aa=!0;var n=Ea.current;Ea.current=lo;var r=e.nextExpirationTimeToWorkOn;r===Ia&&e===xa&&null!==ka||(qa(),Ia=r,ka=Kr((xa=e).current,null),e.pendingCommitExpirationTime=0);for(var i=!1;;){try{if(t)for(;null!==ka&&!Rs();)ka=Ba(ka);else for(;null!==ka;)ka=Ba(ka)}catch(_){if(Fo=Lo=Uo=null,Qi(),null===ka)i=!0,Os(_);else{null===ka&&a("271");var o=ka,s=o.return;if(null!==s){e:{var l=e,u=s,c=o,d=_;if(s=Ia,c.effectTag|=1024,c.firstEffect=c.lastEffect=null,null!==d&&"object"===typeof d&&"function"===typeof d.then){var f=d;d=u;var p=-1,h=-1;do{if(13===d.tag){var m=d.alternate;if(null!==m&&null!==(m=m.memoizedState)){h=10*(1073741822-m.timedOutAt);break}"number"===typeof(m=d.pendingProps.maxDuration)&&(0>=m?p=0:(-1===p||m<p)&&(p=m))}d=d.return}while(null!==d);d=u;do{if((m=13===d.tag)&&(m=void 0!==d.memoizedProps.fallback&&null===d.memoizedState),m){if(null===(u=d.updateQueue)?((u=new Set).add(f),d.updateQueue=u):u.add(f),0===(1&d.mode)){d.effectTag|=64,c.effectTag&=-1957,1===c.tag&&(null===c.alternate?c.tag=17:((s=Yo(1073741823)).tag=Vo,Xo(c,s))),c.expirationTime=1073741823;break e}u=s;var v=(c=l).pingCache;null===v?(v=c.pingCache=new Ta,m=new Set,v.set(f,m)):void 0===(m=v.get(f))&&(m=new Set,v.set(f,m)),m.has(u)||(m.add(u),c=Ya.bind(null,c,f,u),f.then(c,c)),-1===p?l=1073741823:(-1===h&&(h=10*(1073741822-ti(l,s))-5e3),l=h+p),0<=l&&Pa<l&&(Pa=l),d.effectTag|=2048,d.expirationTime=s;break e}d=d.return}while(null!==d);d=Error((st(c.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+lt(c))}Oa=!0,d=oa(d,c),l=u;do{switch(l.tag){case 3:l.effectTag|=2048,l.expirationTime=s,Zo(l,s=Ca(l,d,s));break e;case 1:if(p=d,h=l.type,c=l.stateNode,0===(64&l.effectTag)&&("function"===typeof h.getDerivedStateFromError||null!==c&&"function"===typeof c.componentDidCatch&&(null===Fa||!Fa.has(c)))){l.effectTag|=2048,l.expirationTime=s,Zo(l,s=Sa(l,p,s));break e}}l=l.return}while(null!==l)}ka=Va(o);continue}i=!0,Os(_)}}break}if(Aa=!1,Ea.current=n,Fo=Lo=Uo=null,Qi(),i)xa=null,e.finishedWork=null;else if(null!==ka)e.finishedWork=null;else{if(null===(n=e.current.alternate)&&a("281"),xa=null,Oa){if(i=e.latestPendingTime,o=e.latestSuspendedTime,s=e.latestPingedTime,0!==i&&i<r||0!==o&&o<r||0!==s&&s<r)return ei(e,r),void Cs(e,n,r,e.expirationTime,-1);if(!e.didError&&t)return e.didError=!0,r=e.nextExpirationTimeToWorkOn=r,t=e.expirationTime=1073741823,void Cs(e,n,r,t,-1)}t&&-1!==Pa?(ei(e,r),(t=10*(1073741822-ti(e,r)))<Pa&&(Pa=t),t=10*(1073741822-Ss()),t=Pa-t,Cs(e,n,r,e.expirationTime,0>t?0:t)):(e.pendingCommitExpirationTime=r,e.finishedWork=n)}}function $a(e,t){for(var n=e.return;null!==n;){switch(n.tag){case 1:var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Fa||!Fa.has(r)))return Xo(n,e=Sa(n,e=oa(t,e),1073741823)),void Xa(n,1073741823);break;case 3:return Xo(n,e=Ca(n,e=oa(t,e),1073741823)),void Xa(n,1073741823)}n=n.return}3===e.tag&&(Xo(e,n=Ca(e,n=oa(t,e),1073741823)),Xa(e,1073741823))}function Ja(e,t){var n=o.unstable_getCurrentPriorityLevel(),r=void 0;if(0===(1&t.mode))r=1073741823;else if(Aa&&!Da)r=Ia;else{switch(n){case o.unstable_ImmediatePriority:r=1073741823;break;case o.unstable_UserBlockingPriority:r=1073741822-10*(1+((1073741822-e+15)/10|0));break;case o.unstable_NormalPriority:r=1073741822-25*(1+((1073741822-e+500)/25|0));break;case o.unstable_LowPriority:case o.unstable_IdlePriority:r=1;break;default:a("313")}null!==xa&&r===Ia&&--r}return n===o.unstable_UserBlockingPriority&&(0===ss||r<ss)&&(ss=r),r}function Ya(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),null!==xa&&Ia===n?xa=null:(t=e.earliestSuspendedTime,r=e.latestSuspendedTime,0!==t&&n<=t&&n>=r&&(e.didError=!1,(0===(t=e.latestPingedTime)||t>n)&&(e.latestPingedTime=n),ni(n,e),0!==(n=e.expirationTime)&&bs(e,n)))}function Qa(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,i=null;if(null===r&&3===e.tag)i=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){i=r.stateNode;break}r=r.return}return i}function Xa(e,t){null!==(e=Qa(e,t))&&(!Aa&&0!==Ia&&t>Ia&&qa(),Zr(e,t),Aa&&!Da&&xa===e||bs(e,e.expirationTime),_s>vs&&(_s=0,a("185")))}function Za(e,t,n,r,i){return o.unstable_runWithPriority(o.unstable_ImmediatePriority,function(){return e(t,n,r,i)})}var es=null,ts=null,ns=0,rs=void 0,is=!1,os=null,as=0,ss=0,ls=!1,us=null,cs=!1,ds=!1,fs=null,ps=o.unstable_now(),hs=1073741822-(ps/10|0),ms=hs,vs=50,_s=0,gs=null;function ys(){hs=1073741822-((o.unstable_now()-ps)/10|0)}function Ts(e,t){if(0!==ns){if(t<ns)return;null!==rs&&o.unstable_cancelCallback(rs)}ns=t,e=o.unstable_now()-ps,rs=o.unstable_scheduleCallback(As,{timeout:10*(1073741822-t)-e})}function Cs(e,t,n,r,i){e.expirationTime=r,0!==i||Rs()?0<i&&(e.timeoutHandle=yr(function(e,t,n){e.pendingCommitExpirationTime=n,e.finishedWork=t,ys(),ms=hs,xs(e,n)}.bind(null,e,t,n),i)):(e.pendingCommitExpirationTime=n,e.finishedWork=t)}function Ss(){return is?ms:(Es(),0!==as&&1!==as||(ys(),ms=hs),ms)}function bs(e,t){null===e.nextScheduledRoot?(e.expirationTime=t,null===ts?(es=ts=e,e.nextScheduledRoot=e):(ts=ts.nextScheduledRoot=e).nextScheduledRoot=es):t>e.expirationTime&&(e.expirationTime=t),is||(cs?ds&&(os=e,as=1073741823,Is(e,1073741823,!1)):1073741823===t?ks(1073741823,!1):Ts(e,t))}function Es(){var e=0,t=null;if(null!==ts)for(var n=ts,r=es;null!==r;){var i=r.expirationTime;if(0===i){if((null===n||null===ts)&&a("244"),r===r.nextScheduledRoot){es=ts=r.nextScheduledRoot=null;break}if(r===es)es=i=r.nextScheduledRoot,ts.nextScheduledRoot=i,r.nextScheduledRoot=null;else{if(r===ts){(ts=n).nextScheduledRoot=es,r.nextScheduledRoot=null;break}n.nextScheduledRoot=r.nextScheduledRoot,r.nextScheduledRoot=null}r=n.nextScheduledRoot}else{if(i>e&&(e=i,t=r),r===ts)break;if(1073741823===e)break;n=r,r=r.nextScheduledRoot}}os=t,as=e}var ws=!1;function Rs(){return!!ws||!!o.unstable_shouldYield()&&(ws=!0)}function As(){try{if(!Rs()&&null!==es){ys();var e=es;do{var t=e.expirationTime;0!==t&&hs<=t&&(e.nextExpirationTimeToWorkOn=hs),e=e.nextScheduledRoot}while(e!==es)}ks(0,!0)}finally{ws=!1}}function ks(e,t){if(Es(),t)for(ys(),ms=hs;null!==os&&0!==as&&e<=as&&!(ws&&hs>as);)Is(os,as,hs>as),Es(),ys(),ms=hs;else for(;null!==os&&0!==as&&e<=as;)Is(os,as,!1),Es();if(t&&(ns=0,rs=null),0!==as&&Ts(os,as),_s=0,gs=null,null!==fs)for(e=fs,fs=null,t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(r){ls||(ls=!0,us=r)}}if(ls)throw e=us,us=null,ls=!1,e}function xs(e,t){is&&a("253"),os=e,as=t,Is(e,t,!1),ks(1073741823,!1)}function Is(e,t,n){if(is&&a("245"),is=!0,n){var r=e.finishedWork;null!==r?Ps(e,r,t):(e.finishedWork=null,-1!==(r=e.timeoutHandle)&&(e.timeoutHandle=-1,Tr(r)),Ka(e,n),null!==(r=e.finishedWork)&&(Rs()?e.finishedWork=r:Ps(e,r,t)))}else null!==(r=e.finishedWork)?Ps(e,r,t):(e.finishedWork=null,-1!==(r=e.timeoutHandle)&&(e.timeoutHandle=-1,Tr(r)),Ka(e,n),null!==(r=e.finishedWork)&&Ps(e,r,t));is=!1}function Ps(e,t,n){var r=e.firstBatch;if(null!==r&&r._expirationTime>=n&&(null===fs?fs=[r]:fs.push(r),r._defer))return e.finishedWork=t,void(e.expirationTime=0);e.finishedWork=null,e===gs?_s++:(gs=e,_s=0),o.unstable_runWithPriority(o.unstable_ImmediatePriority,function(){Wa(e,t)})}function Os(e){null===os&&a("246"),os.expirationTime=0,ls||(ls=!0,us=e)}function Ns(e,t){var n=cs;cs=!0;try{return e(t)}finally{(cs=n)||is||ks(1073741823,!1)}}function Ds(e,t){if(cs&&!ds){ds=!0;try{return e(t)}finally{ds=!1}}return e(t)}function Ms(e,t,n){cs||is||0===ss||(ks(ss,!1),ss=0);var r=cs;cs=!0;try{return o.unstable_runWithPriority(o.unstable_UserBlockingPriority,function(){return e(t,n)})}finally{(cs=r)||is||ks(1073741823,!1)}}function Us(e,t,n,r,i){var o=t.current;e:if(n){t:{2===tn(n=n._reactInternalFiber)&&1===n.tag||a("170");var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Dr(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);a("171"),s=void 0}if(1===n.tag){var l=n.type;if(Dr(l)){n=Fr(n,l,s);break e}}n=s}else n=xr;return null===t.context?t.context=n:t.pendingContext=n,t=i,(i=Yo(r)).payload={element:e},null!==(t=void 0===t?null:t)&&(i.callback=t),Ga(),Xo(o,i),Xa(o,r),r}function Ls(e,t,n,r){var i=t.current;return Us(e,t,n,i=Ja(Ss(),i),r)}function Fs(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function qs(e){var t=1073741822-25*(1+((1073741822-Ss()+500)/25|0));t>=Ra&&(t=Ra-1),this._expirationTime=Ra=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function Hs(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function js(e,t,n){e={current:t=Vr(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:n,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null},this._internalRoot=t.stateNode=e}function zs(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Gs(e,t,n,r,i){var o=n._reactRootContainer;if(o){if("function"===typeof i){var a=i;i=function(){var e=Fs(o._internalRoot);a.call(e)}}null!=e?o.legacy_renderSubtreeIntoContainer(e,t,i):o.render(t,i)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new js(e,!1,t)}(n,r),"function"===typeof i){var s=i;i=function(){var e=Fs(o._internalRoot);s.call(e)}}Ds(function(){null!=e?o.legacy_renderSubtreeIntoContainer(e,t,i):o.render(t,i)})}return Fs(o._internalRoot)}function Ws(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return zs(t)||a("200"),function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:$e,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Re=function(e,t,n){switch(t){case"input":if(St(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=F(r);i||a("90"),Ge(r),St(r,i)}}}break;case"textarea":Qn(e,n);break;case"select":null!=(t=n.value)&&$n(e,!!n.multiple,t,!1)}},qs.prototype.render=function(e){this._defer||a("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,r=new Hs;return Us(e,t,null,n,r._onCommit),r},qs.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},qs.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||a("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var r=null,i=t;i!==this;)r=i,i=i._next;null===r&&a("251"),r._next=i._next,this._next=t,e.firstBatch=this}this._defer=!1,xs(e,n),t=this._next,this._next=null,null!==(t=e.firstBatch=t)&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},qs.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},Hs.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Hs.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!==typeof n&&a("191",n),n()}}},js.prototype.render=function(e,t){var n=this._internalRoot,r=new Hs;return null!==(t=void 0===t?null:t)&&r.then(t),Ls(e,n,null,r._onCommit),r},js.prototype.unmount=function(e){var t=this._internalRoot,n=new Hs;return null!==(e=void 0===e?null:e)&&n.then(e),Ls(null,t,null,n._onCommit),n},js.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,i=new Hs;return null!==(n=void 0===n?null:n)&&i.then(n),Ls(t,r,e,i._onCommit),i},js.prototype.createBatch=function(){var e=new qs(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime>=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},Oe=Ns,Ne=Ms,De=function(){is||0===ss||(ks(ss,!1),ss=0)};var Vs={createPortal:Ws,findDOMNode:function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;return void 0===t&&("function"===typeof e.render?a("188"):a("268",Object.keys(e))),e=null===(e=rn(t))?null:e.stateNode},hydrate:function(e,t,n){return zs(t)||a("200"),Gs(null,e,t,!0,n)},render:function(e,t,n){return zs(t)||a("200"),Gs(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){return zs(n)||a("200"),(null==e||void 0===e._reactInternalFiber)&&a("38"),Gs(e,t,n,!1,r)},unmountComponentAtNode:function(e){return zs(e)||a("40"),!!e._reactRootContainer&&(Ds(function(){Gs(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return Ws.apply(void 0,arguments)},unstable_batchedUpdates:Ns,unstable_interactiveUpdates:Ms,flushSync:function(e,t){is&&a("187");var n=cs;cs=!0;try{return Za(e,t)}finally{cs=n,ks(1073741823,!1)}},unstable_createRoot:function(e,t){return zs(e)||a("299","unstable_createRoot"),new js(e,!0,null!=t&&!0===t.hydrate)},unstable_flushControlled:function(e){var t=cs;cs=!0;try{Za(e)}finally{(cs=t)||is||ks(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[U,L,F,x.injectEventPluginsByName,g,W,function(e){R(e,G)},Ie,Pe,kn,P]}};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);jr=Gr(function(e){return t.onCommitFiberRoot(n,e)}),zr=Gr(function(e){return t.onCommitFiberUnmount(n,e)})}catch(r){}})(i({},e,{overrideProps:null,currentDispatcherRef:We.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=rn(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}({findFiberByHostInstance:M,bundleType:0,version:"16.8.6",rendererPackageName:"react-dom"});var Bs={default:Vs},Ks=Bs&&Vs||Bs;e.exports=Ks.default||Ks},function(e,t,n){"use strict";e.exports=n(43)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,i=3,o=-1,a=-1,s=!1,l=!1;function u(){if(!s){var e=n.expirationTime;l?b():l=!0,S(f,e)}}function c(){var e=n,t=n.next;if(n===t)n=null;else{var r=n.previous;n=r.next=t,t.previous=r}e.next=e.previous=null,r=e.callback,t=e.expirationTime,e=e.priorityLevel;var o=i,s=a;i=e,a=t;try{var l=r()}finally{i=o,a=s}if("function"===typeof l)if(l={callback:l,priorityLevel:e,expirationTime:t,next:null,previous:null},null===n)n=l.next=l.previous=l;else{r=null,e=n;do{if(e.expirationTime>=t){r=e;break}e=e.next}while(e!==n);null===r?r=n:r===n&&(n=l,u()),(t=r.previous).next=r.previous=l,l.next=r,l.previous=t}}function d(){if(-1===o&&null!==n&&1===n.priorityLevel){s=!0;try{do{c()}while(null!==n&&1===n.priorityLevel)}finally{s=!1,null!==n?u():l=!1}}}function f(e){s=!0;var i=r;r=e;try{if(e)for(;null!==n;){var o=t.unstable_now();if(!(n.expirationTime<=o))break;do{c()}while(null!==n&&n.expirationTime<=o)}else if(null!==n)do{c()}while(null!==n&&!E())}finally{s=!1,r=i,null!==n?u():l=!1,d()}}var p,h,m=Date,v="function"===typeof setTimeout?setTimeout:void 0,_="function"===typeof clearTimeout?clearTimeout:void 0,g="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,y="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function T(e){p=g(function(t){_(h),e(t)}),h=v(function(){y(p),e(t.unstable_now())},100)}if("object"===typeof performance&&"function"===typeof performance.now){var C=performance;t.unstable_now=function(){return C.now()}}else t.unstable_now=function(){return m.now()};var S,b,E,w=null;if("undefined"!==typeof window?w=window:"undefined"!==typeof e&&(w=e),w&&w._schedMock){var R=w._schedMock;S=R[0],b=R[1],E=R[2],t.unstable_now=R[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var A=null,k=function(e){if(null!==A)try{A(e)}finally{A=null}};S=function(e){null!==A?setTimeout(S,0,e):(A=e,setTimeout(k,0,!1))},b=function(){A=null},E=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof g&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var x=null,I=!1,P=-1,O=!1,N=!1,D=0,M=33,U=33;E=function(){return D<=t.unstable_now()};var L=new MessageChannel,F=L.port2;L.port1.onmessage=function(){I=!1;var e=x,n=P;x=null,P=-1;var r=t.unstable_now(),i=!1;if(0>=D-r){if(!(-1!==n&&n<=r))return O||(O=!0,T(q)),x=e,void(P=n);i=!0}if(null!==e){N=!0;try{e(i)}finally{N=!1}}};var q=function e(t){if(null!==x){T(e);var n=t-D+U;n<U&&M<U?(8>n&&(n=8),U=n<M?M:n):M=n,D=t+U,I||(I=!0,F.postMessage(void 0))}else O=!1};S=function(e,t){x=e,P=t,N||0>t?F.postMessage(void 0):O||(O=!0,T(q))},b=function(){x=null,I=!1,P=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=i,a=o;i=e,o=t.unstable_now();try{return n()}finally{i=r,o=a,d()}},t.unstable_next=function(e){switch(i){case 1:case 2:case 3:var n=3;break;default:n=i}var r=i,a=o;i=n,o=t.unstable_now();try{return e()}finally{i=r,o=a,d()}},t.unstable_scheduleCallback=function(e,r){var a=-1!==o?o:t.unstable_now();if("object"===typeof r&&null!==r&&"number"===typeof r.timeout)r=a+r.timeout;else switch(i){case 1:r=a+-1;break;case 2:r=a+250;break;case 5:r=a+1073741823;break;case 4:r=a+1e4;break;default:r=a+5e3}if(e={callback:e,priorityLevel:i,expirationTime:r,next:null,previous:null},null===n)n=e.next=e.previous=e,u();else{a=null;var s=n;do{if(s.expirationTime>r){a=s;break}s=s.next}while(s!==n);null===a?a=n:a===n&&(n=e,u()),(r=a.previous).next=a.previous=e,e.next=a,e.previous=r}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)n=null;else{e===n&&(n=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=i;return function(){var r=i,a=o;i=n,o=t.unstable_now();try{return e.apply(this,arguments)}finally{i=r,o=a,d()}}},t.unstable_getCurrentPriorityLevel=function(){return i},t.unstable_shouldYield=function(){return!r&&(null!==n&&n.expirationTime<a||E())},t.unstable_continueExecution=function(){null!==n&&u()},t.unstable_pauseExecution=function(){},t.unstable_getFirstCallbackNode=function(){return n}}).call(this,n(44))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},,function(e,t){function n(e){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"===typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t,n){var r=n(6),i=n(21),o=n(48),a=n(49);function s(t){var n="function"===typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},s(t)}e.exports=s},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(21);function i(t,n,o){return!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}}()?e.exports=i=function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}:e.exports=i=Reflect.construct,i.apply(null,arguments)}e.exports=i},function(e,t,n){var r=n(2),i=n(8),o=n(6),a=n(20),s=n(4),l=n(9),u=n(13).EventEmitter,c=n(3),d=n(51),f=n(30),p=n(68),h=n(18),m=n(69),v=n(5),_=n(11),g=n(12),y=n(70),T=n(10),C=n(71),S=n(72),b=n(1)("JsSIP:UA"),E=n(1)("JsSIP:ERROR:UA");E.log=console.warn.bind(console);var w={STATUS_INIT:0,STATUS_READY:1,STATUS_USER_CLOSED:2,STATUS_NOT_READY:3,CONFIGURATION_ERROR:1,NETWORK_ERROR:2};e.exports=function(e){"use strict";function t(e){var n;if(r(this,t),b("new() [configuration:%o]",e),(n=i(this,o(t).call(this)))._cache={credentials:{}},n._configuration=Object.assign({},S.settings),n._dynConfiguration={},n._dialogs={},n._applicants={},n._sessions={},n._transport=null,n._contact=null,n._status=w.STATUS_INIT,n._error=null,n._transactions={nist:{},nict:{},ist:{},ict:{}},n._data={},n._closeTimer=null,void 0===e)throw new TypeError("Not enough arguments");try{n._loadConfig(e)}catch(s){throw n._status=w.STATUS_NOT_READY,n._error=w.CONFIGURATION_ERROR,s}return n._registrator=new d(a(n)),n}return l(t,u),s(t,null,[{key:"C",get:function(){return w}}]),s(t,[{key:"start",value:function(){b("start()"),this._status===w.STATUS_INIT?this._transport.connect():this._status===w.STATUS_USER_CLOSED?(b("restarting UA"),null!==this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null,this._transport.disconnect()),this._status=w.STATUS_INIT,this._transport.connect()):this._status===w.STATUS_READY?b("UA is in READY status, not restarted"):b("ERROR: connection is down, Auto-Recovery system is trying to reconnect"),this._dynConfiguration.register=this._configuration.register}},{key:"register",value:function(){b("register()"),this._dynConfiguration.register=!0,this._registrator.register()}},{key:"unregister",value:function(e){b("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){b("call()");var n=new f(this);return n.connect(e,t),n}},{key:"sendMessage",value:function(e,t,n){b("sendMessage()");var r=new p(this);return r.send(e,t,n),r}},{key:"terminateSessions",value:function(e){for(var t in b("terminateSessions()"),this._sessions)this._sessions[t].isEnded()||this._sessions[t].terminate(e)}},{key:"stop",value:function(){var e=this;if(b("stop()"),this._dynConfiguration={},this._status!==w.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)){b("closing session ".concat(n));try{this._sessions[n].terminate()}catch(i){}}for(var r in this._applicants)if(Object.prototype.hasOwnProperty.call(this._applicants,r))try{this._applicants[r].close()}catch(i){}this._status=w.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 b("UA already closed")}},{key:"normalizeTarget",value:function(e){return v.normalizeTarget(e,this._configuration.hostport_params)}},{key:"get",value:function(e){switch(e){case"realm":return this._configuration.realm;case"ha1":return this._configuration.ha1;default:return void E('get() | cannot get "%s" parameter in runtime',e)}}},{key:"set",value:function(e,t){switch(e){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"display_name":this._configuration.display_name=t;break;default:return E('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:"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 b("Request-URI does not point to us"),void(e.method!==c.ACK&&e.reply_sl(404));if(e.ruri.scheme!==c.SIPS){if(!h.checkTransaction(this,e)){if(t===c.INVITE?new h.InviteServerTransaction(this,this._transport,e):t!==c.ACK&&t!==c.CANCEL&&new h.NonInviteServerTransaction(this,this._transport,e),t===c.OPTIONS)e.reply(200);else if(t===c.MESSAGE){if(0===this.listeners("newMessage").length)return void e.reply(405);new p(this).init_incoming(e)}else if(t===c.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===c.NOTIFY?(r=this._findSession(e))?r.receiveRequest(e):(b("received NOTIFY request for a non existent subscription"),e.reply(481,"Subscription does not exist")):t!==c.ACK&&e.reply(481);else switch(t){case c.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 f(this)).init_incoming(e);else E("INVITE received but WebRTC is not supported"),e.reply(488);break;case c.BYE:e.reply(481);break;case c.CANCEL:(r=this._findSession(e))?r.receiveRequest(e):b("received CANCEL request for a non existent session");break;case c.ACK:break;case c.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],a=t+r,s=this._sessions[a];return o||(s||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{S.load(this._configuration,e)}catch(a){throw a}0===this._configuration.display_name&&(this._configuration.display_name="0"),this._configuration.instance_id||(this._configuration.instance_id=v.newUUID()),this._configuration.jssip_id=v.createRandomToken(5);var t=this._configuration.uri.clone();t.user=null,this._configuration.hostport_params=t.toString().replace(/^sip:/i,"");try{this._transport=new m(this._configuration.sockets,{max_interval:this._configuration.connection_recovery_max_interval,min_interval:this._configuration.connection_recovery_min_interval}),this._transport.onconnecting=function(e){this.emit("connecting",e)}.bind(this),this._transport.onconnect=function(e){if(this._status===w.STATUS_USER_CLOSED)return;this._status=w.STATUS_READY,this._error=null,this.emit("connected",e),this._dynConfiguration.register&&this._registrator.register()}.bind(this),this._transport.ondisconnect=function(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!==w.STATUS_USER_CLOSED&&(this._status=w.STATUS_NOT_READY,this._error=w.NETWORK_ERROR)}.bind(this),this._transport.ondata=function(e){var t=e.transport,n=e.message;if(!(n=y.parseMessage(n,this)))return;if(this._status===w.STATUS_USER_CLOSED&&n instanceof T.IncomingRequest)return;if(!C(n,this,t))return;if(n instanceof T.IncomingRequest)n.transport=t,this.receiveRequest(n);else if(n instanceof T.IncomingResponse){var r;switch(n.method){case c.INVITE:(r=this._transactions.ict[n.via_branch])&&r.receiveResponse(n);break;case c.ACK:break;default:(r=this._transactions.nict[n.via_branch])&&r.receiveResponse(n)}}}.bind(this)}catch(a){throw E(a),new _.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 g("sip",v.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=["password","realm","ha1","display_name","register"];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 b("configuration parameters after validation:"),this._configuration)if(Object.prototype.hasOwnProperty.call(S.settings,o))switch(o){case"uri":case"registrar_server":b("- ".concat(o,": ").concat(this._configuration[o]));break;case"password":case"ha1":b("- ".concat(o,": NOT SHOWN"));break;default:b("- ".concat(o,": ").concat(JSON.stringify(this._configuration[o])))}}},{key:"C",get:function(){return w}},{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(e,t,n){var r=n(2),i=n(4),o=n(5),a=n(3),s=n(10),l=n(19),u=n(1)("JsSIP:Registrator");e.exports=function(){"use strict";function e(t,n){r(this,e);this._ua=t,this._transport=n,this._registrar=t.configuration.registrar_server,this._expires=t.configuration.register_expires,this._call_id=o.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._contact+=";reg-id=".concat(1),this._contact+=';+sip.instance="<urn:uuid:'.concat(this._ua.configuration.instance_id,'>"')}return i(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)u("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 s.OutgoingRequest(a.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},t),r=new l(this._ua,n,{onRequestTimeout:function(){e._registrationFailure(null,a.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._registrationFailure(null,a.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")){u("no Contact header in response to REGISTER, response ignored");break}var n=t.headers.Contact.reduce(function(e,t){return e.concat(t.parsed)},[]).find(function(t){return t.uri.user===e._ua.contact.uri.user});if(!n){u("no Contact header pointing to us, response ignored");break}var r=n.getParam("expires");!r&&t.hasHeader("expires")&&(r=t.getHeader("expires")),r||(r=e._expires),(r=Number(r))<10&&(r=10),e._registrationTimer=setTimeout(function(){e._registrationTimer=null,0===e._ua.listeners("registrationExpiring").length?e.register():e._ua.emit("registrationExpiring")},1e3*r-5e3),n.hasParam("temp-gruu")&&(e._ua.contact.temp_gruu=n.getParam("temp-gruu").replace(/"/g,"")),n.hasParam("pub-gruu")&&(e._ua.contact.pub_gruu=n.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()):(u("423 response received for REGISTER without Min-Expires"),e._registrationFailure(t,a.causes.SIP_FAILURE_CODE));break;default:var i=o.sipErrorCause(t.status_code);e._registrationFailure(t,i)}}});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 s.OutgoingRequest(a.REGISTER,this._registrar,this._ua,{to_uri:this._to_uri,call_id:this._call_id,cseq:this._cseq+=1},n);new l(this._ua,r,{onRequestTimeout:function(){e._unregistered(null,a.causes.REQUEST_TIMEOUT)},onTransportError:function(){e._unregistered(null,a.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=o.sipErrorCause(t.status_code);e._unregistered(t,n)}}}).send()}else u("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(e,t,n){var r=function(e){return String(Number(e))===e?Number(e):e},i=function(e,t,n){var i=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:i&&!t[e.name]&&(t[e.name]={});var o=e.push?{}:i?t[e.name]:t;!function(e,t,n,i){if(i&&!n)t[i]=r(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(t[n[o]]=r(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&t[e.push].push(o)},o=n(28),a=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(e){var t={},n=[],r=t;return e.split(/(\r\n|\r|\n)/).filter(a).forEach(function(e){var t=e[0],a=e.slice(2);"m"===t&&(n.push({rtp:[],fmtp:[]}),r=n[n.length-1]);for(var s=0;s<(o[t]||[]).length;s+=1){var l=o[t][s];if(l.reg.test(a))return i(l,r,a)}}),t.media=n,t};var s=function(e,t){var n=t.split(/=(.+)/,2);return 2===n.length?e[n[0]]=r(n[1]):1===n.length&&t.length>1&&(e[n[0]]=void 0),e};t.parseParams=function(e){return e.split(/;\s?/).reduce(s,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(e){return e.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(r),i=0;i<n.length;i+=3)t.push({component:n[i],ip:n[i+1],port:n[i+2]});return t},t.parseImageAttributes=function(e){return e.split(" ").map(function(e){return e.substring(1,e.length-1).split(",").reduce(s,{})})},t.parseSimulcastStreamList=function(e){return e.split(";").map(function(e){return e.split(",").map(function(e){var t,n=!1;return"~"!==e[0]?t=r(e):(t=r(e.substring(1,e.length)),n=!0),{scid:t,paused:n}})})}},function(e,t,n){var r=n(28),i=/%[sdv%]/g,o=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 o=0;o<t.names.length;o+=1){var a=t.names[o];t.name?r.push(n[t.name][a]):r.push(n[t.names[o]])}else r.push(n[t.name]);return function(e){var t=1,n=arguments,r=n.length;return e.replace(i,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""}})}.apply(null,r)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];e.exports=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||a,i=t.innerOrder||s,l=[];return n.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?l.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){l.push(o(t,n,e))})})}),e.media.forEach(function(e){l.push(o("m",r.m[0],e)),i.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?l.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){l.push(o(t,n,e))})})})}),l.join("\r\n")+"\r\n"}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}i.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];u.push(new h(e,t)),1!==u.length||c||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){var r=n(56);e.exports=function(e){function t(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return i.colors[Math.abs(t)%i.colors.length]}function i(e){var n;function r(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];if(r.enabled){var a=r,s=Number(new Date),l=s-(n||s);a.diff=l,a.prev=n,a.curr=s,n=s,t[0]=i.coerce(t[0]),"string"!==typeof t[0]&&t.unshift("%O");var u=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,function(e,n){if("%%"===e)return e;u++;var r=i.formatters[n];if("function"===typeof r){var o=t[u];e=r.call(a,o),t.splice(u,1),u--}return e}),i.formatArgs.call(a,t),(a.log||i.log).apply(a,t)}}return r.namespace=e,r.enabled=i.enabled(e),r.useColors=i.useColors(),r.color=t(e),r.destroy=o,r.extend=a,"function"===typeof i.init&&i.init(r),i.instances.push(r),r}function o(){var e=i.instances.indexOf(this);return-1!==e&&(i.instances.splice(e,1),!0)}function a(e,t){var n=i(this.namespace+("undefined"===typeof t?":":t)+e);return n.log=this.log,n}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(e){return e instanceof Error?e.stack||e.message:e},i.disable=function(){var e=[].concat(r(i.names.map(s)),r(i.skips.map(s).map(function(e){return"-"+e}))).join(",");return i.enable(""),e},i.enable=function(e){var t;i.save(e),i.names=[],i.skips=[];var n=("string"===typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")));for(t=0;t<i.instances.length;t++){var o=i.instances[t];o.enabled=i.enabled(o.namespace)}},i.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=i.skips.length;t<n;t++)if(i.skips[t].test(e))return!1;for(t=0,n=i.names.length;t<n;t++)if(i.names[t].test(e))return!0;return!1},i.humanize=n(60),Object.keys(e).forEach(function(t){i[t]=e[t]}),i.instances=[],i.names=[],i.skips=[],i.formatters={},i.selectColor=t,i.enable(i.load()),i}},function(e,t,n){var r=n(57),i=n(58),o=n(59);e.exports=function(e){return r(e)||i(e)||o()}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){var n=1e3,r=60*n,i=60*r,o=24*i,a=7*o,s=365.25*o;function l(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var l=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*s;case"weeks":case"week":case"w":return l*a;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*r;case"seconds":case"second":case"secs":case"sec":case"s":return l*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return l(e,t,o,"day");if(t>=i)return l(e,t,i,"hour");if(t>=r)return l(e,t,r,"minute");if(t>=n)return l(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){var r=n(2),i=n(4),o=n(5),a=n(1)("JsSIP:DigestAuthentication"),s=n(1)("JsSIP:ERROR:DigestAuthentication");s.log=console.warn.bind(console),e.exports=function(){"use strict";function e(t){r(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 i(e,[{key:"get",value:function(e){switch(e){case"realm":return this._realm;case"ha1":return this._ha1;default:return void s('get() | cannot get "%s" parameter',e)}}},{key:"authenticate",value:function(e,t){var n=e.method,r=e.ruri,i=e.body,l=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 s('authenticate() | challenge with Digest algorithm different than "MD5", authentication aborted'),!1}else this._algorithm="MD5";if(!this._nonce)return s("authenticate() | challenge without Digest nonce, authentication aborted"),!1;if(!this._realm)return s("authenticate() | challenge without Digest realm, authentication aborted"),!1;if(!this._credentials.password){if(!this._credentials.ha1)return s("authenticate() | no plain SIP password nor ha1 provided, authentication aborted"),!1;if(this._credentials.realm!==this._realm)return s('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 s('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=l||o.createRandomToken(12),this._nc+=1;var u,c,d=Number(this._nc).toString(16);return this._ncHex="00000000".substr(0,8-d.length)+d,4294967296===this._nc&&(this._nc=1,this._ncHex="00000001"),this._credentials.password?this._ha1=o.calculateMD5("".concat(this._credentials.username,":").concat(this._realm,":").concat(this._credentials.password)):this._ha1=this._credentials.ha1,"auth"===this._qop?(u="".concat(this._method,":").concat(this._uri),c=o.calculateMD5(u),a('authenticate() | using qop=auth [a2:"%s"]',u),this._response=o.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth:").concat(c))):"auth-int"===this._qop?(u="".concat(this._method,":").concat(this._uri,":").concat(o.calculateMD5(i||"")),c=o.calculateMD5(u),a('authenticate() | using qop=auth-int [a2:"%s"]',u),this._response=o.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(this._ncHex,":").concat(this._cnonce,":auth-int:").concat(c))):null===this._qop&&(u="".concat(this._method,":").concat(this._uri),c=o.calculateMD5(u),a('authenticate() | using qop=null [a2:"%s"]',u),this._response=o.calculateMD5("".concat(this._ha1,":").concat(this._nonce,":").concat(c))),a("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}()},function(e,t,n){var r=n(2),i=n(4),o=n(10),a=n(3),s=n(18),l=n(63),u=n(5),c=n(1)("JsSIP:Dialog"),d={STATUS_EARLY:1,STATUS_CONFIRMED:2};e.exports=function(){"use strict";function e(t,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.STATUS_CONFIRMED;if(r(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 o.IncomingResponse&&(a=n.status_code<200?d.STATUS_EARLY:d.STATUS_CONFIRMED);var s=n.parseHeader("contact");"UAS"===i?(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=a,this._remote_seqnum=n.cseq,this._local_uri=n.parseHeader("to").uri,this._remote_uri=n.parseHeader("from").uri,this._remote_target=s.uri,this._route_set=n.getHeaders("record-route"),this._ack_seqnum=this._remote_seqnum):"UAC"===i&&(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=a,this._local_seqnum=n.cseq,this._local_uri=n.parseHeader("from").uri,this._remote_uri=n.parseHeader("to").uri,this._remote_target=s.uri,this._route_set=n.getHeaders("record-route").reverse(),this._ack_seqnum=null),this._ua.newDialog(this),c("new ".concat(i," dialog created with status ").concat(this._state===d.STATUS_EARLY?"EARLY":"CONFIRMED"))}return i(e,null,[{key:"C",get:function(){return d}}]),i(e,[{key:"update",value:function(e,t){this._state=d.STATUS_CONFIRMED,c("dialog ".concat(this._id.toString(),"  changed to CONFIRMED state")),"UAC"===t&&(this._route_set=e.getHeaders("record-route").reverse())}},{key:"terminate",value:function(){c("dialog ".concat(this._id.toString()," deleted")),this._ua.destroyDialog(this)}},{key:"sendRequest",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u.cloneArray(n.extraHeaders),i=n.eventHandlers||{},o=n.body||null,a=this._createRequest(e,r,o);return i.onAuthenticated=function(){t._local_seqnum+=1},new l(this,a,i).send(),a}},{key:"receiveRequest",value:function(e){this._checkInDialogRequest(e)&&(e.method===a.ACK&&null!==this._ack_seqnum?this._ack_seqnum=null:e.method===a.INVITE&&(this._ack_seqnum=e.cseq),this._owner.receiveRequest(e))}},{key:"_createRequest",value:function(e,t,n){t=u.cloneArray(t),this._local_seqnum||(this._local_seqnum=Math.floor(1e4*Math.random()));var r=e===a.CANCEL||e===a.ACK?this._local_seqnum:this._local_seqnum+=1;return new o.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!==a.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===a.INVITE||e.method===a.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!==s.C.STATUS_ACCEPTED&&e.server_transaction.state!==s.C.STATUS_COMPLETED&&e.server_transaction.state!==s.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===s.C.STATUS_ACCEPTED&&(t._remote_target=e.parseHeader("contact").uri)})}else e.method===a.NOTIFY&&e.hasHeader("contact")&&e.server_transaction.on("stateChanged",function(){e.server_transaction.state===s.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}()},function(e,t,n){var r=n(2),i=n(4),o=n(3),a=n(18),s=n(30),l=n(19),u={onRequestTimeout:function(){},onTransportError:function(){},onSuccessResponse:function(){},onErrorResponse:function(){},onAuthenticated:function(){},onDialogError:function(){}};e.exports=function(){"use strict";function e(t,n,i){for(var o in r(this,e),this._dialog=t,this._ua=t._ua,this._request=n,this._eventHandlers=i,this._reattempt=!1,this._reattemptTimer=null,u)Object.prototype.hasOwnProperty.call(u,o)&&(this._eventHandlers[o]||(this._eventHandlers[o]=u[o]))}return i(e,[{key:"send",value:function(){var e=this,t=new l(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===o.INVITE||this._request.method===o.UPDATE&&this._request.body)&&t.clientTransaction.state!==a.C.STATUS_TERMINATED){this._dialog.uac_pending_reply=!0;t.clientTransaction.on("stateChanged",function n(){t.clientTransaction.state!==a.C.STATUS_ACCEPTED&&t.clientTransaction.state!==a.C.STATUS_COMPLETED&&t.clientTransaction.state!==a.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===o.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.value=this._dialog.local_seqnum+=1,this._reattemptTimer=setTimeout(function(){t._dialog.owner.status!==s.C.STATUS_TERMINATED&&(t._reattempt=!0,t._request_sender.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}()},function(e,t,n){var r=n(2),i=n(4),o=n(8),a=n(6),s=n(9),l=n(13).EventEmitter,u=n(3),c=n(11),d=n(5),f=n(1)("JsSIP:RTCSession:DTMF");n(1)("JsSIP:ERROR:RTCSession:DTMF").log=console.warn.bind(console);var p={MIN_DURATION:70,MAX_DURATION:6e3,DEFAULT_DURATION:100,MIN_INTER_TONE_GAP:50,DEFAULT_INTER_TONE_GAP:500};e.exports=function(e){"use strict";function t(e){var n;return r(this,t),(n=o(this,a(t).call(this)))._session=e,n._direction=null,n._tone=null,n._duration=null,n._request=null,n}return s(t,l),i(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 c.InvalidStateError(this._session.status);var r=d.cloneArray(n.extraHeaders);if(this.eventHandlers=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(u.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=p.DEFAULT_DURATION),this._tone?this._session.newDTMF({originator:"remote",dtmf:this,request:e}):f("invalid INFO DTMF received, discarded")}},{key:"tone",get:function(){return this._tone}},{key:"duration",get:function(){return this._duration}}]),t}(),e.exports.C=p},function(e,t,n){var r=n(2),i=n(4),o=n(8),a=n(6),s=n(9),l=n(13).EventEmitter;n(1)("JsSIP:ERROR:RTCSession:Info").log=console.warn.bind(console);var u=n(3),c=n(11),d=n(5);e.exports=function(e){"use strict";function t(e){var n;return r(this,t),(n=o(this,a(t).call(this)))._session=e,n._direction=null,n._contentType=null,n._body=null,n}return s(t,l),i(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 c.InvalidStateError(this._session.status);this._contentType=e,this._body=t;var i=d.cloneArray(r.extraHeaders);i.push("Content-Type: ".concat(e)),this._session.newInfo({originator:"local",info:this,request:this.request}),this._session.sendRequest(u.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.getHeader("content-type"),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(e,t,n){var r=n(2),i=n(4),o=n(3),a=n(1)("JsSIP:RTCSession:ReferNotifier"),s={event_type:"refer",body_type:"message/sipfrag;version=2.0",expires:300};e.exports=function(){"use strict";function e(t,n,i){r(this,e),this._session=t,this._id=n,this._expires=i||s.expires,this._active=!0,this.notify(100)}return i(e,[{key:"notify",value:function(e,t){var n;(a("notify()"),!1!==this._active)&&(t=t||o.REASON_PHRASE[e]||"",n=e>=200?"terminated;reason=noresource":"active;expires=".concat(this._expires),this._session.sendRequest(o.NOTIFY,{extraHeaders:["Event: ".concat(s.event_type,";id=").concat(this._id),"Subscription-State: ".concat(n),"Content-Type: ".concat(s.body_type)],body:"SIP/2.0 ".concat(e," ").concat(t),eventHandlers:{onErrorResponse:function(){this._active=!1}}}))}}]),e}()},function(e,t,n){var r=n(2),i=n(4),o=n(8),a=n(6),s=n(9),l=n(13).EventEmitter,u=n(3),c=n(7),d=n(5),f=n(1)("JsSIP:RTCSession:ReferSubscriber");e.exports=function(e){"use strict";function t(e){var n;return r(this,t),(n=o(this,a(t).call(this)))._id=null,n._session=e,n}return s(t,l),i(t,[{key:"sendRefer",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f("sendRefer()");var r=d.cloneArray(n.extraHeaders),i=n.eventHandlers||{};for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&this.on(o,i[o]);var a=null;n.replaces&&(a=n.replaces._request.call_id,a+=";to-tag=".concat(n.replaces._to_tag),a+=";from-tag=".concat(n.replaces._from_tag),a=encodeURIComponent(a));var s="Refer-To: <".concat(e).concat(a?"?Replaces=".concat(a):"",">");r.push(s),r.push("Contact: ".concat(this._session.contact));var l=this._session.sendRequest(u.REFER,{extraHeaders:r,eventHandlers:{onSuccessResponse:function(e){t._requestSucceeded(e)},onErrorResponse:function(e){t._requestFailed(e,u.causes.REJECTED)},onTransportError:function(){t._requestFailed(null,u.causes.CONNECTION_ERROR)},onRequestTimeout:function(){t._requestFailed(null,u.causes.REQUEST_TIMEOUT)},onDialogError:function(){t._requestFailed(null,u.causes.DIALOG_ERROR)}}});this._id=l.cseq}},{key:"receiveNotify",value:function(e){if(f("receiveNotify()"),e.body){var t=c.parse(e.body.trim(),"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 f('receiveNotify() | error parsing NOTIFY body: "'.concat(e.body,'"'))}}},{key:"_requestSucceeded",value:function(e){f("REFER succeeded"),f('emit "requestSucceeded"'),this.emit("requestSucceeded",{response:e})}},{key:"_requestFailed",value:function(e,t){f("REFER failed"),f('emit "requestFailed"'),this.emit("requestFailed",{response:e||null,cause:t})}},{key:"id",get:function(){return this._id}}]),t}()},function(e,t,n){var r=n(2),i=n(4),o=n(8),a=n(6),s=n(9),l=n(13).EventEmitter,u=n(3),c=n(10),d=n(5),f=n(19),p=n(11),h=n(1)("JsSIP:Message");e.exports=function(e){"use strict";function t(e){var n;return r(this,t),(n=o(this,a(t).call(this)))._ua=e,n._request=null,n._closed=!1,n._direction=null,n._local_identity=null,n._remote_identity=null,n._is_replied=!1,n._data={},n}return s(t,l),i(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=d.cloneArray(r.extraHeaders),a=r.eventHandlers||{},s=r.contentType||"text/plain";for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&this.on(l,a[l]);o.push("Content-Type: ".concat(s)),this._request=new c.OutgoingRequest(u.MESSAGE,e,this._ua,null,o),t&&(this._request.body=t);var p=new f(this._ua,this._request,{onRequestTimeout:function(){n._onRequestTimeout()},onTransportError:function(){n._onTransportError()},onReceiveResponse:function(e){n._receiveResponse(e)}});this._newMessage("local",this._request),p.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=d.cloneArray(e.extraHeaders),n=e.body;if("incoming"!==this._direction)throw new p.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=d.cloneArray(e.extraHeaders),i=e.body;if("incoming"!==this._direction)throw new p.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=d.sipErrorCause(e.status_code);this._failed("remote",e,t)}}},{key:"_onRequestTimeout",value:function(){this._closed||this._failed("system",null,u.causes.REQUEST_TIMEOUT)}},{key:"_onTransportError",value:function(){this._closed||this._failed("system",null,u.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){h("MESSAGE failed"),this._close(),h('emit "failed"'),this.emit("failed",{originator:e,response:t||null,cause:n})}},{key:"_succeeded",value:function(e,t){h("MESSAGE succeeded"),this._close(),h('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(e,t,n){var r=n(2),i=n(4),o=n(31),a=n(1)("JsSIP:Transport"),s=n(1)("JsSIP:ERROR:Transport");s.log=console.warn.bind(console);var l={STATUS_CONNECTED:0,STATUS_CONNECTING:1,STATUS_DISCONNECTED:2,SOCKET_STATUS_READY:0,SOCKET_STATUS_ERROR:1,recovery_options:{min_interval:2,max_interval:30}};e.exports=function(){"use strict";function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.recovery_options;if(r(this,e),a("new()"),this.status=l.STATUS_DISCONNECTED,this.socket=null,this.sockets=[],this.recovery_options=n,this.recover_attempts=0,this.recovery_timer=null,this.close_requested=!1,"undefined"===typeof t)throw new TypeError("Invalid argument. undefined 'sockets' argument");t instanceof Array||(t=[t]),t.forEach(function(e){if(!o.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:l.SOCKET_STATUS_READY})},this),this._getSocket()}return i(e,[{key:"connect",value:function(){a("connect()"),this.isConnected()?a("Transport is already connected"):this.isConnecting()?a("Transport is connecting"):(this.close_requested=!1,this.status=l.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(){a("close()"),this.close_requested=!0,this.recover_attempts=0,this.status=l.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(a("send()"),!this.isConnected())return s("unable to send message, transport is not connected"),!1;var t=e.toString();return a("sending message:\n\n".concat(t,"\n")),this.socket.send(t)}},{key:"isConnected",value:function(){return this.status===l.STATUS_CONNECTED}},{key:"isConnecting",value:function(){return this.status===l.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),a("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!==l.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=l.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=l.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=l.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=l.SOCKET_STATUS_ERROR)},this),this._reconnect(e))}},{key:"_onData",value:function(e){if("\r\n"!==e){if("string"!==typeof e){try{e=String.fromCharCode.apply(null,new Uint8Array(e))}catch(t){return void a("received binary message failed to be converted into string, message discarded")}a("received binary message:\n\n".concat(e,"\n"))}else a("received text message:\n\n".concat(e,"\n"));this.ondata({transport:this,message:e})}else a("received message with CRLF Keep Alive response")}},{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}()},function(e,t,n){var r=n(7),i=n(10),o=n(1)("JsSIP:ERROR:Parser");function a(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 s(e,t,n,o){var a,s=t.indexOf(":",n),l=t.substring(n,s).trim(),u=t.substring(s+1,o).trim();switch(l.toLowerCase()){case"via":case"v":e.addHeader("via",u),1===e.getHeaders("via").length?(a=e.parseHeader("Via"))&&(e.via=a,e.via_branch=a.branch):a=0;break;case"from":case"f":e.setHeader("from",u),(a=e.parseHeader("from"))&&(e.from=a,e.from_tag=a.getParam("tag"));break;case"to":case"t":e.setHeader("to",u),(a=e.parseHeader("to"))&&(e.to=a,e.to_tag=a.getParam("tag"));break;case"record-route":if(-1===(a=r.parse(u,"Record_Route")))a=void 0;else{var c=!0,d=!1,f=void 0;try{for(var p,h=a[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var m=p.value;e.addHeader("record-route",u.substring(m.possition,m.offset)),e.headers["Record-Route"][e.getHeaders("record-route").length-1].parsed=m.parsed}}catch(S){d=!0,f=S}finally{try{c||null==h.return||h.return()}finally{if(d)throw f}}}break;case"call-id":case"i":e.setHeader("call-id",u),(a=e.parseHeader("call-id"))&&(e.call_id=u);break;case"contact":case"m":if(-1===(a=r.parse(u,"Contact")))a=void 0;else{var v=!0,_=!1,g=void 0;try{for(var y,T=a[Symbol.iterator]();!(v=(y=T.next()).done);v=!0){var C=y.value;e.addHeader("contact",u.substring(C.possition,C.offset)),e.headers.Contact[e.getHeaders("contact").length-1].parsed=C.parsed}}catch(S){_=!0,g=S}finally{try{v||null==T.return||T.return()}finally{if(_)throw g}}}break;case"content-length":case"l":e.setHeader("content-length",u),a=e.parseHeader("content-length");break;case"content-type":case"c":e.setHeader("content-type",u),a=e.parseHeader("content-type");break;case"cseq":e.setHeader("cseq",u),(a=e.parseHeader("cseq"))&&(e.cseq=a.value),e instanceof i.IncomingResponse&&(e.method=a.method);break;case"max-forwards":e.setHeader("max-forwards",u),a=e.parseHeader("max-forwards");break;case"www-authenticate":e.setHeader("www-authenticate",u),a=e.parseHeader("www-authenticate");break;case"proxy-authenticate":e.setHeader("proxy-authenticate",u),a=e.parseHeader("proxy-authenticate");break;case"session-expires":case"x":e.setHeader("session-expires",u),(a=e.parseHeader("session-expires"))&&(e.session_expires=a.expires,e.session_expires_refresher=a.refresher);break;case"refer-to":case"r":e.setHeader("refer-to",u),(a=e.parseHeader("refer-to"))&&(e.refer_to=a);break;case"replaces":e.setHeader("replaces",u),(a=e.parseHeader("replaces"))&&(e.replaces=a);break;case"event":case"o":e.setHeader("event",u),(a=e.parseHeader("event"))&&(e.event=a);break;default:e.addHeader(l,u),a=0}return void 0!==a||{error:'error parsing header "'.concat(l,'"')}}o.log=console.warn.bind(console),t.parseMessage=function(e,t){var n,l,u=e.indexOf("\r\n");if(-1!==u){var c=e.substring(0,u),d=r.parse(c,"Request_Response");if(-1!==d){d.status_code?((n=new i.IncomingResponse).status_code=d.status_code,n.reason_phrase=d.reason_phrase):((n=new i.IncomingRequest(t)).method=d.method,n.ruri=d.uri),n.data=e;for(var f=u+2;;){if(-2===(u=a(e,f))){l=f+2;break}if(-1===u)return void o("parseMessage() | malformed message");if(!0!==(d=s(n,e,f,u)))return void o("parseMessage() |",d.error);f=u+2}if(n.hasHeader("content-length")){var p=n.getHeader("content-length");n.body=e.substr(l,p)}else n.body=e.substring(l);return n}o('parseMessage() | error parsing first line of SIP message: "'.concat(c,'"'))}else o("parseMessage() | no CRLF found, not a SIP message")}},function(e,t,n){var r,i,o,a=n(3),s=n(10),l=n(5),u=n(1)("JsSIP:sanityCheck"),c=[function(){for(var e=0,t=["from","to","call_id","cseq","via"];e<t.length;e++){var n=t[e];if(!r.hasHeader(n))return u("missing mandatory header field : ".concat(n,", dropping the response")),!1}}],d=[function(){if("sip"!==r.s("to").uri.scheme)return p(416),!1},function(){if(!r.to_tag&&r.call_id.substr(0,5)===i.configuration.jssip_id)return p(482),!1},function(){var e=l.str_utf8_length(r.body),t=r.getHeader("content-length");if(e<t)return p(400),!1},function(){var e,t=r.from_tag,n=r.call_id,o=r.cseq;if(r.to_tag)return;if(r.method===a.INVITE){if(i._transactions.ist[r.via_branch])return!1;for(var s in i._transactions.ist)if(Object.prototype.hasOwnProperty.call(i._transactions.ist,s)&&(e=i._transactions.ist[s]).request.from_tag===t&&e.request.call_id===n&&e.request.cseq===o)return p(482),!1}else{if(i._transactions.nist[r.via_branch])return!1;for(var l in i._transactions.nist)if(Object.prototype.hasOwnProperty.call(i._transactions.nist,l)&&(e=i._transactions.nist[l]).request.from_tag===t&&e.request.call_id===n&&e.request.cseq===o)return p(482),!1}}],f=[function(){if(r.getHeaders("via").length>1)return u("more than one Via header field present in the response, dropping the response"),!1},function(){var e=l.str_utf8_length(r.body),t=r.getHeader("content-length");if(e<t)return u("message body length is lower than the value in Content-Length header field, dropping the response"),!1}];function p(e){var t,n=r.getHeaders("via"),i="SIP/2.0 ".concat(e," ").concat(a.REASON_PHRASE[e],"\r\n"),s=!0,u=!1,c=void 0;try{for(var d,f=n[Symbol.iterator]();!(s=(d=f.next()).done);s=!0){var p=d.value;i+="Via: ".concat(p,"\r\n")}}catch(h){u=!0,c=h}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}t=r.getHeader("To"),r.to_tag||(t+=";tag=".concat(l.newTag())),i+="To: ".concat(t,"\r\n"),i+="From: ".concat(r.getHeader("From"),"\r\n"),i+="Call-ID: ".concat(r.call_id,"\r\n"),i+="CSeq: ".concat(r.cseq," ").concat(r.method,"\r\n"),i+="\r\n",o.send(i)}e.exports=function(e,t,n){r=e,i=t,o=n;for(var a=0,l=c;a<l.length;a++){if(!1===(0,l[a])())return!1}if(r instanceof s.IncomingRequest)for(var u=0,p=d;u<p.length;u++){if(!1===(0,p[u])())return!1}else if(r instanceof s.IncomingResponse)for(var h=0,m=f;h<m.length;h++){if(!1===(0,m[h])())return!1}return!0}},function(e,t,n){var r=n(5),i=n(3),o=n(7),a=n(12),s=n(31),l=n(11);t.settings={authorization_user:null,password:null,realm:null,ha1:null,display_name:null,uri:null,contact_uri:null,instance_id:null,use_preloaded_route:!1,session_timers:!0,session_timers_refresh_method:i.UPDATE,no_answer_timeout:60,register:!0,register_expires:600,registrar_server:null,sockets:null,connection_recovery_max_interval:null,connection_recovery_min_interval:null,via_host:"".concat(r.createRandomToken(12),".invalid")};var u={mandatory:{sockets:function(e){var t=[];if(s.isSocket(e))t.push({socket:e});else{if(!Array.isArray(e)||!e.length)return;var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;Object.prototype.hasOwnProperty.call(l,"socket")&&s.isSocket(l.socket)?t.push(l):s.isSocket(l)&&t.push({socket:l})}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}return t},uri:function(e){/^sip:/i.test(e)||(e="".concat(i.SIP,":").concat(e));var t=a.parse(e);return t&&t.user?t:void 0}},optional:{authorization_user:function(e){return-1===o.parse('"'.concat(e,'"'),"quoted_string")?void 0:e},user_agent:function(e){if("string"===typeof e)return e},connection_recovery_max_interval:function(e){if(r.isDecimal(e)){var t=Number(e);if(t>0)return t}},connection_recovery_min_interval:function(e){if(r.isDecimal(e)){var t=Number(e);if(t>0)return t}},contact_uri:function(e){if("string"===typeof e){var t=o.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===o.parse(e,"uuid")?void 0:e},no_answer_timeout:function(e){if(r.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())===i.INVITE||e===i.UPDATE))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(r.isDecimal(e)){var t=Number(e);if(t>0)return t}},registrar_server:function(e){/^sip:/i.test(e)||(e="".concat(i.SIP,":").concat(e));var t=a.parse(e);return t?t.user?void 0:t:void 0},use_preloaded_route:function(e){if("boolean"===typeof e)return e}}};t.load=function(e,t){for(var n in u.mandatory){if(!t.hasOwnProperty(n))throw new l.ConfigurationError(n);var i=t[n],o=u.mandatory[n](i);if(void 0===o)throw new l.ConfigurationError(n,i);e[n]=o}for(var a in u.optional)if(t.hasOwnProperty(a)){var s=t[a];if(r.isEmpty(s))continue;var c=u.optional[a](s);if(void 0===c)throw new l.ConfigurationError(a,s);e[a]=c}}},function(e,t,n){var r=n(2),i=n(4),o=n(7),a=n(1)("JsSIP:WebSocketInterface"),s=n(1)("JsSIP:ERROR:WebSocketInterface");s.log=console.warn.bind(console),e.exports=function(){"use strict";function e(t){r(this,e),a('new() [url:"%s"]',t),this._url=t,this._sip_uri=null,this._via_transport=null,this._ws=null;var n=o.parse(t,"absoluteURI");if(-1===n)throw s("invalid WebSocket URI: ".concat(t)),new TypeError("Invalid argument: ".concat(t));if("wss"!==n.scheme&&"ws"!==n.scheme)throw s("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 i(e,[{key:"connect",value:function(){if(a("connect()"),this.isConnected())a("WebSocket ".concat(this._url," is already connected"));else if(this.isConnecting())a("WebSocket ".concat(this._url," is connecting"));else{this._ws&&this.disconnect(),a("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(){a("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 a("send()"),this.isConnected()?(this._ws.send(e),!0):(s("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(){a("WebSocket ".concat(this._url," connected")),this.onconnect()}},{key:"_onClose",value:function(e){var t=e.wasClean,n=e.code,r=e.reason;a("WebSocket ".concat(this._url," closed")),!1===t&&a("WebSocket abrupt disconnection");var i={socket:this,error:!t,code:n,reason:r};this.ondisconnect(i)}},{key:"_onMessage",value:function(e){var t=e.data;a("received WebSocket message"),this.ondata(t)}},{key:"_onError",value:function(e){s("WebSocket ".concat(this._url," error: ").concat(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}()}]]);
  //# sourceMappingURL=2.7cf0f70f.chunk.js.map