uyem
Version:
WebRTC client-server SFU application
2 lines • 189 kB
JavaScript
/*! For license information please see Main.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(global,(e=>(()=>{"use strict";var t={278:(e,t)=>{t.Q=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var r={},o=t||{},i=e.split(";"),s=o.decode||n,c=0;c<i.length;c++){var d=i[c],l=d.indexOf("=");if(!(l<0)){var u=d.substring(0,l).trim();if(null==r[u]){var m=d.substring(l+1,d.length).trim();'"'===m[0]&&(m=m.slice(1,-1)),r[u]=a(m,s)}}}return r},t.q=function(e,t,n){var a=n||{},i=a.encode||r;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!o.test(s))throw new TypeError("argument val is invalid");var c=e+"="+s;if(null!=a.maxAge){var d=a.maxAge-0;if(isNaN(d)||!isFinite(d))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(d)}if(a.domain){if(!o.test(a.domain))throw new TypeError("option domain is invalid");c+="; Domain="+a.domain}if(a.path){if(!o.test(a.path))throw new TypeError("option path is invalid");c+="; Path="+a.path}if(a.expires){if("function"!=typeof a.expires.toUTCString)throw new TypeError("option expires is invalid");c+="; Expires="+a.expires.toUTCString()}if(a.httpOnly&&(c+="; HttpOnly"),a.secure&&(c+="; Secure"),a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return c};var n=decodeURIComponent,r=encodeURIComponent,o=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function a(e,t){try{return t(e)}catch(t){return e}}},742:e=>{const t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};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 e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+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&&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.substr(14).split(" ")},t.parseRtpMap=function(e){let t=e.substr(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.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){const t={};let n;const r=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<r.length;e++)n=r[e].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.substr(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.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},t.parseSsrcGroup=function(e){const t=e.substr(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.substr(6)},t.parseFingerprint=function(e){const t=e.substr(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.substr(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.substr(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],o=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substr(12),password:o.substr(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(" ");for(let o=3;o<r.length;o++){const a=r[o],i=t.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(i){const r=t.parseRtpMap(i),o=t.matchPrefix(e,"a=fmtp:"+a+" ");switch(r.parameters=o.length?t.parseFmtp(o[0]):{},r.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(t.parseRtcpFb),n.codecs.push(r),r.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(r.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))})),n},t.writeRtpDescription=function(e,n){let r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" 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 o=0;return n.codecs.forEach((e=>{e.maxptime>o&&(o=e.maxptime)})),o>0&&(r+="a=maxptime:"+o+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{r+=t.writeExtmap(e)})),r},t.parseRtpEncodingParameters=function(e){const n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),a=-1!==r.fecMechanisms.indexOf("ULPFEC"),i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=i.length>0&&i[0].ssrc;let c;const d=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substr(17).split(" ").map((e=>parseInt(e,10)))));d.length>0&&d[0].length>1&&d[0][0]===s&&(c=d[0][1]),r.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),n.push(t),o&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:a?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&s&&n.push({ssrc:s});let l=t.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=l}))),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 o=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=o.length>0,n.compound=0===o.length;const a=t.matchPrefix(e,"a=rtcp-mux");return n.mux=a.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].substr(7).split(" "),{stream:n[0],track:n[1]};const o=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return o.length>0?(n=o[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 o;r.length>0&&(o=parseInt(r[0].substr(19),10)),isNaN(o)&&(o=65536);const a=t.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substr(12),10),protocol:n.fmt,maxMessageSize:o};const i=t.matchPrefix(e,"a=sctpmap:");if(i.length>0){const e=i[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:o}}},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,21)},t.writeSessionBoilerplate=function(e,n,r){let o;const a=void 0!==n?n:2;return o=e||t.generateSessionId(),"v=0\r\no="+(r||"thisisadapterortc")+" "+o+" "+a+" 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 e=0;e<r.length;e++)switch(r[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[e].substr(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substr(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].substr(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 e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t},156:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{default:()=>ki});var e={};r.r(e),r.d(e,{fixNegotiationNeeded:()=>er,shimAddTrackRemoveTrack:()=>$n,shimAddTrackRemoveTrackWithNative:()=>Jn,shimGetDisplayMedia:()=>Bn,shimGetSendersWithDtmf:()=>Kn,shimGetStats:()=>qn,shimGetUserMedia:()=>Yn,shimMediaStream:()=>zn,shimOnTrack:()=>Xn,shimPeerConnection:()=>Zn,shimSenderReceiverGetStats:()=>Qn});var t={};r.r(t),r.d(t,{shimAddTransceiver:()=>dr,shimCreateAnswer:()=>mr,shimCreateOffer:()=>ur,shimGetDisplayMedia:()=>nr,shimGetParameters:()=>lr,shimGetUserMedia:()=>tr,shimOnTrack:()=>rr,shimPeerConnection:()=>or,shimRTCDataChannel:()=>cr,shimReceiverGetStats:()=>ir,shimRemoveStream:()=>sr,shimSenderGetStats:()=>ar});var n={};r.r(n),r.d(n,{shimAudioContext:()=>Sr,shimCallbacksAPI:()=>hr,shimConstraints:()=>vr,shimCreateOfferLegacy:()=>Cr,shimGetUserMedia:()=>gr,shimLocalStreamsAPI:()=>pr,shimRTCIceServerUrls:()=>yr,shimRemoteStreamsAPI:()=>fr,shimTrackEventTransceiver:()=>Er});var a={};r.r(a),r.d(a,{removeExtmapAllowMixed:()=>Ir,shimAddIceCandidateNullOrEmpty:()=>Or,shimConnectionState:()=>kr,shimMaxMessageSize:()=>Mr,shimParameterlessSetLocalDescription:()=>Rr,shimRTCIceCandidate:()=>br,shimSendThrowTypeError:()=>_r});var i=r(156),s=r.n(i);function c(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=c(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const d=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=c(e))&&(r&&(r+=" "),r+=t);return r},l="hphzAHseXdWL3HpBABRZ",u="mpBnssUygF9Ns76YMBxO",m="EUaY3CfBeDMZeGKcamXv",p="t4TJ0CWfUt6fYaVKwUqI";function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function h(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function g(e){return h(1,arguments),e instanceof Date||"object"===f(e)&&"[object Date]"===Object.prototype.toString.call(e)}function v(e){h(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===f(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function y(e){if(h(1,arguments),!g(e)&&"number"!=typeof e)return!1;var t=v(e);return!isNaN(Number(t))}function E(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function C(e,t){h(2,arguments);var n=v(e).getTime(),r=E(t);return new Date(n+r)}function S(e,t){h(2,arguments);var n=E(t);return C(e,-n)}var T=864e5;function w(e){h(1,arguments);var t=1,n=v(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function b(e){h(1,arguments);var t=v(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=w(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=w(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function M(e){h(1,arguments);var t=b(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=w(n);return r}var _=6048e5,k={};function I(){return k}function O(e,t){var n,r,o,a,i,s,c,d;h(1,arguments);var l=I(),u=E(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t||null===(i=t.locale)||void 0===i||null===(s=i.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:l.weekStartsOn)&&void 0!==r?r:null===(c=l.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=v(e),p=m.getUTCDay(),f=(p<u?7:0)+p-u;return m.setUTCDate(m.getUTCDate()-f),m.setUTCHours(0,0,0,0),m}function R(e,t){var n,r,o,a,i,s,c,d;h(1,arguments);var l=v(e),u=l.getUTCFullYear(),m=I(),p=E(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(i=t.locale)||void 0===i||null===(s=i.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:m.firstWeekContainsDate)&&void 0!==r?r:null===(c=m.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==n?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setUTCFullYear(u+1,0,p),f.setUTCHours(0,0,0,0);var g=O(f,t),y=new Date(0);y.setUTCFullYear(u,0,p),y.setUTCHours(0,0,0,0);var C=O(y,t);return l.getTime()>=g.getTime()?u+1:l.getTime()>=C.getTime()?u:u-1}function P(e,t){var n,r,o,a,i,s,c,d;h(1,arguments);var l=I(),u=E(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(i=t.locale)||void 0===i||null===(s=i.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:l.firstWeekContainsDate)&&void 0!==r?r:null===(c=l.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==n?n:1),m=R(e,t),p=new Date(0);p.setUTCFullYear(m,0,u),p.setUTCHours(0,0,0,0);var f=O(p,t);return f}var L=6048e5;function A(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}const x=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return A("yy"===t?r%100:r,t.length)},N=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):A(n+1,2)},D=function(e,t){return A(e.getUTCDate(),t.length)},U=function(e,t){return A(e.getUTCHours()%12||12,t.length)},j=function(e,t){return A(e.getUTCHours(),t.length)},G=function(e,t){return A(e.getUTCMinutes(),t.length)},H=function(e,t){return A(e.getUTCSeconds(),t.length)},V=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return A(Math.floor(r*Math.pow(10,n-3)),t.length)};function W(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;if(0===a)return n+String(o);var i=t||"";return n+String(o)+i+A(a,2)}function F(e,t){return e%60==0?(e>0?"-":"+")+A(Math.abs(e)/60,2):Y(e,t)}function Y(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+A(Math.floor(o/60),2)+n+A(o%60,2)}const B={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return x(e,t)},Y:function(e,t,n,r){var o=R(e,r),a=o>0?o:1-o;return"YY"===t?A(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):A(a,t.length)},R:function(e,t){return A(b(e),t.length)},u:function(e,t){return A(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return A(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return A(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return N(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return A(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){h(1,arguments);var n=v(e),r=O(n,t).getTime()-P(n,t).getTime();return Math.round(r/L)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):A(o,t.length)},I:function(e,t,n){var r=function(e){h(1,arguments);var t=v(e),n=w(t).getTime()-M(t).getTime();return Math.round(n/_)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):A(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):D(e,t)},D:function(e,t,n){var r=function(e){h(1,arguments);var t=v(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/T)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):A(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return A(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return A(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return A(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return U(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):j(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):A(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):A(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):G(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):H(e,t)},S:function(e,t){return V(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return F(o);case"XXXX":case"XX":return Y(o);default:return Y(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return F(o);case"xxxx":case"xx":return Y(o);default:return Y(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+W(o,":");default:return"GMT"+Y(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+W(o,":");default:return"GMT"+Y(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return A(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return A((r._originalDate||e).getTime(),t.length)}};var z=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},X=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},K={p:X,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return z(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",z(o,t)).replace("{{time}}",X(a,t))}};const q=K;function Q(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var J=["D","DD"],$=["YY","YYYY"];function Z(e){return-1!==J.indexOf(e)}function ee(e){return-1!==$.indexOf(e)}function te(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ne={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function re(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var oe,ae={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function se(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function ce(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;var i,s=a[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?le(c,(function(e){return e.test(s)})):de(c,(function(e){return e.test(s)}));i=e.valueCallback?e.valueCallback(d):d,i=n.valueCallback?n.valueCallback(i):i;var l=t.slice(s.length);return{value:i,rest:l}}}function de(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function le(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}const ue={code:"en-US",formatDistance:function(e,t,n){var r,o=ne[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:ae,formatRelative:function(e,t,n,r){return ie[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:se({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:se({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:se({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:se({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:se({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(oe={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(oe.matchPattern);if(!n)return null;var r=n[0],o=e.match(oe.parsePattern);if(!o)return null;var a=oe.valueCallback?oe.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var i=e.slice(r.length);return{value:a,rest:i}}),era:ce({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ce({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ce({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ce({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ce({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var me=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fe=/^'([^]*?)'?$/,he=/''/g,ge=/[a-zA-Z]/;function ve(e,t,n){var r,o,a,i,s,c,d,l,u,m,p,f,g,C,T,w,b,M;h(2,arguments);var _=String(t),k=I(),O=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:k.locale)&&void 0!==r?r:ue,R=E(null!==(a=null!==(i=null!==(s=null!==(c=null==n?void 0:n.firstWeekContainsDate)&&void 0!==c?c:null==n||null===(d=n.locale)||void 0===d||null===(l=d.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==s?s:k.firstWeekContainsDate)&&void 0!==i?i:null===(u=k.locale)||void 0===u||null===(m=u.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==a?a:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=E(null!==(p=null!==(f=null!==(g=null!==(C=null==n?void 0:n.weekStartsOn)&&void 0!==C?C:null==n||null===(T=n.locale)||void 0===T||null===(w=T.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==g?g:k.weekStartsOn)&&void 0!==f?f:null===(b=k.locale)||void 0===b||null===(M=b.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==p?p:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var L=v(e);if(!y(L))throw new RangeError("Invalid time value");var A=Q(L),x=S(L,A),N={firstWeekContainsDate:R,weekStartsOn:P,locale:O,_originalDate:L},D=_.match(pe).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,q[t])(e,O.formatLong):e})).join("").match(me).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return ye(r);var a=B[o];if(a)return null!=n&&n.useAdditionalWeekYearTokens||!ee(r)||te(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!Z(r)||te(r,t,String(e)),a(x,r,O.localize,N);if(o.match(ge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("");return D}function ye(e){var t=e.match(fe);return t?t[1].replace(he,"'"):e}const Ee=parseInt(process.env.REACT_APP_LOG_LEVEL,10),Ce=["video/webm;codecs=H264","video/webm;codecs=vp8","video/webm;codecs=vp9","video/webm;codecs=vp8.0","video/webm;codecs=vp9.0","video/webm;codecs=h264","video/webm;codecs=avc1","video/webm;codecs=vp8,opus","video/WEBM;codecs=VP8,OPUS","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,vp9,opus","video/webm;codecs=h264,opus","video/webm;codecs=h264,vp9,opus","video/x-matroska;codecs=avc1"],Se={open:!1,children:"",type:"log"},Te={unitId:"0",id:0,text:"",isOwner:!1},we={open:!1,children:"",clientX:0,clientY:0,width:0,height:0,context:Te,secure:!1},be={width:40,height:150},Me={width:150,height:150},_e={width:120,height:180},ke={width:120,height:100},Ie="right: calc(1rem - 10px);transition: top 0.3s ease-in",Oe=24;var Re,Pe,Le,Ae,xe;!function(e){e.initial="initial",e.roomIsInactive="roomIsInactive",e.errorSendMessage="errorSendMessage",e.youAreBanned="youAreBanned",e.videoRecordStop="videoRecordStop",e.forbidden="forbidden",e.notAuthorised="notAuthorised",e.duplicateTab="duplicateTab",e.errorDeleteMessage="errorDeleteMessage",e.errorSetAdmin="errorSetAdmin",e.errorToBan="errorToBan",e.errorToMute="errorToMute",e.errorToOffCamera="errorToOffCamera"}(Re||(Re={})),function(e){e[e.log=0]="log",e[e.info=1]="info",e[e.warn=2]="warn",e[e.error=3]="error"}(Pe||(Pe={})),function(e){e.start="start",e.stop="stop"}(Le||(Le={})),function(e){e.GET_USER_ID="GET_USER_ID",e.SET_USER_ID="SET_USER_ID",e.GET_LOGIN="GET_LOGIN",e.TOKEN="TOKEN",e.OFFER="OFFER",e.CANDIDATE="CANDIDATE",e.ANSWER="ANSWER",e.GET_ROOM="GET_ROOM",e.SET_ROOM="SET_ROOM",e.GET_CHAT_UNIT="GET_CHAT_UNIT",e.GET_SETTINGS_UNIT="GET_SETTINGS_UNIT",e.SET_ERROR="SET_ERROR",e.GET_ROOM_GUESTS="GET_ROOM_GUESTS",e.SET_ROOM_GUESTS="SET_ROOM_GUESTS",e.SET_CHANGE_UNIT="SET_CHANGE_UNIT",e.GET_MUTE="GET_MUTE",e.SET_MUTE="SET_MUTE",e.GET_NEED_RECONNECT="GET_NEED_RECONNECT",e.GET_CLOSE_PEER_CONNECTION="GET_CLOSE_PEER_CONNECTION",e.SET_CLOSE_PEER_CONNECTION="SET_CLOSE_PEER_CONNECTION",e.GET_ROOM_MESSAGE="GET_ROOM_MESSAGE",e.SET_ROOM_MESSAGE="SET_ROOM_MESSAGE",e.SET_CHAT_UNIT="SET_CHAT_UNIT",e.SET_SETTINGS_UNIT="SET_SETTINGS_UNIT",e.GET_CHAT_MESSAGES="GET_CHAT_MESSAGES",e.SET_CHAT_MESSAGES="SET_CHAT_MESSAGES",e.GET_EDIT_MESSAGE="GET_EDIT_MESSAGE",e.SET_EDIT_MESSAGE="SET_EDIT_MESSAGE",e.GET_CREATE_MESSAGE="GET_CREATE_MESSAGE",e.SET_CREATE_MESSAGE="SET_CREATE_MESSAGE",e.GET_CREATE_QUOTE="GET_CREATE_QUOTE",e.SET_CREATE_QUOTE="SET_CREATE_QUOTE",e.GET_DELETE_MESSAGE="GET_DELETE_MESSAGE",e.SET_DELETE_MESSAGE="SET_DELETE_MESSAGE",e.GET_LOCALE="GET_LOCALE",e.SET_LOCALE="SET_LOCALE",e.GET_TO_MUTE="GET_TO_MUTE",e.GET_TO_BAN="GET_TO_BAN",e.GET_TO_UNMUTE="GET_TO_UNMUTE",e.GET_TO_UNBAN="GET_TO_UNBAN",e.SET_BAN_LIST="SET_BAN_LIST",e.SET_MUTE_LIST="SET_MUTE_LIST",e.GET_RECORD="GET_RECORD",e.SET_RECORDING="SET_RECORDING",e.GET_VIDEO_FIND_MANY="GET_VIDEO_FIND_MANY",e.SET_VIDEO_FIND_MANY="SET_VIDEO_FIND_MANY",e.GET_VIDEO_FIND_FIRST="GET_VIDEO_FIND_FIRST",e.SET_VIDEO_FIND_FIRST="SET_VIDEO_FIND_FIRST",e.GET_ASK_FLOOR="GET_ASK_FLOOR",e.SET_ASK_FLOOR="SET_ASK_FLOOR",e.GET_MUTE_FOR_ALL="GET_MUTE_FOR_ALL",e.SET_MUTE_FOR_ALL="SET_MUTE_FOR_ALL",e.GET_BLOCK_CHAT="GET_BLOCK_CHAT",e.SET_BLOCK_CHAT="SET_BLOCK_CHAT",e.GET_VIDEO_TRACK="GET_VIDEO_TRACK",e.SET_VIDEO_TRACK="SET_VIDEO_TRACK",e.GET_TO_ADMIN="GET_TO_ADMIN",e.SET_TO_ADMIN="SET_TO_ADMIN"}(Ae||(Ae={})),function(e){e.DEFAULT="en",e.SELECTOR=[{name:"English",value:"en",impl:!0},{name:"Русский",value:"ru",impl:!0}]}(xe||(xe={}));const Ne=xe.DEFAULT,De=xe.SELECTOR;var Ue,je,Ge;function He(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ve(e){return!!e&&!!e[kt]}function We(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===It}(e)||Array.isArray(e)||!!e[_t]||!!e.constructor[_t]||Ke(e)||qe(e))}function Fe(e,t,n){void 0===n&&(n=!1),0===Ye(e)?(n?Object.keys:Ot)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function Ye(e){var t=e[kt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ke(e)?2:qe(e)?3:0}function Be(e,t){return 2===Ye(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ze(e,t,n){var r=Ye(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function Xe(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ke(e){return Tt&&e instanceof Map}function qe(e){return wt&&e instanceof Set}function Qe(e){return e.o||e.t}function Je(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Rt(e);delete t[kt];for(var n=Ot(t),r=0;r<n.length;r++){var o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function $e(e,t){return void 0===t&&(t=!1),et(e)||Ve(e)||!We(e)||(Ye(e)>1&&(e.set=e.add=e.clear=e.delete=Ze),Object.freeze(e),t&&Fe(e,(function(e,t){return $e(t,!0)}),!0)),e}function Ze(){He(2)}function et(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function tt(e){var t=Pt[e];return t||He(18,e),t}function nt(){return Ct}function rt(e,t){t&&(tt("Patches"),e.u=[],e.s=[],e.v=t)}function ot(e){at(e),e.p.forEach(st),e.p=null}function at(e){e===Ct&&(Ct=e.l)}function it(e){return Ct={p:[],l:Ct,h:e,m:!0,_:0}}function st(e){var t=e[kt];0===t.i||1===t.i?t.j():t.O=!0}function ct(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||tt("ES5").S(t,e,r),r?(n[kt].P&&(ot(t),He(4)),We(e)&&(e=dt(t,e),t.l||ut(t,e)),t.u&&tt("Patches").M(n[kt].t,e,t.u,t.s)):e=dt(t,n,[]),ot(t),t.u&&t.v(t.u,t.s),e!==Mt?e:void 0}function dt(e,t,n){if(et(t))return t;var r=t[kt];if(!r)return Fe(t,(function(o,a){return lt(e,r,t,o,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return ut(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=Je(r.k):r.o;Fe(3===r.i?new Set(o):o,(function(t,a){return lt(e,r,o,t,a,n)})),ut(e,o,!1),n&&e.u&&tt("Patches").R(r,n,e.u,e.s)}return r.o}function lt(e,t,n,r,o,a){if(Ve(o)){var i=dt(e,o,a&&t&&3!==t.i&&!Be(t.D,r)?a.concat(r):void 0);if(ze(n,r,i),!Ve(i))return;e.m=!1}if(We(o)&&!et(o)){if(!e.h.F&&e._<1)return;dt(e,o),t&&t.A.l||ut(e,o)}}function ut(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&$e(t,n)}function mt(e,t){var n=e[kt];return(n?Qe(n):e)[t]}function pt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function ft(e){e.P||(e.P=!0,e.l&&ft(e.l))}function ht(e){e.o||(e.o=Je(e.t))}function gt(e,t,n){var r=Ke(t)?tt("MapSet").N(t,n):qe(t)?tt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:nt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,a=Lt;n&&(o=[r],a=At);var i=Proxy.revocable(o,a),s=i.revoke,c=i.proxy;return r.k=c,r.j=s,c}(t,n):tt("ES5").J(t,n);return(n?n.A:nt()).p.push(r),r}function vt(e){return Ve(e)||He(22,e),function e(t){if(!We(t))return t;var n,r=t[kt],o=Ye(t);if(r){if(!r.P&&(r.i<4||!tt("ES5").K(r)))return r.t;r.I=!0,n=yt(t,o),r.I=!1}else n=yt(t,o);return Fe(n,(function(t,o){r&&function(e,t){return 2===Ye(e)?e.get(t):e[t]}(r.t,t)===o||ze(n,t,e(o))})),3===o?new Set(n):n}(e)}function yt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Je(e)}!function(e){e.WSInterface=class{delimiter="_"}}(Ue||(Ue={})),function(e){e.RTCInterface=class{delimiter="_"}}(je||(je={})),function(e){e.DBInterface=class{}}(Ge||(Ge={}));var Et,Ct,St="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Tt="undefined"!=typeof Map,wt="undefined"!=typeof Set,bt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Mt=St?Symbol.for("immer-nothing"):((Et={})["immer-nothing"]=!0,Et),_t=St?Symbol.for("immer-draftable"):"__$immer_draftable",kt=St?Symbol.for("immer-state"):"__$immer_state",It=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),Ot="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Rt=Object.getOwnPropertyDescriptors||function(e){var t={};return Ot(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Pt={},Lt={get:function(e,t){if(t===kt)return e;var n=Qe(e);if(!Be(n,t))return function(e,t,n){var r,o=pt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!We(r)?r:r===mt(e.t,t)?(ht(e),e.o[t]=gt(e.A.h,r,e)):r},has:function(e,t){return t in Qe(e)},ownKeys:function(e){return Reflect.ownKeys(Qe(e))},set:function(e,t,n){var r=pt(Qe(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=mt(Qe(e),t),a=null==o?void 0:o[kt];if(a&&a.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(Xe(n,o)&&(void 0!==n||Be(e.t,t)))return!0;ht(e),ft(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==mt(e.t,t)||t in e.t?(e.D[t]=!1,ht(e),ft(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Qe(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){He(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){He(12)}},At={};Fe(Lt,(function(e,t){At[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),At.deleteProperty=function(e,t){return At.set.call(this,e,t,void 0)},At.set=function(e,t,n){return Lt.set.call(this,e[0],t,n,e[0])};var xt=function(){function e(e){var t=this;this.g=bt,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return a.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var i;if("function"!=typeof n&&He(6),void 0!==r&&"function"!=typeof r&&He(7),We(e)){var s=it(t),c=gt(t,e,void 0),d=!0;try{i=n(c),d=!1}finally{d?ot(s):at(s)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return rt(s,r),ct(e,s)}),(function(e){throw ot(s),e})):(rt(s,r),ct(i,s))}if(!e||"object"!=typeof e){if(void 0===(i=n(e))&&(i=e),i===Mt&&(i=void 0),t.F&&$e(i,!0),r){var l=[],u=[];tt("Patches").M(e,i,l,u),r(l,u)}return i}He(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,a=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,r,o]})):[a,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){We(e)||He(8),Ve(e)&&(e=vt(e));var t=it(this),n=gt(this,e,void 0);return n[kt].C=!0,at(t),n},t.finishDraft=function(e,t){var n=(e&&e[kt]).A;return rt(n,t),ct(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!bt&&He(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=tt("Patches").$;return Ve(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),Nt=new xt,Dt=Nt.produce;Nt.produceWithPatches.bind(Nt),Nt.setAutoFreeze.bind(Nt),Nt.setUseProxies.bind(Nt),Nt.applyPatches.bind(Nt),Nt.createDraft.bind(Nt),Nt.finishDraft.bind(Nt);const Ut=Dt;function jt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===f(t)?t:String(t)}(t))in e?Object