UNPKG

@tencentcloud/call-engine-wx

Version:
3 lines 105 kB
import e from"@tencentcloud/chat";export{default as TIM,default as TencentCloudChat}from"@tencentcloud/chat";import t from"@tencentcloud/trtc-component-wx";export{default as TRTCCloud}from"@tencentcloud/trtc-component-wx";function n(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{u(i.next(e))}catch(t){o(t)}}function s(e){try{u(i.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var i={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,l,c=this._events[s],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,i),!0;case 4:return c.fn.call(c.context,t,i,r),!0;case 5:return c.fn.call(c.context,t,i,r,o),!0;case 6:return c.fn.call(c.context,t,i,r,o,a),!0}for(l=1,u=new Array(d-1);l<d;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,v=c.length;for(l=0;l<v;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,i);break;case 4:c[l].fn.call(c[l].context,t,i,r);break;default:if(!u)for(f=1,u=new Array(d-1);f<d;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==t||r&&!s[u].once||i&&s[u].context!==i)&&l.push(s[u]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}({get exports(){return i},set exports(e){i=e}});var r,o,a,s,u,l,c,d=i;!function(e){e[e.ERR_SUCC=0]="ERR_SUCC",e[e.ERR_FAILED=-1]="ERR_FAILED",e[e.ERR_INVALID_PARAMETER=-1001]="ERR_INVALID_PARAMETER",e[e.ERR_SDK_NOT_INITIALIZED=-1002]="ERR_SDK_NOT_INITIALIZED",e[e.ERR_PERMISSION_DENIED=-1003]="ERR_PERMISSION_DENIED",e[e.ERR_REQUIRE_PAYMENT=-1004]="ERR_REQUIRE_PAYMENT",e[e.ERR_CAMERA_START_FAILED=-1100]="ERR_CAMERA_START_FAILED",e[e.ERR_CAMERA_NOT_AUTHORIZED=-1101]="ERR_CAMERA_NOT_AUTHORIZED",e[e.ERR_CAMERA_OCCUPIED=-1102]="ERR_CAMERA_OCCUPIED",e[e.ERR_CAMERA_DEVICE_EMPTY=-1103]="ERR_CAMERA_DEVICE_EMPTY",e[e.ERR_MICROPHONE_START_FAILED=-1104]="ERR_MICROPHONE_START_FAILED",e[e.ERR_MICROPHONE_NOT_AUTHORIZED=-1105]="ERR_MICROPHONE_NOT_AUTHORIZED",e[e.ERR_MICROPHONE_OCCUPIED=-1106]="ERR_MICROPHONE_OCCUPIED",e[e.ERR_MICROPHONE_DEVICE_EMPTY=-1107]="ERR_MICROPHONE_DEVICE_EMPTY",e[e.ERR_ROOM_NAME_INVALID=-2107]="ERR_ROOM_NAME_INVALID",e[e.ERR_USER_NOT_EXIST=-2200]="ERR_USER_NOT_EXIST",e[e.ERR_REQUEST_ID_INVALID=-2311]="ERR_REQUEST_ID_INVALID"}(r||(r={})),function(e){e[e.kVideoQuality_360p=1]="kVideoQuality_360p",e[e.kVideoQuality_540p=2]="kVideoQuality_540p",e[e.kVideoQuality_720p=3]="kVideoQuality_720p",e[e.kVideoQuality_1080p=4]="kVideoQuality_1080p"}(o||(o={})),function(e){e[e.kResolutionMode_Landscape=0]="kResolutionMode_Landscape",e[e.kResolutionMode_Portrait=1]="kResolutionMode_Portrait"}(a||(a={})),function(e){e.ERROR="onError",e.SDK_READY="sdkReady",e.KICKED_OUT="onKickedOffLine",e.onUserSigExpired="onUserSigExpired",e.ON_CALL_BEGIN="onCallBegin",e.INVITED="onInvited",e.ON_CALL_RECEIVED="onCallReceived",e.USER_ACCEPT="onUserAccept",e.USER_ENTER="onUserJoin",e.USER_LEAVE="onUserLeave",e.REJECT="onUserReject",e.NO_RESP="onUserNoResponse",e.LINE_BUSY="onUserLineBusy",e.CALLING_CANCEL="onCallingCancel",e.ON_CALL_CANCELED="onCallCancelled",e.CALL_END="onCallEnd",e.CALLING_END="onCallEnd",e.USER_VIDEO_AVAILABLE="onUserVideoAvailable",e.USER_AUDIO_AVAILABLE="onUserAudioAvailable",e.USER_VOICE_VOLUME="onUserVoiceVolumeChanged",e.GROUP_CALL_INVITEE_LIST_UPDATE="onGroupCallInviteeListUpdate",e.CALL_TYPE_CHANGED="onCallMediaTypeChanged",e.DEVICED_UPDATED="onDeviceUpdated",e.ON_USER_NETWORK_QUALITY_CHANGED="onUserNetworkQualityChanged",e.MESSAGE_SENT_BY_ME="onMessageSentByMe",e.onDeviceChange="onDeviceChange",e.ON_CALL_NOT_CONNECTED="onCallNotConnected",e.ON_USER_INVITING="onUserInviting"}(s||(s={})),function(e){e[e.FRONT=0]="FRONT",e[e.BACK=1]="BACK"}(u||(u={})),function(e){e[e.SPEAKER=0]="SPEAKER",e[e.EAR=1]="EAR"}(l||(l={})),function(e){e.SPEAKER="speaker",e.EAR="ear"}(c||(c={}));const f={AUDIO_CALL:1,VIDEO_CALL:2,DEVCIED_CAMERA:"camera",DEVCIED_MICROPHONES:"microphones"};var v;!function(e){e[e.UnKnown=0]="UnKnown",e[e.Hangup=1]="Hangup",e[e.Reject=2]="Reject",e[e.NoResponse=3]="NoResponse",e[e.Offline=4]="Offline",e[e.LineBusy=5]="LineBusy",e[e.Canceled=6]="Canceled",e[e.OtherDeviceAccepted=7]="OtherDeviceAccepted",e[e.OtherDeviceReject=8]="OtherDeviceReject",e[e.EndByServer=9]="EndByServer"}(v||(v={}));var h,p,m,g,y,_,C,E="3.3.0";!function(e){e[e.TRTCVideoResolution_640_480=62]="TRTCVideoResolution_640_480",e[e.TRTCVideoResolution_960_720=64]="TRTCVideoResolution_960_720",e[e.TRTCVideoResolution_960_540=110]="TRTCVideoResolution_960_540",e[e.TRTCVideoResolution_1280_720=112]="TRTCVideoResolution_1280_720",e[e.TRTCVideoResolution_1920_1080=114]="TRTCVideoResolution_1920_1080"}(h||(h={})),function(e){e[e.TRTCVideoFillMode_Fill=0]="TRTCVideoFillMode_Fill",e[e.TRTCVideoFillMode_Fit=1]="TRTCVideoFillMode_Fit"}(p||(p={})),function(e){e[e.TRTCVideoMirrorType_Auto=0]="TRTCVideoMirrorType_Auto",e[e.TRTCVideoMirrorType_Enable=1]="TRTCVideoMirrorType_Enable",e[e.TRTCVideoMirrorType_Disable=2]="TRTCVideoMirrorType_Disable"}(m||(m={})),function(e){e[e.TRTCBeautyStyleSmooth=0]="TRTCBeautyStyleSmooth",e[e.TRTCBeautyStyleNature=1]="TRTCBeautyStyleNature"}(g||(g={}));class T{constructor(e="",t="",n="",i="",r=""){this.deviceId=e,this.deviceName=t,this.kind=n,this.label=i,this.groupId=r}}class R{constructor(e=h.TRTCVideoResolution_640_480,t=15,n=550){this.videoResolution=e,this.videoFps=t,this.videoBitrate=n}}!function(e){e[e.TRTCVideoRotation0=0]="TRTCVideoRotation0",e[e.TRTCVideoRotation90=1]="TRTCVideoRotation90",e[e.TRTCVideoRotation180=2]="TRTCVideoRotation180",e[e.TRTCVideoRotation270=3]="TRTCVideoRotation270"}(y||(y={}));class b{constructor(e=y.TRTCVideoRotation0,t=p.TRTCVideoFillMode_Fit,n=m.TRTCVideoMirrorType_Disable){this.rotation=e,this.fillMode=t,this.mirrorType=n}}!function(e){e[e.TRTCQuality_Unknown=0]="TRTCQuality_Unknown",e[e.TRTCQuality_Excellent=1]="TRTCQuality_Excellent",e[e.TRTCQuality_Good=2]="TRTCQuality_Good",e[e.TRTCQuality_Poor=3]="TRTCQuality_Poor",e[e.TRTCQuality_Bad=4]="TRTCQuality_Bad",e[e.TRTCQuality_Vbad=5]="TRTCQuality_Vbad",e[e.TRTCQuality_Down=6]="TRTCQuality_Down"}(_||(_={})),function(e){e[e.TRTCLogLevelVerbose=0]="TRTCLogLevelVerbose",e[e.TRTCLogLevelDebug=1]="TRTCLogLevelDebug",e[e.TRTCLogLevelInfo=2]="TRTCLogLevelInfo",e[e.TRTCLogLevelWarn=3]="TRTCLogLevelWarn",e[e.TRTCLogLevelError=4]="TRTCLogLevelError",e[e.TRTCLogLevelFatal=5]="TRTCLogLevelFatal",e[e.TRTCLogLevelNone=6]="TRTCLogLevelNone"}(C||(C={}));const S={cover:p.TRTCVideoFillMode_Fill,fill:p.TRTCVideoFillMode_Fill,contain:p.TRTCVideoFillMode_Fit},I="string",w="object",A="array",O="function",D="undefined",N={ELECTRON:"electron",WEB:"web",MINI_PROGRAM:"miniProgram"},P="麦克风权限授权",L="使用语音通话,需要在设置中对麦克风进行授权允许",k="麦克风、摄像头权限授权",V="使用视频通话,需要在设置中对麦克风、摄像头进行授权允许",M="去设置",$="麦克风权限未开启",U="在设置-应用-微信-权限中开启麦克风权限,以正常使用音视频通话功能",F="麦克风/摄像头权限未开启",j="在设置-应用-微信-权限中开启麦克风/摄像头权限,以正常使用音视频通话功能",x="前往设置",J="authorized",W="scope.record",B="scope.camera",G="cameraAuthorized",H="microphoneAuthorized",K=65535;var Q;function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function z(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function q(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(e){z(o,i,r,a,s,"next",e)}function s(e){z(o,i,r,a,s,"throw",e)}a(void 0)})}}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,oe(i.key),i)}}function ee(e,t,n){return t&&Z(e.prototype,t),n&&Z(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function te(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var u=i&&i.prototype instanceof s?i:s,l=Object.create(u.prototype);return ne(l,"_invoke",function(n,i,r){var o,s,u,l=0,c=r||[],d=!1,f={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(t,n){return o=t,s=0,u=e,f.n=n,a}};function v(n,i){for(s=n,u=i,t=0;!d&&l&&!r&&t<c.length;t++){var r,o=c[t],v=f.p,h=o[2];n>3?(r=h===i)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=v&&((r=n<2&&v<o[1])?(s=0,f.v=i,f.n=o[1]):v<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,f.n=h,s=0))}if(r||n>1)return a;throw d=!0,i}return function(r,c,h){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&v(c,h),s=c,u=h;(t=s<2?e:u)||!d;){o||(s?s<3?(s>1&&(f.n=-1),v(s,u)):f.n=u:f.v=u);try{if(l=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(d=f.n<0)?u:n.call(i,f))!==a)break}catch(t){o=e,s=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,r,o),!0),l}var a={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var c=[][i]?t(t([][i]())):(ne(t={},i,function(){return this}),t),d=l.prototype=s.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,ne(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=l,ne(d,"constructor",l),ne(l,"constructor",u),u.displayName="GeneratorFunction",ne(l,r,"GeneratorFunction"),ne(d),ne(d,r,"Generator"),ne(d,i,function(){return this}),ne(d,"toString",function(){return"[object Generator]"}),(te=function(){return{w:o,m:f}})()}function ne(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}ne=function(e,t,n,i){function o(t,n){ne(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ne(e,t,n,i)}function ie(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 i,r,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(e){l=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||se(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 re(e){return function(e){if(Array.isArray(e))return Y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||se(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 oe(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function ae(e){return ae="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},ae(e)}function se(e,t){if(e){if("string"==typeof e)return Y(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)?Y(e,t):void 0}}!function(e){e[e.UNKNOWN=65535]="UNKNOWN",e[e.ERROR_REQUEST_REPEATED=-1204]="ERROR_REQUEST_REPEATED"}(Q||(Q={}));var ue=function(e){return function(e){return ae(Array.isArray)===O?Array.isArray(e):de(e)===A}(e)||function(e){return null!==e&&ae(e)===w}(e)},le=function(e){return ae(e)===O},ce=function(e){return e instanceof Error},de=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()};Date.now||(Date.now=function(){return(new Date).getTime()});var fe=function(e){return JSON.stringify(e,["message","code"])};function ve(e){if("string"!=typeof e)return e;var t;try{var n=JSON.parse(e);t="object"===ae(n)&&n?n:e}catch(i){t=e}return t}function he(){return new Promise(function(){var e=q(te().m(function e(t,n){return te().w(function(e){for(;;)switch(e.n){case 0:wx.getSetting({success:function(e){var n=null;n=wx.$TUICallKitPlugin?e.miniprogramAuthSetting:e.authSetting,t(n)},fail:function(e){n(e)}});case 1:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}())}function pe(){return(pe=q(te().m(function e(t){var n,i,r,o,a,s,u,l;return te().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2,!1);case 1:return n=t.microphone,i=void 0!==n&&n,r=t.camera,o=void 0!==r&&r,e.p=2,e.n=3,he();case 3:if(l=e.v){e.n=4;break}l=!1;case 4:if(s=(a=l)[W],u=a[B],!i||!o){e.n=5;break}return e.a(2,s&&u);case 5:if(!i){e.n=6;break}return e.a(2,s);case 6:if(!o){e.n=7;break}return e.a(2,u);case 7:return e.a(2,!1);case 8:return e.p=8,e.v,e.a(2,!1)}},e,null,[[2,8]])}))).apply(this,arguments)}function me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={title:e.title,desc:e.description||"",extension:e.extension||"",is_disable_push:e.isDisablePush||!1,ios_push_type:e.iOSPushType||0,android_push_type:e.androidPushType||0,ignore_ios_badge:!!e.ignoreIOSBadge,android_vivo_classification:e.androidVIVOClassification};return e.iOSSound&&(t.ios_sound=e.iOSSound),e.androidSound&&(t.android_sound=e.androidSound),e.androidOPPOChannelID&&(t.android_oppo_channel_id=e.androidOPPOChannelID),e.androidFCMChannelID&&(t.android_fcm_channel_id=e.androidFCMChannelID),e.androidXiaoMiChannelID&&(t.android_xiaomi_channel_id=e.androidXiaoMiChannelID),e.androidHuaWeiCategory&&(t.android_huawei_category=e.androidHuaWeiCategory),t}function ge({code:e,params:t,enableDocLink:n=!1,languageList:i=["en","zh-CN"]}){let r,o="";const a=Q[e];try{i.forEach(e=>{switch(e){case"en":r=ye[a];break;case"zh-CN":r=_e[a]}le(r)?(o=o?`${o} `:o,o+=r(t)):ae(r)===I&&(o=r)})}catch(s){r=ye.UNKNOWN_ERROR}return n&&(o+=" doc:"),o}const ye={ERROR_REQUEST_REPEATED:({fnName:e})=>`you are already ${e}(), cannot repeated call '${e}'.`,UNKNOWN_ERROR:({fnName:e,error:t})=>`'${e}' throw unknown exception${t?`, error: ${t.toString()}.`:"."}`},_e={ERROR_REQUEST_REPEATED:({fnName:e})=>`你已经调用 ${e}(), 请勿重复调用 '${e}'。`};class Ce extends Error{constructor({name:e="",code:t=K,message:n="",messageParams:i={},extraCode:r="",fnName:o=""}){super(n||ge({code:t,params:Object.assign({fnName:o},i)})),this.name="TUICallEngineError",this.message="",this.functionName="",this.name=e||this.name,this.code=t,this.functionName=o||this.functionName,this.message=n||this.message}getCode(){return this.code}}const Ee={[s.ERROR]:["code","message"],[s.KICKED_OUT]:["message"],[s.onUserSigExpired]:[],[s.ON_CALL_RECEIVED]:["callerId","calleeIdList","chatGroupID","callMediaType","userData","roomID","strRoomID","callId","callRole"],[s.ON_CALL_BEGIN]:["roomID","strRoomID","callMediaType","callRole","callId","chatGroupID"],[s.CALLING_END]:["roomID","strRoomID","callMediaType","callRole","callId","totalTime","reason","userID","chatGroupID"],[s.LINE_BUSY]:["userID"],[s.REJECT]:["userID"],[s.USER_ACCEPT]:["userID"],[s.ON_CALL_CANCELED]:["userID","callId","roomID","strRoomID","callMediaType","callRole"],[s.NO_RESP]:["userIDList"],[s.ON_USER_INVITING]:["userID"],[s.USER_ENTER]:["userID"],[s.USER_LEAVE]:["userID"],[s.USER_AUDIO_AVAILABLE]:["userID","isAudioAvailable"],[s.USER_VIDEO_AVAILABLE]:["userID","isVideoAvailable"],[s.USER_VOICE_VOLUME]:["userID","isVideoAvailable"],[s.ON_USER_NETWORK_QUALITY_CHANGED]:["network"],[s.ON_CALL_NOT_CONNECTED]:["userID","callId","roomID","strRoomID","callMediaType","callRole","reason","chatGroupID"],[s.onDeviceChange]:["deviceId","type","state"]};function Te(e,t){const n=ve(t),i=Ee[e],r={};if(e===s.ON_CALL_RECEIVED)i.forEach((e,t)=>{r[e]="userIDList"===e&&1===t?Array.from(new Set(ve(n[t]))):n[t]});else i.forEach((e,t)=>{r[e]=n[t]});return r}var Re,be;Re="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Se=function(){},Ie=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],we=Ie.length;we--;)be=Ie[we],console[be]||(Re[be]=Se);Re.methods=Ie;var Ae,Oe=Re;const De="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),Ne=(null===window||void 0===window?void 0:window.navigator)&&(null===(Ae=null===window||void 0===window?void 0:window.navigator)||void 0===Ae?void 0:Ae.userAgent)||"",Pe=/iPad/i.test(Ne),Le=/iPhone/i.test(Ne)&&!Pe,ke=/iPod/i.test(Ne),Ve=Le||Pe||ke,Me=/Android/i.test(Ne),$e=new RegExp("HeadlessChrome","i").test(Ne);var Ue=0,Fe="%cCallEngine%c%s",je="padding: 1px 4px;border-radius: 3px;color: #fff;background: #444;",xe="display: inline",Je=!(Ve||Me||$e);function We(){var e=new Date;return"[".concat(e.toLocaleTimeString("en-US",{hour12:!1}),".").concat(function(e){var t;switch(e.toString().length){case 1:t="00".concat(e);break;case 2:t="0".concat(e);break;default:t=e}return t}(e.getMilliseconds()),"]")}var Be,Ge,He,Ke={_data:[],_length:0,_visible:!1,arguments2String:function(e,t){var n;if(1===t.length)n="".concat(We()," <").concat(e,"> ").concat(t[0]);else{n="".concat(We()," <").concat(e,"> ");for(var i=0,r=t.length;i<r;i++)ue(t[i])?ce(t[i])?n+=fe(t[i]):n+=JSON.stringify(t[i]):n+=t[i],n+=" "}return n},info:function(){if(Ue<=1){var e=this.arguments2String("INFO",arguments);Ke.record(e,"info"),Je?Oe.info(Fe,je,xe,e):Oe.info(e)}},error:function(){if(Ue<=3){var e=this.arguments2String("ERROR",arguments);Ke.record(e,"error"),Je?Oe.error(Fe,je,xe,e):Oe.error(e)}},setLevel:function(e){e<4&&Oe.log("".concat(We(),"set level from ").concat(Ue," to ").concat(e)),Ue=e},getLevel:function(){return Ue},record:function(e,t){1100===Ke._length&&(Ke._data.splice(0,100),Ke._length=1e3),Ke._length++,Ke._data.push("".concat(e," [").concat(t,"] \n"))}};function Qe(e){return n(this,void 0,void 0,function*(){if(e===Ge.AUDIO_CALL||e===Ge.VIDEO_CALL)return new Promise((t,i)=>n(this,void 0,void 0,function*(){const r={microphone:!0,camera:e===Ge.VIDEO_CALL},o=function(e){if(!e)return!1;const{microphone:t=!1,camera:n=!1}=e,i=wx.getAppAuthorizeSetting(),r=i[H]===J,o=i[G]===J;if(t&&n)return r&&o;if(t)return r;if(n)return o;return!1}(r);if(!o&&e===Ge.AUDIO_CALL){ze($,U),i({callType:e,hasAppDevicePermission:o})}if(!o&&e===Ge.VIDEO_CALL){ze(F,j),i({callType:e,hasAppDevicePermission:o})}const a=yield function(e){return n(this,void 0,void 0,function*(){if(!e)return!1;const{microphone:t=!1,camera:n=!1}=e;try{const e=(yield getAuthSetting())||!1,i=e[W],r=e[B];return t&&n?i&&r:t?i:!!n&&r}catch(i){return!1}})}(r);if(!a&&e===Ge.AUDIO_CALL)try{yield qe({scope:W})}catch(s){const t=P;Ye(t,L),i({callType:e,text:t})}if(!a&&e===Ge.VIDEO_CALL)try{if((yield function(e){return n(this,void 0,void 0,function*(){return yield Promise.all(e.map(e=>n(this,void 0,void 0,function*(){try{return{status:"fulfilled",value:yield e}}catch(t){return{status:"rejected",reason:t}}})))})}([qe({scope:W}),qe({scope:B})])).find(e=>"rejected"===(null==e?void 0:e.status))){const t=k;Ye(t,V),i({callType:e,text:t})}}catch(s){console.debug(s)}t()}))})}function Ye(e,t){wx.showModal({title:e,content:t,confirmText:M,success:e=>{e.confirm&&wx.openSetting()}})}function ze(e,t){wx.showModal({title:e,content:t,confirmText:x,success:e=>{e.confirm&&wx.openAppAuthorizeSetting()}})}function qe(e){return n(this,void 0,void 0,function*(){wx.$TUICallKitPlugin?yield wx.authorizeForMiniProgram(e):yield wx.authorize(e)})}!function(e){e[e.APNs=0]="APNs",e[e.VoIP=1]="VoIP"}(Be||(Be={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.AUDIO_CALL=1]="AUDIO_CALL",e[e.VIDEO_CALL=2]="VIDEO_CALL"}(Ge||(Ge={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.RELEASE=1]="RELEASE",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE"}(He||(He={}));const Xe=function(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n},Ze=function(){},et=function(){const e=new WeakSet;return function(t,n){if(n instanceof Error)return`Error.message: ${n.message} \n Error.stack: ${n.stack}`;if("object"==typeof n&&null!==n){if(e.has(n))return`[Circular ${t||"root"}]`;e.add(n)}return n}},tt=function(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,et())||"undefined").replace(/"/gim,""):JSON.stringify(e,et())||"undefined"}catch(t){return`error happen when aegis stringify: \n ${t.message} \n ${t.stack}`}},nt=[],it=()=>{let e;const t=new Promise(t=>{e=t});return nt.push({promise:t,resolve:e}),t};let rt=0;function ot(e){return n(this,void 0,void 0,function*(){try{for(;rt>=2;)yield it();return rt++,yield new Promise((t,n)=>{wx.request(Object.assign(Object.assign({},e),{success(e){t(e)},fail(e){n(e)}}))})}catch(t){return Promise.reject(t)}finally{rt--,nt.length&&(nt[0].resolve(),nt.shift())}})}const at=e=>n(void 0,void 0,void 0,function*(){var{url:t,data:n,header:i={},method:r="GET",dataType:o,responseType:a}=e,s=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["url","data","header","method","dataType","responseType"]);return ot(Object.assign({url:t,data:n,header:i,method:r,dataType:o,responseType:a},s))}),st=({table:e})=>(t,n)=>{try{const i=null==t?void 0:t.map(e=>{let t={};return Object.keys(e).forEach(n=>{if(Xe(e[n]))try{t[n]=tt(e[n])}catch(i){console.debug(i)}else t[n]="level"===n?e[n]+"":"time"===n?new Date(e[n]).toISOString():e[n]}),t});n({table:e,report:i})}catch(i){console.debug(i)}},ut=(e,t)=>{let n,i=[];return(r,o)=>{if(Array.isArray(r)?i=i.concat(r):i.push(r),t&&i.length>=t||e.sendNow&&i.length>0)return o(i.splice(0,i.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout(()=>{n=null,i.length>0&&o(i.splice(0,i.length))},e.delay||1e3)}};var lt;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARING=2]="WARING",e[e.ERROR=3]="ERROR"}(lt||(lt={}));const ct={metric:!0,context:!0},dt=(e,t,n=0)=>Xe(e)?Xe(t)?(Object.keys(t).forEach(i=>{const r=e[i],o=t[i];e[i]=ct[i]&&0===n?dt(r,o,1):o}),e):e:Xe(t)?t:{};class ft{constructor(e){this.uploadChannel="",this.sendEsPipe=null,this._logLevel=lt.INFO,this._getReportDataList=[],this._blacklist=[],this.updateBlacklist()}updateEsConfig(e){try{if(e){this.esConfig=e;const{url:i,table:r}=e;i&&r&&(this.uploadChannel=i,this.sendEsPipe=(e=>{if(!e||!e.reduce||!e.length)throw new TypeError("createPipeline need at least one function param");return 1===e.length?(t,n)=>{e[0](t,n||Ze)}:e.reduce((e,t)=>(n,i=Ze)=>e(n,e=>null==t?void 0:t(e,i)))})([(t=this,(e,n)=>{try{const{sdkappid:i}=e,r=t.getBlackList();if(null==r?void 0:r.includes(String(i)))throw new Error("this sdkappid in blacklist");n(e)}catch(i){console.debug(i)}}),ut(this,5),st({table:r}),(e,t)=>{try{e=e||{};let{logs:n=[]}=e;e.logs=null==n?void 0:n.map(e=>{const t=102400,n=e.contents;return Object.keys(n).forEach(e=>{const i=n[e];try{i&&i.length>t&&(n[e]=null==i?void 0:i.substring(0,t))}catch(r){console.debug("size of content > limitSize"),n[e]=tt(i).substring(0,t)}}),e}),t(e)}catch(n){console.debug(n)}},e=>n(this,void 0,void 0,function*(){let t=0;const r=()=>n(this,void 0,void 0,function*(){try{yield this.send({url:i,data:e})}catch(n){t<=2?(t++,setTimeout(()=>{r()},1e3)):console.debug(n)}});r()})]))}}catch(i){console.debug(i)}var t}updateGetReportData(e){"function"==typeof e&&this._getReportDataList.push(e)}updateBlacklist(){return n(this,void 0,void 0,function*(){try{const{data:e}=yield at({url:"https://jsonschema.qpic.cn/87084b1b6d263426b92926cfa5fa23af/18f29786d25587b5eb162d5e9f724b1e/blackList"}),t=null==e?void 0:e.blackList;"string"==typeof t&&(this._blacklist=t.split(","))}catch(e){console.debug("update blacklist fail",e)}})}getBlackList(){return this._blacklist}setLogLevel(e){"number"!=typeof e&&(e=lt.INFO),this._logLevel=e}createLogFunc(e){return(t,n)=>{this.log(t,n,{level:e})}}info(e,t){this.log(e,t,{level:lt.INFO})}debug(e,t){this.log(e,t,{level:lt.DEBUG})}warn(e,t){this.log(e,t,{level:lt.WARING})}error(e,t){this.log(e,t,{level:lt.ERROR})}log(e,t,n){try{const{level:i}=n||{};if(this._logLevel<=i){const n=this.getCommonReportData(),r=dt(n,Object.assign({level:i,method:e},t));"function"==typeof this.sendEsPipe&&this.sendEsPipe(r)}}catch(i){console.debug(i)}}getCommonReportData(){let e={};for(let t=0;t<this._getReportDataList.length;t++)e=dt(e,this._getReportDataList[t]());return e}send(e){return n(this,void 0,void 0,function*(){const{url:t,data:n}=e||{};try{t&&(yield at({url:t,data:n,method:"post"}))}catch(i){throw console.debug(i),new Error(i)}})}}let vt=null;var ht,pt=(ht="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){e=void 0!==(e=e||{})?e:{};var t,n,i=WXWebAssembly;e.ready=new Promise(function(e,i){t=e,n=i});var r=Object.assign({},e),o="./this.program",a="object"==("undefined"==typeof window?"undefined":ae(window)),s="function"==typeof importScripts;"object"==("undefined"==typeof process?"undefined":ae(process))&&"object"==ae(process.versions)&&process.versions.node;var u="";(a||s)&&(s?u=self.location.href:"undefined"!=typeof document&&document.currentScript&&(u=document.currentScript.src),ht&&(u=ht),u=0!==u.indexOf("blob:")?u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):"");var l,c=e.print||console.log.bind(console),d=e.printErr||console.warn.bind(console);Object.assign(e,r),r=null,e.arguments&&e.arguments,e.thisProgram&&(o=e.thisProgram),e.quit&&e.quit,e.wasmBinary&&e.wasmBinary,e.noExitRuntime,"object"!=ae(i)&&$("no native wasm support detected");var f,v,h,p,m,g,y,_,C,E,T=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function b(e,t,n){for(var i=t+n,r=t;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&R)return R.decode(e.subarray(t,r));for(var o="";t<r;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)o+=String.fromCharCode(a);else{var l=a-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function S(e,t){return e?b(h,e,t):""}function I(e,t,n,i){if(!(i>0))return 0;for(var r=n,o=n+i-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(n>=o)break;t[n++]=s}else if(s<=2047){if(n+1>=o)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=o)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=o)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-r}function w(e){for(var t=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++n)),i<=127?++t:t+=i<=2047?2:i<=65535?3:4}return t}e.INITIAL_MEMORY;var A=[],O=[],D=[];function N(e){A.unshift(e)}function P(e){D.unshift(e)}var L,k,V=0,M=null;function $(t){e.onAbort&&e.onAbort(t),d(t="Aborted("+t+")"),T=!0,t+=". Build with -sASSERTIONS for more info.";var i=new Error(t);throw n(i),i}function U(t){for(;t.length>0;)t.shift()(e)}function F(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}(L="RTCCallEngine.wasm").startsWith("data:application/octet-stream;base64,")||(k=L,L=e.locateFile?e.locateFile(k,u):u+k);var j=void 0;function x(e){for(var t="",n=e;h[n];)t+=j[h[n++]];return t}var J={},W={},B={};function G(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?"_"+e:e}function H(e,t){return e=G(e),function(){return t.apply(this,arguments)}}function K(e,t){var n=H(t,function(e){this.name=t,this.message=e;var n=new Error(e).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Q=void 0;function Y(e){throw new Q(e)}var z=void 0;function q(e){throw new z(e)}function Z(e,t,n){function i(t){var i=n(t);i.length!==e.length&&q("Mismatched type converter count");for(var r=0;r<e.length;++r)ne(e[r],i[r])}e.forEach(function(e){B[e]=t});var r=new Array(t.length),o=[],a=0;t.forEach(function(e,t){W.hasOwnProperty(e)?r[t]=W[e]:(o.push(e),J.hasOwnProperty(e)||(J[e]=[]),J[e].push(function(){r[t]=W[e],++a===o.length&&i(r)}))}),0===o.length&&i(r)}function ne(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=t.name;if(e||Y('type "'+i+'" must have a positive integer typeid pointer'),W.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Y("Cannot register type '"+i+"' twice")}if(W[e]=t,delete B[e],J.hasOwnProperty(e)){var r=J[e];delete J[e],r.forEach(function(e){return e()})}}function oe(e){if(!(this instanceof Ae))return!1;if(!(e instanceof Ae))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,i=e.$$.ptrType.registeredClass,r=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;i.baseClass;)r=i.upcast(r),i=i.baseClass;return t===i&&n===r}function se(e){Y(e.$$.ptrType.registeredClass.name+" instance already deleted")}var ue=!1;function le(e){}function ce(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function de(e,t,n){if(t===n)return e;if(void 0===n.baseClass)return null;var i=de(e,t,n.baseClass);return null===i?null:n.downcast(i)}var fe={};function ve(){return Object.keys(_e).length}function he(){var e=[];for(var t in _e)_e.hasOwnProperty(t)&&e.push(_e[t]);return e}var pe=[];function me(){for(;pe.length;){var e=pe.pop();e.$$.deleteScheduled=!1,e.delete()}}var ge=void 0;function ye(e){ge=e,pe.length&&ge&&ge(me)}var _e={};function Ce(e,t){return t=function(e,t){for(void 0===t&&Y("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),_e[t]}function Ee(e,t){return t.ptrType&&t.ptr||q("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&q("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Re(Object.create(e,{$$:{value:t}}))}function Te(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=Ce(this.registeredClass,t);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var i=n.clone();return this.destructor(e),i}function r(){return this.isSmartPointer?Ee(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ee(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o,a=this.registeredClass.getActualType(t),s=fe[a];if(!s)return r.call(this);o=this.isConst?s.constPointerType:s.pointerType;var u=de(t,this.registeredClass,o.registeredClass);return null===u?r.call(this):this.isSmartPointer?Ee(o.registeredClass.instancePrototype,{ptrType:o,ptr:u,smartPtrType:this,smartPtr:e}):Ee(o.registeredClass.instancePrototype,{ptrType:o,ptr:u})}function Re(e){return"undefined"==typeof FinalizationRegistry?(Re=function(e){return e},e):(ue=new FinalizationRegistry(function(e){ce(e.$$)}),Re=function(e){var t=e.$$;if(t.smartPtr){var n={$$:t};ue.register(e,n,e)}return e},le=function(e){return ue.unregister(e)},Re(e))}function be(){if(this.$$.ptr||se(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Re(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Se(){this.$$.ptr||se(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Y("Object already scheduled for deletion"),le(this),ce(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ie(){return!this.$$.ptr}function we(){return this.$$.ptr||se(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Y("Object already scheduled for deletion"),pe.push(this),1===pe.length&&ge&&ge(me),this.$$.deleteScheduled=!0,this}function Ae(){}function Oe(e,t,n){if(void 0===e[t].overloadTable){var i=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Y("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[i.argCount]=i}}function De(e,t,n,i,r,o,a,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=i,this.baseClass=r,this.getActualType=o,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Ne(e,t,n){for(;t!==n;)t.upcast||Y("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Pe(e,t){if(null===t)return this.isReference&&Y("null is not a valid "+this.name),0;t.$$||Y('Cannot pass "'+nt(t)+'" as a '+this.name),t.$$.ptr||Y("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass;return Ne(t.$$.ptr,n,this.registeredClass)}function Le(e,t){var n;if(null===t)return this.isReference&&Y("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,n),n):0;t.$$||Y('Cannot pass "'+nt(t)+'" as a '+this.name),t.$$.ptr||Y("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Y("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var i=t.$$.ptrType.registeredClass;if(n=Ne(t.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Y("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Y("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var r=t.clone();n=this.rawShare(n,tt.toHandle(function(){r.delete()})),null!==e&&e.push(this.rawDestructor,n)}break;default:Y("Unsupporting sharing policy")}return n}function ke(e,t){if(null===t)return this.isReference&&Y("null is not a valid "+this.name),0;t.$$||Y('Cannot pass "'+nt(t)+'" as a '+this.name),t.$$.ptr||Y("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Y("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;return Ne(t.$$.ptr,n,this.registeredClass)}function Ve(e){return this.fromWireType(g[e>>2])}function Me(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function $e(e){this.rawDestructor&&this.rawDestructor(e)}function Ue(e){null!==e&&e.delete()}function Fe(e,t,n,i,r,o,a,s,u,l,c){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=i,this.isSmartPointer=r,this.pointeeType=o,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,r||void 0!==t.baseClass?this.toWireType=Le:i?(this.toWireType=Pe,this.destructorFunction=null):(this.toWireType=ke,this.destructorFunction=null)}var je=[];function xe(e){var t=je[e];return t||(e>=je.length&&(je.length=e+1),je[e]=t=E.get(e)),t}function Je(t,n,i){return t.includes("j")?function(t,n,i){var r=e["dynCall_"+t];return i&&i.length?r.apply(null,[n].concat(i)):r.call(null,n)}(t,n,i):xe(n).apply(null,i)}function We(e,t){var n,i,r,o=(e=x(e)).includes("j")?(n=e,i=t,r=[],function(){return r.length=0,Object.assign(r,arguments),Je(n,i,r)}):xe(t);return"function"!=typeof o&&Y("unknown function pointer with signature "+e+": "+t),o}var Be=void 0;function Ge(e){var t=kt(e),n=x(t);return Pt(t),n}function He(e,t){var n=[],i={};throw t.forEach(function e(t){i[t]||W[t]||(B[t]?B[t].forEach(e):(n.push(t),i[t]=!0))}),new Be(e+": "+n.map(Ge).join([", "]))}function Ke(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Qe(e,t,n,i,r){var o=t.length;o<2&&Y("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==n,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var l="void"!==t[0].name,c=o-2,d=new Array(c),f=[],v=[];return function(){var n;arguments.length!==c&&Y("function "+e+" called with "+arguments.length+" arguments, expected "+c+" args!"),v.length=0,f.length=a?2:1,f[0]=r,a&&(n=t[1].toWireType(v,this),f[1]=n);for(var o=0;o<c;++o)d[o]=t[o+2].toWireType(v,arguments[o]),f.push(d[o]);return function(e){if(s)Ke(v);else for(var i=a?1:2;i<t.length;i++){var r=1===i?n:d[i-2];null!==t[i].destructorFunction&&t[i].destructorFunction(r)}if(l)return t[0].fromWireType(e)}(i.apply(null,f))}}function Ye(e,t){for(var n=[],i=0;i<e;i++)n.push(y[t+4*i>>2]);return n}var ze=[],qe=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Xe(e){e>4&&0===--qe[e].refcount&&(qe[e]=void 0,ze.push(e))}function Ze(){for(var e=0,t=5;t<qe.length;++t)void 0!==qe[t]&&++e;return e}function et(){for(var e=5;e<qe.length;++e)if(void 0!==qe[e])return qe[e];return null}var tt={toValue:function(e){return e||Y("Cannot use deleted val. handle = "+e),qe[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=ze.length?ze.pop():qe.length;return qe[t]={refcount:1,value:e},t}}};function nt(e){if(null===e)return"null";var t=ae(e);return"object"===t||"array"===t||"function"===t?e.toString():""+e}function it(e,t){switch(t){case 2:return function(e){return this.fromWireType(_[e>>2])};case 3:return function(e){return this.fromWireType(C[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function rt(e,t,n){switch(t){case 0:return n?function(e){return v[e]}:function(e){return h[e]};case 1:return n?function(e){return p[e>>1]}:function(e){return m[e>>1]};case 2:return n?function(e){return g[e>>2]}:function(e){return y[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var ot="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function at(e,t){for(var n=e,i=n>>1,r=i+t/2;!(i>=r)&&m[i];)++i;if((n=i<<1)-e>32&&ot)return ot.decode(h.subarray(e,n));for(var o="",a=0;!(a>=t/2);++a){var s=p[e+2*a>>1];if(0==s)break;o+=String.fromCharCode(s)}return o}function st(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var i=t,r=(n-=2)<2*e.length?n/2:e.length,o=0;o<r;++o){var a=e.charCodeAt(o);p[t>>1]=a,t+=2}return p[t>>1]=0,t-i}function ut(e){return 2*e.length}function lt(e,t){for(var n=0,i="";!(n>=t/4);){var r=g[e+4*n>>2];if(0==r)break;if(++n,r>=65536){var o=r-65536;i+=String.fromCharCode(55296|o>>10,56320|1023&o)}else i+=String.fromCharCode(r)}return i}function ct(e,t,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var i=t,r=i+n-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),g[t>>2]=a,(t+=4)+4>r)break}return g[t>>2]=0,t-i}function dt(e){for(var t=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);i>=55296&&i<=57343&&++n,t+=4}return t}function ft(e,t){var n=W[e];return void 0===n&&Y(t+" has unknown type "+Ge(e)),n}function vt(e,t){for(var n=new Array(e),i=0;i<e;++i)n[i]=ft(y[t+4*i>>2],"parameter "+i);return n}var pt={};function mt(e){var t=pt[e];return void 0===t?x(e):t}var gt=[];function yt(){if("object"==("undefined"==typeof globalThis?"undefined":ae(globalThis)))return globalThis;function e(e){e.$$$embind_global$$$=e;var t="object"==("undefined"==typeof $$$embind_global$$$?"undefined":ae($$$embind_global$$$))&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if("object"==("undefined"==typeof $$$embind_global$$$?"undefined":ae($$$embind_global$$$)))return $$$embind_global$$$;if("object"==("undefined"==typeof global?"undefined":ae(global))&&e(global)?$$$embind_global$$$=global:"object"==("undefined"==typeof self?"undefined":ae(self))&&e(self)&&($$$embind_global$$$=self),"object"==("undefined"==typeof $$$embind_global$$$?"undefined":ae($$$embind_global$$$)))return $$$embind_global$$$;throw Error("unable to get global object.")}var _t,Ct=[],Et={};_t=function(){return performance.now()};var Tt={};function Rt(){if(!Rt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==("undefined"==typeof navigator?"undefined":ae(navigator))&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:o||"./this.program"};for(var t in Tt)void 0===Tt[t]?delete e[t]:e[t]=Tt[t];var n=[];for(var t in e)n.push(t+"="+e[t]);Rt.strings=n}return Rt.strings}var bt=[null,[],[]];function St(e,t){var n=bt[e];0===t||10===t?((1===e?c:d)(b(n,0)),n.length=0):n.push(t)}function It(e){return e%4==0&&(e%100!=0||e%400==0)}var wt=[31,29,31,30,31,30,31,31,30,31,30,31],At=[31,28,31,30,31,30,31,31,30,31,30,31];function Ot(e,t,n,i){var r=g[i+40>>2],o={tm_sec:g[i>>2],tm_min:g[i+4>>2],tm_hour:g[i+8>>2],tm_mday:g[i+12>>2],tm_mon:g[i+16>>2],tm_year:g[i+20>>2],tm_wday:g[i+24>>2],tm_yday:g[i+28>>2],tm_isdst:g[i+32>>2],tm_gmtoff:g[i+36>>2],tm_zone:r?S(r):""},a=S(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,n){for(var i="number"==typeof e?e.toString():e||"";i.length<t;)i=n[0]+i;return i}function f(e,t){return d(e,t,"0")}function h(e,t){function n(e){return e<0?-1:e>0?1:0}var i;return 0===(i=n(e.getFullYear()-t.getFullYear()))&&0===(i=n(e.getMonth()-t.getMonth()))&&(i=n(e.getDate()-t.getDate())),i}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=function(e,t){for(var n=new Date(e.getTime());t>0;){var i=It(n.getFullYear()),r=n.getMonth(),o=(i?wt:At)[r];if(!(t>o-n.getDate()))return n.setDate(n.getDate()+t),n;t-=o-n.getDate()+1,n.setDate(1),r<11?n.setMonth(r+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}(new Date(e.tm_year+1900,0,1),e.tm_yday),n=new Date(t.getFullYear(),0,4),i=new Date(t.getFullYear()+1,0,4),r=p(n),o=p(i);return h(r,t)<=0?h(o,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var y={"%a":function(e){return l[e.tm_wday].substring(0,3)},"%A":function(e){return l[e.tm_wday]},"%b":function(e){return c[e.tm_mon].substring(0,3)},"%B":function(e){return c[e.tm_mon]},"%C":function(e){return f((e.tm_year+1900)/100|0,2)},"%d":function(e){return f(e.tm_mday,2)},"%e":function(e){return d(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return f(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":function(e){return f(e.tm_mday+function(e,t){for(var n=0,i=0;i<=t;n+=e[i++]);return n}(It(e.tm_year+1900)?wt:At,e.tm_mon-1),3)},"%m":function(e){return f(e.tm_mon+1,2)},"%M":function(e){return f(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return f(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var n=(e.tm_wday+371-e.tm_yday)%7;4==n||3==n&&It(e.tm_year)||(t=1)}}else{t=52;var i=(e.tm_wday+7-e.tm_yday-1)%7;(4==i||5==i&&It(e.tm_year%400-1))&&t++}return f(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,n=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(n?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in a=a.replace(/%%/g,"\0\0"),y)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),y[u](o)));var _=function(e,t,n){var i=n>0?n:w(e)+1,r=new Array(i),o=I(e,r,0,r.length);return t&&(r.length=o),r}(a=a.replace(/\0\0/g,"%"),!1);return _.length>t?0:(function(e,t){v.set(e,t)}(_,e),_.length-1)}!function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);j=e}(),Q=e.BindingError=K(Error,"BindingError"),z=e.InternalError=K(Error,"InternalError"),Ae.prototype.isAliasOf=oe,Ae.prototype.clone=be,Ae.prototype.delete=Se,Ae.prototype.isDeleted=Ie,Ae.prototype.deleteLater=we,e.getInheritedInstanceCount=ve,e.getLiveInheritedInstances=he,e.flushPendingDeletes=me,e.setDelayFunction=ye,Fe.prototype.getPointee=Me,Fe.prototype.destructor=$e,Fe.prototype.argPackAdvance=8,Fe.prototype.readValueFromPointer=Ve,Fe.prototype.deleteObject=Ue,Fe.prototype.fromWireType=Te,Be=e.UnboundTypeError=K(Error,"UnboundTypeError"),e.count_emval_handles=Ze,e.get_first_emval=et;var Dt={__assert_fail:function(e,t,n,i){$("Assertion failed: "+S(e)+", at: "+[t?S(t):"unknown filename",n,i?S(i):"unknown function"])},_embind_register_bigint:function(e,t,n,i,r){},_embind_register_bool:function(e,t,n,i,r){var o=F(n);ne(e,{name:t=x(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?i:r},argPackAdvance:8,readValueFromPointer:function(e){var i;if(1===n)i=v;else if(2===n)i=p;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+t);i=g}return this.fromWireType(i[e>>o])},destructorFunction:null})},_embind_register_class:function(t,n,i,r,o,a,s,u,l,c,d,f,v){d=x(d),a=We(o,a),u&&(u=We(s,u)),c&&(c=We(l,c)),v=We(f,v);var h=G(d);!function(t,n,i){e.hasOwnProperty(t)?((void 0===i||void 0!==e[t].overloadTable&&void 0!==e[t].overloadTable[i])&&Y("Cannot register public name '"+t+"' twice"),Oe(e,t,t),e.hasOwnProperty(i)&&Y("Cannot register multiple overloads of a function with the same number of arguments ("+i+")!"),e[t].overloadTable[i]=n):(e[t]=n,void 0!==i&&(e[t].numArguments=i))}(h,function(){He("Cannot construct "+d+" due to unbound types",[r])}),Z([t,n,i],r?[r]:[],function(n){var i,o;n=n[0],o=r?(i=n.registeredClass).instancePrototype:Ae.prototype;var s=H(h,function(){if(Object.getPrototypeOf(this)!==l)