📄 832.6e8ba9e6.chunk.js
/home/palash/git/site/build/static/js/832.6e8ba9e6.chunk.js
Language: js • Lines: 3
/*! For license information please see 832.6e8ba9e6.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunknew_site=self.webpackChunknew_site||[]).push([[832],{4063(e,t,n){n.d(t,{A:()=>p});var r=n(9379),i=n(45),o=n(8139),s=n.n(o),a=n(5043),c=n(7852),h=n(579);const d=["bsPrefix","bg","pill","text","className","as"],l=a.forwardRef((e,t)=>{let n=e.bsPrefix,o=e.bg,a=void 0===o?"primary":o,l=e.pill,p=void 0!==l&&l,u=e.text,f=e.className,m=e.as,g=void 0===m?"span":m,y=(0,i.A)(e,d);const v=(0,c.oU)(n,"badge");return(0,h.jsx)(g,(0,r.A)((0,r.A)({ref:t},y),{},{className:s()(f,v,p&&"rounded-pill",u&&"text-".concat(u),a&&"bg-".concat(a))}))});l.displayName="Badge";const p=l},8628(e,t,n){n.d(t,{A:()=>H});var r=n(9379),i=n(45),o=n(8139),s=n.n(o),a=n(5043),c=n(7852),h=n(579);const d=["className","bsPrefix","as"],l=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,l=void 0===a?"div":a,p=(0,i.A)(e,d);return o=(0,c.oU)(o,"card-body"),(0,h.jsx)(l,(0,r.A)({ref:t,className:s()(n,o)},p))});l.displayName="CardBody";const p=l,u=["className","bsPrefix","as"],f=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,d=void 0===a?"div":a,l=(0,i.A)(e,u);return o=(0,c.oU)(o,"card-footer"),(0,h.jsx)(d,(0,r.A)({ref:t,className:s()(n,o)},l))});f.displayName="CardFooter";const m=f;var g=n(1778);const y=["bsPrefix","className","as"],v=a.forwardRef((e,t)=>{let n=e.bsPrefix,o=e.className,d=e.as,l=void 0===d?"div":d,p=(0,i.A)(e,y);const u=(0,c.oU)(n,"card-header"),f=(0,a.useMemo)(()=>({cardHeaderBsPrefix:u}),[u]);return(0,h.jsx)(g.A.Provider,{value:f,children:(0,h.jsx)(l,(0,r.A)((0,r.A)({ref:t},p),{},{className:s()(o,u)}))})});v.displayName="CardHeader";const _=v,C=["bsPrefix","className","variant","as"],b=a.forwardRef((e,t)=>{let n=e.bsPrefix,o=e.className,a=e.variant,d=e.as,l=void 0===d?"img":d,p=(0,i.A)(e,C);const u=(0,c.oU)(n,"card-img");return(0,h.jsx)(l,(0,r.A)({ref:t,className:s()(a?"".concat(u,"-").concat(a):u,o)},p))});b.displayName="CardImg";const w=b,S=["className","bsPrefix","as"],T=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,d=void 0===a?"div":a,l=(0,i.A)(e,S);return o=(0,c.oU)(o,"card-img-overlay"),(0,h.jsx)(d,(0,r.A)({ref:t,className:s()(n,o)},l))});T.displayName="CardImgOverlay";const E=T,R=["className","bsPrefix","as"],P=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,d=void 0===a?"a":a,l=(0,i.A)(e,R);return o=(0,c.oU)(o,"card-link"),(0,h.jsx)(d,(0,r.A)({ref:t,className:s()(n,o)},l))});P.displayName="CardLink";const k=P;var A=n(4488);const x=["className","bsPrefix","as"],I=(0,A.A)("h6"),D=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,d=void 0===a?I:a,l=(0,i.A)(e,x);return o=(0,c.oU)(o,"card-subtitle"),(0,h.jsx)(d,(0,r.A)({ref:t,className:s()(n,o)},l))});D.displayName="CardSubtitle";const M=D,O=["className","bsPrefix","as"],U=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,d=void 0===a?"p":a,l=(0,i.A)(e,O);return o=(0,c.oU)(o,"card-text"),(0,h.jsx)(d,(0,r.A)({ref:t,className:s()(n,o)},l))});U.displayName="CardText";const N=U,B=["className","bsPrefix","as"],L=(0,A.A)("h5"),F=a.forwardRef((e,t)=>{let n=e.className,o=e.bsPrefix,a=e.as,d=void 0===a?L:a,l=(0,i.A)(e,B);return o=(0,c.oU)(o,"card-title"),(0,h.jsx)(d,(0,r.A)({ref:t,className:s()(n,o)},l))});F.displayName="CardTitle";const z=F,j=["bsPrefix","className","bg","text","border","body","children","as"],V=a.forwardRef((e,t)=>{let n=e.bsPrefix,o=e.className,a=e.bg,d=e.text,l=e.border,u=e.body,f=void 0!==u&&u,m=e.children,g=e.as,y=void 0===g?"div":g,v=(0,i.A)(e,j);const _=(0,c.oU)(n,"card");return(0,h.jsx)(y,(0,r.A)((0,r.A)({ref:t},v),{},{className:s()(o,_,a&&"bg-".concat(a),d&&"text-".concat(d),l&&"border-".concat(l)),children:f?(0,h.jsx)(p,{children:m}):m}))});V.displayName="Card";const H=Object.assign(V,{Img:w,Title:z,Subtitle:M,Body:p,Link:k,Text:N,Header:_,Footer:m,ImgOverlay:E})},3083(e,t,n){n.d(t,{A:()=>Y});var r,i=n(5544),o=n(45),s=n(9379),a=n(8139),c=n.n(a),h=n(3043),d=n(8279),l=n(182),p=n(8260);function u(e){if((!r&&0!==r||e)&&d.A){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),r=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return r}var f=n(5043);var m=n(6618),g=n(8293);function y(e){const t=function(e){const t=(0,f.useRef)(e);return t.current=e,t}(e);(0,f.useEffect)(()=>()=>t.current(),[])}var v=n(4232),_=n(3655),C=n(5675),b=n(8072),w=n(7852),S=n(579);const T=["className","bsPrefix","as"],E=f.forwardRef((e,t)=>{let n=e.className,r=e.bsPrefix,i=e.as,a=void 0===i?"div":i,h=(0,o.A)(e,T);return r=(0,w.oU)(r,"modal-body"),(0,S.jsx)(a,(0,s.A)({ref:t,className:c()(n,r)},h))});E.displayName="ModalBody";const R=E;var P=n(1602);const k=["bsPrefix","className","contentClassName","centered","size","fullscreen","children","scrollable"],A=f.forwardRef((e,t)=>{let n=e.bsPrefix,r=e.className,i=e.contentClassName,a=e.centered,h=e.size,d=e.fullscreen,l=e.children,p=e.scrollable,u=(0,o.A)(e,k);n=(0,w.oU)(n,"modal");const f="".concat(n,"-dialog"),m="string"===typeof d?"".concat(n,"-fullscreen-").concat(d):"".concat(n,"-fullscreen");return(0,S.jsx)("div",(0,s.A)((0,s.A)({},u),{},{ref:t,className:c()(f,r,h&&"".concat(n,"-").concat(h),a&&"".concat(f,"-centered"),p&&"".concat(f,"-scrollable"),d&&m),children:(0,S.jsx)("div",{className:c()("".concat(n,"-content"),i),children:l})}))});A.displayName="ModalDialog";const x=A,I=["className","bsPrefix","as"],D=f.forwardRef((e,t)=>{let n=e.className,r=e.bsPrefix,i=e.as,a=void 0===i?"div":i,h=(0,o.A)(e,I);return r=(0,w.oU)(r,"modal-footer"),(0,S.jsx)(a,(0,s.A)({ref:t,className:c()(n,r)},h))});D.displayName="ModalFooter";const M=D;var O=n(2258);const U=["bsPrefix","className","closeLabel","closeButton"],N=f.forwardRef((e,t)=>{let n=e.bsPrefix,r=e.className,i=e.closeLabel,a=void 0===i?"Close":i,h=e.closeButton,d=void 0!==h&&h,l=(0,o.A)(e,U);return n=(0,w.oU)(n,"modal-header"),(0,S.jsx)(O.A,(0,s.A)((0,s.A)({ref:t},l),{},{className:c()(r,n),closeLabel:a,closeButton:d}))});N.displayName="ModalHeader";const B=N;var L=n(4488);const F=["className","bsPrefix","as"],z=(0,L.A)("h4"),j=f.forwardRef((e,t)=>{let n=e.className,r=e.bsPrefix,i=e.as,a=void 0===i?z:i,h=(0,o.A)(e,F);return r=(0,w.oU)(r,"modal-title"),(0,S.jsx)(a,(0,s.A)({ref:t,className:c()(n,r)},h))});j.displayName="ModalTitle";const V=j,H=["bsPrefix","className","style","dialogClassName","contentClassName","children","dialogAs","data-bs-theme","aria-labelledby","aria-describedby","aria-label","show","animation","backdrop","keyboard","onEscapeKeyDown","onShow","onHide","container","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","onEntered","onExit","onExiting","onEnter","onEntering","onExited","backdropClassName","manager"];function W(e){return(0,S.jsx)(b.A,(0,s.A)((0,s.A)({},e),{},{timeout:null}))}function K(e){return(0,S.jsx)(b.A,(0,s.A)((0,s.A)({},e),{},{timeout:null}))}const G=f.forwardRef((e,t)=>{let n=e.bsPrefix,r=e.className,a=e.style,b=e.dialogClassName,T=e.contentClassName,E=e.children,R=e.dialogAs,k=void 0===R?x:R,A=e["data-bs-theme"],I=e["aria-labelledby"],D=e["aria-describedby"],M=e["aria-label"],O=e.show,U=void 0!==O&&O,N=e.animation,B=void 0===N||N,L=e.backdrop,F=void 0===L||L,z=e.keyboard,j=void 0===z||z,V=e.onEscapeKeyDown,G=e.onShow,Y=e.onHide,Q=e.container,J=e.autoFocus,X=void 0===J||J,Z=e.enforceFocus,q=void 0===Z||Z,$=e.restoreFocus,ee=void 0===$||$,te=e.restoreFocusOptions,ne=e.onEntered,re=e.onExit,ie=e.onExiting,oe=e.onEnter,se=e.onEntering,ae=e.onExited,ce=e.backdropClassName,he=e.manager,de=(0,o.A)(e,H);const le=(0,f.useState)({}),pe=(0,i.A)(le,2),ue=pe[0],fe=pe[1],me=(0,f.useState)(!1),ge=(0,i.A)(me,2),ye=ge[0],ve=ge[1],_e=(0,f.useRef)(!1),Ce=(0,f.useRef)(!1),be=(0,f.useRef)(null),we=(0,f.useState)(null),Se=(0,i.A)(we,2),Te=Se[0],Ee=Se[1],Re=(0,g.A)(t,Ee),Pe=(0,m.A)(Y),ke=(0,w.Wz)();n=(0,w.oU)(n,"modal");const Ae=(0,f.useMemo)(()=>({onHide:Pe}),[Pe]);function xe(){return he||(0,C.R)({isRTL:ke})}function Ie(e){if(!d.A)return;const t=xe().getScrollbarWidth()>0,n=e.scrollHeight>(0,l.A)(e).documentElement.clientHeight;fe({paddingRight:t&&!n?u():void 0,paddingLeft:!t&&n?u():void 0})}const De=(0,m.A)(()=>{Te&&Ie(Te.dialog)});y(()=>{(0,p.A)(window,"resize",De),null==be.current||be.current()});const Me=()=>{_e.current=!0},Oe=e=>{_e.current&&Te&&e.target===Te.dialog&&(Ce.current=!0),_e.current=!1},Ue=()=>{ve(!0),be.current=(0,v.A)(Te.dialog,()=>{ve(!1)})},Ne=e=>{"static"!==F?Ce.current||e.target!==e.currentTarget?Ce.current=!1:null==Y||Y():(e=>{e.target===e.currentTarget&&Ue()})(e)},Be=(0,f.useCallback)(e=>(0,S.jsx)("div",(0,s.A)((0,s.A)({},e),{},{className:c()("".concat(n,"-backdrop"),ce,!B&&"show")})),[B,ce,n]),Le=(0,s.A)((0,s.A)({},a),ue);Le.display="block";return(0,S.jsx)(P.A.Provider,{value:Ae,children:(0,S.jsx)(_.A,{show:U,ref:Re,backdrop:F,container:Q,keyboard:!0,autoFocus:X,enforceFocus:q,restoreFocus:ee,restoreFocusOptions:te,onEscapeKeyDown:e=>{j?null==V||V(e):(e.preventDefault(),"static"===F&&Ue())},onShow:G,onHide:Y,onEnter:(e,t)=>{e&&Ie(e),null==oe||oe(e,t)},onEntering:(e,t)=>{null==se||se(e,t),(0,h.Ay)(window,"resize",De)},onEntered:ne,onExit:e=>{null==be.current||be.current(),null==re||re(e)},onExiting:ie,onExited:e=>{e&&(e.style.display=""),null==ae||ae(e),(0,p.A)(window,"resize",De)},manager:xe(),transition:B?W:void 0,backdropTransition:B?K:void 0,renderBackdrop:Be,renderDialog:e=>(0,S.jsx)("div",(0,s.A)((0,s.A)({role:"dialog"},e),{},{style:Le,className:c()(r,n,ye&&"".concat(n,"-static"),!B&&"show"),onClick:F?Ne:void 0,onMouseUp:Oe,"data-bs-theme":A,"aria-label":M,"aria-labelledby":I,"aria-describedby":D,children:(0,S.jsx)(k,(0,s.A)((0,s.A)({},de),{},{onMouseDown:Me,className:b,contentClassName:T,children:E}))}))})})});G.displayName="Modal";const Y=Object.assign(G,{Body:R,Header:B,Title:V,Footer:M,Dialog:x,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150})},4196(e,t,n){n.d(t,{A:()=>p});var r=n(9379),i=n(45),o=n(8139),s=n.n(o),a=n(5043),c=n(7852),h=n(579);const d=["bsPrefix","className","striped","bordered","borderless","hover","size","variant","responsive"],l=a.forwardRef((e,t)=>{let n=e.bsPrefix,o=e.className,a=e.striped,l=e.bordered,p=e.borderless,u=e.hover,f=e.size,m=e.variant,g=e.responsive,y=(0,i.A)(e,d);const v=(0,c.oU)(n,"table"),_=s()(o,v,m&&"".concat(v,"-").concat(m),f&&"".concat(v,"-").concat(f),a&&"".concat(v,"-").concat("string"===typeof a?"striped-".concat(a):"striped"),l&&"".concat(v,"-bordered"),p&&"".concat(v,"-borderless"),u&&"".concat(v,"-hover")),C=(0,h.jsx)("table",(0,r.A)((0,r.A)({},y),{},{className:_,ref:t}));if(g){let e="".concat(v,"-responsive");return"string"===typeof g&&(e="".concat(e,"-").concat(g)),(0,h.jsx)("div",{className:e,children:C})}return C});l.displayName="Table";const p=l},8824(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map(e=>e.trim())},t.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter(e=>0===e.indexOf(n))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let 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:void 0===n[t[r]]&&(n[t[r]]=t[r+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&void 0!==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(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const 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},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const r=e.substring(e.indexOf(" ")+1).split(";");for(let i=0;i<r.length;i++)n=r[i].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const r=[];Object.keys(e.parameters).forEach(t=>{void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)}),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const r=t.matchPrefix(e+n,"a=ice-ufrag:")[0],i=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&i?{usernameFragment:r.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=t.splitLines(e)[0].split(" ");n.profile=r[2];for(let o=3;o<r.length;o++){const i=r[o],s=t.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(s){const r=t.parseRtpMap(s),o=t.matchPrefix(e,"a=fmtp:"+i+" ");switch(r.parameters=o.length?t.parseFmtp(o[0]):{},r.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(t.parseRtcpFb),n.codecs.push(r),r.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(r.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach(e=>{n.headerExtensions.push(t.parseExtmap(e))});const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach(e=>{i.forEach(t=>{e.rtcpFeedback.find(e=>e.type===t.type&&e.parameter===t.parameter)||e.rtcpFeedback.push(t)})}),n},t.writeRtpDescription=function(e,n){let r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map(e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach(e=>{r+=t.writeRtpMap(e),r+=t.writeFmtp(e),r+=t.writeRtcpFb(e)});let i=0;return n.codecs.forEach(e=>{e.maxptime>i&&(i=e.maxptime)}),i>0&&(r+="a=maxptime:"+i+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach(e=>{r+=t.writeExtmap(e)}),r},t.parseRtpEncodingParameters=function(e){const n=[],r=t.parseRtpParameters(e),i=-1!==r.fecMechanisms.indexOf("RED"),o=-1!==r.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map(e=>t.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute),a=s.length>0&&s[0].ssrc;let c;const h=t.matchPrefix(e,"a=ssrc-group:FID").map(e=>e.substring(17).split(" ").map(e=>parseInt(e,10)));h.length>0&&h[0].length>1&&h[0][0]===a&&(c=h[0][1]),r.codecs.forEach(e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&c&&(t.rtx={ssrc:c}),n.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},n.push(t))}}),0===n.length&&a&&n.push({ssrc:a});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,n.forEach(e=>{e.maxBitrate=d})),n},t.parseRtcpParameters=function(e){const n={},r=t.matchPrefix(e,"a=ssrc:").map(e=>t.parseSsrcMedia(e)).filter(e=>"cname"===e.attribute)[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=i.length>0,n.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return n.mux=o.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const r=t.matchPrefix(e,"a=msid:");if(1===r.length)return n=r[0].substring(7).split(" "),{stream:n[0],track:n[1]};const i=t.matchPrefix(e,"a=ssrc:").map(e=>t.parseSsrcMedia(e)).filter(e=>"msid"===e.attribute);return i.length>0?(n=i[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");let i;r.length>0&&(i=parseInt(r[0].substring(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:n.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let 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("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,r){let i;const o=void 0!==n?n:2;i=e||t.generateSessionId();return"v=0\r\no="+(r||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const r=t.splitLines(e);for(let t=0;t<r.length;t++)switch(r[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[t].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!==typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let t=0;t<n.length;t++)if(n[t].length<2||"="!==n[t].charAt(1))return!1;return!0},e.exports=t},8816(e,t,n){n.d(t,{xM:()=>Ut});var r={};n.r(r),n.d(r,{fixNegotiationNeeded:()=>U,shimAddTrackRemoveTrack:()=>M,shimAddTrackRemoveTrackWithNative:()=>D,shimGetSendersWithDtmf:()=>x,shimGetUserMedia:()=>P,shimMediaStream:()=>k,shimOnTrack:()=>A,shimPeerConnection:()=>O,shimSenderReceiverGetStats:()=>I});var i={};n.r(i),n.d(i,{shimAddTransceiver:()=>K,shimCreateAnswer:()=>Q,shimCreateOffer:()=>Y,shimGetDisplayMedia:()=>B,shimGetParameters:()=>G,shimGetStats:()=>z,shimGetUserMedia:()=>N,shimOnTrack:()=>L,shimPeerConnection:()=>F,shimRTCDataChannel:()=>W,shimReceiverGetStats:()=>V,shimRemoveStream:()=>H,shimSenderGetStats:()=>j});var o={};n.r(o),n.d(o,{shimAudioContext:()=>re,shimCallbacksAPI:()=>Z,shimConstraints:()=>$,shimCreateOfferLegacy:()=>ne,shimGetUserMedia:()=>q,shimLocalStreamsAPI:()=>J,shimRTCIceServerUrls:()=>ee,shimRemoteStreamsAPI:()=>X,shimTrackEventTransceiver:()=>te});var s={};n.r(s),n.d(s,{removeExtmapAllowMixed:()=>le,shimAddIceCandidateNullOrEmpty:()=>pe,shimConnectionState:()=>de,shimMaxMessageSize:()=>ce,shimParameterlessSetLocalDescription:()=>ue,shimRTCIceCandidate:()=>se,shimRTCIceCandidateRelayProtocol:()=>ae,shimSendThrowTypeError:()=>he});var a=n(5544),c=n(9379);class h{constructor(){this.encoder=new TextEncoder,this._pieces=[],this._parts=[]}append_buffer(e){this.flush(),this._parts.push(e)}append(e){this._pieces.push(e)}flush(){if(this._pieces.length>0){const e=new Uint8Array(this._pieces);this._parts.push(e),this._pieces=[]}}toArrayBuffer(){const e=[];for(const t of this._parts)e.push(t);return function(e){let t=0;for(const i of e)t+=i.byteLength;const n=new Uint8Array(t);let r=0;for(const i of e){const e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);n.set(e,r),r+=i.byteLength}return n}(e).buffer}}function d(e){return new p(e).unpack()}function l(e){const t=new u,n=t.pack(e);return n instanceof Promise?n.then(()=>t.getBuffer()):t.getBuffer()}class p{constructor(e){this.index=0,this.dataBuffer=e,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}unpack(){const e=this.unpack_uint8();if(e<128)return e;if((224^e)<32)return(224^e)-32;let t;if((t=160^e)<=15)return this.unpack_raw(t);if((t=176^e)<=15)return this.unpack_string(t);if((t=144^e)<=15)return this.unpack_array(t);if((t=128^e)<=15)return this.unpack_map(t);switch(e){case 192:return null;case 193:case 212:case 213:case 214:case 215:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 216:return t=this.unpack_uint16(),this.unpack_string(t);case 217:return t=this.unpack_uint32(),this.unpack_string(t);case 218:return t=this.unpack_uint16(),this.unpack_raw(t);case 219:return t=this.unpack_uint32(),this.unpack_raw(t);case 220:return t=this.unpack_uint16(),this.unpack_array(t);case 221:return t=this.unpack_uint32(),this.unpack_array(t);case 222:return t=this.unpack_uint16(),this.unpack_map(t);case 223:return t=this.unpack_uint32(),this.unpack_map(t)}}unpack_uint8(){const e=255&this.dataView[this.index];return this.index++,e}unpack_uint16(){const e=this.read(2),t=256*(255&e[0])+(255&e[1]);return this.index+=2,t}unpack_uint32(){const e=this.read(4),t=256*(256*(256*e[0]+e[1])+e[2])+e[3];return this.index+=4,t}unpack_uint64(){const e=this.read(8),t=256*(256*(256*(256*(256*(256*(256*e[0]+e[1])+e[2])+e[3])+e[4])+e[5])+e[6])+e[7];return this.index+=8,t}unpack_int8(){const e=this.unpack_uint8();return e<128?e:e-256}unpack_int16(){const e=this.unpack_uint16();return e<32768?e:e-65536}unpack_int32(){const e=this.unpack_uint32();return e<2**31?e:e-2**32}unpack_int64(){const e=this.unpack_uint64();return e<2**63?e:e-2**64}unpack_raw(e){if(this.length<this.index+e)throw new Error("BinaryPackFailure: index is out of range ".concat(this.index," ").concat(e," ").concat(this.length));const t=this.dataBuffer.slice(this.index,this.index+e);return this.index+=e,t}unpack_string(e){const t=this.read(e);let n,r,i=0,o="";for(;i<e;)n=t[i],n<160?(r=n,i++):(192^n)<32?(r=(31&n)<<6|63&t[i+1],i+=2):(224^n)<16?(r=(15&n)<<12|(63&t[i+1])<<6|63&t[i+2],i+=3):(r=(7&n)<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3],i+=4),o+=String.fromCodePoint(r);return this.index+=e,o}unpack_array(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=this.unpack();return t}unpack_map(e){const t={};for(let n=0;n<e;n++){t[this.unpack()]=this.unpack()}return t}unpack_float(){const e=this.unpack_uint32();return(0===e>>31?1:-1)*(8388607&e|8388608)*2**((e>>23&255)-127-23)}unpack_double(){const e=this.unpack_uint32(),t=(e>>20&2047)-1023;return(0===e>>31?1:-1)*((1048575&e|1048576)*2**(t-20)+this.unpack_uint32()*2**(t-52))}read(e){const t=this.index;if(t+e<=this.length)return this.dataView.subarray(t,t+e);throw new Error("BinaryPackFailure: read index out of range")}}class u{getBuffer(){return this._bufferBuilder.toArrayBuffer()}pack(e){if("string"===typeof e)this.pack_string(e);else if("number"===typeof e)Math.floor(e)===e?this.pack_integer(e):this.pack_double(e);else if("boolean"===typeof e)!0===e?this._bufferBuilder.append(195):!1===e&&this._bufferBuilder.append(194);else if(void 0===e)this._bufferBuilder.append(192);else{if("object"!==typeof e)throw new Error('Type "'.concat(typeof e,'" not yet supported'));if(null===e)this._bufferBuilder.append(192);else{const t=e.constructor;if(e instanceof Array){const t=this.pack_array(e);if(t instanceof Promise)return t.then(()=>this._bufferBuilder.flush())}else if(e instanceof ArrayBuffer)this.pack_bin(new Uint8Array(e));else if("BYTES_PER_ELEMENT"in e){const t=e;this.pack_bin(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}else if(e instanceof Date)this.pack_string(e.toString());else{if(e instanceof Blob)return e.arrayBuffer().then(e=>{this.pack_bin(new Uint8Array(e)),this._bufferBuilder.flush()});if(t!=Object&&!t.toString().startsWith("class"))throw new Error('Type "'.concat(t.toString(),'" not yet supported'));{const t=this.pack_object(e);if(t instanceof Promise)return t.then(()=>this._bufferBuilder.flush())}}}}this._bufferBuilder.flush()}pack_bin(e){const t=e.length;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this._bufferBuilder.append(218),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this._bufferBuilder.append(219),this.pack_uint32(t)}this._bufferBuilder.append_buffer(e)}pack_string(e){const t=this._textEncoder.encode(e),n=t.length;if(n<=15)this.pack_uint8(176+n);else if(n<=65535)this._bufferBuilder.append(216),this.pack_uint16(n);else{if(!(n<=4294967295))throw new Error("Invalid length");this._bufferBuilder.append(217),this.pack_uint32(n)}this._bufferBuilder.append_buffer(t)}pack_array(e){const t=e.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this._bufferBuilder.append(220),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this._bufferBuilder.append(221),this.pack_uint32(t)}const n=r=>{if(r<t){const t=this.pack(e[r]);return t instanceof Promise?t.then(()=>n(r+1)):n(r+1)}};return n(0)}pack_integer(e){if(e>=-32&&e<=127)this._bufferBuilder.append(255&e);else if(e>=0&&e<=255)this._bufferBuilder.append(204),this.pack_uint8(e);else if(e>=-128&&e<=127)this._bufferBuilder.append(208),this.pack_int8(e);else if(e>=0&&e<=65535)this._bufferBuilder.append(205),this.pack_uint16(e);else if(e>=-32768&&e<=32767)this._bufferBuilder.append(209),this.pack_int16(e);else if(e>=0&&e<=4294967295)this._bufferBuilder.append(206),this.pack_uint32(e);else if(e>=-2147483648&&e<=2147483647)this._bufferBuilder.append(210),this.pack_int32(e);else if(e>=-0x8000000000000000&&e<=0x8000000000000000)this._bufferBuilder.append(211),this.pack_int64(e);else{if(!(e>=0&&e<=0x10000000000000000))throw new Error("Invalid integer");this._bufferBuilder.append(207),this.pack_uint64(e)}}pack_double(e){let t=0;e<0&&(t=1,e=-e);const n=Math.floor(Math.log(e)/Math.LN2),r=e/2**n-1,i=Math.floor(r*2**52),o=2**32,s=t<<31|n+1023<<20|i/o&1048575,a=i%o;this._bufferBuilder.append(203),this.pack_int32(s),this.pack_int32(a)}pack_object(e){const t=Object.keys(e),n=t.length;if(n<=15)this.pack_uint8(128+n);else if(n<=65535)this._bufferBuilder.append(222),this.pack_uint16(n);else{if(!(n<=4294967295))throw new Error("Invalid length");this._bufferBuilder.append(223),this.pack_uint32(n)}const r=n=>{if(n<t.length){const i=t[n];if(e.hasOwnProperty(i)){this.pack(i);const t=this.pack(e[i]);if(t instanceof Promise)return t.then(()=>r(n+1))}return r(n+1)}};return r(0)}pack_uint8(e){this._bufferBuilder.append(e)}pack_uint16(e){this._bufferBuilder.append(e>>8),this._bufferBuilder.append(255&e)}pack_uint32(e){const t=4294967295&e;this._bufferBuilder.append((4278190080&t)>>>24),this._bufferBuilder.append((16711680&t)>>>16),this._bufferBuilder.append((65280&t)>>>8),this._bufferBuilder.append(255&t)}pack_uint64(e){const t=e/2**32,n=e%2**32;this._bufferBuilder.append((4278190080&t)>>>24),this._bufferBuilder.append((16711680&t)>>>16),this._bufferBuilder.append((65280&t)>>>8),this._bufferBuilder.append(255&t),this._bufferBuilder.append((4278190080&n)>>>24),this._bufferBuilder.append((16711680&n)>>>16),this._bufferBuilder.append((65280&n)>>>8),this._bufferBuilder.append(255&n)}pack_int8(e){this._bufferBuilder.append(255&e)}pack_int16(e){this._bufferBuilder.append((65280&e)>>8),this._bufferBuilder.append(255&e)}pack_int32(e){this._bufferBuilder.append(e>>>24&255),this._bufferBuilder.append((16711680&e)>>>16),this._bufferBuilder.append((65280&e)>>>8),this._bufferBuilder.append(255&e)}pack_int64(e){const t=Math.floor(e/2**32),n=e%2**32;this._bufferBuilder.append((4278190080&t)>>>24),this._bufferBuilder.append((16711680&t)>>>16),this._bufferBuilder.append((65280&t)>>>8),this._bufferBuilder.append(255&t),this._bufferBuilder.append((4278190080&n)>>>24),this._bufferBuilder.append((16711680&n)>>>16),this._bufferBuilder.append((65280&n)>>>8),this._bufferBuilder.append(255&n)}constructor(){this._bufferBuilder=new h,this._textEncoder=new TextEncoder}}let f=!0,m=!0;function g(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseFloat(r[n],10)}function y(e,t,n){if(!e.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,"addEventListener").writable)return void C("Unable to polyfill events");const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,o),i.apply(this,[e,o])};const o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(n))return o.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(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."):(m=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function C(){if("object"===typeof window){if(f)return;"undefined"!==typeof console&&"function"===typeof console.log&&console.log.apply(console,arguments)}}function b(e,t){m&&console.warn(e+" is deprecated, please use "+t+" instead.")}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){return w(e)?Object.keys(e).reduce(function(t,n){const r=w(e[n]),i=r?S(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[n]:i})},{}):e}function T(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith("Id")?T(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach(t=>{T(e,e.get(t),n)})}))}function E(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach(e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)}),o.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&T(e,n,i)})}),i}const R=C;function P(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(e){if("object"!==typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"===typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"===typeof r.exact&&(r.min=r.max=r.exact);const 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||[];let e={};"number"===typeof r.ideal?(e[i("min",n)]=r.ideal,t.optional.push(e),e={},e[i("max",n)]=r.ideal,t.optional.push(e)):(e[i("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!==typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(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(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"===typeof e.video){let o=e.video.facingMode;o=o&&("object"===typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then(n=>{let s=(n=n.filter(e=>"videoinput"===e.kind)).find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!s&&n.length&&t.includes("back")&&(s=n[n.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=r(e.video),R("chrome: "+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return R("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.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(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(o(e))})})}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException("","NotFoundError");return e},e=>Promise.reject(o(e))))}}}function k(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function A(e,t){if(!(t.version>102))if("object"===typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else y(e,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function x(e){if("object"===typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const 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()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{const t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),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)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function I(e,t){if(t.version>=67)return;if(!("object"===typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>E(t,e.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),y(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then(t=>E(t,e.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),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 n.apply(this,arguments)}}function D(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const 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};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")});const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(e=>-1===t.indexOf(e));this._shimmedLocalStreams[e.id]=[e].concat(r)};const 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)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function M(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return D(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const 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})}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){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(e=>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(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)},["createOffer","createAnswer"].forEach(function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"===typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>o(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]});const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{const 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]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=a.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){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");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function O(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})}function U(e,t){t.version>102||y(e,"negotiationneeded",e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e})}function N(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){b("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"===typeof n&&"object"===typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"===typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function B(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function L(e){"object"===typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function F(e,t){"object"===typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)&&(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function z(e,t){if("object"!==typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;if(t.version>=151)return;const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const e=Array.prototype.slice.call(arguments),i=e[0],o=e[1],s=e[2];return"closed"===this.signalingState?Promise.resolve(new Map):r.apply(this,[i||null]).then(e=>{if(t.version<53&&!o)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(r){if("TypeError"!==r.name)throw r;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(o,s)}}function j(e){if("object"!==typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const 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 V(e){if("object"!==typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),y(e,"track",e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function H(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){b("removeStream","removeTrack"),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function W(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function K(e){if("object"!==typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach(e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=t.apply(this,arguments);if(n){const t=r.sender,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function G(e){if("object"!==typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function Y(e){if("object"!==typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function Q(e){if("object"!==typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function J(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)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r&&r.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function X(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(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function Z(e){if("object"!==typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const 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){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=a,a=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=a,a=function(e,t,n){const r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=a}function q(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n($(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function $(e){return e&&void 0!==e.video?Object.assign({},e,{video:S(e.video)}):e}function ee(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];void 0===r.urls&&r.url?(b("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function te(e){"object"===typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ne(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){"undefined"!==typeof e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find(e=>"audio"===e.receiver.track.kind);!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),"undefined"!==typeof e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find(e=>"video"===e.receiver.track.kind);!1===e.offerToReceiveVideo&&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.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function re(e){"object"!==typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var ie=n(8824),oe=n.n(ie);function se(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const 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.substring(2)),e.candidate&&e.candidate.length){const n=new t(e),r=oe().parseCandidate(e.candidate);for(const e in r)e in n||Object.defineProperty(n,e,{value:r[e]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,y(e,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t))}function ae(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||y(e,"icecandidate",e=>{if(e.candidate){const t=oe().parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function ce(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return"undefined"===typeof this._sctp?null:this._sctp}});const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get(){return"undefined"===typeof this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=oe().splitSections(e.sdp);return t.shift(),t.some(e=>{const t=oe().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!==n?-1:n}(arguments[0]),n=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n}(e),r=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=oe().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substring(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r}(arguments[0],e);let i;i=0===n&&0===r?Number.POSITIVE_INFINITY:0===n||0===r?Math.max(n,r):Math.min(n,r);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>i}),this._sctp=o}return n.apply(this,arguments)}}function he(e,t){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;if("chrome"===t.browser&&t.version>149)return;if("firefox"===t.browser&&t.version>60)return;function n(e,t){const n=e.send;e.send=function(){const 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)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return n(e,this),e},y(e,"datachannel",e=>(n(e.channel,e.target),e))}function de(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(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(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function le(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t._safariVersion>=13.1)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter(e=>"a=extmap-allow-mixed"!==e.trim()).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function pe(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ue(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!==typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);return("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then(e=>n.apply(this,[e]))})}const fe=function(){let 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,shimSafari:!0};const n=C,a=function(e){const t={browser:null,version:null};if("undefined"===typeof e||!e.navigator||!e.navigator.userAgent)return t.browser="Not a browser.",t;const n=e.navigator;if(n.userAgentData&&n.userAgentData.brands){const e=n.userAgentData.brands.find(e=>"Chromium"===e.brand);if(e)return{browser:"chrome",version:parseInt(e.version,10)}}if(n.mozGetUserMedia)t.browser="firefox",t.version=parseInt(g(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=parseInt(g(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=parseInt(g(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype,t._safariVersion=g(n.userAgent,/Version\/(\d+(\.?\d+))/,1)}return t}(e),c={browserDetails:a,commonShim:s,extractVersion:g,disableLog:v,disableWarnings:_,sdp:ie};switch(a.browser){case"chrome":if(!r||!O||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),c;if(null===a.version)return n("Chrome shim can not determine version, not shimming."),c;n("adapter.js shimming chrome."),c.browserShim=r,pe(e,a),ue(e),P(e,a),k(e),O(e,a),A(e,a),M(e,a),x(e),I(e,a),U(e,a),se(e),ae(e),de(e),ce(e,a),he(e,a),le(e,a);break;case"firefox":if(!i||!F||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),c;n("adapter.js shimming firefox."),c.browserShim=i,pe(e,a),ue(e),N(e,a),F(e,a),z(e,a),L(e),H(e),j(e),V(e),W(e),K(e),G(e),Y(e),Q(e),se(e),de(e),ce(e,a),he(e,a);break;case"safari":if(!o||!t.shimSafari)return n("Safari shim is not included in this adapter release."),c;n("adapter.js shimming safari."),c.browserShim=o,pe(e,a),ue(e),ee(e),ne(e),Z(e),J(e),X(e),te(e),q(e),re(e),se(e),ae(e),ce(e,a),he(e,a),le(e,a);break;default:n("Unsupported browser!")}return c}({window:"undefined"===typeof window?void 0:window}),me=fe;var ge,ye,ve,_e=4294967295;function Ce(e,t,n){var r=Math.floor(n/4294967296),i=n;e.setUint32(t,r),e.setUint32(t+4,i)}function be(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var we=("undefined"===typeof process||"never"!==(null===(ge=null===process||void 0===process?void 0:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_FIREBASE_API_KEY:"AIzaSyDzZxO2e-zW_QfU9RZEFy-vZ4PrjennqEU",REACT_APP_FIREBASE_AUTH_DOMAIN:"palashkantikundu.in",REACT_APP_FIREBASE_PROJECT_ID:"site-e4669",REACT_APP_FIREBASE_STORAGE_BUCKET:"site-e4669.firebasestorage.app",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"579970439825",REACT_APP_FIREBASE_APP_ID:"G-7BPQKTD1TT",REACT_APP_ENV:""})||void 0===ge?void 0:ge.TEXT_ENCODING))&&"undefined"!==typeof TextEncoder&&"undefined"!==typeof TextDecoder;function Se(e){for(var t=e.length,n=0,r=0;r<t;){var i=e.charCodeAt(r++);if(0!==(4294967168&i))if(0===(4294965248&i))n+=2;else{if(i>=55296&&i<=56319&&r<t){var o=e.charCodeAt(r);56320===(64512&o)&&(++r,i=((1023&i)<<10)+(1023&o)+65536)}n+=0===(4294901760&i)?3:4}else n++}return n}var Te=we?new TextEncoder:void 0,Ee=we?"undefined"!==typeof process&&"force"!==(null===(ye=null===process||void 0===process?void 0:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_FIREBASE_API_KEY:"AIzaSyDzZxO2e-zW_QfU9RZEFy-vZ4PrjennqEU",REACT_APP_FIREBASE_AUTH_DOMAIN:"palashkantikundu.in",REACT_APP_FIREBASE_PROJECT_ID:"site-e4669",REACT_APP_FIREBASE_STORAGE_BUCKET:"site-e4669.firebasestorage.app",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"579970439825",REACT_APP_FIREBASE_APP_ID:"G-7BPQKTD1TT",REACT_APP_ENV:""})||void 0===ye?void 0:ye.TEXT_ENCODING)?200:0:_e;var Re=(null===Te||void 0===Te?void 0:Te.encodeInto)?function(e,t,n){Te.encodeInto(e,t.subarray(n))}:function(e,t,n){t.set(Te.encode(e),n)};function Pe(e,t,n){for(var r=t,i=r+n,o=[],s="";r<i;){var a=e[r++];if(0===(128&a))o.push(a);else if(192===(224&a)){var c=63&e[r++];o.push((31&a)<<6|c)}else if(224===(240&a)){c=63&e[r++];var h=63&e[r++];o.push((31&a)<<12|c<<6|h)}else if(240===(248&a)){var d=(7&a)<<18|(c=63&e[r++])<<12|(h=63&e[r++])<<6|63&e[r++];d>65535&&(d-=65536,o.push(d>>>10&1023|55296),d=56320|1023&d),o.push(d)}else o.push(a);o.length>=4096&&(s+=String.fromCharCode.apply(String,o),o.length=0)}return o.length>0&&(s+=String.fromCharCode.apply(String,o)),s}var ke=we?new TextDecoder:null,Ae=we?"undefined"!==typeof process&&"force"!==(null===(ve=null===process||void 0===process?void 0:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_FIREBASE_API_KEY:"AIzaSyDzZxO2e-zW_QfU9RZEFy-vZ4PrjennqEU",REACT_APP_FIREBASE_AUTH_DOMAIN:"palashkantikundu.in",REACT_APP_FIREBASE_PROJECT_ID:"site-e4669",REACT_APP_FIREBASE_STORAGE_BUCKET:"site-e4669.firebasestorage.app",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"579970439825",REACT_APP_FIREBASE_APP_ID:"G-7BPQKTD1TT",REACT_APP_ENV:""})||void 0===ve?void 0:ve.TEXT_DECODER)?200:0:_e;var xe=function(e,t){this.type=e,this.data=t},Ie=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),De=function(e){function t(n){var r=e.call(this,n)||this,i=Object.create(t.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:t.name}),r}return Ie(t,e),t}(Error);var Me={type:-1,encode:function(e){return e instanceof Date?function(e){var t,n=e.sec,r=e.nsec;if(n>=0&&r>=0&&n<=17179869183){if(0===r&&n<=4294967295){var i=new Uint8Array(4);return(t=new DataView(i.buffer)).setUint32(0,n),i}var o=n/4294967296,s=4294967295&n;return i=new Uint8Array(8),(t=new DataView(i.buffer)).setUint32(0,r<<2|3&o),t.setUint32(4,s),i}return i=new Uint8Array(12),(t=new DataView(i.buffer)).setUint32(0,r),Ce(t,4,n),i}(function(e){var t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),i=Math.floor(r/1e9);return{sec:n+i,nsec:r-1e9*i}}(e)):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:be(t,4),nsec:t.getUint32(0)};default:throw new De("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},Oe=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Me)}return e.prototype.register=function(e){var t=e.type,n=e.encode,r=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{var i=1+t;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}},e.prototype.tryToEncode=function(e,t){for(var n=0;n<this.builtInEncoders.length;n++){if(null!=(r=this.builtInEncoders[n]))if(null!=(i=r(e,t)))return new xe(-1-n,i)}for(n=0;n<this.encoders.length;n++){var r,i;if(null!=(r=this.encoders[n]))if(null!=(i=r(e,t)))return new xe(n,i)}return e instanceof xe?e:null},e.prototype.decode=function(e,t,n){var r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,n):new xe(t,e)},e.defaultCodec=new e,e}();function Ue(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}!function(){function e(e,t,n,r,i,o,s,a){void 0===e&&(e=Oe.defaultCodec),void 0===t&&(t=void 0),void 0===n&&(n=100),void 0===r&&(r=2048),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=!1),this.extensionCodec=e,this.context=t,this.maxDepth=n,this.initialBufferSize=r,this.sortKeys=i,this.forceFloat32=o,this.ignoreUndefined=s,this.forceIntegerToFloat=a,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"===typeof e?this.encodeBoolean(e):"number"===typeof e?this.encodeNumber(e):"string"===typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),n=new Uint8Array(t),r=new DataView(t);n.set(this.bytes),this.view=r,this.bytes=n},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){Number.isSafeInteger(e)&&!this.forceIntegerToFloat?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>Ee){var t=Se(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),Re(e,this.bytes,this.pos),this.pos+=t}else{t=Se(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var r=e.length,i=n,o=0;o<r;){var s=e.charCodeAt(o++);if(0!==(4294967168&s)){if(0===(4294965248&s))t[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&o<r){var a=e.charCodeAt(o);56320===(64512&a)&&(++o,s=((1023&s)<<10)+(1023&a)+65536)}0===(4294901760&s)?(t[i++]=s>>12&15|224,t[i++]=s>>6&63|128):(t[i++]=s>>18&7|240,t[i++]=s>>12&63|128,t[i++]=s>>6&63|128)}t[i++]=63&s|128}else t[i++]=s}}(e,this.bytes,this.pos),this.pos+=t}},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!==typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=Ue(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var r=0,i=e;r<i.length;r++){var o=i[r];this.doEncode(o,t+1)}},e.prototype.countWithoutUndefined=function(e,t){for(var n=0,r=0,i=t;r<i.length;r++){void 0!==e[i[r]]&&n++}return n},e.prototype.encodeMap=function(e,t){var n=Object.keys(e);this.sortKeys&&n.sort();var r=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else{if(!(r<4294967296))throw new Error("Too large map object: ".concat(r));this.writeU8(223),this.writeU32(r)}for(var i=0,o=n;i<o.length;i++){var s=o[i],a=e[s];this.ignoreUndefined&&void 0===a||(this.encodeString(s),this.doEncode(a,t+1))}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: ".concat(t));this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,n){var r=n/4294967296,i=n;e.setUint32(t,r),e.setUint32(t+4,i)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),Ce(this.view,this.pos,e),this.pos+=8}}();function Ne(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var Be=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var n=0;n<this.maxKeyLength;n++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var r=0,i=this.caches[n-1];r<i.length;r++){for(var o=i[r],s=o.bytes,a=0;a<n;a++)if(s[a]!==e[t+a])continue e;return o.str}return null},e.prototype.store=function(e,t){var n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)},e.prototype.decode=function(e,t,n){var r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;var i=Pe(e,t,n),o=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(o,i),i},e}(),Le=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},Fe=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ze=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"===typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,i,(t=e[n](t)).done,t.value)})}}},je=function(e){return this instanceof je?(this.v=e,this):new je(e)},Ve=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{(n=i[e](t)).value instanceof je?Promise.resolve(n.value.v).then(c,h):d(o[0][2],n)}catch(r){d(o[0][3],r)}var n}function c(e){a("next",e)}function h(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},He=function(e){var t=typeof e;return"string"===t||"number"===t},We=new DataView(new ArrayBuffer(0)),Ke=new Uint8Array(We.buffer),Ge=function(){try{We.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")}(),Ye=new Ge("Insufficient data"),Qe=new Be;!function(){function e(e,t,n,r,i,o,s,a){void 0===e&&(e=Oe.defaultCodec),void 0===t&&(t=void 0),void 0===n&&(n=_e),void 0===r&&(r=_e),void 0===i&&(i=_e),void 0===o&&(o=_e),void 0===s&&(s=_e),void 0===a&&(a=Qe),this.extensionCodec=e,this.context=t,this.maxStrLength=n,this.maxBinLength=r,this.maxArrayLength=i,this.maxMapLength=o,this.maxExtLength=s,this.keyDecoder=a,this.totalPos=0,this.pos=0,this.view=We,this.bytes=Ke,this.headByte=-1,this.stack=[]}e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.length=0},e.prototype.setBuffer=function(e){this.bytes=Ue(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=Ue(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),n=Ue(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return Fe(this,function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}})},e.prototype.decodeAsync=function(e){var t,n,r,i;return Le(this,void 0,void 0,function(){var o,s,a,c,h,d,l,p;return Fe(this,function(u){switch(u.label){case 0:o=!1,u.label=1;case 1:u.trys.push([1,6,7,12]),t=ze(e),u.label=2;case 2:return[4,t.next()];case 3:if((n=u.sent()).done)return[3,5];if(a=n.value,o)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),o=!0}catch(f){if(!(f instanceof Ge))throw f}this.totalPos+=this.pos,u.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=u.sent(),r={error:c},[3,12];case 7:return u.trys.push([7,,10,11]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,9];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(o){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw d=(h=this).headByte,l=h.pos,p=h.totalPos,new RangeError("Insufficient data in parsing ".concat(Ne(d)," at ").concat(p," (").concat(l," in the current buffer)"))}})})},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return Ve(this,arguments,function(){var n,r,i,o,s,a,c,h,d;return Fe(this,function(l){switch(l.label){case 0:n=t,r=-1,l.label=1;case 1:l.trys.push([1,13,14,19]),i=ze(e),l.label=2;case 2:return[4,je(i.next())];case 3:if((o=l.sent()).done)return[3,12];if(s=o.value,t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(r=this.readArraySize(),n=!1,this.complete()),l.label=4;case 4:l.trys.push([4,9,,10]),l.label=5;case 5:return[4,je(this.doDecodeSync())];case 6:return[4,l.sent()];case 7:return l.sent(),0===--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=l.sent())instanceof Ge))throw a;return[3,10];case 10:this.totalPos+=this.pos,l.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=l.sent(),h={error:c},[3,19];case 14:return l.trys.push([14,,17,18]),o&&!o.done&&(d=i.return)?[4,je(d.call(i))]:[3,16];case 15:l.sent(),l.label=16;case 16:return[3,18];case 17:if(h)throw h.error;return[7];case 18:return[7];case 19:return[2]}})})},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!==(r=e-128)){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){if(0!==(r=e-144)){this.pushArrayState(r),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e){n=this.lookU8();t=this.decodeUtf8String(n,1)}else if(218===e){n=this.lookU16();t=this.decodeUtf8String(n,2)}else if(219===e){n=this.lookU32();t=this.decodeUtf8String(n,4)}else if(220===e){if(0!==(r=this.readU16())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(221===e){if(0!==(r=this.readU32())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(222===e){if(0!==(r=this.readU16())){this.pushMapState(r),this.complete();continue e}t={}}else if(223===e){if(0!==(r=this.readU32())){this.pushMapState(r),this.complete();continue e}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e){r=this.lookU16();t=this.decodeBinary(r,2)}else if(198===e){r=this.lookU32();t=this.decodeBinary(r,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){r=this.lookU8();t=this.decodeExtension(r,1)}else if(200===e){r=this.lookU16();t=this.decodeExtension(r,2)}else{if(201!==e)throw new De("Unrecognized type byte: ".concat(Ne(e)));r=this.lookU32();t=this.decodeExtension(r,4)}this.complete();for(var i=this.stack;i.length>0;){var o=i[i.length-1];if(0===o.type){if(o.array[o.position]=t,o.position++,o.position!==o.size)continue e;i.pop(),t=o.array}else{if(1===o.type){if(!He(t))throw new De("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new De("The key __proto__ is not allowed");o.key=t,o.type=2;continue e}if(o.map[o.key]=t,o.readCount++,o.readCount!==o.size){o.key=null,o.type=1;continue e}i.pop(),t=o.map}}return t}},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new De("Unrecognized array type byte: ".concat(Ne(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new De("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new De("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new De("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw Ye;var r,i=this.pos+t;return r=this.stateIsMapKey()&&(null===(n=this.keyDecoder)||void 0===n?void 0:n.canBeCached(e))?this.keyDecoder.decode(this.bytes,i,e):e>Ae?function(e,t,n){var r=e.subarray(t,t+n);return ke.decode(r)}(this.bytes,i,e):Pe(this.bytes,i,e),this.pos+=t+e,r},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new De("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Ye;var n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new De("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=be(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e}}();var Je;function Xe(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}class Ze{constructor(){this.chunkedMTU=16300,this._dataCount=1,this.chunk=e=>{const t=[],n=e.byteLength,r=Math.ceil(n/this.chunkedMTU);let i=0,o=0;for(;o<n;){const s=Math.min(n,o+this.chunkedMTU),a=e.slice(o,s),c={__peerData:this._dataCount,n:i,data:a,total:r};t.push(c),o=s,i++}return this._dataCount++,t}}}function qe(e){let t=0;for(const i of e)t+=i.byteLength;const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.byteLength;return n}const $e=me.default||me,et=new class{isWebRTCSupported(){return"undefined"!==typeof RTCPeerConnection}isBrowserSupported(){const e=this.getBrowser(),t=this.getVersion();return!!this.supportedBrowsers.includes(e)&&("chrome"===e?t>=this.minChromeVersion:"firefox"===e?t>=this.minFirefoxVersion:"safari"===e&&(!this.isIOS&&t>=this.minSafariVersion))}getBrowser(){return $e.browserDetails.browser}getVersion(){return $e.browserDetails.version||0}isUnifiedPlanSupported(){const e=this.getBrowser(),t=$e.browserDetails.version||0;if("chrome"===e&&t<this.minChromeVersion)return!1;if("firefox"===e&&t>=this.minFirefoxVersion)return!0;if(!window.RTCRtpTransceiver||!("currentDirection"in RTCRtpTransceiver.prototype))return!1;let n,r=!1;try{n=new RTCPeerConnection,n.addTransceiver("audio"),r=!0}catch(i){}finally{n&&n.close()}return r}toString(){return"Supports:\n    browser:".concat(this.getBrowser(),"\n    version:").concat(this.getVersion(),"\n    isIOS:").concat(this.isIOS,"\n    isWebRTCSupported:").concat(this.isWebRTCSupported(),"\n    isBrowserSupported:").concat(this.isBrowserSupported(),"\n    isUnifiedPlanSupported:").concat(this.isUnifiedPlanSupported())}constructor(){this.isIOS="undefined"!==typeof navigator&&["iPad","iPhone","iPod"].includes(navigator.platform),this.supportedBrowsers=["firefox","chrome","safari"],this.minFirefoxVersion=59,this.minChromeVersion=72,this.minSafariVersion=605}},tt=e=>!e||/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(e),nt=()=>Math.random().toString(36).slice(2),rt={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:["turn:eu-0.turn.peerjs.com:3478","turn:us-0.turn.peerjs.com:3478"],username:"peerjs",credential:"peerjsp"}],sdpSemantics:"unified-plan"};const it=new class extends Ze{noop(){}blobToArrayBuffer(e,t){const n=new FileReader;return n.onload=function(e){e.target&&t(e.target.result)},n.readAsArrayBuffer(e),n}binaryStringToArrayBuffer(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer}isSecure(){return"https:"===location.protocol}constructor(){super(...arguments),this.CLOUD_HOST="0.peerjs.com",this.CLOUD_PORT=443,this.chunkedBrowsers={Chrome:1,chrome:1},this.defaultConfig=rt,this.browser=et.getBrowser(),this.browserVersion=et.getVersion(),this.pack=l,this.unpack=d,this.supports=function(){const e={browser:et.isBrowserSupported(),webRTC:et.isWebRTCSupported(),audioVideo:!1,data:!1,binaryBlob:!1,reliable:!1};if(!e.webRTC)return e;let t;try{let r;t=new RTCPeerConnection(rt),e.audioVideo=!0;try{r=t.createDataChannel("_PEERJSTEST",{ordered:!0}),e.data=!0,e.reliable=!!r.ordered;try{r.binaryType="blob",e.binaryBlob=!et.isIOS}catch(n){}}catch(n){}finally{r&&r.close()}}catch(n){}finally{t&&t.close()}return e}(),this.validateId=tt,this.randomToken=nt}};var ot,st=new class{get logLevel(){return this._logLevel}set logLevel(e){this._logLevel=e}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._logLevel>=3&&this._print(3,...t)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._logLevel>=2&&this._print(2,...t)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._logLevel>=1&&this._print(1,...t)}setLogFunction(e){this._print=e}_print(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=["PeerJS: ",...n];for(const o in i)i[o]instanceof Error&&(i[o]="("+i[o].name+") "+i[o].message);e>=3?console.log(...i):e>=2?console.warn("WARNING",...i):e>=1&&console.error("ERROR",...i)}constructor(){this._logLevel=0}},at=Object.prototype.hasOwnProperty,ct="~";function ht(){}function dt(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function lt(e,t,n,r,i){if("function"!==typeof n)throw new TypeError("The listener must be a function");var o=new dt(n,r||e,i),s=ct?ct+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function pt(e,t){0===--e._eventsCount?e._events=new ht:delete e._events[t]}function ut(){this._events=new ht,this._eventsCount=0}Object.create&&(ht.prototype=Object.create(null),(new ht).__proto__||(ct=!1)),ut.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)at.call(e,t)&&n.push(ct?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},ut.prototype.listeners=function(e){var t=ct?ct+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,o=new Array(i);r<i;r++)o[r]=n[r].fn;return o},ut.prototype.listenerCount=function(e){var t=ct?ct+e:e,n=this._events[t];return n?n.fn?1:n.length:0},ut.prototype.emit=function(e,t,n,r,i,o){var s=ct?ct+e:e;if(!this._events[s])return!1;var a,c,h=this._events[s],d=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),d){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,n),!0;case 4:return h.fn.call(h.context,t,n,r),!0;case 5:return h.fn.call(h.context,t,n,r,i),!0;case 6:return h.fn.call(h.context,t,n,r,i,o),!0}for(c=1,a=new Array(d-1);c<d;c++)a[c-1]=arguments[c];h.fn.apply(h.context,a)}else{var l,p=h.length;for(c=0;c<p;c++)switch(h[c].once&&this.removeListener(e,h[c].fn,void 0,!0),d){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,t);break;case 3:h[c].fn.call(h[c].context,t,n);break;case 4:h[c].fn.call(h[c].context,t,n,r);break;default:if(!a)for(l=1,a=new Array(d-1);l<d;l++)a[l-1]=arguments[l];h[c].fn.apply(h[c].context,a)}}return!0},ut.prototype.on=function(e,t,n){return lt(this,e,t,n,!1)},ut.prototype.once=function(e,t,n){return lt(this,e,t,n,!0)},ut.prototype.removeListener=function(e,t,n,r){var i=ct?ct+e:e;if(!this._events[i])return this;if(!t)return pt(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||r&&!o.once||n&&o.context!==n||pt(this,i);else{for(var s=0,a=[],c=o.length;s<c;s++)(o[s].fn!==t||r&&!o[s].once||n&&o[s].context!==n)&&a.push(o[s]);a.length?this._events[i]=1===a.length?a[0]:a:pt(this,i)}return this},ut.prototype.removeAllListeners=function(e){var t;return e?(t=ct?ct+e:e,this._events[t]&&pt(this,t)):(this._events=new ht,this._eventsCount=0),this},ut.prototype.off=ut.prototype.removeListener,ut.prototype.addListener=ut.prototype.on,ut.prefixed=ct,ut.EventEmitter=ut,ot=ut;var ft={};Xe(ft,"ConnectionType",()=>mt),Xe(ft,"PeerErrorType",()=>gt),Xe(ft,"BaseConnectionErrorType",()=>yt),Xe(ft,"DataConnectionErrorType",()=>vt),Xe(ft,"SerializationType",()=>_t),Xe(ft,"SocketEventType",()=>Ct),Xe(ft,"ServerMessageType",()=>bt);var mt=function(e){return e.Data="data",e.Media="media",e}({}),gt=function(e){return e.BrowserIncompatible="browser-incompatible",e.Disconnected="disconnected",e.InvalidID="invalid-id",e.InvalidKey="invalid-key",e.Network="network",e.PeerUnavailable="peer-unavailable",e.SslUnavailable="ssl-unavailable",e.ServerError="server-error",e.SocketError="socket-error",e.SocketClosed="socket-closed",e.UnavailableID="unavailable-id",e.WebRTC="webrtc",e}({}),yt=function(e){return e.NegotiationFailed="negotiation-failed",e.ConnectionClosed="connection-closed",e}({}),vt=function(e){return e.NotOpenYet="not-open-yet",e.MessageToBig="message-too-big",e}({}),_t=function(e){return e.Binary="binary",e.BinaryUTF8="binary-utf8",e.JSON="json",e.None="raw",e}({}),Ct=function(e){return e.Message="message",e.Disconnected="disconnected",e.Error="error",e.Close="close",e}({}),bt=function(e){return e.Heartbeat="HEARTBEAT",e.Candidate="CANDIDATE",e.Offer="OFFER",e.Answer="ANSWER",e.Open="OPEN",e.Error="ERROR",e.IdTaken="ID-TAKEN",e.InvalidKey="INVALID-KEY",e.Leave="LEAVE",e.Expire="EXPIRE",e}({});const wt="1.5.5";class St extends ot.EventEmitter{constructor(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5e3;super(),this.pingInterval=o,this._disconnected=!0,this._messagesQueue=[];const s=e?"wss://":"ws://";this._baseUrl=s+t+":"+n+r+"peerjs?key="+i}start(e,t){this._id=e;const n="".concat(this._baseUrl,"&id=").concat(e,"&token=").concat(t);!this._socket&&this._disconnected&&(this._socket=new WebSocket(n+"&version="+wt),this._disconnected=!1,this._socket.onmessage=e=>{let t;try{t=JSON.parse(e.data),st.log("Server message received:",t)}catch(n){return void st.log("Invalid server message",e.data)}this.emit(Ct.Message,t)},this._socket.onclose=e=>{this._disconnected||(st.log("Socket closed.",e),this._cleanup(),this._disconnected=!0,this.emit(Ct.Disconnected))},this._socket.onopen=()=>{this._disconnected||(this._sendQueuedMessages(),st.log("Socket open"),this._scheduleHeartbeat())})}_scheduleHeartbeat(){this._wsPingTimer=setTimeout(()=>{this._sendHeartbeat()},this.pingInterval)}_sendHeartbeat(){if(!this._wsOpen())return void st.log("Cannot send heartbeat, because socket closed");const e=JSON.stringify({type:bt.Heartbeat});this._socket.send(e),this._scheduleHeartbeat()}_wsOpen(){return!!this._socket&&1===this._socket.readyState}_sendQueuedMessages(){const e=[...this._messagesQueue];this._messagesQueue=[];for(const t of e)this.send(t)}send(e){if(this._disconnected)return;if(!this._id)return void this._messagesQueue.push(e);if(!e.type)return void this.emit(Ct.Error,"Invalid message");if(!this._wsOpen())return;const t=JSON.stringify(e);this._socket.send(t)}close(){this._disconnected||(this._cleanup(),this._disconnected=!0)}_cleanup(){this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(),this._socket=void 0),clearTimeout(this._wsPingTimer)}}class Tt{constructor(e){this.connection=e}startConnection(e){const t=this._startPeerConnection();if(this.connection.peerConnection=t,this.connection.type===mt.Media&&e._stream&&this._addTracksToConnection(e._stream,t),e.originator){const n=this.connection,r={ordered:!!e.reliable},i=t.createDataChannel(n.label,r);n._initializeDataChannel(i),this._makeOffer()}else this.handleSDP("OFFER",e.sdp)}_startPeerConnection(){st.log("Creating RTCPeerConnection.");const e=new RTCPeerConnection(this.connection.provider.options.config);return this._setupListeners(e),e}_setupListeners(e){const t=this.connection.peer,n=this.connection.connectionId,r=this.connection.type,i=this.connection.provider;st.log("Listening for ICE candidates."),e.onicecandidate=e=>{e.candidate&&e.candidate.candidate&&(st.log("Received ICE candidates for ".concat(t,":"),e.candidate),i.socket.send({type:bt.Candidate,payload:{candidate:e.candidate,type:r,connectionId:n},dst:t}))},e.oniceconnectionstatechange=()=>{switch(e.iceConnectionState){case"failed":st.log("iceConnectionState is failed, closing connections to "+t),this.connection.emitError(yt.NegotiationFailed,"Negotiation of connection to "+t+" failed."),this.connection.close();break;case"closed":st.log("iceConnectionState is closed, closing connections to "+t),this.connection.emitError(yt.ConnectionClosed,"Connection to "+t+" closed."),this.connection.close();break;case"disconnected":st.log("iceConnectionState changed to disconnected on the connection with "+t);break;case"completed":e.onicecandidate=()=>{}}this.connection.emit("iceStateChanged",e.iceConnectionState)},st.log("Listening for data channel"),e.ondatachannel=e=>{st.log("Received data channel");const r=e.channel;i.getConnection(t,n)._initializeDataChannel(r)},st.log("Listening for remote stream"),e.ontrack=e=>{st.log("Received remote stream");const r=e.streams[0],o=i.getConnection(t,n);if(o.type===mt.Media){const e=o;this._addStreamToMediaConnection(r,e)}}}cleanup(){st.log("Cleaning up PeerConnection to "+this.connection.peer);const e=this.connection.peerConnection;if(!e)return;this.connection.peerConnection=null,e.onicecandidate=e.oniceconnectionstatechange=e.ondatachannel=e.ontrack=()=>{};const t="closed"!==e.signalingState;let n=!1;const r=this.connection.dataChannel;r&&(n=!!r.readyState&&"closed"!==r.readyState),(t||n)&&e.close()}async _makeOffer(){const e=this.connection.peerConnection,t=this.connection.provider;try{const r=await e.createOffer(this.connection.options.constraints);st.log("Created offer."),this.connection.options.sdpTransform&&"function"===typeof this.connection.options.sdpTransform&&(r.sdp=this.connection.options.sdpTransform(r.sdp)||r.sdp);try{await e.setLocalDescription(r),st.log("Set localDescription:",r,"for:".concat(this.connection.peer));let n={sdp:r,type:this.connection.type,connectionId:this.connection.connectionId,metadata:this.connection.metadata};if(this.connection.type===mt.Data){const e=this.connection;n=(0,c.A)((0,c.A)({},n),{},{label:e.label,reliable:e.reliable,serialization:e.serialization})}t.socket.send({type:bt.Offer,payload:n,dst:this.connection.peer})}catch(n){"OperationError: Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer"!=n&&(t.emitError(gt.WebRTC,n),st.log("Failed to setLocalDescription, ",n))}}catch(r){t.emitError(gt.WebRTC,r),st.log("Failed to createOffer, ",r)}}async _makeAnswer(){const e=this.connection.peerConnection,t=this.connection.provider;try{const r=await e.createAnswer();st.log("Created answer."),this.connection.options.sdpTransform&&"function"===typeof this.connection.options.sdpTransform&&(r.sdp=this.connection.options.sdpTransform(r.sdp)||r.sdp);try{await e.setLocalDescription(r),st.log("Set localDescription:",r,"for:".concat(this.connection.peer)),t.socket.send({type:bt.Answer,payload:{sdp:r,type:this.connection.type,connectionId:this.connection.connectionId},dst:this.connection.peer})}catch(n){t.emitError(gt.WebRTC,n),st.log("Failed to setLocalDescription, ",n)}}catch(r){t.emitError(gt.WebRTC,r),st.log("Failed to create answer, ",r)}}async handleSDP(e,t){t=new RTCSessionDescription(t);const n=this.connection.peerConnection,r=this.connection.provider;st.log("Setting remote description",t);const i=this;try{await n.setRemoteDescription(t),st.log("Set remoteDescription:".concat(e," for:").concat(this.connection.peer)),"OFFER"===e&&await i._makeAnswer()}catch(o){r.emitError(gt.WebRTC,o),st.log("Failed to setRemoteDescription, ",o)}}async handleCandidate(e){st.log("handleCandidate:",e);try{await this.connection.peerConnection.addIceCandidate(e),st.log("Added ICE candidate for:".concat(this.connection.peer))}catch(t){this.connection.provider.emitError(gt.WebRTC,t),st.log("Failed to handleCandidate, ",t)}}_addTracksToConnection(e,t){if(st.log("add tracks from stream ".concat(e.id," to peer connection")),!t.addTrack)return st.error("Your browser does't support RTCPeerConnection#addTrack. Ignored.");e.getTracks().forEach(n=>{t.addTrack(n,e)})}_addStreamToMediaConnection(e,t){st.log("add stream ".concat(e.id," to media connection ").concat(t.connectionId)),t.addStream(e)}}class Et extends ot.EventEmitter{emitError(e,t){st.error("Error:",t),this.emit("error",new Rt("".concat(e),t))}}class Rt extends Error{constructor(e,t){"string"===typeof t?super(t):(super(),Object.assign(this,t)),this.type=e}}class Pt extends Et{get open(){return this._open}constructor(e,t,n){super(),this.peer=e,this.provider=t,this.options=n,this._open=!1,this.metadata=n.metadata}}class kt extends Pt{get type(){return mt.Media}get localStream(){return this._localStream}get remoteStream(){return this._remoteStream}constructor(e,t,n){super(e,t,n),this._localStream=this.options._stream,this.connectionId=this.options.connectionId||kt.ID_PREFIX+it.randomToken(),this._negotiator=new Tt(this),this._localStream&&this._negotiator.startConnection({_stream:this._localStream,originator:!0})}_initializeDataChannel(e){this.dataChannel=e,this.dataChannel.onopen=()=>{st.log("DC#".concat(this.connectionId," dc connection success")),this.emit("willCloseOnRemote")},this.dataChannel.onclose=()=>{st.log("DC#".concat(this.connectionId," dc closed for:"),this.peer),this.close()}}addStream(e){st.log("Receiving stream",e),this._remoteStream=e,super.emit("stream",e)}handleMessage(e){const t=e.type,n=e.payload;switch(e.type){case bt.Answer:this._negotiator.handleSDP(t,n.sdp),this._open=!0;break;case bt.Candidate:this._negotiator.handleCandidate(n.candidate);break;default:st.warn("Unrecognized message type:".concat(t," from peer:").concat(this.peer))}}answer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._localStream)return void st.warn("Local stream already exists on this MediaConnection. Are you answering a call twice?");this._localStream=e,t&&t.sdpTransform&&(this.options.sdpTransform=t.sdpTransform),this._negotiator.startConnection((0,c.A)((0,c.A)({},this.options._payload),{},{_stream:e}));const n=this.provider._getMessages(this.connectionId);for(const r of n)this.handleMessage(r);this._open=!0}close(){this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this._localStream=null,this._remoteStream=null,this.provider&&(this.provider._removeConnection(this),this.provider=null),this.options&&this.options._stream&&(this.options._stream=null),this.open&&(this._open=!1,super.emit("close"))}}kt.ID_PREFIX="mc_";class At{constructor(e){this._options=e}_buildRequest(e){const t=this._options.secure?"https":"http",n=this._options,r=n.host,i=n.port,o=n.path,s=n.key,a=new URL("".concat(t,"://").concat(r,":").concat(i).concat(o).concat(s,"/").concat(e));return a.searchParams.set("ts","".concat(Date.now()).concat(Math.random())),a.searchParams.set("version",wt),fetch(a.href,{referrerPolicy:this._options.referrerPolicy})}async retrieveId(){try{const e=await this._buildRequest("id");if(200!==e.status)throw new Error("Error. Status:".concat(e.status));return e.text()}catch(e){st.error("Error retrieving ID",e);let t="";throw"/"===this._options.path&&this._options.host!==it.CLOUD_HOST&&(t=" If you passed in a `path` to your self-hosted PeerServer, you'll also need to pass in that same path when creating a new Peer."),new Error("Could not get an ID from the server."+t)}}async listAllPeers(){try{const e=await this._buildRequest("peers");if(200!==e.status){if(401===e.status){let e="";throw e=this._options.host===it.CLOUD_HOST?"It looks like you're using the cloud server. You can email team@peerjs.com to enable peer listing for your API key.":"You need to enable `allow_discovery` on your self-hosted PeerServer to use this feature.",new Error("It doesn't look like you have permission to list peers IDs. "+e)}throw new Error("Error. Status:".concat(e.status))}return e.json()}catch(e){throw st.error("Error retrieving list peers",e),new Error("Could not get list peers from the server."+e)}}}class xt extends Pt{get type(){return mt.Data}constructor(e,t,n){super(e,t,n),this.connectionId=this.options.connectionId||xt.ID_PREFIX+nt(),this.label=this.options.label||this.connectionId,this.reliable=!!this.options.reliable,this._negotiator=new Tt(this),this._negotiator.startConnection(this.options._payload||{originator:!0,reliable:this.reliable})}_initializeDataChannel(e){this.dataChannel=e,this.dataChannel.onopen=()=>{st.log("DC#".concat(this.connectionId," dc connection success")),this._open=!0,this.emit("open")},this.dataChannel.onmessage=e=>{st.log("DC#".concat(this.connectionId," dc onmessage:"),e.data)},this.dataChannel.onclose=()=>{st.log("DC#".concat(this.connectionId," dc closed for:"),this.peer),this.close()}}close(e){null!==e&&void 0!==e&&e.flush?this.send({__peerData:{type:"close"}}):(this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this.provider&&(this.provider._removeConnection(this),this.provider=null),this.dataChannel&&(this.dataChannel.onopen=null,this.dataChannel.onmessage=null,this.dataChannel.onclose=null,this.dataChannel=null),this.open&&(this._open=!1,super.emit("close")))}send(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.open)return this._send(e,t);this.emitError(vt.NotOpenYet,"Connection is not open. You should listen for the `open` event before sending messages.")}async handleMessage(e){const t=e.payload;switch(e.type){case bt.Answer:await this._negotiator.handleSDP(e.type,t.sdp);break;case bt.Candidate:await this._negotiator.handleCandidate(t.candidate);break;default:st.warn("Unrecognized message type:",e.type,"from peer:",this.peer)}}}(Je=xt).ID_PREFIX="dc_",Je.MAX_BUFFERED_AMOUNT=8388608;class It extends xt{get bufferSize(){return this._bufferSize}_initializeDataChannel(e){super._initializeDataChannel(e),this.dataChannel.binaryType="arraybuffer",this.dataChannel.addEventListener("message",e=>this._handleDataMessage(e))}_bufferedSend(e){!this._buffering&&this._trySend(e)||(this._buffer.push(e),this._bufferSize=this._buffer.length)}_trySend(e){if(!this.open)return!1;if(this.dataChannel.bufferedAmount>xt.MAX_BUFFERED_AMOUNT)return this._buffering=!0,setTimeout(()=>{this._buffering=!1,this._tryBuffer()},50),!1;try{this.dataChannel.send(e)}catch(t){return st.error("DC#:".concat(this.connectionId," Error when sending:"),t),this._buffering=!0,this.close(),!1}return!0}_tryBuffer(){if(!this.open)return;if(0===this._buffer.length)return;const e=this._buffer[0];this._trySend(e)&&(this._buffer.shift(),this._bufferSize=this._buffer.length,this._tryBuffer())}close(e){null!==e&&void 0!==e&&e.flush?this.send({__peerData:{type:"close"}}):(this._buffer=[],this._bufferSize=0,super.close())}constructor(){super(...arguments),this._buffer=[],this._bufferSize=0,this._buffering=!1}}class Dt extends It{close(e){super.close(e),this._chunkedData={}}constructor(e,t,n){super(e,t,n),this.chunker=new Ze,this.serialization=_t.Binary,this._chunkedData={}}_handleDataMessage(e){const t=d(e.data),n=t.__peerData;if(n)return"close"===n.type?void this.close():void this._handleChunk(t);this.emit("data",t)}_handleChunk(e){const t=e.__peerData,n=this._chunkedData[t]||{data:[],count:0,total:e.total};if(n.data[e.n]=new Uint8Array(e.data),n.count++,this._chunkedData[t]=n,n.total===n.count){delete this._chunkedData[t];const e=qe(n.data);this._handleDataMessage({data:e})}}_send(e,t){const n=l(e);if(n instanceof Promise)return this._send_blob(n);!t&&n.byteLength>this.chunker.chunkedMTU?this._sendChunks(n):this._bufferedSend(n)}async _send_blob(e){const t=await e;t.byteLength>this.chunker.chunkedMTU?this._sendChunks(t):this._bufferedSend(t)}_sendChunks(e){const t=this.chunker.chunk(e);st.log("DC#".concat(this.connectionId," Try to send ").concat(t.length," chunks..."));for(const n of t)this.send(n,!0)}}class Mt extends It{_handleDataMessage(e){let t=e.data;super.emit("data",t)}_send(e,t){this._bufferedSend(e)}constructor(){super(...arguments),this.serialization=_t.None}}class Ot extends It{_handleDataMessage(e){let t=e.data;const n=this.parse(this.decoder.decode(t)),r=n.__peerData;r&&"close"===r.type?this.close():this.emit("data",n)}_send(e,t){const n=this.encoder.encode(this.stringify(e));n.byteLength>=it.chunkedMTU?this.emitError(vt.MessageToBig,"Message too big for JSON channel"):this._bufferedSend(n)}constructor(){super(...arguments),this.serialization=_t.JSON,this.encoder=new TextEncoder,this.decoder=new TextDecoder,this.stringify=JSON.stringify,this.parse=JSON.parse}}class Ut extends Et{get id(){return this._id}get options(){return this._options}get open(){return this._open}get socket(){return this._socket}get connections(){const e=Object.create(null);for(const n of this._connections){var t=(0,a.A)(n,2);const r=t[0],i=t[1];e[r]=i}return e}get destroyed(){return this._destroyed}get disconnected(){return this._disconnected}constructor(e,t){let n;super(),this._serializers={raw:Mt,json:Ot,binary:Dt,"binary-utf8":Dt,default:Dt},this._id=null,this._lastServerId=null,this._destroyed=!1,this._disconnected=!1,this._open=!1,this._connections=new Map,this._lostMessages=new Map,e&&e.constructor==Object?t=e:e&&(n=e.toString()),t=(0,c.A)({debug:0,host:it.CLOUD_HOST,port:it.CLOUD_PORT,path:"/",key:Ut.DEFAULT_KEY,token:it.randomToken(),config:it.defaultConfig,referrerPolicy:"strict-origin-when-cross-origin",serializers:{}},t),this._options=t,this._serializers=(0,c.A)((0,c.A)({},this._serializers),this.options.serializers),"/"===this._options.host&&(this._options.host=window.location.hostname),this._options.path&&("/"!==this._options.path[0]&&(this._options.path="/"+this._options.path),"/"!==this._options.path[this._options.path.length-1]&&(this._options.path+="/")),void 0===this._options.secure&&this._options.host!==it.CLOUD_HOST?this._options.secure=it.isSecure():this._options.host==it.CLOUD_HOST&&(this._options.secure=!0),this._options.logFunction&&st.setLogFunction(this._options.logFunction),st.logLevel=this._options.debug||0,this._api=new At(t),this._socket=this._createServerConnection(),it.supports.audioVideo||it.supports.data?!n||it.validateId(n)?n?this._initialize(n):this._api.retrieveId().then(e=>this._initialize(e)).catch(e=>this._abort(gt.ServerError,e)):this._delayedAbort(gt.InvalidID,'ID "'.concat(n,'" is invalid')):this._delayedAbort(gt.BrowserIncompatible,"The current browser does not support WebRTC")}_createServerConnection(){const e=new St(this._options.secure,this._options.host,this._options.port,this._options.path,this._options.key,this._options.pingInterval);return e.on(Ct.Message,e=>{this._handleMessage(e)}),e.on(Ct.Error,e=>{this._abort(gt.SocketError,e)}),e.on(Ct.Disconnected,()=>{this.disconnected||(this.emitError(gt.Network,"Lost connection to server."),this.disconnect())}),e.on(Ct.Close,()=>{this.disconnected||this._abort(gt.SocketClosed,"Underlying socket is already closed.")}),e}_initialize(e){this._id=e,this.socket.start(e,this._options.token)}_handleMessage(e){const t=e.type,n=e.payload,r=e.src;switch(t){case bt.Open:this._lastServerId=this.id,this._open=!0,this.emit("open",this.id);break;case bt.Error:this._abort(gt.ServerError,n.msg);break;case bt.IdTaken:this._abort(gt.UnavailableID,'ID "'.concat(this.id,'" is taken'));break;case bt.InvalidKey:this._abort(gt.InvalidKey,'API KEY "'.concat(this._options.key,'" is invalid'));break;case bt.Leave:st.log("Received leave message from ".concat(r)),this._cleanupPeer(r),this._connections.delete(r);break;case bt.Expire:this.emitError(gt.PeerUnavailable,"Could not connect to peer ".concat(r));break;case bt.Offer:{const e=n.connectionId;let t=this.getConnection(r,e);if(t&&(t.close(),st.warn("Offer received for existing Connection ID:".concat(e))),n.type===mt.Media){const i=new kt(r,this,{connectionId:e,_payload:n,metadata:n.metadata});t=i,this._addConnection(r,t),this.emit("call",i)}else{if(n.type!==mt.Data)return void st.warn("Received malformed connection type:".concat(n.type));{const i=new this._serializers[n.serialization](r,this,{connectionId:e,_payload:n,metadata:n.metadata,label:n.label,serialization:n.serialization,reliable:n.reliable});t=i,this._addConnection(r,t),this.emit("connection",i)}}const i=this._getMessages(e);for(const n of i)t.handleMessage(n);break}default:{if(!n)return void st.warn("You received a malformed message from ".concat(r," of type ").concat(t));const i=n.connectionId,o=this.getConnection(r,i);o&&o.peerConnection?o.handleMessage(e):i?this._storeMessage(i,e):st.warn("You received an unrecognized message:",e);break}}}_storeMessage(e,t){this._lostMessages.has(e)||this._lostMessages.set(e,[]),this._lostMessages.get(e).push(t)}_getMessages(e){const t=this._lostMessages.get(e);return t?(this._lostMessages.delete(e),t):[]}connect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=(0,c.A)({serialization:"default"},t),this.disconnected)return st.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect, or call reconnect on this peer if you believe its ID to still be available."),void this.emitError(gt.Disconnected,"Cannot connect to new Peer after disconnecting from server.");const n=new this._serializers[t.serialization](e,this,t);return this._addConnection(e,n),n}call(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.disconnected)return st.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect."),void this.emitError(gt.Disconnected,"Cannot connect to new Peer after disconnecting from server.");if(!t)return void st.error("To call a peer, you must provide a stream from your browser's `getUserMedia`.");const r=new kt(e,this,(0,c.A)((0,c.A)({},n),{},{_stream:t}));return this._addConnection(e,r),r}_addConnection(e,t){st.log("add connection ".concat(t.type,":").concat(t.connectionId," to peerId:").concat(e)),this._connections.has(e)||this._connections.set(e,[]),this._connections.get(e).push(t)}_removeConnection(e){const t=this._connections.get(e.peer);if(t){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}this._lostMessages.delete(e.connectionId)}getConnection(e,t){const n=this._connections.get(e);if(!n)return null;for(const r of n)if(r.connectionId===t)return r;return null}_delayedAbort(e,t){setTimeout(()=>{this._abort(e,t)},0)}_abort(e,t){st.error("Aborting!"),this.emitError(e,t),this._lastServerId?this.disconnect():this.destroy()}destroy(){this.destroyed||(st.log("Destroy peer with ID:".concat(this.id)),this.disconnect(),this._cleanup(),this._destroyed=!0,this.emit("close"))}_cleanup(){for(const e of this._connections.keys())this._cleanupPeer(e),this._connections.delete(e);this.socket.removeAllListeners()}_cleanupPeer(e){const t=this._connections.get(e);if(t)for(const n of t)n.close()}disconnect(){if(this.disconnected)return;const e=this.id;st.log("Disconnect peer with ID:".concat(e)),this._disconnected=!0,this._open=!1,this.socket.close(),this._lastServerId=e,this._id=null,this.emit("disconnected",e)}reconnect(){if(this.disconnected&&!this.destroyed)st.log("Attempting reconnection to server with ID ".concat(this._lastServerId)),this._disconnected=!1,this._initialize(this._lastServerId);else{if(this.destroyed)throw new Error("This peer cannot reconnect to the server. It has already been destroyed.");if(this.disconnected||this.open)throw new Error("Peer ".concat(this.id," cannot reconnect because it is not disconnected from the server!"));st.error("In a hurry? We're still trying to make the initial connection!")}}listAllPeers(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>{};this._api.listAllPeers().then(t=>e(t)).catch(e=>this._abort(gt.ServerError,e))}}Ut.DEFAULT_KEY="peerjs"},1614(e,t,n){n.d(t,{h:()=>w});var r,i=n(5544),o=n(5043),s=Object.defineProperty,a=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&d(e,n,t[n]);if(a)for(var n of a(t))h.call(t,n)&&d(e,n,t[n]);return e},p=(e,t)=>{var n={};for(var r in e)c.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&a)for(var r of a(e))t.indexOf(r)<0&&h.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class t{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let t=0;t<this.size;t++)s.push(!1);for(let t=0;t<this.size;t++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r){let o,a,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,l=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||d<-1||d>7)throw new RangeError("Invalid value");for(o=c;;o++){const n=8*t.getNumDataCodewords(o,r),i=s.getTotalBits(e,o);if(i<=n){a=i;break}if(o>=h)throw new RangeError("Data too long")}for(const n of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&a<=8*t.getNumDataCodewords(o,n)&&(r=n);let p=[];for(const t of e){n(t.mode.modeBits,4,p),n(t.numChars,t.mode.numCharCountBits(o),p);for(const e of t.getData())p.push(e)}i(p.length==a);const u=8*t.getNumDataCodewords(o,r);i(p.length<=u),n(0,Math.min(4,u-p.length),p),n(0,(8-p.length%8)%8,p),i(p.length%8==0);for(let t=236;p.length<u;t^=253)n(t,8,p);let f=[];for(;8*f.length<p.length;)f.push(0);return p.forEach((e,t)=>f[t>>>3]|=e<<7-(7&t)),new t(o,r,f,d)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2==0),this.setFunctionModule(n,6,n%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let r=0;r<10;r++)n=n<<1^1335*(n>>>9);const o=21522^(t<<10|n);i(o>>>15==0);for(let i=0;i<=5;i++)this.setFunctionModule(8,i,r(o,i));this.setFunctionModule(8,7,r(o,6)),this.setFunctionModule(8,8,r(o,7)),this.setFunctionModule(7,8,r(o,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,r(o,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,r(o,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,r(o,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let n=0;n<18;n++){const e=r(t,n),i=this.size-11+n%3,o=Math.floor(n/3);this.setFunctionModule(i,o,e),this.setFunctionModule(o,i,e)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),c=o-a%o,h=Math.floor(a/o);let d=[];const l=t.reedSolomonComputeDivisor(s);for(let i=0,u=0;i<o;i++){let n=e.slice(u,u+h-s+(i<c?0:1));u+=n.length;const r=t.reedSolomonComputeRemainder(n,l);i<c&&n.push(0),d.push(n.concat(r))}let p=[];for(let t=0;t<d[0].length;t++)d.forEach((e,n)=>{(t!=h-s||n>=c)&&p.push(e[t])});return i(p.length==a),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let i=0;i<this.size;i++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-i:i;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=r(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let i=0;i<this.size;i++){let n=!1,r=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[i][s]==n?(r++,5==r?e+=t.PENALTY_N1:r>5&&e++):(this.finderPenaltyAddHistory(r,o),n||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),n=this.modules[i][s],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,o)*t.PENALTY_N3}for(let i=0;i<this.size;i++){let n=!1,r=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][i]==n?(r++,5==r?e+=t.PENALTY_N1:r>5&&e++):(this.finderPenaltyAddHistory(r,o),n||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),n=this.modules[s][i],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,o)*t.PENALTY_N3}for(let i=0;i<this.size-1;i++)for(let n=0;n<this.size-1;n++){const r=this.modules[i][n];r==this.modules[i][n+1]&&r==this.modules[i+1][n]&&r==this.modules[i+1][n+1]&&(e+=t.PENALTY_N2)}let n=0;for(const t of this.modules)n=t.reduce((e,t)=>e+(t?1:0),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(const i of e){const e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];function n(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}e.QrCode=t;const o=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(t){let r=[];for(const e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw new RangeError("String contains non-numeric characters");let r=[];for(let e=0;e<t.length;){const i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),3*i+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let r,i=[];for(r=0;r+2<=t.length;r+=2){let o=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r));o+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r+1)),n(o,11,i)}return r<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)),6,i),new e(e.Mode.ALPHANUMERIC,t.length,i)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else{if(!(t<1e6))throw new RangeError("ECI assignment value out of range");n(6,3,r),n(t,21,r)}return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2);return t}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let s=o;e.QrSegment=o})(r||(r={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2);e.Ecc=t})(t=e.QrCode||(e.QrCode={}))})(r||(r={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]);e.Mode=t})(t=e.QrSegment||(e.QrSegment={}))})(r||(r={}));var u=r,f={L:u.QrCode.Ecc.LOW,M:u.QrCode.Ecc.MEDIUM,Q:u.QrCode.Ecc.QUARTILE,H:u.QrCode.Ecc.HIGH},m="#FFFFFF",g="#000000",y=!1;function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(o,s){if(!o&&null!==i)return n.push("M".concat(i+t," ").concat(r+t,"h").concat(s-i,"v1H").concat(i+t,"z")),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push("M".concat(s+t,",").concat(r+t," h1v1H").concat(s+t,"z")):n.push("M".concat(i+t,",").concat(r+t," h").concat(s+1-i,"v1H").concat(i+t,"z"))}})}),n.join("")}function _(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>(n<t.x||n>=t.x+t.w)&&e))}function C(e){let t=e.value,n=e.level,r=e.minVersion,i=e.includeMargin,s=e.marginSize,a=e.imageSettings,c=e.size,h=e.boostLevel,d=o.useMemo(()=>{const e=(Array.isArray(t)?t:[t]).reduce((e,t)=>(e.push(...u.QrSegment.makeSegments(t)),e),[]);return u.QrCode.encodeSegments(e,f[n],r,void 0,void 0,h)},[t,n,r,h]);const l=o.useMemo(()=>{let e=d.getModules();const t=function(e,t){return null!=t?Math.max(Math.floor(t),0):e?4:0}(i,s),n=e.length+2*t,r=function(e,t,n,r){if(null==r)return null;const i=e.length+2*n,o=Math.floor(.1*t),s=i/t,a=(r.width||o)*s,c=(r.height||o)*s,h=null==r.x?e.length/2-a/2:r.x*s,d=null==r.y?e.length/2-c/2:r.y*s,l=null==r.opacity?1:r.opacity;let p=null;if(r.excavate){let e=Math.floor(h),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(a+h-e),h:Math.ceil(c+d-t)}}return{x:h,y:d,h:c,w:a,excavation:p,opacity:l,crossOrigin:r.crossOrigin}}(e,c,t,a);return{cells:e,margin:t,numCells:n,calculatedImageSettings:r}},[d,c,a,i,s]),p=l.cells,m=l.margin,g=l.numCells,y=l.calculatedImageSettings;return{qrcode:d,margin:m,cells:p,numCells:g,calculatedImageSettings:y}}var b=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();o.forwardRef(function(e,t){const n=e,r=n.value,s=n.size,a=void 0===s?128:s,c=n.level,h=void 0===c?"L":c,d=n.bgColor,u=void 0===d?m:d,f=n.fgColor,w=void 0===f?g:f,S=n.includeMargin,T=void 0===S?y:S,E=n.minVersion,R=void 0===E?1:E,P=n.boostLevel,k=n.marginSize,A=n.imageSettings,x=p(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),I=x.style,D=p(x,["style"]),M=null==A?void 0:A.src,O=o.useRef(null),U=o.useRef(null),N=o.useCallback(e=>{O.current=e,"function"===typeof t?t(e):t&&(t.current=e)},[t]),B=o.useState(!1),L=(0,i.A)(B,2),F=(L[0],L[1]),z=C({value:r,level:h,minVersion:R,boostLevel:P,includeMargin:T,marginSize:k,imageSettings:A,size:a}),j=z.margin,V=z.cells,H=z.numCells,W=z.calculatedImageSettings;o.useEffect(()=>{if(null!=O.current){const e=O.current,t=e.getContext("2d");if(!t)return;let n=V;const r=U.current,i=null!=W&&null!==r&&r.complete&&0!==r.naturalHeight&&0!==r.naturalWidth;i&&null!=W.excavation&&(n=_(V,W.excavation));const o=window.devicePixelRatio||1;e.height=e.width=a*o;const s=a/H*o;t.scale(s,s),t.fillStyle=u,t.fillRect(0,0,H,H),t.fillStyle=w,b?t.fill(new Path2D(v(n,j))):V.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+j,n+j,1,1)})}),W&&(t.globalAlpha=W.opacity),i&&t.drawImage(r,W.x+j,W.y+j,W.w,W.h)}}),o.useEffect(()=>{F(!1)},[M]);const K=l({height:a,width:a},I);let G=null;return null!=M&&(G=o.createElement("img",{src:M,key:M,style:{display:"none"},onLoad:()=>{F(!0)},ref:U,crossOrigin:null==W?void 0:W.crossOrigin})),o.createElement(o.Fragment,null,o.createElement("canvas",l({style:K,height:a,width:a,ref:N,role:"img"},D)),G)}).displayName="QRCodeCanvas";var w=o.forwardRef(function(e,t){const n=e,r=n.value,i=n.size,s=void 0===i?128:i,a=n.level,c=void 0===a?"L":a,h=n.bgColor,d=void 0===h?m:h,u=n.fgColor,f=void 0===u?g:u,b=n.includeMargin,w=void 0===b?y:b,S=n.minVersion,T=void 0===S?1:S,E=n.boostLevel,R=n.title,P=n.marginSize,k=n.imageSettings,A=p(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),x=C({value:r,level:c,minVersion:T,boostLevel:E,includeMargin:w,marginSize:P,imageSettings:k,size:s}),I=x.margin,D=x.cells,M=x.numCells,O=x.calculatedImageSettings;let U=D,N=null;null!=k&&null!=O&&(null!=O.excavation&&(U=_(D,O.excavation)),N=o.createElement("image",{href:k.src,height:O.h,width:O.w,x:O.x+I,y:O.y+I,preserveAspectRatio:"none",opacity:O.opacity,crossOrigin:O.crossOrigin}));const B=v(U,I);return o.createElement("svg",l({height:s,width:s,viewBox:"0 0 ".concat(M," ").concat(M),ref:t,role:"img"},A),!!R&&o.createElement("title",null,R),o.createElement("path",{fill:d,d:"M0,0 h".concat(M,"v").concat(M,"H0z"),shapeRendering:"crispEdges"}),o.createElement("path",{fill:f,d:B,shapeRendering:"crispEdges"}),N)});w.displayName="QRCodeSVG"},9804(e,t,n){n.d(t,{fzP:()=>i});var r=n(4479);function i(e){return(0,r.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"},child:[]},{tag:"path",attr:{d:"M12 14c-3 0-4 3-4 3h8s-1-3-4-3zm-2.439-2.439c.014-.014.023-.03.037-.044l1.031.413.742-1.857-5-2-.742 1.856 1.373.549L7 10.5a1.499 1.499 0 0 0 2.561 1.061zm3.068-1.49.742 1.857 1.037-.415c.011.011.019.024.029.035a1.488 1.488 0 0 0 2.112 0c.271-.271.438-.644.438-1.056l-.001-.01 1.386-.554-.742-1.857-5.001 2z"},child:[]}]})(e)}}}]);
//# sourceMappingURL=832.6e8ba9e6.chunk.js.map