@zoom/meetingsdk
Version:
Zoom MeetingSDK-Web Client
2 lines • 673 kB
JavaScript
/*! For license information please see zoomus-websdk-ui.umd.min.js.LICENSE.txt */
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("react"),require("redux"),require("redux-thunk")):"function"===typeof define&&define.amd?define(["react","redux","redux-thunk"],t):"object"===typeof exports?exports["@zoom/meetingsdk"]=t(require("react"),require("redux"),require("redux-thunk")):e["@zoom/meetingsdk"]=t(e[void 0],e[void 0],e[void 0])}(self,(function(e,t,n){return function(){var r={670:function(e,t,n){var r,o,i,a;function u(e,t,n){return t=l(t),function(e,t){if(t&&("object"==S(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}(e,c()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(){"use strict";v=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new F(r||[]);return o(a,"_invoke",{value:T(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",p="suspendedYield",_="executing",h="completed",g={};function m(){}function E(){}function y(){}var D={};c(D,a,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==n&&r.call(w,a)&&(D=w);var A=y.prototype=m.prototype=Object.create(D);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,u){var s=f(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==S(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function T(t,n,r){var o=d;return function(i,a){if(o===_)throw Error("Generator is already running");if(o===h){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var s=I(u,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=_;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?h:p,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=h,r.method="throw",r.arg=c.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(S(t)+" is not iterable")}return E.prototype=y,o(A,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:E,configurable:!0}),E.displayName=c(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,s,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,u,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new C(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(A),c(A,s,"Generator"),c(A,a,(function(){return this})),c(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function E(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e){var t=function(e,t){if("object"!=S(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==S(t)?t:t+""}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e){return S="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},S(e)}e=n.nmd(e),self,a=function(e,t,n){return function(){var r={88213:function(e,t,n){!function(e,t){"use strict";var n={INIT_SUCCESS:"INIT_SUCCESS",INIT_FAIL:"INIT_FAIL",DEVICE_CHANGED:"DEVICE_CHANGED",DEVICE_PERMISSION_MAY_GRANT:"DEVICE_PERMISSION_MAY_GRANT",DEVICE_SELECTED:"DEVICE_SELECTED",HANDLE_DEVICE_CHANGED:"HANDLE_DEVICE_CHANGED"},r="activeMicrophoneDeviceId",o="activeMicrophoneLabel",i="activeSpeakerDeviceId",a="activeSpeakerLabel",u="activeCameraDeviceId",s="activeCameraDeviceLabel",c={labelForDefaultDevice:"default",isExternalMode:!1,shouldListenDeviceChange:!0,setCache:function(e,t){return localStorage.setItem(e,t)},getCache:function(e){return localStorage.getItem(e)}},l=function(){function e(e){var t=Object.assign({},c,e);this._eb=function(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}(),this._labelForDefaultDevice=t.labelForDefaultDevice,this._setCache=t.setCache,this._getCache=t.getCache,this._deviceMap=new Map,this._microphoneIdList=[],this._speakerIdList=[],this._cameraIdList=[],this._activeMicrophone="default",this._activeSpeaker="default",this._activeCamera="default",this._initComplete=!1,this._isMicrophoneAuthorized=!1,this._isCameraAuthorized=!1,this._isExternalMode=Boolean(t.isExternalMode),this._shouldListenDeviceChange=t.shouldListenDeviceChange}return e.prototype.isMicDeviceValid=function(e,t){return(this._isExternalMode||"communications"!==e)&&!/ZoomAudioDevice/i.test(t)&&!/Zoom-\S*/.test(t)&&!/CubebAggregateDevice\S*/.test(t)&&!/Microsoft Teams Audio/i.test(t)},e.prototype.isSpeakerDeviceValid=function(e,t){return(this._isExternalMode||"communications"!==e)&&!/ZoomAudioDevice/i.test(t)&&!/Microsoft Teams Audio/i.test(t)},e.getDeviceKey=function(e,t){return"".concat(e,":").concat(t)},e.isSameDevice=function(e,t){return!(!e||!t)&&e.deviceId===t.deviceId&&e.label===t.label},e.prototype.init=function(){var e=this;"ondevicechange"in navigator.mediaDevices&&this._shouldListenDeviceChange&&(navigator.mediaDevices.ondevicechange=function(){e._handleDeviceChange()}),this._enumerateDevice().then((function(t){e._updateDevices(t),e._updateActiveDevices(),e.emit(n.INIT_SUCCESS,e.getDeviceState())})).catch((function(t){e.emit(n.INIT_FAIL,t)})).finally((function(){e._initComplete=!0})),this.on(n.DEVICE_PERMISSION_MAY_GRANT,(function(){e._isMicrophoneAuthorized&&e._isCameraAuthorized||e._enumerateDevice().then((function(t){e._updateDevices(t),(e._isMicrophoneAuthorized||e._isCameraAuthorized)&&e.emit(n.DEVICE_CHANGED,e.getDeviceState())}))})),this.on(n.HANDLE_DEVICE_CHANGED,(function(){e._handleDeviceChange()}))},e.prototype._handleDeviceChange=function(){var e=this;this._enumerateDevice().then((function(t){e._updateDevices(t),e._updateActiveDevices(),e.emit(n.DEVICE_CHANGED,e.getDeviceState())}))},e.prototype._enumerateDevice=function(){return"object"!==S(navigator.mediaDevices)?Promise.resolve([]):navigator.mediaDevices.enumerateDevices()},e.prototype._updateDevices=function(e){var n,r,o,i=this;this._microphoneIdList=[],this._speakerIdList=[],this._cameraIdList=[],this._deviceMap.clear(),e.forEach((function(e){var a=e.kind,u=e.deviceId,s=e.label,c={kind:a,deviceId:u,label:s};i._hasDevice(a,u)||("audioinput"===a&&i.isMicDeviceValid(u,s)&&(i._microphoneIdList.push(u),t.isEmpty(u)||t.isEmpty(s)||(i._isMicrophoneAuthorized=!0),"default"===u&&(n=u),c.label||(c.label="default"===u?i._labelForDefaultDevice:"".concat("Unrecognized microphone").concat(i._microphoneIdList.length))),"audiooutput"===a&&i.isSpeakerDeviceValid(u,s)&&(i._speakerIdList.push(u),"default"===u&&(r=u),c.label||(c.label="default"===u?i._labelForDefaultDevice:"".concat("Unrecognized speaker").concat(i._speakerIdList.length))),"videoinput"===a&&(i._cameraIdList.push(u),"default"===u&&(o=u),t.isEmpty(u)||t.isEmpty(s)||(i._isCameraAuthorized=!0),c.label||(c.label="default"===u?i._labelForDefaultDevice:"".concat("Unrecognized camera").concat(i._cameraIdList.length))),i._setDevice(a,u,c))})),n||(this._setDevice("audioinput","default",{kind:"audioinput",deviceId:"default",label:this._labelForDefaultDevice}),this._microphoneIdList.unshift("default")),r||(this._setDevice("audiooutput","default",{kind:"audiooutput",deviceId:"default",label:this._labelForDefaultDevice}),this._speakerIdList.unshift("default")),o||(this._setDevice("videoinput","default",{kind:"videoinput",deviceId:"default",label:this._labelForDefaultDevice}),this._cameraIdList.unshift("default"))},e.prototype._updateActiveDevices=function(){var e=this;["audioinput","audiooutput","videoinput"].forEach((function(t){var n=e._getActiveDeviceIdByKind(t),r=e._getManuallySelectedDevice(t),o=e._getDeviceListByKind(t);r&&e._hasDevice(t,r.deviceId)?e._setActiveDeviceIdByKind(t,r.deviceId):e._hasDevice(t,n)||e._setActiveDeviceIdByKind(t,o[0])}))},e.prototype.getDeviceState=function(){var e=this;return{microphones:this._microphoneIdList.map((function(t){return e._getDevice("audioinput",t)})),speakers:this._speakerIdList.map((function(t){return e._getDevice("audiooutput",t)})),cameras:this._cameraIdList.map((function(t){return e._getDevice("videoinput",t)})),activeMicrophone:this._activeMicrophone,activeSpeaker:this._activeSpeaker,activeCamera:this._activeCamera}},e.prototype.isInitComplete=function(){return this._initComplete},e.prototype.emit=function(e,t){this._eb.emit(e,t)},e.prototype.on=function(e,t){this._eb.on(e,t)},e.prototype.off=function(e,t){this._eb.off(e,t)},e.prototype._setManuallySelectedDevice=function(e,t){if(!this._hasDevice(e,t))throw Error("device with id ".concat(t," not exist!"));var n=this._getDevice(e,t);"audioinput"===n.kind?(this._setCache(r,t),this._setCache(o,n.label)):"audiooutput"===n.kind?(this._setCache(i,t),this._setCache(a,n.label)):"videoinput"===n.kind&&(this._setCache(u,t),this._setCache(s,n.label))},e.prototype._getManuallySelectedDevice=function(e){var t,n;return"audioinput"===e?(t=this._getCache(r),n=this._getCache(o)):"audiooutput"===e?(t=this._getCache(i),n=this._getCache(a)):"videoinput"===e&&(t=this._getCache(u),n=this._getCache(s)),t&&n?{deviceId:t,label:n}:null},e.prototype.manuallySelectSpeaker=function(e){this._setManuallySelectedDevice("audiooutput",e),this._activeSpeaker=e,this.emit(n.DEVICE_SELECTED,{activeSpeaker:e})},e.prototype.manuallySelectMicrophone=function(e){this._setManuallySelectedDevice("audioinput",e),this._activeMicrophone=e,this.emit(n.DEVICE_SELECTED,{activeMicrophone:e})},e.prototype.manuallySelectCamera=function(e){this._setManuallySelectedDevice("videoinput",e),this._activeCamera=e,this.emit(n.DEVICE_SELECTED,{activeCamera:e})},e.prototype._getDeviceListByKind=function(e){return"audioinput"===e?this._microphoneIdList:"audiooutput"===e?this._speakerIdList:"videoinput"===e?this._cameraIdList:[]},e.prototype._getActiveDeviceIdByKind=function(e){return"audioinput"===e?this._activeMicrophone:"audiooutput"===e?this._activeSpeaker:"videoinput"===e?this._activeCamera:""},e.prototype._setActiveDeviceIdByKind=function(e,t){"audioinput"===e?this._activeMicrophone=t:"audiooutput"===e?this._activeSpeaker=t:"videoinput"===e&&(this._activeCamera=t)},e.prototype._hasDevice=function(t,n){return this._deviceMap.has(e.getDeviceKey(t,n))},e.prototype._getDevice=function(t,n){var r=this._deviceMap.get(e.getDeviceKey(t,n));return function(e){if(null==e)throw new Error("device not exist")}(r),r},e.prototype._setDevice=function(t,n,r){this._deviceMap.set(e.getDeviceKey(t,n),r)},e.prototype.watchInitComplete=function(){var e=this;return new Promise((function(t,r){e.isInitComplete()?t(e.getDeviceState()):(e.on(n.INIT_SUCCESS,t),e.on(n.INIT_FAIL,r))}))},e}(),f={FEATUTRE_FLAG_UNDEFINE:void 0,FEATUTRE_FLAG_ENABLE:!0,FEATUTRE_FLAG_DISABLE:!1},d=function(){function e(e){this.featureOptions=e||""}return e.prototype.getOpFeatureFlagBit=function(e,t){void 0===t&&(t=1);var n=this.featureOptions.length-e-t+1;if(!(n<0)){var r=this.featureOptions.slice(n,this.featureOptions.length-e+1);if(r)return parseInt(r,16)}},e.prototype.getOpFeatureFlag=function(e,t,n){void 0===t&&(t=1);var r=this.getOpFeatureFlagBit(e,t);if(void 0===r)return f.FEATUTRE_FLAG_UNDEFINE;if(n){var o=n(r);if(void 0!==o&&"boolean"!==typeof o)throw new Error("Rule must return FEATUTRE_FLAG type value");return o}return 0!==r?f.FEATUTRE_FLAG_ENABLE:f.FEATUTRE_FLAG_DISABLE},e.prototype.getOpFeatureFlagFromRuleMap=function(e,t,n,r){void 0===t&&(t=1),void 0===r&&(r=[]);var o=this.getOpFeatureFlagBit(e,t);if(void 0===o)return f.FEATUTRE_FLAG_UNDEFINE;var i=r.find((function(e){return"function"===typeof e.checked?e.checked(o,e):!!e.checked}));return i?i.rule?i.rule(o,i):n?n(o,i):f.FEATUTRE_FLAG_DISABLE:f.FEATUTRE_FLAG_DISABLE},e}(),p=function(e,t){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},p(e,t)};function _(e,t){function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var h=function(){return h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},g=new Error("Browser don't support change speaker");g.name="CHANGE_SPEAKER_ERROR";var v=function(){function e(e){this.options=h({analyserFrequent:20},e||{}),this.initAudioCtx(),this.initAnalyserNode(),this.initAudioPlayer(),this.setAnalyzingStatus(!1)}return e.prototype.getAnalyzingStatus=function(){return!!this.isAnalyzing},e.prototype.setAnalyzingStatus=function(e){this.isAnalyzing=!!e},e.prototype.getDestroyedStatus=function(){return!!this.isDestroyed},e.prototype.setDestroyedStatus=function(e){this.isDestroyed=!!e},e.prototype.initAudioCtx=function(){this.audioCtx=new AudioContext,this.destinationNode=new MediaStreamAudioDestinationNode(this.audioCtx)},e.prototype.initAnalyserNode=function(){this.analyserNode=this.audioCtx.createAnalyser(),this.analyserNode.connect(this.destinationNode),this.analyserNode.fftSize=1024},e.prototype.analyserNodeIntervalCallback=function(){var e,t;if(this.analyserNodeBufferDataArray&&this.options.analyserCallback){this.analyserNode.getByteFrequencyData(this.analyserNodeBufferDataArray);var r=0;try{for(var o=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.analyserNodeBufferDataArray),i=o.next();!i.done;i=o.next())r+=i.value}catch(n){e={error:n}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}var a=r/this.analyserNodeBufferDataArray.length;this.options.analyserCallback(a)}},e.prototype.setAnalyzeInterval=function(){this.clearAnalyzeInterval();var e=this.analyserNode.frequencyBinCount;this.analyserNodeBufferDataArray=new Uint8Array(e),this.analyserNodeTimer=window.setInterval(this.analyserNodeIntervalCallback.bind(this),this.options.analyserFrequent)},e.prototype.clearAnalyzeInterval=function(){this.analyserNodeTimer&&(window.clearInterval(this.analyserNodeTimer),this.analyserNodeTimer=null,this.analyserNodeBufferDataArray=null)},e.prototype.stopAnalyze=function(){this.setAnalyzingStatus(!1),this.clearAnalyzeInterval(),this.stopAudioPlayer()},e.prototype.startAnalyze=function(e){var t=this;return this.getAnalyzingStatus()?Promise.reject(new Error("Analyze is runing already")):this.getDestroyedStatus()?Promise.reject(new Error("WCAudioOutputLevel is destroyed already")):(this.setAnalyzingStatus(!0),(e?e():Promise.resolve(!0)).then((function(){return t.setAnalyzeInterval(),t.startAudioPlayer()})).catch((function(e){throw t.stopAnalyze(),console.error(e),e})))},e.prototype.initAudioPlayer=function(){this.audioPlayer=new Audio,this.audioPlayer.loop=!0,this.audioPlayer.srcObject=this.destinationNode.stream},e.prototype.stopAudioPlayer=function(){this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.pause())},e.prototype.startAudioPlayer=function(){return this.resumeAudioCtx(),this.audioPlayer.currentTime=0,this.audioPlayer.play()},e.prototype.resumeAudioCtx=function(){"running"!==this.audioCtx.state&&this.audioCtx.resume()},e}(),m=function(){function e(e){this.options=h({maxRecordDuration:1e4},e||{}),this.isRecording=!1,this.chunks=[],this.initAudioPlayer()}return e.prototype.isSupportReording=function(){return"function"===typeof MediaRecorder},e.prototype.start=function(e){var t=this;if(!this.isSupportReording())return Promise.reject(new Error("Broswer doesn't support MeidaRecorder"));if(this.isRecording)return Promise.reject(new Error("Recording is running already"));var n=new Promise((function(n,r){t.isRecording=!0,t.setRecordTimer(),t.recorder=new MediaRecorder(e),t.recorder.ondataavailable=t.handleDataAvailable.bind(t),t.recorder.onstop=function(){n(t.handleRecordStopped())},t.recorder.onerror=r,t.recorder.start()})).finally(this.clearRecordStatus.bind(this)),r=n.then((function(e){return!!e&&t.startAudioPlayer(e)}));return Promise.resolve({recordPromise:n,playRecordPromise:r})},e.prototype.setRecordTimer=function(){this.clearRecordTimer(),this.timer=window.setTimeout(this.stop.bind(this),this.options.maxRecordDuration)},e.prototype.clearRecordTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.handleDataAvailable=function(e){e.data&&this.chunks.push(e.data)},e.prototype.handleRecordStopped=function(){var e;if(this.chunks.length>0&&this.shouldPlayAfterStop){var t=new Blob(this.chunks,{type:(null===(e=this.chunks[0])||void 0===e?void 0:e.type)||"audio/ogg; codecs=opus"});return window.URL.createObjectURL(t)}return""},e.prototype.clearRecordStatus=function(){this.clearRecordTimer(),this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null),this.recorder=null,this.isRecording=!1,this.chunks=[],this.shouldPlayAfterStop=!1},e.prototype.stop=function(e){void 0===e&&(e=!0),this.recorder&&this.isRecording&&(this.shouldPlayAfterStop=e,this.recorder.stop())},e.prototype.initAudioPlayer=function(){this.audioPlayer=new Audio},e.prototype.stopAudioPlayer=function(){this.audioPlayer&&this.audioPlayer.pause()},e.prototype.clearAudioPlayerStatus=function(){this.audioPlayer.currentTime=0,this.audioPlayer.src="",this.audioPlayer.onended=null,this.audioPlayer.onpause=null,this.audioPlayer.onerror=null},e.prototype.startAudioPlayer=function(e){var t=this;return new Promise((function(n,r){t.audioPlayer.src=e,t.audioPlayer.currentTime=0,t.audioPlayer.play().catch(r),t.audioPlayer.onended=function(){window.URL.revokeObjectURL(e),n(!0)},t.audioPlayer.onpause=function(){window.URL.revokeObjectURL(e),n(!0)},t.audioPlayer.onerror=r})).finally(this.clearAudioPlayerStatus.bind(this))},e.prototype.changeSpeaker=function(e){return this.audioPlayer.setSinkId?this.audioPlayer.setSinkId(e):Promise.reject(g)},e}(),E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t.IsBrowserSupport=function(){return"function"===typeof AudioContext&&"function"===typeof MediaStreamAudioDestinationNode&&Boolean(AudioContext.prototype.createAnalyser)&&Boolean(AudioContext.prototype.createBufferSource)&&AudioContext.prototype.decodeAudioData},t.IsBrowserSupportChangeSpeaker=function(){return"function"===typeof Audio.prototype.setSinkId},t.prototype.start=function(e,t){var n=this;return e?this.startAnalyze((function(){return n.initSourceNode(e)})).then((function(){if(t)return n.changeSpeaker(t,!1)})):Promise.reject(new Error("No audio data to test speaker"))},t.prototype.stop=function(){this.stopAnalyze(),this.clearSourceNode()},t.prototype.initSourceNode=function(e){var t=this;return this.clearSourceNode(),(this.sourceNodeBuffer?Promise.resolve(this.sourceNodeBuffer):this.audioCtx.decodeAudioData(e)).then((function(e){return t.sourceNode=t.audioCtx.createBufferSource(),t.sourceNodeBuffer=e,t.sourceNode.buffer=e,t.sourceNode.loop=!0,t.sourceNode.connect(t.analyserNode),t.sourceNode.start(0),t.resumeAudioCtx(),!0})).catch((function(e){throw t.clearSourceNode(),console.error(e),e}))},t.prototype.clearSourceNode=function(){this.sourceNode&&(this.sourceNode.stop(0),this.sourceNode.disconnect(this.analyserNode),this.sourceNode.buffer=null,this.sourceNode=null)},t.prototype.destroy=function(){this.stop(),this.analyserNode.disconnect(this.destinationNode),this.setDestroyedStatus(!0),this.audioCtx.close(),this.sourceNodeBuffer=null},t.prototype.changeSpeaker=function(e,t){return void 0===t&&(t=!0),t&&this.stop(),this.audioPlayer.setSinkId?this.audioPlayer.setSinkId(e):Promise.reject(g)},t}(v),y=function(e){function t(t){var n=this,r=t||{},o=r.maxRecordDuration,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(r,["maxRecordDuration"]);return(n=e.call(this,i)||this).audioRecorder=new m(o?{maxRecordDuration:o}:void 0),n}return _(t,e),t.IsBrowserSupport=function(){var e;return"function"===typeof AudioContext&&"function"===typeof MediaStreamAudioDestinationNode&&Boolean(AudioContext.prototype.createAnalyser)&&Boolean(AudioContext.prototype.createMediaStreamSource)&&(null===(e=window.navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)},t.IsBrowserSupportChangeSpeaker=function(){return"function"===typeof Audio.prototype.setSinkId},t.prototype.initSourceNode=function(e){var t=this;this.clearSourceNode();var n=e||this.currentMicrophoneDeviceId;return window.navigator.mediaDevices.getUserMedia({audio:!n||{deviceId:n}}).then((function(e){return t.audioStream=e,t.sourceNode=t.audioCtx.createMediaStreamSource(e),t.sourceNode.connect(t.analyserNode),t.resumeAudioCtx(),!0})).catch((function(e){throw t.clearSourceNode(),console.error(e),e}))},t.prototype.clearSourceNode=function(){this.sourceNode&&(this.sourceNode.disconnect(this.analyserNode),this.sourceNode=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach((function(e){e.stop()})),this.audioStream=null),this.audioRecorder&&(this.stopRecord(!1),this.audioRecorder.stopAudioPlayer())},t.prototype.start=function(e){var t=this;return this.startAnalyze((function(){return t.audioPlayer.muted=!0,t.initSourceNode(e)}))},t.prototype.stop=function(){this.stopAnalyze(),this.clearSourceNode()},t.prototype.changeMicrophone=function(e){return this.currentMicrophoneDeviceId=e,this.audioStream&&this.getAnalyzingStatus()?this.initSourceNode(e):Promise.resolve(!0)},t.prototype.destroy=function(){this.stop(),this.analyserNode.disconnect(this.destinationNode),this.setDestroyedStatus(!0),this.audioCtx.close(),this.currentMicrophoneDeviceId=null},t.prototype.startRecord=function(){return this.getAnalyzingStatus()?this.audioStream?this.audioRecorder?this.audioRecorder.start(this.audioStream):Promise.reject(new Error("Recorder has been destroyed")):Promise.reject(new Error("Audio input stream is not capturing")):Promise.reject(new Error("Analyze is not runing"))},t.prototype.stopRecord=function(e){var t;void 0===e&&(e=!0),this.getAnalyzingStatus()&&this.audioStream&&(null===(t=this.audioRecorder)||void 0===t?void 0:t.isRecording)&&this.audioRecorder.stop(e)},t.prototype.changeSpeaker=function(e){this.audioRecorder&&this.audioRecorder.changeSpeaker(e)},t}(v),D={timeout:0,deps:[]},b=Error("Job was cancelled."),w=function(){function e(){}return e.getJob=function(t){var n=e.jobs.get(t);return function(e){if(null==e)throw new Error("job not exist")}(n),n},e.start=function(n,r,o){if(void 0===r&&(r=t.noop),!n)throw Error("id required!");e.check(n)&&e.fail(n,b);var i=t.extend({},D,o),a=i.timeout,u=i.deps,s={deps:u,result:[],resolve:t.noop,reject:t.noop,job:Promise.resolve(),timer:0},c=[new Promise((function(t,o){s.resolve=t,s.reject=o,e.jobs.set(n,s),r()}))];if(a){var l=new Promise((function(e,t){s.timer=window.setTimeout((function(){t(Error("".concat(n," job timeout after ").concat(a," ms")))}),a)}));c.push(l)}return s.job=Promise.race(c),u.forEach((function(t){var r=e.deps.get(t);null==r?e.deps.set(t,[n]):r.push(n)})),s.job},e.watch=function(n){if(e.jobs.has(n))return e.getJob(n).job;var r=t.uniqueId();return e.start(r,t.noop,{deps:[n]})},e.check=function(t){return e.jobs.has(t)},e.completeSync=function(t,n){e.start(t),e.complete(t,n)},e.complete=function(t,n){var r=e.getJob(t),o=r.deps;if(o.length>0)throw Error("dependent step ".concat(o," not complete yet!"));r.result=n,r.resolve(n),r.timer&&clearTimeout(r.timer);var i=e.deps.get(t);Array.isArray(i)&&i.forEach((function(r){var o=e.getJob(r),i=o.deps,a=o.result,u=i.indexOf(t);u>-1&&(i.splice(u,1),a.push(n)),0===i.length&&e.complete(r,a)}))},e.fail=function(t,n){if(e.jobs.has(t)){var r=e.getJob(t);r.reject(n),r.timer&&clearTimeout(r.timer);var o=e.deps.get(t);Array.isArray(o)&&o.forEach((function(t){e.fail(t,"dependent job ".concat(t," failed"))}))}},e.jobs=new Map,e.deps=new Map,e}();e.DEVICE_EVENTS=n,e.DeviceManager=l,e.FEATUTRE_FLAG=f,e.Job=w,e.JobCancelError=b,e.OpFeatureUtility=d,e.WCAudioInputLevel=y,e.WCAudioOutputLevel=E,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(2543))},17696:function(e,t,n){"use strict";n.d(t,{EP:function(){return l},Sf:function(){return c},zQ:function(){return s}});var r=n(56507),o=n(68001),i=n(76046),a=n(50704),u=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n="".concat(e);n.length<t;)n="0".concat(n);return n},s=function(e){var t=new Date(e);return"".concat(t.getUTCFullYear(),"-").concat(u(t.getUTCMonth()+1),"-").concat(u(t.getUTCDate())," ").concat(u(t.getUTCHours()),":").concat(u(t.getUTCMinutes()),":").concat(u(t.getUTCSeconds()),".").concat(u(t.getUTCMilliseconds(),3))},c={version:"000001",flag:"0"},l=function(e){return e.reduce((function(e,t){var n=function(e){var t=e.message,n=e.logLevel,r=e.tags,u=e.timestamp,c=(e.id,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["message","logLevel","tags","timestamp","id"])),l=Object.assign({time:s(u),logLevel:o.$b[n],message:t,tags:r,laplaceSessionId:a.y},c);return(0,i.s)(l)}(t),u=(0,r.Su)(n),c=e[e.length-1];return c.currentSize+u>30720?e.push({messages:[n],ids:[t.id],currentSize:u}):(c.messages.push(n),c.ids.push(t.id),c.currentSize+=u),e}),[{messages:[],ids:[],currentSize:0}]).filter((function(e){return e.currentSize>0})).map((function(e){return{messages:e.messages.join("\n"),ids:e.ids,meta:c}}))}},16257:function(e,t,n){"use strict";n.d(t,{H:function(){return a}});var r=n(77783),o=n(17175),i=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function u(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},a=E((function e(t){var a=this;D(this,e),this.set=function(e,t){try{return!a.disableDB&&o.g.enqueue((function(){return i(a,void 0,void 0,v().mark((function n(){return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,r.hZ)(e,t,this.store));case 1:case"end":return n.stop()}}),n,this)})))}))}catch(n){a.disableDB=!0}},this.makeNextId=function(){return a.nextId+=1,a.nextId},this.addLog=function(e){a.addToMemory(e);var t=e.id;return Number.isNaN(t),a.set("".concat(t),e)},this.addToMemory=function(e,t){a.memoryStoreData=t?[].concat(e):a.memoryStoreData.concat(e)},this.syncFromIDB=function(){return i(a,void 0,void 0,v().mark((function e(){var t,n,a,u,s=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.g.enqueue((function(){return i(s,void 0,void 0,v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,r.jO)(this.store));case 1:case"end":return e.stop()}}),e,this)})))}));case 2:if(n=e.sent,a=n.filter((function(e){var t=_(e,2),n=t[0],r=t[1];return!(null===r||void 0===r?void 0:r.id)&&0!==(null===r||void 0===r?void 0:r.id)||!Number.isInteger(Number(n))})).map((function(e){return e[0]})),u=n.filter((function(e){var t=_(e,1)[0];return!a.includes(t)})).sort((function(e,t){var n,r;return(null===(n=e[1])||void 0===n?void 0:n.id)-(null===(r=t[1])||void 0===r?void 0:r.id)})).map((function(e){return _(e,2)[1]})),this.addToMemory(u,!0),e.t0=a.length>0,!e.t0){e.next=10;break}return e.next=10,this.deleteLogs(a);case 10:return this.nextId=0===this.memoryStoreData.length?0:null===(t=this.memoryStoreData[this.memoryStoreData.length-1])||void 0===t?void 0:t.id,e.abrupt("return",this.memoryStoreData);case 12:case"end":return e.stop()}}),e,this)})))},this.getStore=function(){return a.memoryStoreData},this.filterStore=function(e){var t,n=[e].flatMap((function(e){return e}));return t=e?a.memoryStoreData.filter((function(e){return n.some((function(t){return"string"===typeof t?e.tags.some((function(e){return t===e})):"function"===typeof t&&t(e)}))})):a.memoryStoreData,t},this.deleteLogs=function(e){return i(a,void 0,void 0,v().mark((function t(){var n=this;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.deleteMemoryLogs(e),o.g.enqueue((function(){return i(n,void 0,void 0,v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,r.LJ)(e.map((function(e){return"".concat(e)})),this.store));case 1:case"end":return t.stop()}}),t,this)})))}))));case 1:case"end":return t.stop()}}),t,this)})))},this.deleteLogsAfterReport=function(e){return i(a,void 0,void 0,v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.deleteMemoryLogs(e),(0,r.LJ)(e.map((function(e){return"".concat(e)})),this.store)));case 1:case"end":return t.stop()}}),t,this)})))},this.deleteMemoryLogs=function(e){a.memoryStoreData=a.memoryStoreData.filter((function(t){var n;return!(null===(n=e.includes)||void 0===n?void 0:n.call(e,t.id))}))},this.reset=function(){a.memoryStoreData=[],o.g.enqueue((function(){return i(a,void 0,void 0,v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,r.IU)(this.store));case 1:case"end":return e.stop()}}),e,this)})))}))},this.nextId=0,this.memoryStoreData=[],this.disableDB=!1,o.g.enqueue((function(){return i(a,void 0,void 0,v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,r.y$)(t,t+"-store"));case 1:case"end":return e.stop()}}),e)})))})).then((function(e){a.store=e}))}))},29182:function(e,t,n){"use strict";n.d(t,{C:function(){return r},Z:function(){return g}});var r=n(68001),o=n(17696),i=n(16257),a=n(60480),u=n(76046),s=n(47977),c=n(17175),l=n(25858),f=n.n(l),d=n(50704),_=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function u(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},h={databaseName:"laplace-default-db"},g=E((function e(t){var n=this;D(this,e),this.cacheFilter=[],this.log=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.$b.log,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _(n,void 0,void 0,v().mark((function n(){var u,s,c;return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.reportUrl){n.next=2;break}return n.abrupt("return");case 2:u=[t,this.publicTags].flatMap((function(e){return e})),s=function(e,t,n,r){var o=Date.now();return Object.assign({message:e,logLevel:n,tags:t,timestamp:o},r)}(e,u,o,Object.assign(Object.assign({},this.publicAttributes),i)),(c=(0,a.s)(this,r.Ii.beforeLog,s)).id=this.idbManager.makeNextId(),this.idbManager.addLog(c),(0,a.s)(this,r.Ii.afterLog,c);case 4:case"end":return n.stop()}}),n,this)})))},this.deleteLog=function(e,t){if(!Array.isArray(t)||(n.idbManager.deleteLogs(t),e)){var r=n.idbManager.filterStore(e).map((function(e){return e.id}));n.idbManager.deleteLogs(r)}},this.deleteAll=function(){n.idbManager.reset()},this.getLogs=function(e){return n.idbManager.filterStore(e)},this.throttleReport=f()((function(e){n.reportByHttps(e),n.cacheFilter=[]}),5e3,{leading:!0,trailing:!0}),this.reportByFilter=function(e){n.cacheFilter=n.cacheFilter.concat(e),n.throttleReport(n.cacheFilter)},this.reportByHttps=function(e){return _(n,void 0,void 0,v().mark((function t(){var n=this;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:c.g.enqueue((function(){return _(n,void 0,void 0,v().mark((function t(){var n,i,u;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.idbManager.filterStore(e))&&0!==n.length){t.next=3;break}return t.abrupt("return");case 3:return i=(0,a.s)(this,r.Ii.beforeReport,n),u=(0,o.EP)(i),t.abrupt("return",this.commonReport(u));case 5:case"end":return t.stop()}}),t,this)})))}));case 1:case"end":return t.stop()}}),t)})))},this.directReport=function(e,t){var i,a,u,s,c=null!==(i=t.sampleRate)&&void 0!==i?i:1;if(!(Math.random()>c))return s=t.useRawData?e:Object.assign({message:e,time:(0,o.zQ)(Date.now()),tags:[].concat(p(null!==(a=null===t||void 0===t?void 0:t.tags)&&void 0!==a?a:[]),p(n.publicTags)),logLevel:null!==(u=null===t||void 0===t?void 0:t.logLevel)&&void 0!==u?u:r.$b.log,laplaceSessionId:d.y},n.publicAttributes),n.commonReport([{messages:s,meta:o.Sf}],!1)},this.commonReport=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(n.reportUrl)return Promise.all(e.map((function(e){return{url:n.reportUrl,type:"POST",withCredentials:!1,headers:{},data:(0,u.s)({messages:e.messages,meta:e.meta}),reportItem:e}})).map(s.x)).then((function(e){var o=e.filter((function(e){return!e.error})).flatMap((function(e){return e.report.ids}));if((0,a.s)(n,r.Ii.afterReport,{removeIds:o}),t)return n.idbManager.deleteLogsAfterReport(o)}))};var i=t.databaseName,l=t.reportUrl,h=void 0===l?"":l,g=t.plugins,m=void 0===g?[]:g,E=t.idbManager,y=t.publicTags,S=void 0===y?[]:y,b=t.publicAttributes,w=void 0===b?{}:b;this.databaseName=i,this.reportUrl=h,this.plugins=m,this.idbManager=E,this.publicTags=S,this.publicAttributes=w,(0,a.s)(this,r.Ii.afterInit)}));g.init=function(e){return _(void 0,void 0,void 0,v().mark((function t(){var n,r,o;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.databaseName,r=void 0===n?"laplace-default-db":n,o=new i.H(r),t.next=3,o.syncFromIDB();case 3:return t.abrupt("return",new g(Object.assign(Object.assign(Object.assign({},h),e),{idbManager:o})));case 4:case"end":return t.stop()}}),t)})))}},68001:function(e,t,n){"use strict";var r,o;n.d(t,{$b:function(){return r},Ii:function(){return o},UU:function(){return i}}),function(e){e[e.info=0]="info",e[e.debug=1]="debug",e[e.log=2]="log",e[e.warn=3]="warn",e[e.error=4]="error"}(r||(r={})),function(e){e.afterInit="afterInit",e.beforeLog="beforeLog",e.afterLog="afterLog",e.beforeReport="beforeReport",e.afterReport="afterReport"}(o||(o={}));var i=E((function e(){D(this,e)}))},34493:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=function(e){function t(e){var n;return D(this,t),(n=u(this,t)).config={debug:!1},n.debugLog=function(e){n.config.debug&&console.log("[AutoCleanLogPlugin]: ".concat(e))},n.afterInit=function(e){var t=n.config.expireBefore;if(t){var r=e.idbManager.getStore(),o=("function"===typeof t?r.filter(t):r.filter((function(e){return e.timestamp<t}))).map((function(e){return e.id}));e.deleteLog(void 0,o),n.debugLog("afterInit, clean log id: ".concat(o))}else n.debugLog("early return on beforeInit because expireBefore is falsy")},e&&(n.config=e),n}return f(t,e),E(t)}(n(68001).UU),o=r},22112:function(e,t,n){"use strict";n.d(t,{A:function(){return d}});var r=n(68001),o=n(56507),i=n(76046),a=n(25858),s=n.n(a),c=["RESOURCE_ERROR","JS_ERROR","UNHANDLED_PROMISE_REJECTION"],l=function(e){function t(e){var a;return D(this,t),(a=u(this,t)).config={debug:!1,publicTags:[]},a.errorCount=0,a.hashErrors={},a.addPublicTags=function(e){var t;return null===(t=a.config.publicTags)||void 0===t?void 0:t.concat(e).filter((function(e){return e}))},a.debugLog=function(e){a.config.debug&&console.log("[AutoLogErrorPlugin]:",e)},a.ignore=function(e){var t,n,r,o,i;return void 0!==(null===(t=a.config)||void 0===t?void 0:t.maxErrorCount)&&a.errorCount>=(null===(n=a.config)||void 0===n?void 0:n.maxErrorCount)||!!(null===(r=a.config)||void 0===r?void 0:r.ignoredErrorMsgKeywords)&&e&&(null===(i=null===(o=a.config)||void 0===o?void 0:o.ignoredErrorMsgKeywords)||void 0===i?void 0:i.some((function(t){return null===e||void 0===e?void 0:e.includes(t)})))},a.report=s()((function(e){}),600,{trailing:!0,leading:!1}),a.afterInit=function(e){if(self.addEventListener){var t=function(t,n,i,u){a.debugLog(i),a.errorCount+=1;try{return(0,o.W7)(t).then((function(o){return a.hashErrors[o]?"dismissed":(a.hashErrors[o]=!0,e.log(t,a.addPublicTags([].concat(n)),null!==u&&void 0!==u?u:r.$b.error,{extraProperties:{messageHash:o}}).then((function(){return e.reportByFilter(c)})))})).catch(console.error)}catch(s){return console.error(s),Promise.resolve(s)}};try{self.addEventListener("error",(function(e){var n,r,o,i,u,s,c;if(!a.ignore(null===e||void 0===e?void 0:e.message)){if("function"===typeof a.config.onError){var l=a.config.onError(e),f=l.message,d=l.tags,_=l.logLevel;return t(f,["JS_ERROR"].concat(p(d)),e,_)}if((null===e||void 0===e?void 0:e.target)&&((null===(n=null===e||void 0===e?void 0:e.target)||void 0===n?void 0:n.src)||(null===(r=null===e||void 0===e?void 0:e.target)||void 0===r?void 0:r.href))){var h="Load Resource Error in ".concat(null===(o=null===e||void 0===e?void 0:e.target)||void 0===o?void 0:o.tagName," element: ").concat((null===(i=null===e||void 0===e?void 0:e.target)||void 0===i?void 0:i.src)||(null===(u=null===e||void 0===e?void 0:e.target)||void 0===u?void 0:u.href));return t(h,"RESOURCE_ERROR",e)}var g="Javascript Runtime Error in ".concat(null===e||void 0===e?void 0:e.filename," (").concat(null===e||void 0===e?void 0:e.lineno,":").concat(null===e||void 0===e?void 0:e.colno,"): ").concat(null===e||void 0===e?void 0:e.message,"\nStack: ").concat(null!==(c=null===(s=null===e||void 0===e?void 0:e.error)||void 0===s?void 0:s.stack)&&void 0!==c?c:null===e||void 0===e?void 0:e.stack);return t(g,"JS_ERROR",e)}})),self.addEventListener("unhandledrejection",(function(e){var n;if(!a.ignore(null===(n=null===e||void 0===e?void 0:e.reason)||void 0===n?void 0:n.message)){if("function"===typeof a.config.onError){var r=a.config.onError(e),o=r.message,u=r.tags,s=r.logLevel;return t(o,["UNHANDLED_PROMISE_REJECTION"].concat(p(u)),e,s)}var c,l=null===e||void 0===e?void 0:e.reason;return c="string"===typeof l?"Promise Error: ".concat(l):l instanceof Error?"Promise Error: ".concat(l.message," ").concat(l.name," ").concat(l.stack):"object"===S(l)?"Promise Error with reason: ".concat((0,i.s)(l)):"Promise Error with unrecognized reason: ".concat(l),t(c,"UNHANDLED_PROMISE_REJECTION",e)}}))}catch(n){console.error(n)}a.debugLog("afterInit, add listener")}},e&&(a.config=e),a.config.publicTags=[].concat(null===e||void 0===e?void 0:e.publicTags),a}return f(t,e),E(t)}(r.UU),d=l},28041:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(68001),o=n(14687),i=n.n(o),a=["STATIC_RESOURCE_TIMING"],c=function(e){function t(e){var n;return D(this,t),(n=u(this,t)).config={debug:!1,publicTags:[],excludeResourceTimingKeys:[],userRegion:"",enable:!1},n.entryList=[],n.debugLog=function(e){n.config.debug&&console.log("[AutoLogStaticResourcePlugin]:",e)},n.addPublicTags=function(e){var t;return null===(t=n.config.publicTags)||void 0===t?void 0:t.concat(e).filter((function(e){return e}))},n.pickEntryProperties=function(e){var t,r=e.domainLookupEnd,o=e.domainLookupStart,a=e.redirectStart,u=e.redirectEnd,s=e.connectStart,c=e.connectEnd,l=e.secureConnectionStart,f=e.responseEnd,d=e.responseStart,p=e.requestStart,_=0!==o,h=_?Math.round(r-o):-1,g=_?Math.round(d-p):-1,v=_?Math.round(u-a):-1,m=_?Math.round(c-s):-1;l&&_&&(m=Math.round(c-l));var E=_?Math.round(f-d):-1,y=navigator.connection?navigator.connection.effectiveType:"Unknown",D=i()(e,n.config.excludeResourceTimingKeys.concat("toJSON","Symbol(Symbol.toStringTag)")),S=function(e){var t=(e=e.replace(/\/+$/,"")).match(/[^/]+$/);return t?t[0]:null}(null!==(t=D.name)&&void 0!==t?t:"");return Object.assign(Object.assign({},D),{name:S,url:D.name,dns:h,ttfb:g,redirect:v,connect:m,download:E,network:y,duration:Math.round(e.duration),userRegion:n.config.userRegion})},n.afterInit=function(e){var t=n.addPublicTags(["STATIC_RESOURCE_TIMING"]),o=Boolean(n.config.enable);new PerformanceObserver((function(i){i.getEntries().forEach((function(i){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function u(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}(s(n),void 0,void 0,v().mark((function n(){var u;return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!function(e,t){if(!t)return!0;for(var n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1}(i.name,this.config.includeResourceList)){n.next=10;break}if(u=this.pickEntryProperties(i),!o){n.next=8;break}return n.next=5,e.log(u,t,r.$b.info);case 5:o&&e.reportByFilter(a),n.next=10;break;case 8:return n.next=10,e.log(u,t,r.$b.info);case 10:case"end":return n.stop()}}),n,this)})))}))})).observe({type:"resource",buffered:!0})},e&&(n.config=Object.assign({},n.config,e)),n}return f(t,e),E(t)}(r.UU),l=c},82230:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(33237),o=n(68001),i=n(76046);function a(e){var t;return e?"".concat(null===e||void 0===e?void 0:e.tagName,".").concat(null===(t=null===e||void 0===e?void 0:e.classList)||void 0===t?void 0:t.toString()):""}var c=function(e){function t(e){var n;return D(this,t),(n=u(this,t)).config={debug:!1,publicTags:[],enable:!1},n.debugLog=function(e){n.config.debug&&console.log("[AutoLogWebVitalsPlugin]:",e)},n.afterInit=function(e){var t=n.config,u=t.enable,c=t.publicTags,l=Boolean(u),f=function(t){return function(r){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function u(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}(s(n),void 0,void 0,v().mark((function n(){var u,s,f;return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(u=Object.assign(Object.assign({},r),{duration:parseInt(r.value.toString())}),"CLS"!==(null===r||void 0===r?void 0:r.name)&&"LCP"!==(null===r||void 0===r?void 0:r.name)&&"INP"!==(null===r||void 0===r?void 0:r.name)||(u.sourcesData=function(e){if(!e||!e.entries||!e.entries.length)return[];var t=[];return e.entries.f