@formant/data-sdk 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,63 @@
1
- (function(Qe,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(Qe=typeof globalThis<"u"?globalThis:Qe||self,et(Qe.FormantDataSDK={}))})(this,function(exports){var et;"use strict";var ln=Object.defineProperty;var un=(Qe,et,Je)=>et in Qe?ln(Qe,et,{enumerable:!0,configurable:!0,writable:!0,value:Je}):Qe[et]=Je;var _e=(Qe,et,Je)=>(un(Qe,typeof et!="symbol"?et+"":et,Je),Je);const DEFAULT_FORMANT_API_URL="https://api.formant.io";function whichFormantApiUrl(e,t){try{if(t.get("formant_stage"))return"https://api-stage.formant.io";if(t.get("formant_dev"))return"https://api-dev.formant.io";if(t.get("formant_local"))return"https://api.formant.local";if(t.get("formant_url")){const n=t.get("formant_url");if(n!==null)try{return new URL(n).origin}catch{console.warn(`Ignoring malformed \`formant_url\` url parameter: ${n}`)}}}catch{}return typeof e<"u"&&"FORMANT_API_URL"in e&&typeof e.FORMANT_API_URL=="string"?e.FORMANT_API_URL:DEFAULT_FORMANT_API_URL}const FORMANT_API_URL=whichFormantApiUrl(typeof window<"u"?window:globalThis,new URLSearchParams(typeof window<"u"&&window.location?window.location.search:void 0));var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var base64={exports:{}};/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */base64.exports,function(e,t){(function(n){var r=t,o=e&&e.exports==r&&e,l=typeof commonjsGlobal=="object"&&commonjsGlobal;(l.global===l||l.window===l)&&(n=l);var u=function(d){this.message=d};u.prototype=new Error,u.prototype.name="InvalidCharacterError";var s=function(d){throw new u(d)},g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,f=function(d){d=String(d).replace(c,"");var h=d.length;h%4==0&&(d=d.replace(/==?$/,""),h=d.length),(h%4==1||/[^+a-zA-Z0-9/]/.test(d))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var S=0,I,L,O="",R=-1;++R<h;)L=g.indexOf(d.charAt(R)),I=S%4?I*64+L:L,S++%4&&(O+=String.fromCharCode(255&I>>(-2*S&6)));return O},T=function(d){d=String(d),/[^\0-\xFF]/.test(d)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var h=d.length%3,S="",I=-1,L,O,R,m,M=d.length-h;++I<M;)L=d.charCodeAt(I)<<16,O=d.charCodeAt(++I)<<8,R=d.charCodeAt(++I),m=L+O+R,S+=g.charAt(m>>18&63)+g.charAt(m>>12&63)+g.charAt(m>>6&63)+g.charAt(m&63);return h==2?(L=d.charCodeAt(I)<<8,O=d.charCodeAt(++I),m=L+O,S+=g.charAt(m>>10)+g.charAt(m>>4&63)+g.charAt(m<<2&63)+"="):h==1&&(m=d.charCodeAt(I),S+=g.charAt(m>>2)+g.charAt(m<<4&63)+"=="),S},v={encode:T,decode:f,version:"1.0.0"};if(r&&!r.nodeType)if(o)o.exports=v;else for(var p in v)v.hasOwnProperty(p)&&(r[p]=v[p]);else n.base64=v})(commonjsGlobal)}(base64,base64.exports);var base64Exports=base64.exports;class AuthenticationStore{constructor({apiUrl:t,refreshAuthToken:n,addAccessTokenRefreshListener:r}){_e(this,"_refreshToken");_e(this,"_isShareToken",!1);_e(this,"_currentOrganization");_e(this,"_currentUser");_e(this,"_defaultDeviceId");_e(this,"_token");_e(this,"_waitingForAuth",new Set);_e(this,"_refreshTimer");_e(this,"_apiUrl");_e(this,"_refreshAuthToken");_e(this,"_addAccessTokenRefreshListener");this._apiUrl=t,this._refreshAuthToken=n,this._addAccessTokenRefreshListener=r}get token(){return this._token}get currentUser(){return this._currentUser}get currentOrganization(){return this._currentOrganization}get defaultDeviceId(){return this._defaultDeviceId}get refreshToken(){return this._refreshToken}get isShareToken(){return this._isShareToken}async login(t,n){try{const r=await fetch(`${this._apiUrl}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:n}),headers:{"Content-Type":"application/json"}}),o=await r.json();if(r.status!==200)throw new Error(o.message);return await this.loginWithToken(o.authentication.accessToken,o.authentication.refreshToken),o.authentication}catch(r){return console.error("login() failed",{err:r}),this._waitingForAuth.forEach(o=>o(!1)),this._waitingForAuth.clear(),Promise.reject(r)}}async loginWithToken(t,n){var o;const r=JSON.parse(base64Exports.decode(t.split(".")[1]));try{let l;if(this._isShareToken=r["formant:claims"]&&r["formant:claims"].type=="share",r["formant:claims"]&&(this._currentOrganization=r["formant:claims"].organizationId),r["custom:organization_id"]&&(this._currentOrganization=r["custom:organization_id"]),this._isShareToken||(l=r.sub),r["formant:claims"]&&r["formant:claims"].userId&&(l=r["formant:claims"].userId),l&&((o=this._currentUser)==null?void 0:o.id)!==l){const u=await fetch(`${this._apiUrl}/v1/admin/users/${l}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),s=await u.json();if(u.status!==200)throw new Error(s.message);this._currentUser=s}this._token=t,this._waitingForAuth.forEach(u=>u(!0))}catch(l){console.error("loginWithToken() failed",{err:l}),this._waitingForAuth.forEach(u=>u(!1))}finally{this._waitingForAuth.clear()}n&&(this._refreshToken=n,setInterval(async()=>{if(this._refreshToken){const u=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this._refreshToken})})).json();this._token=u.authentication.accessToken}},1e3*60*60))}isAuthenticated(){return this._token!==void 0}getCurrentUser(){return this._currentUser}async waitTilAuthenticated(){return this.token!==void 0?!0:new Promise(t=>{this._waitingForAuth.add(t)})}async listenForRefresh(){const n=()=>{this._refreshTimer=void 0,this._refreshAuthToken()};this._addAccessTokenRefreshListener(r=>{this._refreshTimer&&clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(n,36e5),this.loginWithToken(r)}),this._refreshTimer=setTimeout(n,36e5)}async forgotPassword(t){await fetch(`${this._apiUrl}/v1/admin/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:t}),headers:{"Content-Type":"application/json"}})}async confirmForgotPassword(t){return(await fetch(`${this._apiUrl}/v1/admin/auth/confirm-forgot-password`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).ok}async respondToNewPasswordRequiredChallenge(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/respond-to-new-password-required-challenge`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async loginWithGoogle(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/login-google`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async refresh(t){const r=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})})).json();await this.loginWithToken(r.authentication.accessToken,t)}}function getCurrentModuleContext(){return typeof window<"u"&&window.location?new URLSearchParams(window.location.search).get("module"):null}function sendAppMessage(e){if(!(window&&window.parent))throw new Error("cannot send message to non-existent parent");window.parent.postMessage(e,"*")}function refreshAuthToken(){const e=getCurrentModuleContext();if(!e)throw new Error("No module context");sendAppMessage({type:"refresh_auth_token",module:e})}function addAccessTokenRefreshListener(e){function t(n){const r=n.data;r.type==="auth_token"&&e(r.token)}return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}const Authentication=new AuthenticationStore({apiUrl:FORMANT_API_URL,refreshAuthToken,addAccessTokenRefreshListener});async function getModuleConfiguration(e){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/module-configurations/${e}`,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).configuration}function disableAnalyticsBottomBar(){sendAppMessage({type:"hide_analytics_date_picker"})}function goToDevice(e){sendAppMessage({type:"go_to_device",deviceId:e})}function goToTime(e){sendAppMessage({type:"go_to_time",time:e.getTime()})}function requestModuleData(){const e=getCurrentModuleContext();if(!e)throw new Error("No module context");sendAppMessage({type:"request_module_data",module:e})}function sendChannelData(e,t){const n=getCurrentModuleContext();if(!n)throw new Error("No module context");sendAppMessage({type:"send_channel_data",source:n,channel:e,data:t})}function setModuleDateTimeRange(e,t){const n=getCurrentModuleContext();if(!n)throw new Error("No module context");sendAppMessage({type:"set_module_data_time_range",module:n,before:e,after:t||0})}function setupModuleMenus(e){const t=getCurrentModuleContext();if(!t)throw new Error("No module context");sendAppMessage({type:"setup_module_menus",module:t,menus:e})}function showMessage(e){sendAppMessage({type:"show_message",message:e})}function addChannelDataListener(e,t){const n=r=>{const o=r.data;o.type==="channel_data"&&o.channel===e&&t({source:o.source,data:o.data})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function addMenuListener(e){const t=n=>{const r=n.data;r.type==="module_menu_item_clicked"&&e(r.menu)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function addModuleConfigurationListener(e){const t=n=>{const r=n.data;r.type==="module_configuration"&&e(r)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function addModuleDataListener(e){const t=getCurrentModuleContext();t&&sendAppMessage({type:"request_module_data",module:t});const n=r=>{const o=r.data;o.type==="module_data"&&e({streams:o.streams,time:o.time,queryRange:o.queryRange})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function addOverviewDeviceListener(e){sendAppMessage({type:"request_devices"});const t=n=>{const r=n.data;r.type==="overview_devices"&&e(r.data)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function _typeof(e){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(e)}function toInteger(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function requiredArgs(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function toDate(e){requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||_typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function addDays(e,t){requiredArgs(2,arguments);var n=toDate(e),r=toInteger(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function addMonths(e,t){requiredArgs(2,arguments);var n=toDate(e),r=toInteger(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),l=new Date(n.getTime());l.setMonth(n.getMonth()+r+1,0);var u=l.getDate();return o>=u?l:(n.setFullYear(l.getFullYear(),l.getMonth(),o),n)}function addMilliseconds(e,t){requiredArgs(2,arguments);var n=toDate(e).getTime(),r=toInteger(t);return new Date(n+r)}var MILLISECONDS_IN_HOUR=36e5;function addHours(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*MILLISECONDS_IN_HOUR)}var defaultOptions={};function getDefaultOptions(){return defaultOptions}function startOfWeek(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var f=getDefaultOptions(),T=toInteger((n=(r=(o=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&r!==void 0?r:(g=f.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=toDate(e),p=v.getDay(),d=(p<T?7:0)+p-T;return v.setDate(v.getDate()-d),v.setHours(0,0,0,0),v}function startOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(0,0,0,0),t}var MILLISECONDS_IN_MINUTE=6e4;function addMinutes(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*MILLISECONDS_IN_MINUTE)}function addQuarters(e,t){requiredArgs(2,arguments);var n=toInteger(t),r=n*3;return addMonths(e,r)}function addSeconds(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*1e3)}function addWeeks(e,t){requiredArgs(2,arguments);var n=toInteger(t),r=n*7;return addDays(e,r)}function addYears(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMonths(e,n*12)}function getQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=Math.floor(t.getMonth()/3)+1;return n}var roundingMap={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},defaultRoundingMethod="trunc";function getRoundingMethod(e){return e?roundingMap[e]:roundingMap[defaultRoundingMethod]}function endOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(23,59,59,999),t}function endOfMonth(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function eachDayOfInterval(e,t){var n;requiredArgs(1,arguments);var r=e||{},o=toDate(r.start),l=toDate(r.end),u=l.getTime();if(!(o.getTime()<=u))throw new RangeError("Invalid interval");var s=[],g=o;g.setHours(0,0,0,0);var c=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;g.getTime()<=u;)s.push(toDate(g)),g.setDate(g.getDate()+c),g.setHours(0,0,0,0);return s}function eachHourOfInterval(e,t){var n;requiredArgs(1,arguments);var r=e||{},o=toDate(r.start),l=toDate(r.end),u=o.getTime(),s=l.getTime();if(!(u<=s))throw new RangeError("Invalid interval");var g=[],c=o;c.setMinutes(0,0,0);var f=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(f<1||isNaN(f))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=s;)g.push(toDate(c)),c=addHours(c,f);return g}function startOfMinute(e){requiredArgs(1,arguments);var t=toDate(e);return t.setSeconds(0,0),t}function eachMinuteOfInterval(e,t){var n;requiredArgs(1,arguments);var r=startOfMinute(toDate(e.start)),o=toDate(e.end),l=r.getTime(),u=o.getTime();if(l>=u)throw new RangeError("Invalid interval");var s=[],g=r,c=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number equal to or greater than 1");for(;g.getTime()<=u;)s.push(toDate(g)),g=addMinutes(g,c);return s}function eachMonthOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime(),l=[];if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var u=n;for(u.setHours(0,0,0,0),u.setDate(1);u.getTime()<=o;)l.push(toDate(u)),u.setMonth(u.getMonth()+1);return l}function startOfQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth(),r=n-n%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function eachQuarterOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var l=startOfQuarter(n),u=startOfQuarter(r);o=u.getTime();for(var s=[],g=l;g.getTime()<=o;)s.push(toDate(g)),g=addQuarters(g,1);return s}function eachWeekOfInterval(e,t){requiredArgs(1,arguments);var n=e||{},r=toDate(n.start),o=toDate(n.end),l=o.getTime();if(!(r.getTime()<=l))throw new RangeError("Invalid interval");var u=startOfWeek(r,t),s=startOfWeek(o,t);u.setHours(15),s.setHours(15),l=s.getTime();for(var g=[],c=u;c.getTime()<=l;)c.setHours(0),g.push(toDate(c)),c=addWeeks(c,1),c.setHours(15);return g}function startOfMonth(e){requiredArgs(1,arguments);var t=toDate(e);return t.setDate(1),t.setHours(0,0,0,0),t}function endOfYear(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function startOfYear(e){requiredArgs(1,arguments);var t=toDate(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eachYearOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var l=[],u=n;for(u.setHours(0,0,0,0),u.setMonth(0,1);u.getTime()<=o;)l.push(toDate(u)),u.setFullYear(u.getFullYear()+1);return l}function endOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(59,59,999),t}function endOfWeek(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var f=getDefaultOptions(),T=toInteger((n=(r=(o=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&r!==void 0?r:(g=f.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=toDate(e),p=v.getDay(),d=(p<T?-7:0)+6-(p-T);return v.setDate(v.getDate()+d),v.setHours(23,59,59,999),v}function endOfMinute(e){requiredArgs(1,arguments);var t=toDate(e);return t.setSeconds(59,999),t}function endOfQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth(),r=n-n%3+3;return t.setMonth(r,0),t.setHours(23,59,59,999),t}function getDay(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getDay();return n}function getHours(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getHours();return n}function getMinutes(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMinutes();return n}function getMonth(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth();return n}function getWeekYear(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var f=toDate(e),T=f.getFullYear(),v=getDefaultOptions(),p=toInteger((n=(r=(o=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:v.firstWeekContainsDate)!==null&&r!==void 0?r:(g=v.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setFullYear(T+1,0,p),d.setHours(0,0,0,0);var h=startOfWeek(d,t),S=new Date(0);S.setFullYear(T,0,p),S.setHours(0,0,0,0);var I=startOfWeek(S,t);return f.getTime()>=h.getTime()?T+1:f.getTime()>=I.getTime()?T:T-1}function startOfWeekYear(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var f=getDefaultOptions(),T=toInteger((n=(r=(o=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&r!==void 0?r:(g=f.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),v=getWeekYear(e,t),p=new Date(0);p.setFullYear(v,0,T),p.setHours(0,0,0,0);var d=startOfWeek(p,t);return d}var MILLISECONDS_IN_WEEK=6048e5;function getWeek(e,t){requiredArgs(1,arguments);var n=toDate(e),r=startOfWeek(n,t).getTime()-startOfWeekYear(n,t).getTime();return Math.round(r/MILLISECONDS_IN_WEEK)+1}function getYear(e){return requiredArgs(1,arguments),toDate(e).getFullYear()}function startOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(0,0,0),t}function subDays(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addDays(e,-n)}function roundToNearestMinutes(e,t){var n;if(arguments.length<1)throw new TypeError("1 argument required, but only none provided present");var r=toInteger((n=t==null?void 0:t.nearestTo)!==null&&n!==void 0?n:1);if(r<1||r>30)throw new RangeError("`options.nearestTo` must be between 1 and 30");var o=toDate(e),l=o.getSeconds(),u=o.getMinutes()+l/60,s=getRoundingMethod(t==null?void 0:t.roundingMethod),g=s(u/r)*r,c=u%r,f=Math.round(c/r)*r;return new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),g+f)}function subMonths(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMonths(e,-n)}function subHours(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addHours(e,-n)}function subMinutes(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMinutes(e,-n)}function subQuarters(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addQuarters(e,-n)}function subWeeks(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addWeeks(e,-n)}function subYears(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addYears(e,-n)}const millisecond=1,second=1e3,minute=60*second,hour=60*minute,day=24*hour,week=7*day,month=30*day,year=365*day,duration={millisecond,second,minute,hour,day,week,month,year};function filterDataByType(e,t){return e.filter(n=>t.includes(n.type))}function filterDataByTime(e,t,n){const r=t.getTime(),o=n.getTime();return e.map(l=>({...l,points:l.points.filter(([u])=>u>=r&&u<o)})).filter(({points:l})=>l.length>0)}function fork(e){}class StoreCache{constructor({capacity:t,timeout:n}={}){_e(this,"entries",new Map);_e(this,"metadata",new Map);_e(this,"capacity");_e(this,"timeout");this.capacity=t||1e4,this.timeout=n||duration.minute}get(t,n){const r=this.keyToCacheKey(t),o=this.entries.get(r),l=this.metadata.get(r);return(o===void 0||l&&(l==null?void 0:l.expiration.getTime())<Date.now())&&!(l!=null&&l.generating)&&n&&this.generate(t,n()),o===void 0&&l&&l.lastValue!==void 0?l.lastValue:o}set(t,n){const r=this.keyToCacheKey(t);this.metadata.set(r,{generating:!1,expiration:new Date(Date.now()+this.timeout),lastValue:n}),this.entries.set(r,n),this.metadata.size>this.capacity&&this.deleteOldestEntry()}clear(){this.entries.clear(),[...this.metadata.values()].forEach(t=>t.generating=!1)}clearKey(t){this.metadata.delete(t),this.entries.delete(t)}keyToCacheKey(t){return JSON.stringify(t)}deleteOldestEntry(){if(this.metadata.size<1)return;const[t]=[...this.metadata.entries()].reduce(([n,r],[o,l])=>l.expiration.getTime()<r.expiration.getTime()?[o,l]:[n,r]);this.clearKey(t)}generate(t,n){const r=this.keyToCacheKey(t),o=this.metadata.get(r)||{};this.metadata.set(r,{...o,generating:!0,expiration:new Date(Date.now()+this.timeout)}),setTimeout(()=>{n.then(l=>{const u=this.metadata.get(r);!(u!=null&&u.generating)||this.set(t,l)})},0)}}async function queryTelemetry(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}class QueryStore{constructor(){_e(this,"queryStoreCache",new StoreCache({capacity:1e4,timeout:20*duration.second}));_e(this,"liveQueryStoreCache",new StoreCache({capacity:1e4,timeout:200*duration.millisecond}))}moduleQuery(t,n,r,o,l,u=!1){const s={...t,names:[...n],types:[...r]},g=this.query(s,o,l,u);return g===void 0||g==="too much data"?g:filterDataByType(g,r)}query(t,n,r,o=!1){const l={...t,start:startOfMinute(n).toISOString(),end:o?r.toISOString():addMinutes(roundToNearestMinutes(r),1).toISOString(),latestOnly:o},u=r>addSeconds(new Date,-20);let s;return u?s=this.liveQueryCache(l):s=this.queryCache(l),!s||s==="too much data"||o?s:filterDataByTime(s,n,r)}queryCache(t){return this.queryStoreCache.get(t,async()=>{try{return await queryTelemetry(t)}catch(n){throw n}})}liveQueryCache(t){return this.liveQueryStoreCache.get(t,async()=>{try{return await queryTelemetry(t)}catch(n){throw n}})}}const queryStore=new QueryStore;function addStreamListener(e,t,n){const r=o=>{const l=o.data;if(l.type==="module_data"){const{start:u,end:s}=l.queryRange;n(queryStore.moduleQuery({},e,t,new Date(u),new Date(s),!1))}};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)}async function getDate(e,t,n){return new Promise(r=>{sendAppMessage({type:"request_date",minTime:t,maxTime:n,time:e});const o=l=>{const u=l.data;u.type==="date_response"&&(window.removeEventListener("message",o),r(u.data))};window.addEventListener("message",o)})}async function prompt(e,t){return new Promise(n=>{const r=Math.random().toString();sendAppMessage({type:"prompt",promptId:r,schema:e,okText:t==null?void 0:t.okText,cancelText:t==null?void 0:t.cancelText});const o=l=>{const u=l.data;u.type==="prompt_response"&&u.promptId===r&&n(u.data),window.removeEventListener("message",o)};window.addEventListener("message",o)})}const Qe=class{static isModule(){return getCurrentModuleContext()!==null}static async getCurrentModuleConfiguration(){let t=new URLSearchParams("");typeof window<"u"&&window.location&&(t=new URLSearchParams(window.location.search));const n=t.get("configuration");if(!(n===null||n.trim()===""))return getModuleConfiguration(n.trim())}static get isOnline(){return Qe._isOnline}static listenForConnectionEvents(){const t=n=>{const{data:r}=n;r.type==="formant_online"&&(this._isOnline=r.online)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}static checkConnection(t=1e3){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("deadline expired: took too long")),t),l=u=>{window.removeEventListener("message",l),clearTimeout(o);const{data:s}=u;s.type==="formant_online"&&(this._isOnline=s.online,n(s.online))};window.addEventListener("message",l),sendAppMessage({type:"formant_online"})})}static waitForConnection(t=5e3){let n=!1;const r=new Promise((u,s)=>{setTimeout(()=>{n=!0,s(new Error("deadline expired: took too long"))},t)}),o=u=>new Promise(s=>setTimeout(s,u)),l=async()=>{for(await o(50);!n&&!(this.isOnline||await this.checkConnection);)await o(500)};return Promise.race([r,l()])}};let App=Qe;_e(App,"getCurrentModuleContext",getCurrentModuleContext),_e(App,"disableAnalyticsBottomBar",disableAnalyticsBottomBar),_e(App,"goToDevice",goToDevice),_e(App,"goToTime",goToTime),_e(App,"refreshAuthToken",refreshAuthToken),_e(App,"requestModuleData",requestModuleData),_e(App,"sendChannelData",sendChannelData),_e(App,"setModuleDateTimeRange",setModuleDateTimeRange),_e(App,"setupModuleMenus",setupModuleMenus),_e(App,"showMessage",showMessage),_e(App,"addAccessTokenRefreshListener",addAccessTokenRefreshListener),_e(App,"addChannelDataListener",addChannelDataListener),_e(App,"addMenuListener",addMenuListener),_e(App,"addModuleConfigurationListener",addModuleConfigurationListener),_e(App,"addModuleDataListener",addModuleDataListener),_e(App,"addOverviewDeviceListener",addOverviewDeviceListener),_e(App,"addStreamListener",addStreamListener),_e(App,"getDate",getDate),_e(App,"prompt",prompt),_e(App,"_isOnline",null);function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}var dist={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(module,exports){(function(e,t){module.exports=t()})(window,function(){return function(e){function t(c){for(var f,T,v=c[0],p=c[1],d=0,h=[];d<v.length;d++)T=v[d],Object.prototype.hasOwnProperty.call(r,T)&&r[T]&&h.push(r[T][0]),r[T]=0;for(f in p)Object.prototype.hasOwnProperty.call(p,f)&&(e[f]=p[f]);for(g&&g(c);h.length;)h.shift()()}var n={},r={0:0};function o(c){if(n[c])return n[c].exports;var f=n[c]={i:c,l:!1,exports:{}};return e[c].call(f.exports,f,f.exports,o),f.l=!0,f.exports}o.e=function(){return Promise.resolve()},o.m=e,o.c=n,o.d=function(c,f,T){o.o(c,f)||Object.defineProperty(c,f,{enumerable:!0,get:T})},o.r=function(c){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},o.t=function(c,f){if(1&f&&(c=o(c)),8&f||4&f&&typeof c=="object"&&c&&c.__esModule)return c;var T=Object.create(null);if(o.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:c}),2&f&&typeof c!="string")for(var v in c)o.d(T,v,function(p){return c[p]}.bind(null,v));return T},o.n=function(c){var f=c&&c.__esModule?function(){return c.default}:function(){return c};return o.d(f,"a",f),f},o.o=function(c,f){return Object.prototype.hasOwnProperty.call(c,f)},o.p="",o.oe=function(c){throw console.error(c),c};var l=window.webpackJsonpFormantRealtimeSDK=window.webpackJsonpFormantRealtimeSDK||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var g=u;return o(o.s=227)}([function(e,t,n){n.d(t,"a",function(){return j});var r=n(18),o=n(56),l=n(14),u=n.n(l),s=n(19);function g(K,Y){if(Y.length<K)throw new TypeError(K+" argument"+(K>1?"s":"")+" required, but only "+Y.length+" present")}function c(K){if(K===null||K===!0||K===!1)return NaN;var Y=Number(K);return isNaN(Y)?Y:Y<0?Math.ceil(Y):Math.floor(Y)}var f={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},T=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,v=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,p=/^([+-])(\d{2})(?::?(\d{2}))?$/;function d(K){var Y,re={},oe=K.split(f.dateTimeDelimiter);if(oe.length>2)return re;if(/:/.test(oe[0])?Y=oe[0]:(re.date=oe[0],Y=oe[1],f.timeZoneDelimiter.test(re.date)&&(re.date=K.split(f.timeZoneDelimiter)[0],Y=K.substr(re.date.length,K.length))),Y){var ue=f.timezone.exec(Y);ue?(re.time=Y.replace(ue[1],""),re.timezone=ue[1]):re.time=Y}return re}function h(K,Y){var re=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+Y)+"})|(\\d{2}|[+-]\\d{"+(2+Y)+"})$)"),oe=K.match(re);if(!oe)return{year:NaN,restDateString:""};var ue=oe[1]?parseInt(oe[1]):null,ve=oe[2]?parseInt(oe[2]):null;return{year:ve===null?ue:100*ve,restDateString:K.slice((oe[1]||oe[2]).length)}}function S(K,Y){if(Y===null)return new Date(NaN);var re=K.match(T);if(!re)return new Date(NaN);var oe=!!re[4],ue=I(re[1]),ve=I(re[2])-1,Re=I(re[3]),Te=I(re[4]),Ne=I(re[5])-1;if(oe)return function(Ce,Me,Fe){return Me>=1&&Me<=53&&Fe>=0&&Fe<=6}(0,Te,Ne)?function(Ce,Me,Fe){var $e=new Date(0);$e.setUTCFullYear(Ce,0,4);var nt=$e.getUTCDay()||7,Et=7*(Me-1)+Fe+1-nt;return $e.setUTCDate($e.getUTCDate()+Et),$e}(Y,Te,Ne):new Date(NaN);var Oe=new Date(0);return function(Ce,Me,Fe){return Me>=0&&Me<=11&&Fe>=1&&Fe<=(m[Me]||(M(Ce)?29:28))}(Y,ve,Re)&&function(Ce,Me){return Me>=1&&Me<=(M(Ce)?366:365)}(Y,ue)?(Oe.setUTCFullYear(Y,ve,Math.max(ue,Re)),Oe):new Date(NaN)}function I(K){return K?parseInt(K):1}function L(K){var Y=K.match(v);if(!Y)return NaN;var re=O(Y[1]),oe=O(Y[2]),ue=O(Y[3]);return function(ve,Re,Te){return ve===24?Re===0&&Te===0:Te>=0&&Te<60&&Re>=0&&Re<60&&ve>=0&&ve<25}(re,oe,ue)?36e5*re+6e4*oe+1e3*ue:NaN}function O(K){return K&&parseFloat(K.replace(",","."))||0}function R(K){if(K==="Z")return 0;var Y=K.match(p);if(!Y)return 0;var re=Y[1]==="+"?-1:1,oe=parseInt(Y[2]),ue=Y[3]&&parseInt(Y[3])||0;return function(ve,Re){return Re>=0&&Re<=59}(0,ue)?re*(36e5*oe+6e4*ue):NaN}var m=[31,null,31,30,31,30,31,31,30,31,30,31];function M(K){return K%400==0||K%4==0&&K%100!=0}function G(K){return(G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y})(K)}function Z(K){return g(1,arguments),K instanceof Date||G(K)==="object"&&Object.prototype.toString.call(K)==="[object Date]"}function _(K){return(_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y})(K)}function y(K){g(1,arguments);var Y=Object.prototype.toString.call(K);return K instanceof Date||_(K)==="object"&&Y==="[object Date]"?new Date(K.getTime()):typeof K=="number"||Y==="[object Number]"?new Date(K):(typeof K!="string"&&Y!=="[object String]"||typeof console>"u"||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function C(K){const Y=function(re,oe){var ue;g(1,arguments);var ve=c((ue=oe==null?void 0:oe.additionalDigits)!==null&&ue!==void 0?ue:2);if(ve!==2&&ve!==1&&ve!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(typeof re!="string"&&Object.prototype.toString.call(re)!=="[object String]")return new Date(NaN);var Re,Te=d(re);if(Te.date){var Ne=h(Te.date,ve);Re=S(Ne.restDateString,Ne.year)}if(!Re||isNaN(Re.getTime()))return new Date(NaN);var Oe,Ce=Re.getTime(),Me=0;if(Te.time&&(Me=L(Te.time),isNaN(Me)))return new Date(NaN);if(!Te.timezone){var Fe=new Date(Ce+Me),$e=new Date(0);return $e.setFullYear(Fe.getUTCFullYear(),Fe.getUTCMonth(),Fe.getUTCDate()),$e.setHours(Fe.getUTCHours(),Fe.getUTCMinutes(),Fe.getUTCSeconds(),Fe.getUTCMilliseconds()),$e}return Oe=R(Te.timezone),isNaN(Oe)?new Date(NaN):new Date(Ce+Me+Oe)}(K);if(!function(re){if(g(1,arguments),!Z(re)&&typeof re!="number")return!1;var oe=y(re);return!isNaN(Number(oe))}(Y))throw new Error(`Invalid ISO 8601 date string (${K})`);return Y}const w=Math.pow(2,20),x=w;var H=n(4),U=n(30);function N(K){return u()(K,{cycles:!0})}var k=function(K,Y){var re={};for(var oe in K)Object.prototype.hasOwnProperty.call(K,oe)&&Y.indexOf(oe)<0&&(re[oe]=K[oe]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(oe=Object.getOwnPropertySymbols(K);ue<oe.length;ue++)Y.indexOf(oe[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,oe[ue])&&(re[oe[ue]]=K[oe[ue]])}return re};function F(K,Y={}){const{redacted:re=!0}=Y,oe=Ne=>re?Object(U.a)(Ne):Ne;if(!K.stack)return{message:N(oe(K))};const{name:ue,message:ve,stack:Re}=K,Te=k(K,["name","message","stack"]);return{name:ue,message:ve!==void 0?ve:N(oe(K)),stack:Re,meta:Te&&Object.keys(Te).length===0?void 0:oe(Te)}}function A(K,Y={}){const{message:re,stack:oe,meta:ue}=F(K,Y);return`${oe||re||""}${ue&&Object.keys(ue).length>0?` -- ${N(ue)}`:""}`}var b=n(39),B=n(102),W=n.n(B),Q=function(K,Y,re,oe){return new(re||(re=Promise))(function(ue,ve){function Re(Oe){try{Ne(oe.next(Oe))}catch(Ce){ve(Ce)}}function Te(Oe){try{Ne(oe.throw(Oe))}catch(Ce){ve(Ce)}}function Ne(Oe){var Ce;Oe.done?ue(Oe.value):(Ce=Oe.value,Ce instanceof re?Ce:new re(function(Me){Me(Ce)})).then(Re,Te)}Ne((oe=oe.apply(K,Y||[])).next())})},ee=function(K,Y){var re={};for(var oe in K)Object.prototype.hasOwnProperty.call(K,oe)&&Y.indexOf(oe)<0&&(re[oe]=K[oe]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(oe=Object.getOwnPropertySymbols(K);ue<oe.length;ue++)Y.indexOf(oe[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,oe[ue])&&(re[oe[ue]]=K[oe[ue]])}return re};class ne extends W.a{constructor(Y,re){super(),this.endpoint=Y,this.metadata=re,this.logClient=this.getLogClient()}getLogClient(){return Q(this,void 0,void 0,function*(){const{LogClient:Y}=yield Promise.resolve().then(n.bind(null,230));return new Y(this.endpoint)})}log(Y,re){return Q(this,void 0,void 0,function*(){const{level:oe,message:ue,error:ve}=Y,Re=ee(Y,["level","message","error"]);this.emit("logged");try{yield(yield this.logClient).log([{timestamp:new Date().toISOString(),level:oe,message:`${ue}`.substring(0,1e3),error:ve!==void 0?F(ve):void 0,meta:Object.assign(Object.assign({},Re),this.metadata)}])}catch(Te){console.error(`Failed to log to log-api: ${A(Te)}`)}re()})}}var X=function(K,Y){var re={};for(var oe in K)Object.prototype.hasOwnProperty.call(K,oe)&&Y.indexOf(oe)<0&&(re[oe]=K[oe]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(oe=Object.getOwnPropertySymbols(K);ue<oe.length;ue++)Y.indexOf(oe[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,oe[ue])&&(re[oe[ue]]=K[oe[ue]])}return re};const $={app:H.a,namespace:H.i,buildTag:H.b,instanceId:b.a},E=H.e?s.format.printf(K=>{var{timestamp:Y,level:re,message:oe,error:ue}=K,ve=X(K,["timestamp","level","message","error"]);const Re=Object.assign(Object.assign({timestamp:Y?C(Y).getTime():new Date().getTime(),level:re.toUpperCase(),message:oe},ue?{error:F(ue)}:{}),{meta:Object.assign(Object.assign({},$),ve)});return u()(Re,{cycles:!0})}):s.format.printf(K=>{var{timestamp:Y,level:re,message:oe,error:ue}=K,ve=X(K,["timestamp","level","message","error"]);let Re=`${Y||new Date().toISOString()} ${re.toUpperCase()}: ${oe} `;return Object.keys(ve).length>0&&(Re+=u()(ve,{cycles:!0})),ue&&(Re+=`
2
- ${A(ue)}`),Re}),j=Object(s.createLogger)({level:H.f});if(j.add(new s.transports.Console({format:E,level:"debug"})),j.transports.forEach(K=>{K.silent=!H.g}),H.d&&j.add(new ne(H.d,$)),H.h){const K=o.resolve(r.tmpdir(),`silly-${H.a}.log`);j.debug("Logging silly logs to file",{filename:K}),j.add(new s.transports.File({filename:K,maxsize:1*x,maxFiles:10,format:s.format.combine((V="silly",Object(s.format)(Y=>Y.level===V&&Y)()),E),level:"silly"}))}var V},function(e,t,n){n.d(t,"a",function(){return r});const r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}},function(e,t){var n,r,o=e.exports={};function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(S){if(n===setTimeout)return setTimeout(S,0);if((n===l||!n)&&setTimeout)return n=setTimeout,setTimeout(S,0);try{return n(S,0)}catch{try{return n.call(null,S,0)}catch{return n.call(this,S,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:l}catch{n=l}try{r=typeof clearTimeout=="function"?clearTimeout:u}catch{r=u}})();var g,c=[],f=!1,T=-1;function v(){f&&g&&(f=!1,g.length?c=g.concat(c):T=-1,c.length&&p())}function p(){if(!f){var S=s(v);f=!0;for(var I=c.length;I;){for(g=c,c=[];++T<I;)g&&g[T].run();T=-1,I=c.length}g=null,f=!1,function(L){if(r===clearTimeout)return clearTimeout(L);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(L);try{r(L)}catch{try{return r.call(null,L)}catch{return r.call(this,L)}}}(S)}}function d(S,I){this.fun=S,this.array=I}function h(){}o.nextTick=function(S){var I=new Array(arguments.length-1);if(arguments.length>1)for(var L=1;L<arguments.length;L++)I[L-1]=arguments[L];c.push(new d(S,I)),c.length!==1||f||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(S){return[]},o.binding=function(S){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(S){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")}),Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")}),Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")}),Object.defineProperty(t,"configs",{value:n(117)})},function(e,t,n){(function(r){n.d(t,"a",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"j",function(){return g}),n.d(t,"b",function(){return c}),n.d(t,"f",function(){return f}),n.d(t,"e",function(){return T}),n.d(t,"g",function(){return v}),n.d(t,"d",function(){return p}),n.d(t,"c",function(){return d}),n.d(t,"h",function(){return h});var o=n(101);const l=o.from({ENVIRONMENT:r.env.ENV,AGGREGATE_LEVEL:r.env.AGGREGATE_LEVEL,API_ENDPOINT:r.env.API_ENDPOINT,APP:"realtime-sdk",APP_PATH:r.env.APP_PATH,BUILD_TAG:r.env.BUILD_TAG,ENABLE_SELF_SERVE:r.env.ENABLE_SELF_SERVE,ENABLE_SENTRY:r.env.ENABLE_SENTRY,ENABLE_SENTRY_PROFILING:r.env.ENABLE_SENTRY_PROFILING,GIT_COMMIT:r.env.GIT_COMMIT,JEST_WORKER_ID:r.env.JEST_WORKER_ID,LOG_API_ENDPOINT:r.env.LOG_API_ENDPOINT,LOG_JSON:"false",LOG_LEVEL:r.env.LOG_LEVEL,LOG_TO_CONSOLE:r.env.LOG_TO_CONSOLE,LOG_TO_FILE:r.env.LOG_TO_FILE,NAMESPACE:"production",SENTRY_DSN:r.env.SENTRY_DSN,SHEET_EXPORT_MAX_ROW_COUNT:r.env.SHEET_EXPORT_MAX_ROW_COUNT,STABLE_AGENT_VERSION:r.env.STABLE_AGENT_VERSION,VERSION:r.env.VERSION}),u=(l.get("ENVIRONMENT").default("").asString(),l.get("APP").default("").asString()),s=(l.get("APP_PATH").default("").asString(),l.get("API_ENDPOINT").default("").asString(),l.get("NAMESPACE").default("").asString()),g=l.get("VERSION").default("").asString(),c=l.get("BUILD_TAG").default("").asString(),f=(l.get("GIT_COMMIT").default("").asString(),l.get("ENABLE_SENTRY").default("false").asBool(),l.get("ENABLE_SENTRY_PROFILING").default("false").asBool(),l.get("SENTRY_DSN").default("").asString(),l.get("LOG_LEVEL").default("debug").asString()),T=l.get("LOG_JSON").default("true").asBool(),v=l.get("LOG_TO_CONSOLE").default("true").asBool(),p=(l.get("STABLE_AGENT_VERSION").default("").asString(),l.get("LOG_API_ENDPOINT").asString()),d=l.get("JEST_WORKER_ID").asString(),h=(l.get("SHEET_EXPORT_MAX_ROW_COUNT").default("10000").asIntPositive(),l.get("LOG_TO_FILE").default("false").asBoolStrict());l.get("ENABLE_SELF_SERVE").default("true").asBoolStrict(),l.get("AGGREGATE_LEVEL").default("hour").asEnum(["day","hour","minute"])}).call(this,n(2))},function(e,t,n){(function(r){var o=n(125),l=n(126),u=n(42);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(E,j){if(s()<j)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(E=new Uint8Array(j)).__proto__=c.prototype:(E===null&&(E=new c(j)),E.length=j),E}function c(E,j,V){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(E,j,V);if(typeof E=="number"){if(typeof j=="string")throw new Error("If encoding is specified then the first argument must be a string");return v(this,E)}return f(this,E,j,V)}function f(E,j,V,K){if(typeof j=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&j instanceof ArrayBuffer?function(Y,re,oe,ue){if(re.byteLength,oe<0||re.byteLength<oe)throw new RangeError("'offset' is out of bounds");if(re.byteLength<oe+(ue||0))throw new RangeError("'length' is out of bounds");return re=oe===void 0&&ue===void 0?new Uint8Array(re):ue===void 0?new Uint8Array(re,oe):new Uint8Array(re,oe,ue),c.TYPED_ARRAY_SUPPORT?(Y=re).__proto__=c.prototype:Y=p(Y,re),Y}(E,j,V,K):typeof j=="string"?function(Y,re,oe){if(typeof oe=="string"&&oe!==""||(oe="utf8"),!c.isEncoding(oe))throw new TypeError('"encoding" must be a valid string encoding');var ue=0|h(re,oe),ve=(Y=g(Y,ue)).write(re,oe);return ve!==ue&&(Y=Y.slice(0,ve)),Y}(E,j,V):function(Y,re){if(c.isBuffer(re)){var oe=0|d(re.length);return(Y=g(Y,oe)).length===0||re.copy(Y,0,0,oe),Y}if(re){if(typeof ArrayBuffer<"u"&&re.buffer instanceof ArrayBuffer||"length"in re)return typeof re.length!="number"||(ue=re.length)!=ue?g(Y,0):p(Y,re);if(re.type==="Buffer"&&u(re.data))return p(Y,re.data)}var ue;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(E,j)}function T(E){if(typeof E!="number")throw new TypeError('"size" argument must be a number');if(E<0)throw new RangeError('"size" argument must not be negative')}function v(E,j){if(T(j),E=g(E,j<0?0:0|d(j)),!c.TYPED_ARRAY_SUPPORT)for(var V=0;V<j;++V)E[V]=0;return E}function p(E,j){var V=j.length<0?0:0|d(j.length);E=g(E,V);for(var K=0;K<V;K+=1)E[K]=255&j[K];return E}function d(E){if(E>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|E}function h(E,j){if(c.isBuffer(E))return E.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(E)||E instanceof ArrayBuffer))return E.byteLength;typeof E!="string"&&(E=""+E);var V=E.length;if(V===0)return 0;for(var K=!1;;)switch(j){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":case void 0:return ne(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*V;case"hex":return V>>>1;case"base64":return X(E).length;default:if(K)return ne(E).length;j=(""+j).toLowerCase(),K=!0}}function S(E,j,V){var K=!1;if((j===void 0||j<0)&&(j=0),j>this.length||((V===void 0||V>this.length)&&(V=this.length),V<=0)||(V>>>=0)<=(j>>>=0))return"";for(E||(E="utf8");;)switch(E){case"hex":return H(this,j,V);case"utf8":case"utf-8":return C(this,j,V);case"ascii":return w(this,j,V);case"latin1":case"binary":return x(this,j,V);case"base64":return y(this,j,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,j,V);default:if(K)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),K=!0}}function I(E,j,V){var K=E[j];E[j]=E[V],E[V]=K}function L(E,j,V,K,Y){if(E.length===0)return-1;if(typeof V=="string"?(K=V,V=0):V>2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),V=+V,isNaN(V)&&(V=Y?0:E.length-1),V<0&&(V=E.length+V),V>=E.length){if(Y)return-1;V=E.length-1}else if(V<0){if(!Y)return-1;V=0}if(typeof j=="string"&&(j=c.from(j,K)),c.isBuffer(j))return j.length===0?-1:O(E,j,V,K,Y);if(typeof j=="number")return j&=255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(E,j,V):Uint8Array.prototype.lastIndexOf.call(E,j,V):O(E,[j],V,K,Y);throw new TypeError("val must be string, number or Buffer")}function O(E,j,V,K,Y){var re,oe=1,ue=E.length,ve=j.length;if(K!==void 0&&((K=String(K).toLowerCase())==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(E.length<2||j.length<2)return-1;oe=2,ue/=2,ve/=2,V/=2}function Re(Ce,Me){return oe===1?Ce[Me]:Ce.readUInt16BE(Me*oe)}if(Y){var Te=-1;for(re=V;re<ue;re++)if(Re(E,re)===Re(j,Te===-1?0:re-Te)){if(Te===-1&&(Te=re),re-Te+1===ve)return Te*oe}else Te!==-1&&(re-=re-Te),Te=-1}else for(V+ve>ue&&(V=ue-ve),re=V;re>=0;re--){for(var Ne=!0,Oe=0;Oe<ve;Oe++)if(Re(E,re+Oe)!==Re(j,Oe)){Ne=!1;break}if(Ne)return re}return-1}function R(E,j,V,K){V=Number(V)||0;var Y=E.length-V;K?(K=Number(K))>Y&&(K=Y):K=Y;var re=j.length;if(re%2!=0)throw new TypeError("Invalid hex string");K>re/2&&(K=re/2);for(var oe=0;oe<K;++oe){var ue=parseInt(j.substr(2*oe,2),16);if(isNaN(ue))return oe;E[V+oe]=ue}return oe}function m(E,j,V,K){return $(ne(j,E.length-V),E,V,K)}function M(E,j,V,K){return $(function(Y){for(var re=[],oe=0;oe<Y.length;++oe)re.push(255&Y.charCodeAt(oe));return re}(j),E,V,K)}function G(E,j,V,K){return M(E,j,V,K)}function Z(E,j,V,K){return $(X(j),E,V,K)}function _(E,j,V,K){return $(function(Y,re){for(var oe,ue,ve,Re=[],Te=0;Te<Y.length&&!((re-=2)<0);++Te)oe=Y.charCodeAt(Te),ue=oe>>8,ve=oe%256,Re.push(ve),Re.push(ue);return Re}(j,E.length-V),E,V,K)}function y(E,j,V){return j===0&&V===E.length?o.fromByteArray(E):o.fromByteArray(E.slice(j,V))}function C(E,j,V){V=Math.min(E.length,V);for(var K=[],Y=j;Y<V;){var re,oe,ue,ve,Re=E[Y],Te=null,Ne=Re>239?4:Re>223?3:Re>191?2:1;if(Y+Ne<=V)switch(Ne){case 1:Re<128&&(Te=Re);break;case 2:(192&(re=E[Y+1]))==128&&(ve=(31&Re)<<6|63&re)>127&&(Te=ve);break;case 3:re=E[Y+1],oe=E[Y+2],(192&re)==128&&(192&oe)==128&&(ve=(15&Re)<<12|(63&re)<<6|63&oe)>2047&&(ve<55296||ve>57343)&&(Te=ve);break;case 4:re=E[Y+1],oe=E[Y+2],ue=E[Y+3],(192&re)==128&&(192&oe)==128&&(192&ue)==128&&(ve=(15&Re)<<18|(63&re)<<12|(63&oe)<<6|63&ue)>65535&&ve<1114112&&(Te=ve)}Te===null?(Te=65533,Ne=1):Te>65535&&(Te-=65536,K.push(Te>>>10&1023|55296),Te=56320|1023&Te),K.push(Te),Y+=Ne}return function(Oe){var Ce=Oe.length;if(Ce<=4096)return String.fromCharCode.apply(String,Oe);for(var Me="",Fe=0;Fe<Ce;)Me+=String.fromCharCode.apply(String,Oe.slice(Fe,Fe+=4096));return Me}(K)}t.Buffer=c,t.SlowBuffer=function(E){return+E!=E&&(E=0),c.alloc(+E)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=r.TYPED_ARRAY_SUPPORT!==void 0?r.TYPED_ARRAY_SUPPORT:function(){try{var E=new Uint8Array(1);return E.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},E.foo()===42&&typeof E.subarray=="function"&&E.subarray(1,1).byteLength===0}catch{return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(E){return E.__proto__=c.prototype,E},c.from=function(E,j,V){return f(null,E,j,V)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(E,j,V){return function(K,Y,re,oe){return T(Y),Y<=0?g(K,Y):re!==void 0?typeof oe=="string"?g(K,Y).fill(re,oe):g(K,Y).fill(re):g(K,Y)}(null,E,j,V)},c.allocUnsafe=function(E){return v(null,E)},c.allocUnsafeSlow=function(E){return v(null,E)},c.isBuffer=function(E){return!(E==null||!E._isBuffer)},c.compare=function(E,j){if(!c.isBuffer(E)||!c.isBuffer(j))throw new TypeError("Arguments must be Buffers");if(E===j)return 0;for(var V=E.length,K=j.length,Y=0,re=Math.min(V,K);Y<re;++Y)if(E[Y]!==j[Y]){V=E[Y],K=j[Y];break}return V<K?-1:K<V?1:0},c.isEncoding=function(E){switch(String(E).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(E,j){if(!u(E))throw new TypeError('"list" argument must be an Array of Buffers');if(E.length===0)return c.alloc(0);var V;if(j===void 0)for(j=0,V=0;V<E.length;++V)j+=E[V].length;var K=c.allocUnsafe(j),Y=0;for(V=0;V<E.length;++V){var re=E[V];if(!c.isBuffer(re))throw new TypeError('"list" argument must be an Array of Buffers');re.copy(K,Y),Y+=re.length}return K},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var E=this.length;if(E%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var j=0;j<E;j+=2)I(this,j,j+1);return this},c.prototype.swap32=function(){var E=this.length;if(E%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var j=0;j<E;j+=4)I(this,j,j+3),I(this,j+1,j+2);return this},c.prototype.swap64=function(){var E=this.length;if(E%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var j=0;j<E;j+=8)I(this,j,j+7),I(this,j+1,j+6),I(this,j+2,j+5),I(this,j+3,j+4);return this},c.prototype.toString=function(){var E=0|this.length;return E===0?"":arguments.length===0?C(this,0,E):S.apply(this,arguments)},c.prototype.equals=function(E){if(!c.isBuffer(E))throw new TypeError("Argument must be a Buffer");return this===E||c.compare(this,E)===0},c.prototype.inspect=function(){var E="",j=t.INSPECT_MAX_BYTES;return this.length>0&&(E=this.toString("hex",0,j).match(/.{2}/g).join(" "),this.length>j&&(E+=" ... ")),"<Buffer "+E+">"},c.prototype.compare=function(E,j,V,K,Y){if(!c.isBuffer(E))throw new TypeError("Argument must be a Buffer");if(j===void 0&&(j=0),V===void 0&&(V=E?E.length:0),K===void 0&&(K=0),Y===void 0&&(Y=this.length),j<0||V>E.length||K<0||Y>this.length)throw new RangeError("out of range index");if(K>=Y&&j>=V)return 0;if(K>=Y)return-1;if(j>=V)return 1;if(this===E)return 0;for(var re=(Y>>>=0)-(K>>>=0),oe=(V>>>=0)-(j>>>=0),ue=Math.min(re,oe),ve=this.slice(K,Y),Re=E.slice(j,V),Te=0;Te<ue;++Te)if(ve[Te]!==Re[Te]){re=ve[Te],oe=Re[Te];break}return re<oe?-1:oe<re?1:0},c.prototype.includes=function(E,j,V){return this.indexOf(E,j,V)!==-1},c.prototype.indexOf=function(E,j,V){return L(this,E,j,V,!0)},c.prototype.lastIndexOf=function(E,j,V){return L(this,E,j,V,!1)},c.prototype.write=function(E,j,V,K){if(j===void 0)K="utf8",V=this.length,j=0;else if(V===void 0&&typeof j=="string")K=j,V=this.length,j=0;else{if(!isFinite(j))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");j|=0,isFinite(V)?(V|=0,K===void 0&&(K="utf8")):(K=V,V=void 0)}var Y=this.length-j;if((V===void 0||V>Y)&&(V=Y),E.length>0&&(V<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");for(var re=!1;;)switch(K){case"hex":return R(this,E,j,V);case"utf8":case"utf-8":return m(this,E,j,V);case"ascii":return M(this,E,j,V);case"latin1":case"binary":return G(this,E,j,V);case"base64":return Z(this,E,j,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,E,j,V);default:if(re)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),re=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(E,j,V){var K="";V=Math.min(E.length,V);for(var Y=j;Y<V;++Y)K+=String.fromCharCode(127&E[Y]);return K}function x(E,j,V){var K="";V=Math.min(E.length,V);for(var Y=j;Y<V;++Y)K+=String.fromCharCode(E[Y]);return K}function H(E,j,V){var K=E.length;(!j||j<0)&&(j=0),(!V||V<0||V>K)&&(V=K);for(var Y="",re=j;re<V;++re)Y+=ee(E[re]);return Y}function U(E,j,V){for(var K=E.slice(j,V),Y="",re=0;re<K.length;re+=2)Y+=String.fromCharCode(K[re]+256*K[re+1]);return Y}function N(E,j,V){if(E%1!=0||E<0)throw new RangeError("offset is not uint");if(E+j>V)throw new RangeError("Trying to access beyond buffer length")}function k(E,j,V,K,Y,re){if(!c.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>Y||j<re)throw new RangeError('"value" argument is out of bounds');if(V+K>E.length)throw new RangeError("Index out of range")}function F(E,j,V,K){j<0&&(j=65535+j+1);for(var Y=0,re=Math.min(E.length-V,2);Y<re;++Y)E[V+Y]=(j&255<<8*(K?Y:1-Y))>>>8*(K?Y:1-Y)}function A(E,j,V,K){j<0&&(j=4294967295+j+1);for(var Y=0,re=Math.min(E.length-V,4);Y<re;++Y)E[V+Y]=j>>>8*(K?Y:3-Y)&255}function b(E,j,V,K,Y,re){if(V+K>E.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function B(E,j,V,K,Y){return Y||b(E,0,V,4),l.write(E,j,V,K,23,4),V+4}function W(E,j,V,K,Y){return Y||b(E,0,V,8),l.write(E,j,V,K,52,8),V+8}c.prototype.slice=function(E,j){var V,K=this.length;if((E=~~E)<0?(E+=K)<0&&(E=0):E>K&&(E=K),(j=j===void 0?K:~~j)<0?(j+=K)<0&&(j=0):j>K&&(j=K),j<E&&(j=E),c.TYPED_ARRAY_SUPPORT)(V=this.subarray(E,j)).__proto__=c.prototype;else{var Y=j-E;V=new c(Y,void 0);for(var re=0;re<Y;++re)V[re]=this[re+E]}return V},c.prototype.readUIntLE=function(E,j,V){E|=0,j|=0,V||N(E,j,this.length);for(var K=this[E],Y=1,re=0;++re<j&&(Y*=256);)K+=this[E+re]*Y;return K},c.prototype.readUIntBE=function(E,j,V){E|=0,j|=0,V||N(E,j,this.length);for(var K=this[E+--j],Y=1;j>0&&(Y*=256);)K+=this[E+--j]*Y;return K},c.prototype.readUInt8=function(E,j){return j||N(E,1,this.length),this[E]},c.prototype.readUInt16LE=function(E,j){return j||N(E,2,this.length),this[E]|this[E+1]<<8},c.prototype.readUInt16BE=function(E,j){return j||N(E,2,this.length),this[E]<<8|this[E+1]},c.prototype.readUInt32LE=function(E,j){return j||N(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+16777216*this[E+3]},c.prototype.readUInt32BE=function(E,j){return j||N(E,4,this.length),16777216*this[E]+(this[E+1]<<16|this[E+2]<<8|this[E+3])},c.prototype.readIntLE=function(E,j,V){E|=0,j|=0,V||N(E,j,this.length);for(var K=this[E],Y=1,re=0;++re<j&&(Y*=256);)K+=this[E+re]*Y;return K>=(Y*=128)&&(K-=Math.pow(2,8*j)),K},c.prototype.readIntBE=function(E,j,V){E|=0,j|=0,V||N(E,j,this.length);for(var K=j,Y=1,re=this[E+--K];K>0&&(Y*=256);)re+=this[E+--K]*Y;return re>=(Y*=128)&&(re-=Math.pow(2,8*j)),re},c.prototype.readInt8=function(E,j){return j||N(E,1,this.length),128&this[E]?-1*(255-this[E]+1):this[E]},c.prototype.readInt16LE=function(E,j){j||N(E,2,this.length);var V=this[E]|this[E+1]<<8;return 32768&V?4294901760|V:V},c.prototype.readInt16BE=function(E,j){j||N(E,2,this.length);var V=this[E+1]|this[E]<<8;return 32768&V?4294901760|V:V},c.prototype.readInt32LE=function(E,j){return j||N(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},c.prototype.readInt32BE=function(E,j){return j||N(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},c.prototype.readFloatLE=function(E,j){return j||N(E,4,this.length),l.read(this,E,!0,23,4)},c.prototype.readFloatBE=function(E,j){return j||N(E,4,this.length),l.read(this,E,!1,23,4)},c.prototype.readDoubleLE=function(E,j){return j||N(E,8,this.length),l.read(this,E,!0,52,8)},c.prototype.readDoubleBE=function(E,j){return j||N(E,8,this.length),l.read(this,E,!1,52,8)},c.prototype.writeUIntLE=function(E,j,V,K){E=+E,j|=0,V|=0,K||k(this,E,j,V,Math.pow(2,8*V)-1,0);var Y=1,re=0;for(this[j]=255&E;++re<V&&(Y*=256);)this[j+re]=E/Y&255;return j+V},c.prototype.writeUIntBE=function(E,j,V,K){E=+E,j|=0,V|=0,K||k(this,E,j,V,Math.pow(2,8*V)-1,0);var Y=V-1,re=1;for(this[j+Y]=255&E;--Y>=0&&(re*=256);)this[j+Y]=E/re&255;return j+V},c.prototype.writeUInt8=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,1,255,0),c.TYPED_ARRAY_SUPPORT||(E=Math.floor(E)),this[j]=255&E,j+1},c.prototype.writeUInt16LE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[j]=255&E,this[j+1]=E>>>8):F(this,E,j,!0),j+2},c.prototype.writeUInt16BE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[j]=E>>>8,this[j+1]=255&E):F(this,E,j,!1),j+2},c.prototype.writeUInt32LE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[j+3]=E>>>24,this[j+2]=E>>>16,this[j+1]=E>>>8,this[j]=255&E):A(this,E,j,!0),j+4},c.prototype.writeUInt32BE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[j]=E>>>24,this[j+1]=E>>>16,this[j+2]=E>>>8,this[j+3]=255&E):A(this,E,j,!1),j+4},c.prototype.writeIntLE=function(E,j,V,K){if(E=+E,j|=0,!K){var Y=Math.pow(2,8*V-1);k(this,E,j,V,Y-1,-Y)}var re=0,oe=1,ue=0;for(this[j]=255&E;++re<V&&(oe*=256);)E<0&&ue===0&&this[j+re-1]!==0&&(ue=1),this[j+re]=(E/oe>>0)-ue&255;return j+V},c.prototype.writeIntBE=function(E,j,V,K){if(E=+E,j|=0,!K){var Y=Math.pow(2,8*V-1);k(this,E,j,V,Y-1,-Y)}var re=V-1,oe=1,ue=0;for(this[j+re]=255&E;--re>=0&&(oe*=256);)E<0&&ue===0&&this[j+re+1]!==0&&(ue=1),this[j+re]=(E/oe>>0)-ue&255;return j+V},c.prototype.writeInt8=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,1,127,-128),c.TYPED_ARRAY_SUPPORT||(E=Math.floor(E)),E<0&&(E=255+E+1),this[j]=255&E,j+1},c.prototype.writeInt16LE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[j]=255&E,this[j+1]=E>>>8):F(this,E,j,!0),j+2},c.prototype.writeInt16BE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[j]=E>>>8,this[j+1]=255&E):F(this,E,j,!1),j+2},c.prototype.writeInt32LE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[j]=255&E,this[j+1]=E>>>8,this[j+2]=E>>>16,this[j+3]=E>>>24):A(this,E,j,!0),j+4},c.prototype.writeInt32BE=function(E,j,V){return E=+E,j|=0,V||k(this,E,j,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),c.TYPED_ARRAY_SUPPORT?(this[j]=E>>>24,this[j+1]=E>>>16,this[j+2]=E>>>8,this[j+3]=255&E):A(this,E,j,!1),j+4},c.prototype.writeFloatLE=function(E,j,V){return B(this,E,j,!0,V)},c.prototype.writeFloatBE=function(E,j,V){return B(this,E,j,!1,V)},c.prototype.writeDoubleLE=function(E,j,V){return W(this,E,j,!0,V)},c.prototype.writeDoubleBE=function(E,j,V){return W(this,E,j,!1,V)},c.prototype.copy=function(E,j,V,K){if(V||(V=0),K||K===0||(K=this.length),j>=E.length&&(j=E.length),j||(j=0),K>0&&K<V&&(K=V),K===V||E.length===0||this.length===0)return 0;if(j<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("sourceStart out of bounds");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),E.length-j<K-V&&(K=E.length-j+V);var Y,re=K-V;if(this===E&&V<j&&j<K)for(Y=re-1;Y>=0;--Y)E[Y+j]=this[Y+V];else if(re<1e3||!c.TYPED_ARRAY_SUPPORT)for(Y=0;Y<re;++Y)E[Y+j]=this[Y+V];else Uint8Array.prototype.set.call(E,this.subarray(V,V+re),j);return re},c.prototype.fill=function(E,j,V,K){if(typeof E=="string"){if(typeof j=="string"?(K=j,j=0,V=this.length):typeof V=="string"&&(K=V,V=this.length),E.length===1){var Y=E.charCodeAt(0);Y<256&&(E=Y)}if(K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!c.isEncoding(K))throw new TypeError("Unknown encoding: "+K)}else typeof E=="number"&&(E&=255);if(j<0||this.length<j||this.length<V)throw new RangeError("Out of range index");if(V<=j)return this;var re;if(j>>>=0,V=V===void 0?this.length:V>>>0,E||(E=0),typeof E=="number")for(re=j;re<V;++re)this[re]=E;else{var oe=c.isBuffer(E)?E:ne(new c(E,K).toString()),ue=oe.length;for(re=0;re<V-j;++re)this[re+j]=oe[re%ue]}return this};var Q=/[^+\/0-9A-Za-z-_]/g;function ee(E){return E<16?"0"+E.toString(16):E.toString(16)}function ne(E,j){var V;j=j||1/0;for(var K=E.length,Y=null,re=[],oe=0;oe<K;++oe){if((V=E.charCodeAt(oe))>55295&&V<57344){if(!Y){if(V>56319){(j-=3)>-1&&re.push(239,191,189);continue}if(oe+1===K){(j-=3)>-1&&re.push(239,191,189);continue}Y=V;continue}if(V<56320){(j-=3)>-1&&re.push(239,191,189),Y=V;continue}V=65536+(Y-55296<<10|V-56320)}else Y&&(j-=3)>-1&&re.push(239,191,189);if(Y=null,V<128){if((j-=1)<0)break;re.push(V)}else if(V<2048){if((j-=2)<0)break;re.push(V>>6|192,63&V|128)}else if(V<65536){if((j-=3)<0)break;re.push(V>>12|224,V>>6&63|128,63&V|128)}else{if(!(V<1114112))throw new Error("Invalid code point");if((j-=4)<0)break;re.push(V>>18|240,V>>12&63|128,V>>6&63|128,63&V|128)}}return re}function X(E){return o.toByteArray(function(j){if((j=function(V){return V.trim?V.trim():V.replace(/^\s+|\s+$/g,"")}(j).replace(Q,"")).length<2)return"";for(;j.length%4!=0;)j+="=";return j}(E))}function $(E,j,V,K){for(var Y=0;Y<K&&!(Y+V>=j.length||Y>=E.length);++Y)j[Y+V]=E[Y];return Y}}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){r&&(n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(n,r){if(r){n.super_=r;var o=function(){};o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n}}},function(e,t,n){n.d(t,"a",function(){return r});const r=o=>new Promise(l=>setTimeout(l,o||0))},function(e,t,n){var r=n(99),o=r,l=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||l!==void 0&&l||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")(),u=n(98);o.object.extend(proto,u),o.exportSymbol("proto.v1.signaling.api.CreatePeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.CreatePeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.DeletePeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.DeletePeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetHealthRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetHealthResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetIceServersRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetIceServersResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetPeersRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetPeersResponse",null,l),o.exportSymbol("proto.v1.signaling.api.Peer",null,l),o.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamRequest",null,l),o.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamResponse",null,l),o.exportSymbol("proto.v1.signaling.api.RefreshPeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.RefreshPeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.SendSignalRequest",null,l),o.exportSymbol("proto.v1.signaling.api.SendSignalResponse",null,l),o.exportSymbol("proto.v1.signaling.api.SessionType",null,l),o.exportSymbol("proto.v1.signaling.api.Signal",null,l),proto.v1.signaling.api.Peer=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.Peer.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.Peer,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Peer.displayName="proto.v1.signaling.api.Peer"),proto.v1.signaling.api.Signal=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.Signal,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Signal.displayName="proto.v1.signaling.api.Signal"),proto.v1.signaling.api.GetHealthRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetHealthRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthRequest.displayName="proto.v1.signaling.api.GetHealthRequest"),proto.v1.signaling.api.GetHealthResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetHealthResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthResponse.displayName="proto.v1.signaling.api.GetHealthResponse"),proto.v1.signaling.api.CreatePeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.CreatePeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerRequest.displayName="proto.v1.signaling.api.CreatePeerRequest"),proto.v1.signaling.api.CreatePeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.CreatePeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerResponse.displayName="proto.v1.signaling.api.CreatePeerResponse"),proto.v1.signaling.api.DeletePeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.DeletePeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerRequest.displayName="proto.v1.signaling.api.DeletePeerRequest"),proto.v1.signaling.api.DeletePeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.DeletePeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerResponse.displayName="proto.v1.signaling.api.DeletePeerResponse"),proto.v1.signaling.api.RefreshPeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RefreshPeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerRequest.displayName="proto.v1.signaling.api.RefreshPeerRequest"),proto.v1.signaling.api.RefreshPeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RefreshPeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerResponse.displayName="proto.v1.signaling.api.RefreshPeerResponse"),proto.v1.signaling.api.GetPeersRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetPeersRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersRequest.displayName="proto.v1.signaling.api.GetPeersRequest"),proto.v1.signaling.api.GetPeersResponse=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.GetPeersResponse.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.GetPeersResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersResponse.displayName="proto.v1.signaling.api.GetPeersResponse"),proto.v1.signaling.api.GetIceServersRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetIceServersRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersRequest.displayName="proto.v1.signaling.api.GetIceServersRequest"),proto.v1.signaling.api.GetIceServersResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetIceServersResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersResponse.displayName="proto.v1.signaling.api.GetIceServersResponse"),proto.v1.signaling.api.SendSignalRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.SendSignalRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalRequest.displayName="proto.v1.signaling.api.SendSignalRequest"),proto.v1.signaling.api.SendSignalResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.SendSignalResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalResponse.displayName="proto.v1.signaling.api.SendSignalResponse"),proto.v1.signaling.api.ReceiveSignalStreamRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.ReceiveSignalStreamRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.displayName="proto.v1.signaling.api.ReceiveSignalStreamRequest"),proto.v1.signaling.api.ReceiveSignalStreamResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.ReceiveSignalStreamResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.displayName="proto.v1.signaling.api.ReceiveSignalStreamResponse"),proto.v1.signaling.api.Peer.repeatedFields_=[5],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Peer.prototype.toObject=function(s){return proto.v1.signaling.api.Peer.toObject(s,this)},proto.v1.signaling.api.Peer.toObject=function(s,g){var c,f={peerId:r.Message.getFieldWithDefault(g,1,""),organizationId:r.Message.getFieldWithDefault(g,2,""),userId:(c=g.getUserId())&&u.StringValue.toObject(s,c),deviceId:(c=g.getDeviceId())&&u.StringValue.toObject(s,c),sessionIdsList:(c=r.Message.getRepeatedField(g,5))==null?void 0:c,peerCreatedTimestamp:(c=g.getPeerCreatedTimestamp())&&u.Int64Value.toObject(s,c)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.Peer.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.Peer;return proto.v1.signaling.api.Peer.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.Peer.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;case 2:c=g.readString(),s.setOrganizationId(c);break;case 3:c=new u.StringValue,g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setUserId(c);break;case 4:c=new u.StringValue,g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setDeviceId(c);break;case 5:c=g.readString(),s.addSessionIds(c);break;case 6:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setPeerCreatedTimestamp(c);break;default:g.skipField()}return s},proto.v1.signaling.api.Peer.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.Peer.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.Peer.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getPeerId()).length>0&&g.writeString(1,c),(c=s.getOrganizationId()).length>0&&g.writeString(2,c),(c=s.getUserId())!=null&&g.writeMessage(3,c,u.StringValue.serializeBinaryToWriter),(c=s.getDeviceId())!=null&&g.writeMessage(4,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionIdsList()).length>0&&g.writeRepeatedString(5,c),(c=s.getPeerCreatedTimestamp())!=null&&g.writeMessage(6,c,u.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.Peer.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.Peer.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},proto.v1.signaling.api.Peer.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.Peer.prototype.setOrganizationId=function(s){return r.Message.setProto3StringField(this,2,s)},proto.v1.signaling.api.Peer.prototype.getUserId=function(){return r.Message.getWrapperField(this,u.StringValue,3)},proto.v1.signaling.api.Peer.prototype.setUserId=function(s){return r.Message.setWrapperField(this,3,s)},proto.v1.signaling.api.Peer.prototype.clearUserId=function(){return this.setUserId(void 0)},proto.v1.signaling.api.Peer.prototype.hasUserId=function(){return r.Message.getField(this,3)!=null},proto.v1.signaling.api.Peer.prototype.getDeviceId=function(){return r.Message.getWrapperField(this,u.StringValue,4)},proto.v1.signaling.api.Peer.prototype.setDeviceId=function(s){return r.Message.setWrapperField(this,4,s)},proto.v1.signaling.api.Peer.prototype.clearDeviceId=function(){return this.setDeviceId(void 0)},proto.v1.signaling.api.Peer.prototype.hasDeviceId=function(){return r.Message.getField(this,4)!=null},proto.v1.signaling.api.Peer.prototype.getSessionIdsList=function(){return r.Message.getRepeatedField(this,5)},proto.v1.signaling.api.Peer.prototype.setSessionIdsList=function(s){return r.Message.setField(this,5,s||[])},proto.v1.signaling.api.Peer.prototype.addSessionIds=function(s,g){return r.Message.addToRepeatedField(this,5,s,g)},proto.v1.signaling.api.Peer.prototype.clearSessionIdsList=function(){return this.setSessionIdsList([])},proto.v1.signaling.api.Peer.prototype.getPeerCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,6)},proto.v1.signaling.api.Peer.prototype.setPeerCreatedTimestamp=function(s){return r.Message.setWrapperField(this,6,s)},proto.v1.signaling.api.Peer.prototype.clearPeerCreatedTimestamp=function(){return this.setPeerCreatedTimestamp(void 0)},proto.v1.signaling.api.Peer.prototype.hasPeerCreatedTimestamp=function(){return r.Message.getField(this,6)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Signal.prototype.toObject=function(s){return proto.v1.signaling.api.Signal.toObject(s,this)},proto.v1.signaling.api.Signal.toObject=function(s,g){var c,f={sessionId:(c=g.getSessionId())&&u.StringValue.toObject(s,c),sessionCreatedTimestamp:(c=g.getSessionCreatedTimestamp())&&u.Int64Value.toObject(s,c),senderId:r.Message.getFieldWithDefault(g,3,""),receiverId:r.Message.getFieldWithDefault(g,4,""),payload:r.Message.getFieldWithDefault(g,5,""),iceServers:r.Message.getFieldWithDefault(g,6,""),iceTransportPolicy:r.Message.getFieldWithDefault(g,7,""),sessionType:r.Message.getFieldWithDefault(g,8,0)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.Signal.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.Signal;return proto.v1.signaling.api.Signal.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.Signal.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new u.StringValue;g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setSessionId(c);break;case 2:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setSessionCreatedTimestamp(c);break;case 3:c=g.readString(),s.setSenderId(c);break;case 4:c=g.readString(),s.setReceiverId(c);break;case 5:c=g.readString(),s.setPayload(c);break;case 6:c=g.readString(),s.setIceServers(c);break;case 7:c=g.readString(),s.setIceTransportPolicy(c);break;case 8:c=g.readEnum(),s.setSessionType(c);break;default:g.skipField()}return s},proto.v1.signaling.api.Signal.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.Signal.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.Signal.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId())!=null&&g.writeMessage(1,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionCreatedTimestamp())!=null&&g.writeMessage(2,c,u.Int64Value.serializeBinaryToWriter),(c=s.getSenderId()).length>0&&g.writeString(3,c),(c=s.getReceiverId()).length>0&&g.writeString(4,c),(c=s.getPayload()).length>0&&g.writeString(5,c),(c=s.getIceServers()).length>0&&g.writeString(6,c),(c=s.getIceTransportPolicy()).length>0&&g.writeString(7,c),(c=s.getSessionType())!==0&&g.writeEnum(8,c)},proto.v1.signaling.api.Signal.prototype.getSessionId=function(){return r.Message.getWrapperField(this,u.StringValue,1)},proto.v1.signaling.api.Signal.prototype.setSessionId=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.Signal.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.Signal.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,2)},proto.v1.signaling.api.Signal.prototype.setSessionCreatedTimestamp=function(s){return r.Message.setWrapperField(this,2,s)},proto.v1.signaling.api.Signal.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},proto.v1.signaling.api.Signal.prototype.getSenderId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.Signal.prototype.setSenderId=function(s){return r.Message.setProto3StringField(this,3,s)},proto.v1.signaling.api.Signal.prototype.getReceiverId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.Signal.prototype.setReceiverId=function(s){return r.Message.setProto3StringField(this,4,s)},proto.v1.signaling.api.Signal.prototype.getPayload=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.Signal.prototype.setPayload=function(s){return r.Message.setProto3StringField(this,5,s)},proto.v1.signaling.api.Signal.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,6,"")},proto.v1.signaling.api.Signal.prototype.setIceServers=function(s){return r.Message.setProto3StringField(this,6,s)},proto.v1.signaling.api.Signal.prototype.getIceTransportPolicy=function(){return r.Message.getFieldWithDefault(this,7,"")},proto.v1.signaling.api.Signal.prototype.setIceTransportPolicy=function(s){return r.Message.setProto3StringField(this,7,s)},proto.v1.signaling.api.Signal.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,8,0)},proto.v1.signaling.api.Signal.prototype.setSessionType=function(s){return r.Message.setProto3EnumField(this,8,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetHealthRequest.toObject(s,this)},proto.v1.signaling.api.GetHealthRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetHealthRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetHealthRequest;return proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetHealthRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetHealthResponse.toObject(s,this)},proto.v1.signaling.api.GetHealthResponse.toObject=function(s,g){var c={version:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetHealthResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetHealthResponse;return proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setVersion(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetHealthResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getVersion()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.GetHealthResponse.prototype.getVersion=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetHealthResponse.prototype.setVersion=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.CreatePeerRequest.toObject(s,this)},proto.v1.signaling.api.CreatePeerRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.CreatePeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.CreatePeerRequest;return proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.CreatePeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.CreatePeerResponse.toObject(s,this)},proto.v1.signaling.api.CreatePeerResponse.toObject=function(s,g){var c,f={peer:(c=g.getPeer())&&proto.v1.signaling.api.Peer.toObject(s,c)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.CreatePeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.CreatePeerResponse;return proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.setPeer(c);break;default:g.skipField()}return s},proto.v1.signaling.api.CreatePeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeer())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.CreatePeerResponse.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.CreatePeerResponse.prototype.setPeer=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.CreatePeerResponse.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.CreatePeerResponse.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.DeletePeerRequest.toObject(s,this)},proto.v1.signaling.api.DeletePeerRequest.toObject=function(s,g){var c={peerId:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.DeletePeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.DeletePeerRequest;return proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;default:g.skipField()}return s},proto.v1.signaling.api.DeletePeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeerId()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.DeletePeerRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.DeletePeerRequest.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.DeletePeerResponse.toObject(s,this)},proto.v1.signaling.api.DeletePeerResponse.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.DeletePeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.DeletePeerResponse;return proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.DeletePeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.RefreshPeerRequest.toObject(s,this)},proto.v1.signaling.api.RefreshPeerRequest.toObject=function(s,g){var c,f={peer:(c=g.getPeer())&&proto.v1.signaling.api.Peer.toObject(s,c)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.RefreshPeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RefreshPeerRequest;return proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.setPeer(c);break;default:g.skipField()}return s},proto.v1.signaling.api.RefreshPeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeer())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.RefreshPeerRequest.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.RefreshPeerRequest.prototype.setPeer=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.RefreshPeerRequest.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.RefreshPeerRequest.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.RefreshPeerResponse.toObject(s,this)},proto.v1.signaling.api.RefreshPeerResponse.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.RefreshPeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RefreshPeerResponse;return proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.RefreshPeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetPeersRequest.toObject(s,this)},proto.v1.signaling.api.GetPeersRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetPeersRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetPeersRequest;return proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetPeersRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter=function(s,g){},proto.v1.signaling.api.GetPeersResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetPeersResponse.toObject(s,this)},proto.v1.signaling.api.GetPeersResponse.toObject=function(s,g){var c={peersList:r.Message.toObjectList(g.getPeersList(),proto.v1.signaling.api.Peer.toObject,s)};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetPeersResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetPeersResponse;return proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.addPeers(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetPeersResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeersList()).length>0&&g.writeRepeatedMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.GetPeersResponse.prototype.getPeersList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.GetPeersResponse.prototype.setPeersList=function(s){return r.Message.setRepeatedWrapperField(this,1,s)},proto.v1.signaling.api.GetPeersResponse.prototype.addPeers=function(s,g){return r.Message.addToRepeatedWrapperField(this,1,s,proto.v1.signaling.api.Peer,g)},proto.v1.signaling.api.GetPeersResponse.prototype.clearPeersList=function(){return this.setPeersList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetIceServersRequest.toObject(s,this)},proto.v1.signaling.api.GetIceServersRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetIceServersRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetIceServersRequest;return proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetIceServersRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetIceServersResponse.toObject(s,this)},proto.v1.signaling.api.GetIceServersResponse.toObject=function(s,g){var c={iceServers:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetIceServersResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetIceServersResponse;return proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setIceServers(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetIceServersResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getIceServers()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.GetIceServersResponse.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetIceServersResponse.prototype.setIceServers=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalRequest.prototype.toObject=function(s){return proto.v1.signaling.api.SendSignalRequest.toObject(s,this)},proto.v1.signaling.api.SendSignalRequest.toObject=function(s,g){var c,f={signal:(c=g.getSignal())&&proto.v1.signaling.api.Signal.toObject(s,c)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.SendSignalRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.SendSignalRequest;return proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Signal;g.readMessage(c,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),s.setSignal(c);break;default:g.skipField()}return s},proto.v1.signaling.api.SendSignalRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getSignal())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalRequest.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.SendSignalRequest.prototype.setSignal=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.SendSignalRequest.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.SendSignalRequest.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalResponse.prototype.toObject=function(s){return proto.v1.signaling.api.SendSignalResponse.toObject(s,this)},proto.v1.signaling.api.SendSignalResponse.toObject=function(s,g){var c,f={sessionId:(c=g.getSessionId())&&u.StringValue.toObject(s,c),sessionCreatedTimestamp:(c=g.getSessionCreatedTimestamp())&&u.Int64Value.toObject(s,c)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.SendSignalResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.SendSignalResponse;return proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new u.StringValue;g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setSessionId(c);break;case 2:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setSessionCreatedTimestamp(c);break;default:g.skipField()}return s},proto.v1.signaling.api.SendSignalResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId())!=null&&g.writeMessage(1,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionCreatedTimestamp())!=null&&g.writeMessage(2,c,u.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionId=function(){return r.Message.getWrapperField(this,u.StringValue,1)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionId=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,2)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionCreatedTimestamp=function(s){return r.Message.setWrapperField(this,2,s)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.toObject=function(s){return proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject(s,this)},proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject=function(s,g){var c={peerId:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.ReceiveSignalStreamRequest;return proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;default:g.skipField()}return s},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeerId()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.toObject=function(s){return proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject(s,this)},proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject=function(s,g){var c,f={signal:(c=g.getSignal())&&proto.v1.signaling.api.Signal.toObject(s,c)};return s&&(f.$jspbMessageInstance=g),f}),proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.ReceiveSignalStreamResponse;return proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Signal;g.readMessage(c,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),s.setSignal(c);break;default:g.skipField()}return s},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getSignal())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.setSignal=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SessionType={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3},o.object.extend(t,proto.v1.signaling.api)},function(e,t,n){n.d(t,"a",function(){return o});var r=n(30);class o extends Error{constructor(u,s,g,c,f,T,v={}){super(`Response error ${JSON.stringify({method:u,url:s,requestBody:Object(r.a)(g),statusCode:c,responseHeaders:f?Object(r.a)([...f.entries()].reduce((p,[d,h])=>(p[d]=h,p),{})):{},responseBody:Object(r.a)(T)})}`),this.method=u,this.url=s,this.requestBody=g,this.statusCode=c,this.headers=f,this.body=T,this.validationErrors=v}}},function(e,t,n){function r(o,l,u=()=>!0){if(function(s,g,c=()=>!0){return s instanceof g&&c(s)}(o,l,u))return o;throw o}n.d(t,"a",function(){return r})},function(e,t,n){function r(v){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(v)}function o(v,p){return!p||r(p)!=="object"&&typeof p!="function"?l(v):p}function l(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function u(v){var p=typeof Map=="function"?new Map:void 0;return(u=function(d){if(d===null||(h=d,Function.toString.call(h).indexOf("[native code]")===-1))return d;var h;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(p!==void 0){if(p.has(d))return p.get(d);p.set(d,S)}function S(){return s(d,arguments,f(this).constructor)}return S.prototype=Object.create(d.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),c(S,d)})(v)}function s(v,p,d){return(s=g()?Reflect.construct:function(h,S,I){var L=[null];L.push.apply(L,S);var O=new(Function.bind.apply(h,L));return I&&c(O,I.prototype),O}).apply(null,arguments)}function g(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function c(v,p){return(c=Object.setPrototypeOf||function(d,h){return d.__proto__=h,d})(v,p)}function f(v){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)})(v)}var T=function(v){(function(I,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(L&&L.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),L&&c(I,L)})(S,v);var p,d,h=(p=S,d=g(),function(){var I,L=f(p);if(d){var O=f(this).constructor;I=Reflect.construct(L,arguments,O)}else I=L.apply(this,arguments);return o(this,I)});function S(I){var L;return function(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}(this,S),L=h.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
3
- Found: `.concat(I.toString().split(`
1
+ (function(Qe,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(Qe=typeof globalThis<"u"?globalThis:Qe||self,et(Qe.FormantDataSDK={}))})(this,function(exports){var et;"use strict";var vn=Object.defineProperty;var wn=(Qe,et,Je)=>et in Qe?vn(Qe,et,{enumerable:!0,configurable:!0,writable:!0,value:Je}):Qe[et]=Je;var _e=(Qe,et,Je)=>(wn(Qe,typeof et!="symbol"?et+"":et,Je),Je);const DEFAULT_FORMANT_API_URL="https://api.formant.io";function whichFormantApiUrl(e,t){try{if(t.get("formant_stage"))return"https://api-stage.formant.io";if(t.get("formant_dev"))return"https://api-dev.formant.io";if(t.get("formant_local"))return"https://api.formant.local";if(t.get("formant_url")){const n=t.get("formant_url");if(n!==null)try{return new URL(n).origin}catch{console.warn(`Ignoring malformed \`formant_url\` url parameter: ${n}`)}}}catch{}return typeof e<"u"&&"FORMANT_API_URL"in e&&typeof e.FORMANT_API_URL=="string"?e.FORMANT_API_URL:DEFAULT_FORMANT_API_URL}const FORMANT_API_URL=whichFormantApiUrl(typeof window<"u"?window:globalThis,new URLSearchParams(typeof window<"u"&&window.location?window.location.search:void 0));var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var base64={exports:{}};/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */base64.exports,function(e,t){(function(n){var r=t,o=e&&e.exports==r&&e,l=typeof commonjsGlobal=="object"&&commonjsGlobal;(l.global===l||l.window===l)&&(n=l);var u=function(f){this.message=f};u.prototype=new Error,u.prototype.name="InvalidCharacterError";var s=function(f){throw new u(f)},g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,d=function(f){f=String(f).replace(c,"");var p=f.length;p%4==0&&(f=f.replace(/==?$/,""),p=f.length),(p%4==1||/[^+a-zA-Z0-9/]/.test(f))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var S=0,N,B,E="",T=-1;++T<p;)B=g.indexOf(f.charAt(T)),N=S%4?N*64+B:B,S++%4&&(E+=String.fromCharCode(255&N>>(-2*S&6)));return E},w=function(f){f=String(f),/[^\0-\xFF]/.test(f)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var p=f.length%3,S="",N=-1,B,E,T,h,R=f.length-p;++N<R;)B=f.charCodeAt(N)<<16,E=f.charCodeAt(++N)<<8,T=f.charCodeAt(++N),h=B+E+T,S+=g.charAt(h>>18&63)+g.charAt(h>>12&63)+g.charAt(h>>6&63)+g.charAt(h&63);return p==2?(B=f.charCodeAt(N)<<8,E=f.charCodeAt(++N),h=B+E,S+=g.charAt(h>>10)+g.charAt(h>>4&63)+g.charAt(h<<2&63)+"="):p==1&&(h=f.charCodeAt(N),S+=g.charAt(h>>2)+g.charAt(h<<4&63)+"=="),S},v={encode:w,decode:d,version:"1.0.0"};if(r&&!r.nodeType)if(o)o.exports=v;else for(var y in v)v.hasOwnProperty(y)&&(r[y]=v[y]);else n.base64=v})(commonjsGlobal)}(base64,base64.exports);var base64Exports=base64.exports;class AuthenticationStore{constructor({apiUrl:t,refreshAuthToken:n,addAccessTokenRefreshListener:r}){_e(this,"_refreshToken");_e(this,"_isShareToken",!1);_e(this,"_currentOrganization");_e(this,"_currentUser");_e(this,"_defaultDeviceId");_e(this,"_token");_e(this,"_waitingForAuth",new Set);_e(this,"_refreshTimer");_e(this,"_apiUrl");_e(this,"_refreshAuthToken");_e(this,"_addAccessTokenRefreshListener");this._apiUrl=t,this._refreshAuthToken=n,this._addAccessTokenRefreshListener=r}get token(){return this._token}get currentUser(){return this._currentUser}get currentOrganization(){return this._currentOrganization}get defaultDeviceId(){return this._defaultDeviceId}get refreshToken(){return this._refreshToken}get isShareToken(){return this._isShareToken}async login(t,n){try{const r=await fetch(`${this._apiUrl}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:n}),headers:{"Content-Type":"application/json"}}),o=await r.json();if(r.status!==200)throw new Error(o.message);return await this.loginWithToken(o.authentication.accessToken,o.authentication.refreshToken),o.authentication}catch(r){return console.error("login() failed",{err:r}),this._waitingForAuth.forEach(o=>o(!1)),this._waitingForAuth.clear(),Promise.reject(r)}}async loginWithToken(t,n){var o;const r=JSON.parse(base64Exports.decode(t.split(".")[1]));try{let l;if(this._isShareToken=r["formant:claims"]&&r["formant:claims"].type=="share",r["formant:claims"]&&(this._currentOrganization=r["formant:claims"].organizationId),r["custom:organization_id"]&&(this._currentOrganization=r["custom:organization_id"]),this._isShareToken||(l=r.sub),r["formant:claims"]&&r["formant:claims"].userId&&(l=r["formant:claims"].userId),l&&((o=this._currentUser)==null?void 0:o.id)!==l){const u=await fetch(`${this._apiUrl}/v1/admin/users/${l}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),s=await u.json();if(u.status!==200)throw new Error(s.message);this._currentUser=s}this._token=t,this._waitingForAuth.forEach(u=>u(!0))}catch(l){console.error("loginWithToken() failed",{err:l}),this._waitingForAuth.forEach(u=>u(!1))}finally{this._waitingForAuth.clear()}n&&(this._refreshToken=n,setInterval(async()=>{if(this._refreshToken){const u=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this._refreshToken})})).json();this._token=u.authentication.accessToken}},1e3*60*60))}isAuthenticated(){return this._token!==void 0}getCurrentUser(){return this._currentUser}async waitTilAuthenticated(){return this.token!==void 0?!0:new Promise(t=>{this._waitingForAuth.add(t)})}async listenForRefresh(){const n=()=>{this._refreshTimer=void 0,this._refreshAuthToken()};this._addAccessTokenRefreshListener(r=>{this._refreshTimer&&clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(n,36e5),this.loginWithToken(r)}),this._refreshTimer=setTimeout(n,36e5)}async forgotPassword(t){await fetch(`${this._apiUrl}/v1/admin/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:t}),headers:{"Content-Type":"application/json"}})}async confirmForgotPassword(t){return(await fetch(`${this._apiUrl}/v1/admin/auth/confirm-forgot-password`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).ok}async respondToNewPasswordRequiredChallenge(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/respond-to-new-password-required-challenge`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async loginWithGoogle(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/login-google`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async refresh(t){const r=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})})).json();await this.loginWithToken(r.authentication.accessToken,t)}}function getCurrentModuleContext(){return typeof window<"u"&&window.location?new URLSearchParams(window.location.search).get("module"):null}function sendAppMessage(e){if(!(window&&window.parent))throw new Error("cannot send message to non-existent parent");window.parent.postMessage(e,"*")}function refreshAuthToken(){const e=getCurrentModuleContext();if(!e)throw new Error("No module context");sendAppMessage({type:"refresh_auth_token",module:e})}function addAccessTokenRefreshListener(e){function t(n){const r=n.data;r.type==="auth_token"&&e(r.token)}return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}const Authentication=new AuthenticationStore({apiUrl:FORMANT_API_URL,refreshAuthToken,addAccessTokenRefreshListener});async function getModuleConfiguration(e){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/module-configurations/${e}`,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).configuration}function disableAnalyticsBottomBar(){sendAppMessage({type:"hide_analytics_date_picker"})}function goToDevice(e){sendAppMessage({type:"go_to_device",deviceId:e})}function goToTime(e){sendAppMessage({type:"go_to_time",time:e.getTime()})}function requestModuleData(){const e=getCurrentModuleContext();if(!e)throw new Error("No module context");sendAppMessage({type:"request_module_data",module:e})}function sendChannelData(e,t){const n=getCurrentModuleContext();if(!n)throw new Error("No module context");sendAppMessage({type:"send_channel_data",source:n,channel:e,data:t})}function setModuleDateTimeRange(e,t){const n=getCurrentModuleContext();if(!n)throw new Error("No module context");sendAppMessage({type:"set_module_data_time_range",module:n,before:e,after:t||0})}function setupModuleMenus(e){const t=getCurrentModuleContext();if(!t)throw new Error("No module context");sendAppMessage({type:"setup_module_menus",module:t,menus:e})}function showMessage(e){sendAppMessage({type:"show_message",message:e})}function addChannelDataListener(e,t){const n=r=>{const o=r.data;o.type==="channel_data"&&o.channel===e&&t({source:o.source,data:o.data})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function addMenuListener(e){const t=n=>{const r=n.data;r.type==="module_menu_item_clicked"&&e(r.menu)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function addModuleConfigurationListener(e){const t=n=>{const r=n.data;r.type==="module_configuration"&&e(r)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function addModuleDataListener(e){const t=getCurrentModuleContext();t&&sendAppMessage({type:"request_module_data",module:t});const n=r=>{const o=r.data;o.type==="module_data"&&e({streams:o.streams,time:o.time,queryRange:o.queryRange})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function addOverviewDeviceListener(e){sendAppMessage({type:"request_devices"});const t=n=>{const r=n.data;r.type==="overview_devices"&&e(r.data)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function _typeof(e){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(e)}function toInteger(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function requiredArgs(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function toDate(e){requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||_typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function addDays(e,t){requiredArgs(2,arguments);var n=toDate(e),r=toInteger(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function addMonths(e,t){requiredArgs(2,arguments);var n=toDate(e),r=toInteger(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),l=new Date(n.getTime());l.setMonth(n.getMonth()+r+1,0);var u=l.getDate();return o>=u?l:(n.setFullYear(l.getFullYear(),l.getMonth(),o),n)}function addMilliseconds(e,t){requiredArgs(2,arguments);var n=toDate(e).getTime(),r=toInteger(t);return new Date(n+r)}var MILLISECONDS_IN_HOUR=36e5;function addHours(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*MILLISECONDS_IN_HOUR)}var defaultOptions={};function getDefaultOptions(){return defaultOptions}function startOfWeek(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=getDefaultOptions(),w=toInteger((n=(r=(o=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(g=d.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=toDate(e),y=v.getDay(),f=(y<w?7:0)+y-w;return v.setDate(v.getDate()-f),v.setHours(0,0,0,0),v}function startOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(0,0,0,0),t}var MILLISECONDS_IN_MINUTE=6e4;function addMinutes(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*MILLISECONDS_IN_MINUTE)}function addQuarters(e,t){requiredArgs(2,arguments);var n=toInteger(t),r=n*3;return addMonths(e,r)}function addSeconds(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*1e3)}function addWeeks(e,t){requiredArgs(2,arguments);var n=toInteger(t),r=n*7;return addDays(e,r)}function addYears(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMonths(e,n*12)}function getQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=Math.floor(t.getMonth()/3)+1;return n}var roundingMap={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},defaultRoundingMethod="trunc";function getRoundingMethod(e){return e?roundingMap[e]:roundingMap[defaultRoundingMethod]}function endOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(23,59,59,999),t}function endOfMonth(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function eachDayOfInterval(e,t){var n;requiredArgs(1,arguments);var r=e||{},o=toDate(r.start),l=toDate(r.end),u=l.getTime();if(!(o.getTime()<=u))throw new RangeError("Invalid interval");var s=[],g=o;g.setHours(0,0,0,0);var c=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;g.getTime()<=u;)s.push(toDate(g)),g.setDate(g.getDate()+c),g.setHours(0,0,0,0);return s}function eachHourOfInterval(e,t){var n;requiredArgs(1,arguments);var r=e||{},o=toDate(r.start),l=toDate(r.end),u=o.getTime(),s=l.getTime();if(!(u<=s))throw new RangeError("Invalid interval");var g=[],c=o;c.setMinutes(0,0,0);var d=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=s;)g.push(toDate(c)),c=addHours(c,d);return g}function startOfMinute(e){requiredArgs(1,arguments);var t=toDate(e);return t.setSeconds(0,0),t}function eachMinuteOfInterval(e,t){var n;requiredArgs(1,arguments);var r=startOfMinute(toDate(e.start)),o=toDate(e.end),l=r.getTime(),u=o.getTime();if(l>=u)throw new RangeError("Invalid interval");var s=[],g=r,c=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number equal to or greater than 1");for(;g.getTime()<=u;)s.push(toDate(g)),g=addMinutes(g,c);return s}function eachMonthOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime(),l=[];if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var u=n;for(u.setHours(0,0,0,0),u.setDate(1);u.getTime()<=o;)l.push(toDate(u)),u.setMonth(u.getMonth()+1);return l}function startOfQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth(),r=n-n%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function eachQuarterOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var l=startOfQuarter(n),u=startOfQuarter(r);o=u.getTime();for(var s=[],g=l;g.getTime()<=o;)s.push(toDate(g)),g=addQuarters(g,1);return s}function eachWeekOfInterval(e,t){requiredArgs(1,arguments);var n=e||{},r=toDate(n.start),o=toDate(n.end),l=o.getTime();if(!(r.getTime()<=l))throw new RangeError("Invalid interval");var u=startOfWeek(r,t),s=startOfWeek(o,t);u.setHours(15),s.setHours(15),l=s.getTime();for(var g=[],c=u;c.getTime()<=l;)c.setHours(0),g.push(toDate(c)),c=addWeeks(c,1),c.setHours(15);return g}function startOfMonth(e){requiredArgs(1,arguments);var t=toDate(e);return t.setDate(1),t.setHours(0,0,0,0),t}function endOfYear(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function startOfYear(e){requiredArgs(1,arguments);var t=toDate(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eachYearOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var l=[],u=n;for(u.setHours(0,0,0,0),u.setMonth(0,1);u.getTime()<=o;)l.push(toDate(u)),u.setFullYear(u.getFullYear()+1);return l}function endOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(59,59,999),t}function endOfWeek(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=getDefaultOptions(),w=toInteger((n=(r=(o=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(g=d.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=toDate(e),y=v.getDay(),f=(y<w?-7:0)+6-(y-w);return v.setDate(v.getDate()+f),v.setHours(23,59,59,999),v}function endOfMinute(e){requiredArgs(1,arguments);var t=toDate(e);return t.setSeconds(59,999),t}function endOfQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth(),r=n-n%3+3;return t.setMonth(r,0),t.setHours(23,59,59,999),t}function getDay(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getDay();return n}function getHours(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getHours();return n}function getMinutes(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMinutes();return n}function getMonth(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth();return n}function getWeekYear(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=toDate(e),w=d.getFullYear(),v=getDefaultOptions(),y=toInteger((n=(r=(o=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:v.firstWeekContainsDate)!==null&&r!==void 0?r:(g=v.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(y>=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setFullYear(w+1,0,y),f.setHours(0,0,0,0);var p=startOfWeek(f,t),S=new Date(0);S.setFullYear(w,0,y),S.setHours(0,0,0,0);var N=startOfWeek(S,t);return d.getTime()>=p.getTime()?w+1:d.getTime()>=N.getTime()?w:w-1}function startOfWeekYear(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=getDefaultOptions(),w=toInteger((n=(r=(o=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:d.firstWeekContainsDate)!==null&&r!==void 0?r:(g=d.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),v=getWeekYear(e,t),y=new Date(0);y.setFullYear(v,0,w),y.setHours(0,0,0,0);var f=startOfWeek(y,t);return f}var MILLISECONDS_IN_WEEK=6048e5;function getWeek(e,t){requiredArgs(1,arguments);var n=toDate(e),r=startOfWeek(n,t).getTime()-startOfWeekYear(n,t).getTime();return Math.round(r/MILLISECONDS_IN_WEEK)+1}function getYear(e){return requiredArgs(1,arguments),toDate(e).getFullYear()}function startOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(0,0,0),t}function subDays(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addDays(e,-n)}function roundToNearestMinutes(e,t){var n;if(arguments.length<1)throw new TypeError("1 argument required, but only none provided present");var r=toInteger((n=t==null?void 0:t.nearestTo)!==null&&n!==void 0?n:1);if(r<1||r>30)throw new RangeError("`options.nearestTo` must be between 1 and 30");var o=toDate(e),l=o.getSeconds(),u=o.getMinutes()+l/60,s=getRoundingMethod(t==null?void 0:t.roundingMethod),g=s(u/r)*r,c=u%r,d=Math.round(c/r)*r;return new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),g+d)}function subMonths(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMonths(e,-n)}function subHours(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addHours(e,-n)}function subMinutes(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMinutes(e,-n)}function subQuarters(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addQuarters(e,-n)}function subWeeks(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addWeeks(e,-n)}function subYears(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addYears(e,-n)}const millisecond=1,second=1e3,minute=60*second,hour=60*minute,day=24*hour,week=7*day,month=30*day,year=365*day,duration={millisecond,second,minute,hour,day,week,month,year};function filterDataByType(e,t){return e.filter(n=>t.includes(n.type))}function filterDataByTime(e,t,n){const r=t.getTime(),o=n.getTime();return e.map(l=>({...l,points:l.points.filter(([u])=>u>=r&&u<o)})).filter(({points:l})=>l.length>0)}function fork(e){}class StoreCache{constructor({capacity:t,timeout:n}={}){_e(this,"entries",new Map);_e(this,"metadata",new Map);_e(this,"capacity");_e(this,"timeout");this.capacity=t||1e4,this.timeout=n||duration.minute}get(t,n){const r=this.keyToCacheKey(t),o=this.entries.get(r),l=this.metadata.get(r);return(o===void 0||l&&(l==null?void 0:l.expiration.getTime())<Date.now())&&!(l!=null&&l.generating)&&n&&this.generate(t,n()),o===void 0&&l&&l.lastValue!==void 0?l.lastValue:o}set(t,n){const r=this.keyToCacheKey(t);this.metadata.set(r,{generating:!1,expiration:new Date(Date.now()+this.timeout),lastValue:n}),this.entries.set(r,n),this.metadata.size>this.capacity&&this.deleteOldestEntry()}clear(){this.entries.clear(),[...this.metadata.values()].forEach(t=>t.generating=!1)}clearKey(t){this.metadata.delete(t),this.entries.delete(t)}keyToCacheKey(t){return JSON.stringify(t)}deleteOldestEntry(){if(this.metadata.size<1)return;const[t]=[...this.metadata.entries()].reduce(([n,r],[o,l])=>l.expiration.getTime()<r.expiration.getTime()?[o,l]:[n,r]);this.clearKey(t)}generate(t,n){const r=this.keyToCacheKey(t),o=this.metadata.get(r)||{};this.metadata.set(r,{...o,generating:!0,expiration:new Date(Date.now()+this.timeout)}),setTimeout(()=>{n.then(l=>{const u=this.metadata.get(r);!(u!=null&&u.generating)||this.set(t,l)})},0)}}async function queryTelemetry(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}class QueryStore{constructor(){_e(this,"queryStoreCache",new StoreCache({capacity:1e4,timeout:20*duration.second}));_e(this,"liveQueryStoreCache",new StoreCache({capacity:1e4,timeout:200*duration.millisecond}))}moduleQuery(t,n,r,o,l,u=!1){const s={...t,names:[...n],types:[...r]},g=this.query(s,o,l,u);return g===void 0||g==="too much data"?g:filterDataByType(g,r)}query(t,n,r,o=!1){const l={...t,start:startOfMinute(n).toISOString(),end:o?r.toISOString():addMinutes(roundToNearestMinutes(r),1).toISOString(),latestOnly:o},u=r>addSeconds(new Date,-20);let s;return u?s=this.liveQueryCache(l):s=this.queryCache(l),!s||s==="too much data"||o?s:filterDataByTime(s,n,r)}queryCache(t){return this.queryStoreCache.get(t,async()=>{try{return await queryTelemetry(t)}catch(n){throw n}})}liveQueryCache(t){return this.liveQueryStoreCache.get(t,async()=>{try{return await queryTelemetry(t)}catch(n){throw n}})}}const queryStore=new QueryStore;function addStreamListener(e,t,n){const r=o=>{const l=o.data;if(l.type==="module_data"){const{start:u,end:s}=l.queryRange;n(queryStore.moduleQuery({},e,t,new Date(u),new Date(s),!1))}};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)}async function getDate(e,t,n){return new Promise(r=>{sendAppMessage({type:"request_date",minTime:t,maxTime:n,time:e});const o=l=>{const u=l.data;u.type==="date_response"&&(window.removeEventListener("message",o),r(u.data))};window.addEventListener("message",o)})}async function prompt(e,t){return new Promise(n=>{const r=Math.random().toString();sendAppMessage({type:"prompt",promptId:r,schema:e,okText:t==null?void 0:t.okText,cancelText:t==null?void 0:t.cancelText});const o=l=>{const u=l.data;u.type==="prompt_response"&&u.promptId===r&&n(u.data),window.removeEventListener("message",o)};window.addEventListener("message",o)})}const Qe=class{static isModule(){return getCurrentModuleContext()!==null}static async getCurrentModuleConfiguration(){let t=new URLSearchParams("");typeof window<"u"&&window.location&&(t=new URLSearchParams(window.location.search));const n=t.get("configuration");if(!(n===null||n.trim()===""))return getModuleConfiguration(n.trim())}static get isOnline(){return Qe._isOnline}static listenForConnectionEvents(){const t=n=>{const{data:r}=n;r.type==="formant_online"&&(this._isOnline=r.online)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}static checkConnection(t=1e3){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("deadline expired: took too long")),t),l=u=>{window.removeEventListener("message",l),clearTimeout(o);const{data:s}=u;s.type==="formant_online"&&(this._isOnline=s.online,n(s.online))};window.addEventListener("message",l),sendAppMessage({type:"formant_online"})})}static waitForConnection(t=5e3){let n=!1;const r=new Promise((u,s)=>{setTimeout(()=>{n=!0,s(new Error("deadline expired: took too long"))},t)}),o=u=>new Promise(s=>setTimeout(s,u)),l=async()=>{for(await o(50);!n&&!(this.isOnline||await this.checkConnection);)await o(500)};return Promise.race([r,l()])}};let App=Qe;_e(App,"getCurrentModuleContext",getCurrentModuleContext),_e(App,"disableAnalyticsBottomBar",disableAnalyticsBottomBar),_e(App,"goToDevice",goToDevice),_e(App,"goToTime",goToTime),_e(App,"refreshAuthToken",refreshAuthToken),_e(App,"requestModuleData",requestModuleData),_e(App,"sendChannelData",sendChannelData),_e(App,"setModuleDateTimeRange",setModuleDateTimeRange),_e(App,"setupModuleMenus",setupModuleMenus),_e(App,"showMessage",showMessage),_e(App,"addAccessTokenRefreshListener",addAccessTokenRefreshListener),_e(App,"addChannelDataListener",addChannelDataListener),_e(App,"addMenuListener",addMenuListener),_e(App,"addModuleConfigurationListener",addModuleConfigurationListener),_e(App,"addModuleDataListener",addModuleDataListener),_e(App,"addOverviewDeviceListener",addOverviewDeviceListener),_e(App,"addStreamListener",addStreamListener),_e(App,"getDate",getDate),_e(App,"prompt",prompt),_e(App,"_isOnline",null);function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}var dist={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(module,exports){(function(e,t){module.exports=t()})(window,function(){return function(e){function t(c){for(var d,w,v=c[0],y=c[1],f=0,p=[];f<v.length;f++)w=v[f],Object.prototype.hasOwnProperty.call(r,w)&&r[w]&&p.push(r[w][0]),r[w]=0;for(d in y)Object.prototype.hasOwnProperty.call(y,d)&&(e[d]=y[d]);for(g&&g(c);p.length;)p.shift()()}var n={},r={0:0};function o(c){if(n[c])return n[c].exports;var d=n[c]={i:c,l:!1,exports:{}};return e[c].call(d.exports,d,d.exports,o),d.l=!0,d.exports}o.e=function(){return Promise.resolve()},o.m=e,o.c=n,o.d=function(c,d,w){o.o(c,d)||Object.defineProperty(c,d,{enumerable:!0,get:w})},o.r=function(c){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},o.t=function(c,d){if(1&d&&(c=o(c)),8&d||4&d&&typeof c=="object"&&c&&c.__esModule)return c;var w=Object.create(null);if(o.r(w),Object.defineProperty(w,"default",{enumerable:!0,value:c}),2&d&&typeof c!="string")for(var v in c)o.d(w,v,function(y){return c[y]}.bind(null,v));return w},o.n=function(c){var d=c&&c.__esModule?function(){return c.default}:function(){return c};return o.d(d,"a",d),d},o.o=function(c,d){return Object.prototype.hasOwnProperty.call(c,d)},o.p="",o.oe=function(c){throw console.error(c),c};var l=window.webpackJsonpFormantRealtimeSDK=window.webpackJsonpFormantRealtimeSDK||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var g=u;return o(o.s=232)}([function(e,t,n){n.d(t,"a",function(){return I});var r=n(16),o=n(55),l=n(15),u=n.n(l),s=n(18);function g(K,Y){if(Y.length<K)throw new TypeError(K+" argument"+(K>1?"s":"")+" required, but only "+Y.length+" present")}function c(K){if(K===null||K===!0||K===!1)return NaN;var Y=Number(K);return isNaN(Y)?Y:Y<0?Math.ceil(Y):Math.floor(Y)}var d={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},w=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,v=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,y=/^([+-])(\d{2})(?::?(\d{2}))?$/;function f(K){var Y,ne={},ie=K.split(d.dateTimeDelimiter);if(ie.length>2)return ne;if(/:/.test(ie[0])?Y=ie[0]:(ne.date=ie[0],Y=ie[1],d.timeZoneDelimiter.test(ne.date)&&(ne.date=K.split(d.timeZoneDelimiter)[0],Y=K.substr(ne.date.length,K.length))),Y){var ue=d.timezone.exec(Y);ue?(ne.time=Y.replace(ue[1],""),ne.timezone=ue[1]):ne.time=Y}return ne}function p(K,Y){var ne=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+Y)+"})|(\\d{2}|[+-]\\d{"+(2+Y)+"})$)"),ie=K.match(ne);if(!ie)return{year:NaN,restDateString:""};var ue=ie[1]?parseInt(ie[1]):null,we=ie[2]?parseInt(ie[2]):null;return{year:we===null?ue:100*we,restDateString:K.slice((ie[1]||ie[2]).length)}}function S(K,Y){if(Y===null)return new Date(NaN);var ne=K.match(w);if(!ne)return new Date(NaN);var ie=!!ne[4],ue=N(ne[1]),we=N(ne[2])-1,Oe=N(ne[3]),Ee=N(ne[4]),Ne=N(ne[5])-1;if(ie)return function(Ae,Ie,Fe){return Ie>=1&&Ie<=53&&Fe>=0&&Fe<=6}(0,Ee,Ne)?function(Ae,Ie,Fe){var Ve=new Date(0);Ve.setUTCFullYear(Ae,0,4);var rt=Ve.getUTCDay()||7,vt=7*(Ie-1)+Fe+1-rt;return Ve.setUTCDate(Ve.getUTCDate()+vt),Ve}(Y,Ee,Ne):new Date(NaN);var Te=new Date(0);return function(Ae,Ie,Fe){return Ie>=0&&Ie<=11&&Fe>=1&&Fe<=(h[Ie]||(R(Ae)?29:28))}(Y,we,Oe)&&function(Ae,Ie){return Ie>=1&&Ie<=(R(Ae)?366:365)}(Y,ue)?(Te.setUTCFullYear(Y,we,Math.max(ue,Oe)),Te):new Date(NaN)}function N(K){return K?parseInt(K):1}function B(K){var Y=K.match(v);if(!Y)return NaN;var ne=E(Y[1]),ie=E(Y[2]),ue=E(Y[3]);return function(we,Oe,Ee){return we===24?Oe===0&&Ee===0:Ee>=0&&Ee<60&&Oe>=0&&Oe<60&&we>=0&&we<25}(ne,ie,ue)?36e5*ne+6e4*ie+1e3*ue:NaN}function E(K){return K&&parseFloat(K.replace(",","."))||0}function T(K){if(K==="Z")return 0;var Y=K.match(y);if(!Y)return 0;var ne=Y[1]==="+"?-1:1,ie=parseInt(Y[2]),ue=Y[3]&&parseInt(Y[3])||0;return function(we,Oe){return Oe>=0&&Oe<=59}(0,ue)?ne*(36e5*ie+6e4*ue):NaN}var h=[31,null,31,30,31,30,31,31,30,31,30,31];function R(K){return K%400==0||K%4==0&&K%100!=0}function W(K){return(W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y})(K)}function X(K){return g(1,arguments),K instanceof Date||W(K)==="object"&&Object.prototype.toString.call(K)==="[object Date]"}function m(K){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y})(K)}function _(K){g(1,arguments);var Y=Object.prototype.toString.call(K);return K instanceof Date||m(K)==="object"&&Y==="[object Date]"?new Date(K.getTime()):typeof K=="number"||Y==="[object Number]"?new Date(K):(typeof K!="string"&&Y!=="[object String]"||typeof console>"u"||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function G(K){const Y=function(ne,ie){var ue;g(1,arguments);var we=c((ue=ie==null?void 0:ie.additionalDigits)!==null&&ue!==void 0?ue:2);if(we!==2&&we!==1&&we!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(typeof ne!="string"&&Object.prototype.toString.call(ne)!=="[object String]")return new Date(NaN);var Oe,Ee=f(ne);if(Ee.date){var Ne=p(Ee.date,we);Oe=S(Ne.restDateString,Ne.year)}if(!Oe||isNaN(Oe.getTime()))return new Date(NaN);var Te,Ae=Oe.getTime(),Ie=0;if(Ee.time&&(Ie=B(Ee.time),isNaN(Ie)))return new Date(NaN);if(!Ee.timezone){var Fe=new Date(Ae+Ie),Ve=new Date(0);return Ve.setFullYear(Fe.getUTCFullYear(),Fe.getUTCMonth(),Fe.getUTCDate()),Ve.setHours(Fe.getUTCHours(),Fe.getUTCMinutes(),Fe.getUTCSeconds(),Fe.getUTCMilliseconds()),Ve}return Te=T(Ee.timezone),isNaN(Te)?new Date(NaN):new Date(Ae+Ie+Te)}(K);if(!function(ne){if(g(1,arguments),!X(ne)&&typeof ne!="number")return!1;var ie=_(ne);return!isNaN(Number(ie))}(Y))throw new Error(`Invalid ISO 8601 date string (${K})`);return Y}const j=Math.pow(2,20),C=j;var z=n(4),P=n(28);function D(K){return u()(K,{cycles:!0})}var O=function(K,Y){var ne={};for(var ie in K)Object.prototype.hasOwnProperty.call(K,ie)&&Y.indexOf(ie)<0&&(ne[ie]=K[ie]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(ie=Object.getOwnPropertySymbols(K);ue<ie.length;ue++)Y.indexOf(ie[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,ie[ue])&&(ne[ie[ue]]=K[ie[ue]])}return ne};function L(K,Y={}){const{redacted:ne=!0}=Y,ie=Ne=>ne?Object(P.a)(Ne):Ne;if(!K.stack)return{message:D(ie(K))};const{name:ue,message:we,stack:Oe}=K,Ee=O(K,["name","message","stack"]);return{name:ue,message:we!==void 0?we:D(ie(K)),stack:Oe,meta:Ee&&Object.keys(Ee).length===0?void 0:ie(Ee)}}function U(K,Y={}){const{message:ne,stack:ie,meta:ue}=L(K,Y);return`${ie||ne||""}${ue&&Object.keys(ue).length>0?` -- ${D(ue)}`:""}`}var A=n(40),V=n(14),q=n.n(V),Q=function(K,Y,ne,ie){return new(ne||(ne=Promise))(function(ue,we){function Oe(Te){try{Ne(ie.next(Te))}catch(Ae){we(Ae)}}function Ee(Te){try{Ne(ie.throw(Te))}catch(Ae){we(Ae)}}function Ne(Te){var Ae;Te.done?ue(Te.value):(Ae=Te.value,Ae instanceof ne?Ae:new ne(function(Ie){Ie(Ae)})).then(Oe,Ee)}Ne((ie=ie.apply(K,Y||[])).next())})},ee=function(K,Y){var ne={};for(var ie in K)Object.prototype.hasOwnProperty.call(K,ie)&&Y.indexOf(ie)<0&&(ne[ie]=K[ie]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(ie=Object.getOwnPropertySymbols(K);ue<ie.length;ue++)Y.indexOf(ie[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,ie[ue])&&(ne[ie[ue]]=K[ie[ue]])}return ne};class te extends q.a{constructor(Y,ne){super(),this.endpoint=Y,this.metadata=ne,this.logClient=this.getLogClient()}getLogClient(){return Q(this,void 0,void 0,function*(){const{LogClient:Y}=yield Promise.resolve().then(n.bind(null,235));return new Y(this.endpoint)})}log(Y,ne){return Q(this,void 0,void 0,function*(){const{level:ie,message:ue,error:we}=Y,Oe=ee(Y,["level","message","error"]);this.emit("logged");try{yield(yield this.logClient).log([{timestamp:new Date().toISOString(),level:ie,message:`${ue}`.substring(0,1e3),error:we!==void 0?L(we):void 0,meta:Object.assign(Object.assign({},Oe),this.metadata)}])}catch(Ee){console.error(`Failed to log to log-api: ${U(Ee)}`)}ne()})}}var k=function(K,Y){var ne={};for(var ie in K)Object.prototype.hasOwnProperty.call(K,ie)&&Y.indexOf(ie)<0&&(ne[ie]=K[ie]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(ie=Object.getOwnPropertySymbols(K);ue<ie.length;ue++)Y.indexOf(ie[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,ie[ue])&&(ne[ie[ue]]=K[ie[ue]])}return ne};const x={app:z.a,namespace:z.i,buildTag:z.b,instanceId:A.a},b=z.e?s.format.printf(K=>{var{timestamp:Y,level:ne,message:ie,error:ue}=K,we=k(K,["timestamp","level","message","error"]);const Oe=Object.assign(Object.assign({timestamp:Y?G(Y).getTime():new Date().getTime(),level:ne.toUpperCase(),message:ie},ue?{error:L(ue)}:{}),{meta:Object.assign(Object.assign({},x),we)});return u()(Oe,{cycles:!0})}):s.format.printf(K=>{var{timestamp:Y,level:ne,message:ie,error:ue}=K,we=k(K,["timestamp","level","message","error"]);let Oe=`${Y||new Date().toISOString()} ${ne.toUpperCase()}: ${ie} `;return Object.keys(we).length>0&&(Oe+=u()(we,{cycles:!0})),ue&&(Oe+=`
2
+ ${U(ue)}`),Oe}),I=Object(s.createLogger)({level:z.f});if(I.add(new s.transports.Console({format:b,level:"debug"})),I.transports.forEach(K=>{K.silent=!z.g}),z.d&&I.add(new te(z.d,x)),z.h){const K=o.resolve(r.tmpdir(),`silly-${z.a}.log`);I.debug("Logging silly logs to file",{filename:K}),I.add(new s.transports.File({filename:K,maxsize:1*C,maxFiles:10,format:s.format.combine(($="silly",Object(s.format)(Y=>Y.level===$&&Y)()),b),level:"silly"}))}var $},function(e,t,n){n.d(t,"a",function(){return r});const r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}},function(e,t){var n,r,o=e.exports={};function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(S){if(n===setTimeout)return setTimeout(S,0);if((n===l||!n)&&setTimeout)return n=setTimeout,setTimeout(S,0);try{return n(S,0)}catch{try{return n.call(null,S,0)}catch{return n.call(this,S,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:l}catch{n=l}try{r=typeof clearTimeout=="function"?clearTimeout:u}catch{r=u}})();var g,c=[],d=!1,w=-1;function v(){d&&g&&(d=!1,g.length?c=g.concat(c):w=-1,c.length&&y())}function y(){if(!d){var S=s(v);d=!0;for(var N=c.length;N;){for(g=c,c=[];++w<N;)g&&g[w].run();w=-1,N=c.length}g=null,d=!1,function(B){if(r===clearTimeout)return clearTimeout(B);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(B);try{r(B)}catch{try{return r.call(null,B)}catch{return r.call(this,B)}}}(S)}}function f(S,N){this.fun=S,this.array=N}function p(){}o.nextTick=function(S){var N=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)N[B-1]=arguments[B];c.push(new f(S,N)),c.length!==1||d||s(y)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(S){return[]},o.binding=function(S){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(S){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")}),Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")}),Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")}),Object.defineProperty(t,"configs",{value:n(116)})},function(e,t,n){(function(r){n.d(t,"a",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"j",function(){return g}),n.d(t,"b",function(){return c}),n.d(t,"f",function(){return d}),n.d(t,"e",function(){return w}),n.d(t,"g",function(){return v}),n.d(t,"d",function(){return y}),n.d(t,"c",function(){return f}),n.d(t,"h",function(){return p});var o=n(101);const l=o.from({ENVIRONMENT:r.env.ENV,AGGREGATE_LEVEL:r.env.AGGREGATE_LEVEL,API_ENDPOINT:r.env.API_ENDPOINT,APP:"realtime-sdk",APP_PATH:r.env.APP_PATH,BUILD_TAG:r.env.BUILD_TAG,ENABLE_SELF_SERVE:r.env.ENABLE_SELF_SERVE,ENABLE_SENTRY:r.env.ENABLE_SENTRY,ENABLE_SENTRY_PROFILING:r.env.ENABLE_SENTRY_PROFILING,GIT_COMMIT:r.env.GIT_COMMIT,JEST_WORKER_ID:r.env.JEST_WORKER_ID,LOG_API_ENDPOINT:r.env.LOG_API_ENDPOINT,LOG_JSON:"false",LOG_LEVEL:r.env.LOG_LEVEL,LOG_TO_CONSOLE:r.env.LOG_TO_CONSOLE,LOG_TO_FILE:r.env.LOG_TO_FILE,NAMESPACE:"production",SENTRY_DSN:r.env.SENTRY_DSN,SHEET_EXPORT_MAX_ROW_COUNT:r.env.SHEET_EXPORT_MAX_ROW_COUNT,STABLE_AGENT_VERSION:r.env.STABLE_AGENT_VERSION,VERSION:r.env.VERSION}),u=(l.get("ENVIRONMENT").default("").asString(),l.get("APP").default("").asString()),s=(l.get("APP_PATH").default("").asString(),l.get("API_ENDPOINT").default("").asString(),l.get("NAMESPACE").default("").asString()),g=l.get("VERSION").default("").asString(),c=l.get("BUILD_TAG").default("").asString(),d=(l.get("GIT_COMMIT").default("").asString(),l.get("ENABLE_SENTRY").default("false").asBool(),l.get("ENABLE_SENTRY_PROFILING").default("false").asBool(),l.get("SENTRY_DSN").default("").asString(),l.get("LOG_LEVEL").default("debug").asString()),w=l.get("LOG_JSON").default("true").asBool(),v=l.get("LOG_TO_CONSOLE").default("true").asBool(),y=(l.get("STABLE_AGENT_VERSION").default("").asString(),l.get("LOG_API_ENDPOINT").asString()),f=l.get("JEST_WORKER_ID").asString(),p=(l.get("SHEET_EXPORT_MAX_ROW_COUNT").default("10000").asIntPositive(),l.get("LOG_TO_FILE").default("false").asBoolStrict());l.get("ENABLE_SELF_SERVE").default("true").asBoolStrict(),l.get("AGGREGATE_LEVEL").default("hour").asEnum(["day","hour","minute"])}).call(this,n(2))},function(e,t,n){(function(r){var o=n(141),l=n(142),u=n(63);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(b,I){if(s()<I)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(b=new Uint8Array(I)).__proto__=c.prototype:(b===null&&(b=new c(I)),b.length=I),b}function c(b,I,$){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(b,I,$);if(typeof b=="number"){if(typeof I=="string")throw new Error("If encoding is specified then the first argument must be a string");return v(this,b)}return d(this,b,I,$)}function d(b,I,$,K){if(typeof I=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&I instanceof ArrayBuffer?function(Y,ne,ie,ue){if(ne.byteLength,ie<0||ne.byteLength<ie)throw new RangeError("'offset' is out of bounds");if(ne.byteLength<ie+(ue||0))throw new RangeError("'length' is out of bounds");return ne=ie===void 0&&ue===void 0?new Uint8Array(ne):ue===void 0?new Uint8Array(ne,ie):new Uint8Array(ne,ie,ue),c.TYPED_ARRAY_SUPPORT?(Y=ne).__proto__=c.prototype:Y=y(Y,ne),Y}(b,I,$,K):typeof I=="string"?function(Y,ne,ie){if(typeof ie=="string"&&ie!==""||(ie="utf8"),!c.isEncoding(ie))throw new TypeError('"encoding" must be a valid string encoding');var ue=0|p(ne,ie),we=(Y=g(Y,ue)).write(ne,ie);return we!==ue&&(Y=Y.slice(0,we)),Y}(b,I,$):function(Y,ne){if(c.isBuffer(ne)){var ie=0|f(ne.length);return(Y=g(Y,ie)).length===0||ne.copy(Y,0,0,ie),Y}if(ne){if(typeof ArrayBuffer<"u"&&ne.buffer instanceof ArrayBuffer||"length"in ne)return typeof ne.length!="number"||(ue=ne.length)!=ue?g(Y,0):y(Y,ne);if(ne.type==="Buffer"&&u(ne.data))return y(Y,ne.data)}var ue;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(b,I)}function w(b){if(typeof b!="number")throw new TypeError('"size" argument must be a number');if(b<0)throw new RangeError('"size" argument must not be negative')}function v(b,I){if(w(I),b=g(b,I<0?0:0|f(I)),!c.TYPED_ARRAY_SUPPORT)for(var $=0;$<I;++$)b[$]=0;return b}function y(b,I){var $=I.length<0?0:0|f(I.length);b=g(b,$);for(var K=0;K<$;K+=1)b[K]=255&I[K];return b}function f(b){if(b>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|b}function p(b,I){if(c.isBuffer(b))return b.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(b)||b instanceof ArrayBuffer))return b.byteLength;typeof b!="string"&&(b=""+b);var $=b.length;if($===0)return 0;for(var K=!1;;)switch(I){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":case void 0:return te(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*$;case"hex":return $>>>1;case"base64":return k(b).length;default:if(K)return te(b).length;I=(""+I).toLowerCase(),K=!0}}function S(b,I,$){var K=!1;if((I===void 0||I<0)&&(I=0),I>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0)<=(I>>>=0))return"";for(b||(b="utf8");;)switch(b){case"hex":return z(this,I,$);case"utf8":case"utf-8":return G(this,I,$);case"ascii":return j(this,I,$);case"latin1":case"binary":return C(this,I,$);case"base64":return _(this,I,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,I,$);default:if(K)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),K=!0}}function N(b,I,$){var K=b[I];b[I]=b[$],b[$]=K}function B(b,I,$,K,Y){if(b.length===0)return-1;if(typeof $=="string"?(K=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,isNaN($)&&($=Y?0:b.length-1),$<0&&($=b.length+$),$>=b.length){if(Y)return-1;$=b.length-1}else if($<0){if(!Y)return-1;$=0}if(typeof I=="string"&&(I=c.from(I,K)),c.isBuffer(I))return I.length===0?-1:E(b,I,$,K,Y);if(typeof I=="number")return I&=255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(b,I,$):Uint8Array.prototype.lastIndexOf.call(b,I,$):E(b,[I],$,K,Y);throw new TypeError("val must be string, number or Buffer")}function E(b,I,$,K,Y){var ne,ie=1,ue=b.length,we=I.length;if(K!==void 0&&((K=String(K).toLowerCase())==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(b.length<2||I.length<2)return-1;ie=2,ue/=2,we/=2,$/=2}function Oe(Ae,Ie){return ie===1?Ae[Ie]:Ae.readUInt16BE(Ie*ie)}if(Y){var Ee=-1;for(ne=$;ne<ue;ne++)if(Oe(b,ne)===Oe(I,Ee===-1?0:ne-Ee)){if(Ee===-1&&(Ee=ne),ne-Ee+1===we)return Ee*ie}else Ee!==-1&&(ne-=ne-Ee),Ee=-1}else for($+we>ue&&($=ue-we),ne=$;ne>=0;ne--){for(var Ne=!0,Te=0;Te<we;Te++)if(Oe(b,ne+Te)!==Oe(I,Te)){Ne=!1;break}if(Ne)return ne}return-1}function T(b,I,$,K){$=Number($)||0;var Y=b.length-$;K?(K=Number(K))>Y&&(K=Y):K=Y;var ne=I.length;if(ne%2!=0)throw new TypeError("Invalid hex string");K>ne/2&&(K=ne/2);for(var ie=0;ie<K;++ie){var ue=parseInt(I.substr(2*ie,2),16);if(isNaN(ue))return ie;b[$+ie]=ue}return ie}function h(b,I,$,K){return x(te(I,b.length-$),b,$,K)}function R(b,I,$,K){return x(function(Y){for(var ne=[],ie=0;ie<Y.length;++ie)ne.push(255&Y.charCodeAt(ie));return ne}(I),b,$,K)}function W(b,I,$,K){return R(b,I,$,K)}function X(b,I,$,K){return x(k(I),b,$,K)}function m(b,I,$,K){return x(function(Y,ne){for(var ie,ue,we,Oe=[],Ee=0;Ee<Y.length&&!((ne-=2)<0);++Ee)ie=Y.charCodeAt(Ee),ue=ie>>8,we=ie%256,Oe.push(we),Oe.push(ue);return Oe}(I,b.length-$),b,$,K)}function _(b,I,$){return I===0&&$===b.length?o.fromByteArray(b):o.fromByteArray(b.slice(I,$))}function G(b,I,$){$=Math.min(b.length,$);for(var K=[],Y=I;Y<$;){var ne,ie,ue,we,Oe=b[Y],Ee=null,Ne=Oe>239?4:Oe>223?3:Oe>191?2:1;if(Y+Ne<=$)switch(Ne){case 1:Oe<128&&(Ee=Oe);break;case 2:(192&(ne=b[Y+1]))==128&&(we=(31&Oe)<<6|63&ne)>127&&(Ee=we);break;case 3:ne=b[Y+1],ie=b[Y+2],(192&ne)==128&&(192&ie)==128&&(we=(15&Oe)<<12|(63&ne)<<6|63&ie)>2047&&(we<55296||we>57343)&&(Ee=we);break;case 4:ne=b[Y+1],ie=b[Y+2],ue=b[Y+3],(192&ne)==128&&(192&ie)==128&&(192&ue)==128&&(we=(15&Oe)<<18|(63&ne)<<12|(63&ie)<<6|63&ue)>65535&&we<1114112&&(Ee=we)}Ee===null?(Ee=65533,Ne=1):Ee>65535&&(Ee-=65536,K.push(Ee>>>10&1023|55296),Ee=56320|1023&Ee),K.push(Ee),Y+=Ne}return function(Te){var Ae=Te.length;if(Ae<=4096)return String.fromCharCode.apply(String,Te);for(var Ie="",Fe=0;Fe<Ae;)Ie+=String.fromCharCode.apply(String,Te.slice(Fe,Fe+=4096));return Ie}(K)}t.Buffer=c,t.SlowBuffer=function(b){return+b!=b&&(b=0),c.alloc(+b)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=r.TYPED_ARRAY_SUPPORT!==void 0?r.TYPED_ARRAY_SUPPORT:function(){try{var b=new Uint8Array(1);return b.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},b.foo()===42&&typeof b.subarray=="function"&&b.subarray(1,1).byteLength===0}catch{return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(b){return b.__proto__=c.prototype,b},c.from=function(b,I,$){return d(null,b,I,$)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(b,I,$){return function(K,Y,ne,ie){return w(Y),Y<=0?g(K,Y):ne!==void 0?typeof ie=="string"?g(K,Y).fill(ne,ie):g(K,Y).fill(ne):g(K,Y)}(null,b,I,$)},c.allocUnsafe=function(b){return v(null,b)},c.allocUnsafeSlow=function(b){return v(null,b)},c.isBuffer=function(b){return!(b==null||!b._isBuffer)},c.compare=function(b,I){if(!c.isBuffer(b)||!c.isBuffer(I))throw new TypeError("Arguments must be Buffers");if(b===I)return 0;for(var $=b.length,K=I.length,Y=0,ne=Math.min($,K);Y<ne;++Y)if(b[Y]!==I[Y]){$=b[Y],K=I[Y];break}return $<K?-1:K<$?1:0},c.isEncoding=function(b){switch(String(b).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(b,I){if(!u(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return c.alloc(0);var $;if(I===void 0)for(I=0,$=0;$<b.length;++$)I+=b[$].length;var K=c.allocUnsafe(I),Y=0;for($=0;$<b.length;++$){var ne=b[$];if(!c.isBuffer(ne))throw new TypeError('"list" argument must be an Array of Buffers');ne.copy(K,Y),Y+=ne.length}return K},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var b=this.length;if(b%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var I=0;I<b;I+=2)N(this,I,I+1);return this},c.prototype.swap32=function(){var b=this.length;if(b%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var I=0;I<b;I+=4)N(this,I,I+3),N(this,I+1,I+2);return this},c.prototype.swap64=function(){var b=this.length;if(b%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var I=0;I<b;I+=8)N(this,I,I+7),N(this,I+1,I+6),N(this,I+2,I+5),N(this,I+3,I+4);return this},c.prototype.toString=function(){var b=0|this.length;return b===0?"":arguments.length===0?G(this,0,b):S.apply(this,arguments)},c.prototype.equals=function(b){if(!c.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||c.compare(this,b)===0},c.prototype.inspect=function(){var b="",I=t.INSPECT_MAX_BYTES;return this.length>0&&(b=this.toString("hex",0,I).match(/.{2}/g).join(" "),this.length>I&&(b+=" ... ")),"<Buffer "+b+">"},c.prototype.compare=function(b,I,$,K,Y){if(!c.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(I===void 0&&(I=0),$===void 0&&($=b?b.length:0),K===void 0&&(K=0),Y===void 0&&(Y=this.length),I<0||$>b.length||K<0||Y>this.length)throw new RangeError("out of range index");if(K>=Y&&I>=$)return 0;if(K>=Y)return-1;if(I>=$)return 1;if(this===b)return 0;for(var ne=(Y>>>=0)-(K>>>=0),ie=($>>>=0)-(I>>>=0),ue=Math.min(ne,ie),we=this.slice(K,Y),Oe=b.slice(I,$),Ee=0;Ee<ue;++Ee)if(we[Ee]!==Oe[Ee]){ne=we[Ee],ie=Oe[Ee];break}return ne<ie?-1:ie<ne?1:0},c.prototype.includes=function(b,I,$){return this.indexOf(b,I,$)!==-1},c.prototype.indexOf=function(b,I,$){return B(this,b,I,$,!0)},c.prototype.lastIndexOf=function(b,I,$){return B(this,b,I,$,!1)},c.prototype.write=function(b,I,$,K){if(I===void 0)K="utf8",$=this.length,I=0;else if($===void 0&&typeof I=="string")K=I,$=this.length,I=0;else{if(!isFinite(I))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");I|=0,isFinite($)?($|=0,K===void 0&&(K="utf8")):(K=$,$=void 0)}var Y=this.length-I;if(($===void 0||$>Y)&&($=Y),b.length>0&&($<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");for(var ne=!1;;)switch(K){case"hex":return T(this,b,I,$);case"utf8":case"utf-8":return h(this,b,I,$);case"ascii":return R(this,b,I,$);case"latin1":case"binary":return W(this,b,I,$);case"base64":return X(this,b,I,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,b,I,$);default:if(ne)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),ne=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(b,I,$){var K="";$=Math.min(b.length,$);for(var Y=I;Y<$;++Y)K+=String.fromCharCode(127&b[Y]);return K}function C(b,I,$){var K="";$=Math.min(b.length,$);for(var Y=I;Y<$;++Y)K+=String.fromCharCode(b[Y]);return K}function z(b,I,$){var K=b.length;(!I||I<0)&&(I=0),(!$||$<0||$>K)&&($=K);for(var Y="",ne=I;ne<$;++ne)Y+=ee(b[ne]);return Y}function P(b,I,$){for(var K=b.slice(I,$),Y="",ne=0;ne<K.length;ne+=2)Y+=String.fromCharCode(K[ne]+256*K[ne+1]);return Y}function D(b,I,$){if(b%1!=0||b<0)throw new RangeError("offset is not uint");if(b+I>$)throw new RangeError("Trying to access beyond buffer length")}function O(b,I,$,K,Y,ne){if(!c.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>Y||I<ne)throw new RangeError('"value" argument is out of bounds');if($+K>b.length)throw new RangeError("Index out of range")}function L(b,I,$,K){I<0&&(I=65535+I+1);for(var Y=0,ne=Math.min(b.length-$,2);Y<ne;++Y)b[$+Y]=(I&255<<8*(K?Y:1-Y))>>>8*(K?Y:1-Y)}function U(b,I,$,K){I<0&&(I=4294967295+I+1);for(var Y=0,ne=Math.min(b.length-$,4);Y<ne;++Y)b[$+Y]=I>>>8*(K?Y:3-Y)&255}function A(b,I,$,K,Y,ne){if($+K>b.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function V(b,I,$,K,Y){return Y||A(b,0,$,4),l.write(b,I,$,K,23,4),$+4}function q(b,I,$,K,Y){return Y||A(b,0,$,8),l.write(b,I,$,K,52,8),$+8}c.prototype.slice=function(b,I){var $,K=this.length;if((b=~~b)<0?(b+=K)<0&&(b=0):b>K&&(b=K),(I=I===void 0?K:~~I)<0?(I+=K)<0&&(I=0):I>K&&(I=K),I<b&&(I=b),c.TYPED_ARRAY_SUPPORT)($=this.subarray(b,I)).__proto__=c.prototype;else{var Y=I-b;$=new c(Y,void 0);for(var ne=0;ne<Y;++ne)$[ne]=this[ne+b]}return $},c.prototype.readUIntLE=function(b,I,$){b|=0,I|=0,$||D(b,I,this.length);for(var K=this[b],Y=1,ne=0;++ne<I&&(Y*=256);)K+=this[b+ne]*Y;return K},c.prototype.readUIntBE=function(b,I,$){b|=0,I|=0,$||D(b,I,this.length);for(var K=this[b+--I],Y=1;I>0&&(Y*=256);)K+=this[b+--I]*Y;return K},c.prototype.readUInt8=function(b,I){return I||D(b,1,this.length),this[b]},c.prototype.readUInt16LE=function(b,I){return I||D(b,2,this.length),this[b]|this[b+1]<<8},c.prototype.readUInt16BE=function(b,I){return I||D(b,2,this.length),this[b]<<8|this[b+1]},c.prototype.readUInt32LE=function(b,I){return I||D(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+16777216*this[b+3]},c.prototype.readUInt32BE=function(b,I){return I||D(b,4,this.length),16777216*this[b]+(this[b+1]<<16|this[b+2]<<8|this[b+3])},c.prototype.readIntLE=function(b,I,$){b|=0,I|=0,$||D(b,I,this.length);for(var K=this[b],Y=1,ne=0;++ne<I&&(Y*=256);)K+=this[b+ne]*Y;return K>=(Y*=128)&&(K-=Math.pow(2,8*I)),K},c.prototype.readIntBE=function(b,I,$){b|=0,I|=0,$||D(b,I,this.length);for(var K=I,Y=1,ne=this[b+--K];K>0&&(Y*=256);)ne+=this[b+--K]*Y;return ne>=(Y*=128)&&(ne-=Math.pow(2,8*I)),ne},c.prototype.readInt8=function(b,I){return I||D(b,1,this.length),128&this[b]?-1*(255-this[b]+1):this[b]},c.prototype.readInt16LE=function(b,I){I||D(b,2,this.length);var $=this[b]|this[b+1]<<8;return 32768&$?4294901760|$:$},c.prototype.readInt16BE=function(b,I){I||D(b,2,this.length);var $=this[b+1]|this[b]<<8;return 32768&$?4294901760|$:$},c.prototype.readInt32LE=function(b,I){return I||D(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},c.prototype.readInt32BE=function(b,I){return I||D(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},c.prototype.readFloatLE=function(b,I){return I||D(b,4,this.length),l.read(this,b,!0,23,4)},c.prototype.readFloatBE=function(b,I){return I||D(b,4,this.length),l.read(this,b,!1,23,4)},c.prototype.readDoubleLE=function(b,I){return I||D(b,8,this.length),l.read(this,b,!0,52,8)},c.prototype.readDoubleBE=function(b,I){return I||D(b,8,this.length),l.read(this,b,!1,52,8)},c.prototype.writeUIntLE=function(b,I,$,K){b=+b,I|=0,$|=0,K||O(this,b,I,$,Math.pow(2,8*$)-1,0);var Y=1,ne=0;for(this[I]=255&b;++ne<$&&(Y*=256);)this[I+ne]=b/Y&255;return I+$},c.prototype.writeUIntBE=function(b,I,$,K){b=+b,I|=0,$|=0,K||O(this,b,I,$,Math.pow(2,8*$)-1,0);var Y=$-1,ne=1;for(this[I+Y]=255&b;--Y>=0&&(ne*=256);)this[I+Y]=b/ne&255;return I+$},c.prototype.writeUInt8=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,1,255,0),c.TYPED_ARRAY_SUPPORT||(b=Math.floor(b)),this[I]=255&b,I+1},c.prototype.writeUInt16LE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[I]=255&b,this[I+1]=b>>>8):L(this,b,I,!0),I+2},c.prototype.writeUInt16BE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[I]=b>>>8,this[I+1]=255&b):L(this,b,I,!1),I+2},c.prototype.writeUInt32LE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[I+3]=b>>>24,this[I+2]=b>>>16,this[I+1]=b>>>8,this[I]=255&b):U(this,b,I,!0),I+4},c.prototype.writeUInt32BE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[I]=b>>>24,this[I+1]=b>>>16,this[I+2]=b>>>8,this[I+3]=255&b):U(this,b,I,!1),I+4},c.prototype.writeIntLE=function(b,I,$,K){if(b=+b,I|=0,!K){var Y=Math.pow(2,8*$-1);O(this,b,I,$,Y-1,-Y)}var ne=0,ie=1,ue=0;for(this[I]=255&b;++ne<$&&(ie*=256);)b<0&&ue===0&&this[I+ne-1]!==0&&(ue=1),this[I+ne]=(b/ie>>0)-ue&255;return I+$},c.prototype.writeIntBE=function(b,I,$,K){if(b=+b,I|=0,!K){var Y=Math.pow(2,8*$-1);O(this,b,I,$,Y-1,-Y)}var ne=$-1,ie=1,ue=0;for(this[I+ne]=255&b;--ne>=0&&(ie*=256);)b<0&&ue===0&&this[I+ne+1]!==0&&(ue=1),this[I+ne]=(b/ie>>0)-ue&255;return I+$},c.prototype.writeInt8=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,1,127,-128),c.TYPED_ARRAY_SUPPORT||(b=Math.floor(b)),b<0&&(b=255+b+1),this[I]=255&b,I+1},c.prototype.writeInt16LE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[I]=255&b,this[I+1]=b>>>8):L(this,b,I,!0),I+2},c.prototype.writeInt16BE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[I]=b>>>8,this[I+1]=255&b):L(this,b,I,!1),I+2},c.prototype.writeInt32LE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[I]=255&b,this[I+1]=b>>>8,this[I+2]=b>>>16,this[I+3]=b>>>24):U(this,b,I,!0),I+4},c.prototype.writeInt32BE=function(b,I,$){return b=+b,I|=0,$||O(this,b,I,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),c.TYPED_ARRAY_SUPPORT?(this[I]=b>>>24,this[I+1]=b>>>16,this[I+2]=b>>>8,this[I+3]=255&b):U(this,b,I,!1),I+4},c.prototype.writeFloatLE=function(b,I,$){return V(this,b,I,!0,$)},c.prototype.writeFloatBE=function(b,I,$){return V(this,b,I,!1,$)},c.prototype.writeDoubleLE=function(b,I,$){return q(this,b,I,!0,$)},c.prototype.writeDoubleBE=function(b,I,$){return q(this,b,I,!1,$)},c.prototype.copy=function(b,I,$,K){if($||($=0),K||K===0||(K=this.length),I>=b.length&&(I=b.length),I||(I=0),K>0&&K<$&&(K=$),K===$||b.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("sourceStart out of bounds");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),b.length-I<K-$&&(K=b.length-I+$);var Y,ne=K-$;if(this===b&&$<I&&I<K)for(Y=ne-1;Y>=0;--Y)b[Y+I]=this[Y+$];else if(ne<1e3||!c.TYPED_ARRAY_SUPPORT)for(Y=0;Y<ne;++Y)b[Y+I]=this[Y+$];else Uint8Array.prototype.set.call(b,this.subarray($,$+ne),I);return ne},c.prototype.fill=function(b,I,$,K){if(typeof b=="string"){if(typeof I=="string"?(K=I,I=0,$=this.length):typeof $=="string"&&(K=$,$=this.length),b.length===1){var Y=b.charCodeAt(0);Y<256&&(b=Y)}if(K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!c.isEncoding(K))throw new TypeError("Unknown encoding: "+K)}else typeof b=="number"&&(b&=255);if(I<0||this.length<I||this.length<$)throw new RangeError("Out of range index");if($<=I)return this;var ne;if(I>>>=0,$=$===void 0?this.length:$>>>0,b||(b=0),typeof b=="number")for(ne=I;ne<$;++ne)this[ne]=b;else{var ie=c.isBuffer(b)?b:te(new c(b,K).toString()),ue=ie.length;for(ne=0;ne<$-I;++ne)this[ne+I]=ie[ne%ue]}return this};var Q=/[^+\/0-9A-Za-z-_]/g;function ee(b){return b<16?"0"+b.toString(16):b.toString(16)}function te(b,I){var $;I=I||1/0;for(var K=b.length,Y=null,ne=[],ie=0;ie<K;++ie){if(($=b.charCodeAt(ie))>55295&&$<57344){if(!Y){if($>56319){(I-=3)>-1&&ne.push(239,191,189);continue}if(ie+1===K){(I-=3)>-1&&ne.push(239,191,189);continue}Y=$;continue}if($<56320){(I-=3)>-1&&ne.push(239,191,189),Y=$;continue}$=65536+(Y-55296<<10|$-56320)}else Y&&(I-=3)>-1&&ne.push(239,191,189);if(Y=null,$<128){if((I-=1)<0)break;ne.push($)}else if($<2048){if((I-=2)<0)break;ne.push($>>6|192,63&$|128)}else if($<65536){if((I-=3)<0)break;ne.push($>>12|224,$>>6&63|128,63&$|128)}else{if(!($<1114112))throw new Error("Invalid code point");if((I-=4)<0)break;ne.push($>>18|240,$>>12&63|128,$>>6&63|128,63&$|128)}}return ne}function k(b){return o.toByteArray(function(I){if((I=function($){return $.trim?$.trim():$.replace(/^\s+|\s+$/g,"")}(I).replace(Q,"")).length<2)return"";for(;I.length%4!=0;)I+="=";return I}(b))}function x(b,I,$,K){for(var Y=0;Y<K&&!(Y+$>=I.length||Y>=b.length);++Y)I[Y+$]=b[Y];return Y}}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){r&&(n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(n,r){if(r){n.super_=r;var o=function(){};o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n}}},function(e,t,n){function r(v){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y})(v)}function o(v,y){if(y&&(r(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(v)}function l(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function u(v){var y=typeof Map=="function"?new Map:void 0;return(u=function(f){if(f===null||(p=f,Function.toString.call(p).indexOf("[native code]")===-1))return f;var p;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(y!==void 0){if(y.has(f))return y.get(f);y.set(f,S)}function S(){return s(f,arguments,d(this).constructor)}return S.prototype=Object.create(f.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),c(S,f)})(v)}function s(v,y,f){return(s=g()?Reflect.construct.bind():function(p,S,N){var B=[null];B.push.apply(B,S);var E=new(Function.bind.apply(p,B));return N&&c(E,N.prototype),E}).apply(null,arguments)}function g(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c(v,y){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,p){return f.__proto__=p,f})(v,y)}function d(v){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)})(v)}var w=function(v){(function(B,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(E&&E.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),E&&c(B,E)})(N,v);var y,f,p,S=(y=N,f=g(),function(){var B,E=d(y);if(f){var T=d(this).constructor;B=Reflect.construct(E,arguments,T)}else B=E.apply(this,arguments);return o(this,B)});function N(B){var E;return function(T,h){if(!(T instanceof h))throw new TypeError("Cannot call a class as a function")}(this,N),E=S.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
3
+ Found: `.concat(B.toString().split(`
4
4
  `)[0],`
5
- `)),Error.captureStackTrace(l(L),S),L}return S}(u(Error));e.exports=function(v){if(v.length>2)throw new T(v);function p(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=h}function d(h){return new p(h)}return p.prototype.transform=v,d.Format=p,d}},function(e,t,n){(function(r){var o=Object.getOwnPropertyDescriptors||function(N){for(var k=Object.keys(N),F={},A=0;A<k.length;A++)F[k[A]]=Object.getOwnPropertyDescriptor(N,k[A]);return F},l=/%[sdj%]/g;t.format=function(N){if(!L(N)){for(var k=[],F=0;F<arguments.length;F++)k.push(g(arguments[F]));return k.join(" ")}F=1;for(var A=arguments,b=A.length,B=String(N).replace(l,function(Q){if(Q==="%%")return"%";if(F>=b)return Q;switch(Q){case"%s":return String(A[F++]);case"%d":return Number(A[F++]);case"%j":try{return JSON.stringify(A[F++])}catch{return"[Circular]"}default:return Q}}),W=A[F];F<b;W=A[++F])S(W)||!m(W)?B+=" "+W:B+=" "+g(W);return B},t.deprecate=function(N,k){if(r!==void 0&&r.noDeprecation===!0)return N;if(r===void 0)return function(){return t.deprecate(N,k).apply(this,arguments)};var F=!1;return function(){if(!F){if(r.throwDeprecation)throw new Error(k);r.traceDeprecation?console.trace(k):console.error(k),F=!0}return N.apply(this,arguments)}};var u,s={};function g(N,k){var F={seen:[],stylize:f};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),h(k)?F.showHidden=k:k&&t._extend(F,k),O(F.showHidden)&&(F.showHidden=!1),O(F.depth)&&(F.depth=2),O(F.colors)&&(F.colors=!1),O(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=c),T(F,N,F.depth)}function c(N,k){var F=g.styles[k];return F?"\x1B["+g.colors[F][0]+"m"+N+"\x1B["+g.colors[F][1]+"m":N}function f(N,k){return N}function T(N,k,F){if(N.customInspect&&k&&Z(k.inspect)&&k.inspect!==t.inspect&&(!k.constructor||k.constructor.prototype!==k)){var A=k.inspect(F,N);return L(A)||(A=T(N,A,F)),A}var b=function(E,j){if(O(j))return E.stylize("undefined","undefined");if(L(j)){var V="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return E.stylize(V,"string")}if(I(j))return E.stylize(""+j,"number");if(h(j))return E.stylize(""+j,"boolean");if(S(j))return E.stylize("null","null")}(N,k);if(b)return b;var B=Object.keys(k),W=function(E){var j={};return E.forEach(function(V,K){j[V]=!0}),j}(B);if(N.showHidden&&(B=Object.getOwnPropertyNames(k)),G(k)&&(B.indexOf("message")>=0||B.indexOf("description")>=0))return v(k);if(B.length===0){if(Z(k)){var Q=k.name?": "+k.name:"";return N.stylize("[Function"+Q+"]","special")}if(R(k))return N.stylize(RegExp.prototype.toString.call(k),"regexp");if(M(k))return N.stylize(Date.prototype.toString.call(k),"date");if(G(k))return v(k)}var ee,ne="",X=!1,$=["{","}"];return d(k)&&(X=!0,$=["[","]"]),Z(k)&&(ne=" [Function"+(k.name?": "+k.name:"")+"]"),R(k)&&(ne=" "+RegExp.prototype.toString.call(k)),M(k)&&(ne=" "+Date.prototype.toUTCString.call(k)),G(k)&&(ne=" "+v(k)),B.length!==0||X&&k.length!=0?F<0?R(k)?N.stylize(RegExp.prototype.toString.call(k),"regexp"):N.stylize("[Object]","special"):(N.seen.push(k),ee=X?function(E,j,V,K,Y){for(var re=[],oe=0,ue=j.length;oe<ue;++oe)x(j,String(oe))?re.push(p(E,j,V,K,String(oe),!0)):re.push("");return Y.forEach(function(ve){ve.match(/^\d+$/)||re.push(p(E,j,V,K,ve,!0))}),re}(N,k,F,W,B):B.map(function(E){return p(N,k,F,W,E,X)}),N.seen.pop(),function(E,j,V){return E.reduce(function(K,Y){return Y.indexOf(`
6
- `)>=0,K+Y.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?V[0]+(j===""?"":j+`
7
- `)+" "+E.join(`,
8
- `)+" "+V[1]:V[0]+j+" "+E.join(", ")+" "+V[1]}(ee,ne,$)):$[0]+ne+$[1]}function v(N){return"["+Error.prototype.toString.call(N)+"]"}function p(N,k,F,A,b,B){var W,Q,ee;if((ee=Object.getOwnPropertyDescriptor(k,b)||{value:k[b]}).get?Q=ee.set?N.stylize("[Getter/Setter]","special"):N.stylize("[Getter]","special"):ee.set&&(Q=N.stylize("[Setter]","special")),x(A,b)||(W="["+b+"]"),Q||(N.seen.indexOf(ee.value)<0?(Q=S(F)?T(N,ee.value,null):T(N,ee.value,F-1)).indexOf(`
9
- `)>-1&&(Q=B?Q.split(`
10
- `).map(function(ne){return" "+ne}).join(`
5
+ `)),Error.captureStackTrace(l(E),N),E}return p=N,Object.defineProperty(p,"prototype",{writable:!1}),p}(u(Error));e.exports=function(v){if(v.length>2)throw new w(v);function y(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=p}function f(p){return new y(p)}return y.prototype.transform=v,f.Format=y,f}},function(e,t,n){n.d(t,"a",function(){return r});const r=o=>new Promise(l=>setTimeout(l,o||0))},function(e,t,n){var r=n(99),o=r,l=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||l!==void 0&&l||typeof self<"u"&&self||function(){return this}.call(null)||Function("return this")(),u=n(98);o.object.extend(proto,u),o.exportSymbol("proto.v1.signaling.api.CreatePeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.CreatePeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.DeletePeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.DeletePeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetHealthRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetHealthResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetIceServersRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetIceServersResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetPeersRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetPeersResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetSessionsRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetSessionsResponse",null,l),o.exportSymbol("proto.v1.signaling.api.Peer",null,l),o.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamRequest",null,l),o.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamResponse",null,l),o.exportSymbol("proto.v1.signaling.api.RefreshPeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.RefreshPeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.RtcSession",null,l),o.exportSymbol("proto.v1.signaling.api.SendSignalRequest",null,l),o.exportSymbol("proto.v1.signaling.api.SendSignalResponse",null,l),o.exportSymbol("proto.v1.signaling.api.SessionType",null,l),o.exportSymbol("proto.v1.signaling.api.Signal",null,l),proto.v1.signaling.api.Peer=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.Peer.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.Peer,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Peer.displayName="proto.v1.signaling.api.Peer"),proto.v1.signaling.api.Signal=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.Signal,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Signal.displayName="proto.v1.signaling.api.Signal"),proto.v1.signaling.api.RtcSession=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RtcSession,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RtcSession.displayName="proto.v1.signaling.api.RtcSession"),proto.v1.signaling.api.GetSessionsRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetSessionsRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetSessionsRequest.displayName="proto.v1.signaling.api.GetSessionsRequest"),proto.v1.signaling.api.GetSessionsResponse=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.GetSessionsResponse.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.GetSessionsResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetSessionsResponse.displayName="proto.v1.signaling.api.GetSessionsResponse"),proto.v1.signaling.api.GetHealthRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetHealthRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthRequest.displayName="proto.v1.signaling.api.GetHealthRequest"),proto.v1.signaling.api.GetHealthResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetHealthResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthResponse.displayName="proto.v1.signaling.api.GetHealthResponse"),proto.v1.signaling.api.CreatePeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.CreatePeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerRequest.displayName="proto.v1.signaling.api.CreatePeerRequest"),proto.v1.signaling.api.CreatePeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.CreatePeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerResponse.displayName="proto.v1.signaling.api.CreatePeerResponse"),proto.v1.signaling.api.DeletePeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.DeletePeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerRequest.displayName="proto.v1.signaling.api.DeletePeerRequest"),proto.v1.signaling.api.DeletePeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.DeletePeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerResponse.displayName="proto.v1.signaling.api.DeletePeerResponse"),proto.v1.signaling.api.RefreshPeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RefreshPeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerRequest.displayName="proto.v1.signaling.api.RefreshPeerRequest"),proto.v1.signaling.api.RefreshPeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RefreshPeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerResponse.displayName="proto.v1.signaling.api.RefreshPeerResponse"),proto.v1.signaling.api.GetPeersRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetPeersRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersRequest.displayName="proto.v1.signaling.api.GetPeersRequest"),proto.v1.signaling.api.GetPeersResponse=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.GetPeersResponse.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.GetPeersResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersResponse.displayName="proto.v1.signaling.api.GetPeersResponse"),proto.v1.signaling.api.GetIceServersRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetIceServersRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersRequest.displayName="proto.v1.signaling.api.GetIceServersRequest"),proto.v1.signaling.api.GetIceServersResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetIceServersResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersResponse.displayName="proto.v1.signaling.api.GetIceServersResponse"),proto.v1.signaling.api.SendSignalRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.SendSignalRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalRequest.displayName="proto.v1.signaling.api.SendSignalRequest"),proto.v1.signaling.api.SendSignalResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.SendSignalResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalResponse.displayName="proto.v1.signaling.api.SendSignalResponse"),proto.v1.signaling.api.ReceiveSignalStreamRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.ReceiveSignalStreamRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.displayName="proto.v1.signaling.api.ReceiveSignalStreamRequest"),proto.v1.signaling.api.ReceiveSignalStreamResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.ReceiveSignalStreamResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.displayName="proto.v1.signaling.api.ReceiveSignalStreamResponse"),proto.v1.signaling.api.Peer.repeatedFields_=[5],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Peer.prototype.toObject=function(s){return proto.v1.signaling.api.Peer.toObject(s,this)},proto.v1.signaling.api.Peer.toObject=function(s,g){var c,d={peerId:r.Message.getFieldWithDefault(g,1,""),organizationId:r.Message.getFieldWithDefault(g,2,""),userId:(c=g.getUserId())&&u.StringValue.toObject(s,c),deviceId:(c=g.getDeviceId())&&u.StringValue.toObject(s,c),sessionIdsList:(c=r.Message.getRepeatedField(g,5))==null?void 0:c,peerCreatedTimestamp:(c=g.getPeerCreatedTimestamp())&&u.Int64Value.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.Peer.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.Peer;return proto.v1.signaling.api.Peer.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.Peer.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;case 2:c=g.readString(),s.setOrganizationId(c);break;case 3:c=new u.StringValue,g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setUserId(c);break;case 4:c=new u.StringValue,g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setDeviceId(c);break;case 5:c=g.readString(),s.addSessionIds(c);break;case 6:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setPeerCreatedTimestamp(c);break;default:g.skipField()}return s},proto.v1.signaling.api.Peer.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.Peer.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.Peer.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getPeerId()).length>0&&g.writeString(1,c),(c=s.getOrganizationId()).length>0&&g.writeString(2,c),(c=s.getUserId())!=null&&g.writeMessage(3,c,u.StringValue.serializeBinaryToWriter),(c=s.getDeviceId())!=null&&g.writeMessage(4,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionIdsList()).length>0&&g.writeRepeatedString(5,c),(c=s.getPeerCreatedTimestamp())!=null&&g.writeMessage(6,c,u.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.Peer.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.Peer.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},proto.v1.signaling.api.Peer.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.Peer.prototype.setOrganizationId=function(s){return r.Message.setProto3StringField(this,2,s)},proto.v1.signaling.api.Peer.prototype.getUserId=function(){return r.Message.getWrapperField(this,u.StringValue,3)},proto.v1.signaling.api.Peer.prototype.setUserId=function(s){return r.Message.setWrapperField(this,3,s)},proto.v1.signaling.api.Peer.prototype.clearUserId=function(){return this.setUserId(void 0)},proto.v1.signaling.api.Peer.prototype.hasUserId=function(){return r.Message.getField(this,3)!=null},proto.v1.signaling.api.Peer.prototype.getDeviceId=function(){return r.Message.getWrapperField(this,u.StringValue,4)},proto.v1.signaling.api.Peer.prototype.setDeviceId=function(s){return r.Message.setWrapperField(this,4,s)},proto.v1.signaling.api.Peer.prototype.clearDeviceId=function(){return this.setDeviceId(void 0)},proto.v1.signaling.api.Peer.prototype.hasDeviceId=function(){return r.Message.getField(this,4)!=null},proto.v1.signaling.api.Peer.prototype.getSessionIdsList=function(){return r.Message.getRepeatedField(this,5)},proto.v1.signaling.api.Peer.prototype.setSessionIdsList=function(s){return r.Message.setField(this,5,s||[])},proto.v1.signaling.api.Peer.prototype.addSessionIds=function(s,g){return r.Message.addToRepeatedField(this,5,s,g)},proto.v1.signaling.api.Peer.prototype.clearSessionIdsList=function(){return this.setSessionIdsList([])},proto.v1.signaling.api.Peer.prototype.getPeerCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,6)},proto.v1.signaling.api.Peer.prototype.setPeerCreatedTimestamp=function(s){return r.Message.setWrapperField(this,6,s)},proto.v1.signaling.api.Peer.prototype.clearPeerCreatedTimestamp=function(){return this.setPeerCreatedTimestamp(void 0)},proto.v1.signaling.api.Peer.prototype.hasPeerCreatedTimestamp=function(){return r.Message.getField(this,6)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Signal.prototype.toObject=function(s){return proto.v1.signaling.api.Signal.toObject(s,this)},proto.v1.signaling.api.Signal.toObject=function(s,g){var c,d={sessionId:(c=g.getSessionId())&&u.StringValue.toObject(s,c),sessionCreatedTimestamp:(c=g.getSessionCreatedTimestamp())&&u.Int64Value.toObject(s,c),senderId:r.Message.getFieldWithDefault(g,3,""),receiverId:r.Message.getFieldWithDefault(g,4,""),payload:r.Message.getFieldWithDefault(g,5,""),iceServers:r.Message.getFieldWithDefault(g,6,""),iceTransportPolicy:r.Message.getFieldWithDefault(g,7,""),sessionType:r.Message.getFieldWithDefault(g,8,0)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.Signal.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.Signal;return proto.v1.signaling.api.Signal.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.Signal.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new u.StringValue;g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setSessionId(c);break;case 2:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setSessionCreatedTimestamp(c);break;case 3:c=g.readString(),s.setSenderId(c);break;case 4:c=g.readString(),s.setReceiverId(c);break;case 5:c=g.readString(),s.setPayload(c);break;case 6:c=g.readString(),s.setIceServers(c);break;case 7:c=g.readString(),s.setIceTransportPolicy(c);break;case 8:c=g.readEnum(),s.setSessionType(c);break;default:g.skipField()}return s},proto.v1.signaling.api.Signal.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.Signal.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.Signal.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId())!=null&&g.writeMessage(1,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionCreatedTimestamp())!=null&&g.writeMessage(2,c,u.Int64Value.serializeBinaryToWriter),(c=s.getSenderId()).length>0&&g.writeString(3,c),(c=s.getReceiverId()).length>0&&g.writeString(4,c),(c=s.getPayload()).length>0&&g.writeString(5,c),(c=s.getIceServers()).length>0&&g.writeString(6,c),(c=s.getIceTransportPolicy()).length>0&&g.writeString(7,c),(c=s.getSessionType())!==0&&g.writeEnum(8,c)},proto.v1.signaling.api.Signal.prototype.getSessionId=function(){return r.Message.getWrapperField(this,u.StringValue,1)},proto.v1.signaling.api.Signal.prototype.setSessionId=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.Signal.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.Signal.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,2)},proto.v1.signaling.api.Signal.prototype.setSessionCreatedTimestamp=function(s){return r.Message.setWrapperField(this,2,s)},proto.v1.signaling.api.Signal.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},proto.v1.signaling.api.Signal.prototype.getSenderId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.Signal.prototype.setSenderId=function(s){return r.Message.setProto3StringField(this,3,s)},proto.v1.signaling.api.Signal.prototype.getReceiverId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.Signal.prototype.setReceiverId=function(s){return r.Message.setProto3StringField(this,4,s)},proto.v1.signaling.api.Signal.prototype.getPayload=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.Signal.prototype.setPayload=function(s){return r.Message.setProto3StringField(this,5,s)},proto.v1.signaling.api.Signal.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,6,"")},proto.v1.signaling.api.Signal.prototype.setIceServers=function(s){return r.Message.setProto3StringField(this,6,s)},proto.v1.signaling.api.Signal.prototype.getIceTransportPolicy=function(){return r.Message.getFieldWithDefault(this,7,"")},proto.v1.signaling.api.Signal.prototype.setIceTransportPolicy=function(s){return r.Message.setProto3StringField(this,7,s)},proto.v1.signaling.api.Signal.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,8,0)},proto.v1.signaling.api.Signal.prototype.setSessionType=function(s){return r.Message.setProto3EnumField(this,8,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RtcSession.prototype.toObject=function(s){return proto.v1.signaling.api.RtcSession.toObject(s,this)},proto.v1.signaling.api.RtcSession.toObject=function(s,g){var c={sessionId:r.Message.getFieldWithDefault(g,1,""),offerPeerId:r.Message.getFieldWithDefault(g,2,""),answerPeerId:r.Message.getFieldWithDefault(g,3,""),organizationId:r.Message.getFieldWithDefault(g,4,""),sessionType:r.Message.getFieldWithDefault(g,5,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.RtcSession.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RtcSession;return proto.v1.signaling.api.RtcSession.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RtcSession.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setSessionId(c);break;case 2:c=g.readString(),s.setOfferPeerId(c);break;case 3:c=g.readString(),s.setAnswerPeerId(c);break;case 4:c=g.readString(),s.setOrganizationId(c);break;case 5:c=g.readString(),s.setSessionType(c);break;default:g.skipField()}return s},proto.v1.signaling.api.RtcSession.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RtcSession.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RtcSession.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId()).length>0&&g.writeString(1,c),(c=s.getOfferPeerId()).length>0&&g.writeString(2,c),(c=s.getAnswerPeerId()).length>0&&g.writeString(3,c),(c=s.getOrganizationId()).length>0&&g.writeString(4,c),(c=s.getSessionType()).length>0&&g.writeString(5,c)},proto.v1.signaling.api.RtcSession.prototype.getSessionId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.RtcSession.prototype.setSessionId=function(s){return r.Message.setProto3StringField(this,1,s)},proto.v1.signaling.api.RtcSession.prototype.getOfferPeerId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.RtcSession.prototype.setOfferPeerId=function(s){return r.Message.setProto3StringField(this,2,s)},proto.v1.signaling.api.RtcSession.prototype.getAnswerPeerId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.RtcSession.prototype.setAnswerPeerId=function(s){return r.Message.setProto3StringField(this,3,s)},proto.v1.signaling.api.RtcSession.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.RtcSession.prototype.setOrganizationId=function(s){return r.Message.setProto3StringField(this,4,s)},proto.v1.signaling.api.RtcSession.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.RtcSession.prototype.setSessionType=function(s){return r.Message.setProto3StringField(this,5,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetSessionsRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetSessionsRequest.toObject(s,this)},proto.v1.signaling.api.GetSessionsRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetSessionsRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetSessionsRequest;return proto.v1.signaling.api.GetSessionsRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetSessionsRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetSessionsRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetSessionsRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetSessionsRequest.serializeBinaryToWriter=function(s,g){},proto.v1.signaling.api.GetSessionsResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetSessionsResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetSessionsResponse.toObject(s,this)},proto.v1.signaling.api.GetSessionsResponse.toObject=function(s,g){var c={sessionsList:r.Message.toObjectList(g.getSessionsList(),proto.v1.signaling.api.RtcSession.toObject,s)};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetSessionsResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetSessionsResponse;return proto.v1.signaling.api.GetSessionsResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetSessionsResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.RtcSession;g.readMessage(c,proto.v1.signaling.api.RtcSession.deserializeBinaryFromReader),s.addSessions(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetSessionsResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetSessionsResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetSessionsResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getSessionsList()).length>0&&g.writeRepeatedMessage(1,c,proto.v1.signaling.api.RtcSession.serializeBinaryToWriter)},proto.v1.signaling.api.GetSessionsResponse.prototype.getSessionsList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.RtcSession,1)},proto.v1.signaling.api.GetSessionsResponse.prototype.setSessionsList=function(s){return r.Message.setRepeatedWrapperField(this,1,s)},proto.v1.signaling.api.GetSessionsResponse.prototype.addSessions=function(s,g){return r.Message.addToRepeatedWrapperField(this,1,s,proto.v1.signaling.api.RtcSession,g)},proto.v1.signaling.api.GetSessionsResponse.prototype.clearSessionsList=function(){return this.setSessionsList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetHealthRequest.toObject(s,this)},proto.v1.signaling.api.GetHealthRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetHealthRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetHealthRequest;return proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetHealthRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetHealthResponse.toObject(s,this)},proto.v1.signaling.api.GetHealthResponse.toObject=function(s,g){var c={version:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetHealthResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetHealthResponse;return proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setVersion(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetHealthResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getVersion()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.GetHealthResponse.prototype.getVersion=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetHealthResponse.prototype.setVersion=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.CreatePeerRequest.toObject(s,this)},proto.v1.signaling.api.CreatePeerRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.CreatePeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.CreatePeerRequest;return proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.CreatePeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.CreatePeerResponse.toObject(s,this)},proto.v1.signaling.api.CreatePeerResponse.toObject=function(s,g){var c,d={peer:(c=g.getPeer())&&proto.v1.signaling.api.Peer.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.CreatePeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.CreatePeerResponse;return proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.setPeer(c);break;default:g.skipField()}return s},proto.v1.signaling.api.CreatePeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeer())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.CreatePeerResponse.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.CreatePeerResponse.prototype.setPeer=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.CreatePeerResponse.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.CreatePeerResponse.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.DeletePeerRequest.toObject(s,this)},proto.v1.signaling.api.DeletePeerRequest.toObject=function(s,g){var c={peerId:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.DeletePeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.DeletePeerRequest;return proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;default:g.skipField()}return s},proto.v1.signaling.api.DeletePeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeerId()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.DeletePeerRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.DeletePeerRequest.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.DeletePeerResponse.toObject(s,this)},proto.v1.signaling.api.DeletePeerResponse.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.DeletePeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.DeletePeerResponse;return proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.DeletePeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.RefreshPeerRequest.toObject(s,this)},proto.v1.signaling.api.RefreshPeerRequest.toObject=function(s,g){var c,d={peer:(c=g.getPeer())&&proto.v1.signaling.api.Peer.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.RefreshPeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RefreshPeerRequest;return proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.setPeer(c);break;default:g.skipField()}return s},proto.v1.signaling.api.RefreshPeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeer())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.RefreshPeerRequest.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.RefreshPeerRequest.prototype.setPeer=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.RefreshPeerRequest.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.RefreshPeerRequest.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.RefreshPeerResponse.toObject(s,this)},proto.v1.signaling.api.RefreshPeerResponse.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.RefreshPeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RefreshPeerResponse;return proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.RefreshPeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetPeersRequest.toObject(s,this)},proto.v1.signaling.api.GetPeersRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetPeersRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetPeersRequest;return proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetPeersRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter=function(s,g){},proto.v1.signaling.api.GetPeersResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetPeersResponse.toObject(s,this)},proto.v1.signaling.api.GetPeersResponse.toObject=function(s,g){var c={peersList:r.Message.toObjectList(g.getPeersList(),proto.v1.signaling.api.Peer.toObject,s)};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetPeersResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetPeersResponse;return proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.addPeers(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetPeersResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeersList()).length>0&&g.writeRepeatedMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.GetPeersResponse.prototype.getPeersList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.GetPeersResponse.prototype.setPeersList=function(s){return r.Message.setRepeatedWrapperField(this,1,s)},proto.v1.signaling.api.GetPeersResponse.prototype.addPeers=function(s,g){return r.Message.addToRepeatedWrapperField(this,1,s,proto.v1.signaling.api.Peer,g)},proto.v1.signaling.api.GetPeersResponse.prototype.clearPeersList=function(){return this.setPeersList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetIceServersRequest.toObject(s,this)},proto.v1.signaling.api.GetIceServersRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetIceServersRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetIceServersRequest;return proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetIceServersRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetIceServersResponse.toObject(s,this)},proto.v1.signaling.api.GetIceServersResponse.toObject=function(s,g){var c={iceServers:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetIceServersResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetIceServersResponse;return proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setIceServers(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetIceServersResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getIceServers()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.GetIceServersResponse.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetIceServersResponse.prototype.setIceServers=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalRequest.prototype.toObject=function(s){return proto.v1.signaling.api.SendSignalRequest.toObject(s,this)},proto.v1.signaling.api.SendSignalRequest.toObject=function(s,g){var c,d={signal:(c=g.getSignal())&&proto.v1.signaling.api.Signal.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.SendSignalRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.SendSignalRequest;return proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Signal;g.readMessage(c,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),s.setSignal(c);break;default:g.skipField()}return s},proto.v1.signaling.api.SendSignalRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getSignal())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalRequest.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.SendSignalRequest.prototype.setSignal=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.SendSignalRequest.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.SendSignalRequest.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalResponse.prototype.toObject=function(s){return proto.v1.signaling.api.SendSignalResponse.toObject(s,this)},proto.v1.signaling.api.SendSignalResponse.toObject=function(s,g){var c,d={sessionId:(c=g.getSessionId())&&u.StringValue.toObject(s,c),sessionCreatedTimestamp:(c=g.getSessionCreatedTimestamp())&&u.Int64Value.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.SendSignalResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.SendSignalResponse;return proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new u.StringValue;g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setSessionId(c);break;case 2:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setSessionCreatedTimestamp(c);break;default:g.skipField()}return s},proto.v1.signaling.api.SendSignalResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId())!=null&&g.writeMessage(1,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionCreatedTimestamp())!=null&&g.writeMessage(2,c,u.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionId=function(){return r.Message.getWrapperField(this,u.StringValue,1)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionId=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,2)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionCreatedTimestamp=function(s){return r.Message.setWrapperField(this,2,s)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.toObject=function(s){return proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject(s,this)},proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject=function(s,g){var c={peerId:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.ReceiveSignalStreamRequest;return proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;default:g.skipField()}return s},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeerId()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.toObject=function(s){return proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject(s,this)},proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject=function(s,g){var c,d={signal:(c=g.getSignal())&&proto.v1.signaling.api.Signal.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.ReceiveSignalStreamResponse;return proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Signal;g.readMessage(c,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),s.setSignal(c);break;default:g.skipField()}return s},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getSignal())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.setSignal=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SessionType={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3,HEADLESS:4},o.object.extend(t,proto.v1.signaling.api)},function(e,t,n){n.d(t,"a",function(){return o});var r=n(28);class o extends Error{constructor(u,s,g,c,d,w,v={}){super(`Response error ${JSON.stringify({method:u,url:s,requestBody:Object(r.a)(g),statusCode:c,responseHeaders:d?Object(r.a)([...d.entries()].reduce((y,[f,p])=>(y[f]=p,y),{})):{},responseBody:Object(r.a)(w)})}`),this.method=u,this.url=s,this.requestBody=g,this.statusCode=c,this.headers=d,this.body=w,this.validationErrors=v,this.name="ResponseError",Object.setPrototypeOf(this,new.target.prototype)}}},function(e,t,n){function r(o,l,u=()=>!0){if(function(s,g,c=()=>!0){return s instanceof g&&c(s)}(o,l,u))return o;throw o}n.d(t,"a",function(){return r})},function(e,t,n){(function(r){var o=Object.getOwnPropertyDescriptors||function(D){for(var O=Object.keys(D),L={},U=0;U<O.length;U++)L[O[U]]=Object.getOwnPropertyDescriptor(D,O[U]);return L},l=/%[sdj%]/g;t.format=function(D){if(!B(D)){for(var O=[],L=0;L<arguments.length;L++)O.push(g(arguments[L]));return O.join(" ")}L=1;for(var U=arguments,A=U.length,V=String(D).replace(l,function(Q){if(Q==="%%")return"%";if(L>=A)return Q;switch(Q){case"%s":return String(U[L++]);case"%d":return Number(U[L++]);case"%j":try{return JSON.stringify(U[L++])}catch{return"[Circular]"}default:return Q}}),q=U[L];L<A;q=U[++L])S(q)||!h(q)?V+=" "+q:V+=" "+g(q);return V},t.deprecate=function(D,O){if(r!==void 0&&r.noDeprecation===!0)return D;if(r===void 0)return function(){return t.deprecate(D,O).apply(this,arguments)};var L=!1;return function(){if(!L){if(r.throwDeprecation)throw new Error(O);r.traceDeprecation?console.trace(O):console.error(O),L=!0}return D.apply(this,arguments)}};var u,s={};function g(D,O){var L={seen:[],stylize:d};return arguments.length>=3&&(L.depth=arguments[2]),arguments.length>=4&&(L.colors=arguments[3]),p(O)?L.showHidden=O:O&&t._extend(L,O),E(L.showHidden)&&(L.showHidden=!1),E(L.depth)&&(L.depth=2),E(L.colors)&&(L.colors=!1),E(L.customInspect)&&(L.customInspect=!0),L.colors&&(L.stylize=c),w(L,D,L.depth)}function c(D,O){var L=g.styles[O];return L?"\x1B["+g.colors[L][0]+"m"+D+"\x1B["+g.colors[L][1]+"m":D}function d(D,O){return D}function w(D,O,L){if(D.customInspect&&O&&X(O.inspect)&&O.inspect!==t.inspect&&(!O.constructor||O.constructor.prototype!==O)){var U=O.inspect(L,D);return B(U)||(U=w(D,U,L)),U}var A=function(b,I){if(E(I))return b.stylize("undefined","undefined");if(B(I)){var $="'"+JSON.stringify(I).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return b.stylize($,"string")}if(N(I))return b.stylize(""+I,"number");if(p(I))return b.stylize(""+I,"boolean");if(S(I))return b.stylize("null","null")}(D,O);if(A)return A;var V=Object.keys(O),q=function(b){var I={};return b.forEach(function($,K){I[$]=!0}),I}(V);if(D.showHidden&&(V=Object.getOwnPropertyNames(O)),W(O)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return v(O);if(V.length===0){if(X(O)){var Q=O.name?": "+O.name:"";return D.stylize("[Function"+Q+"]","special")}if(T(O))return D.stylize(RegExp.prototype.toString.call(O),"regexp");if(R(O))return D.stylize(Date.prototype.toString.call(O),"date");if(W(O))return v(O)}var ee,te="",k=!1,x=["{","}"];return f(O)&&(k=!0,x=["[","]"]),X(O)&&(te=" [Function"+(O.name?": "+O.name:"")+"]"),T(O)&&(te=" "+RegExp.prototype.toString.call(O)),R(O)&&(te=" "+Date.prototype.toUTCString.call(O)),W(O)&&(te=" "+v(O)),V.length!==0||k&&O.length!=0?L<0?T(O)?D.stylize(RegExp.prototype.toString.call(O),"regexp"):D.stylize("[Object]","special"):(D.seen.push(O),ee=k?function(b,I,$,K,Y){for(var ne=[],ie=0,ue=I.length;ie<ue;++ie)C(I,String(ie))?ne.push(y(b,I,$,K,String(ie),!0)):ne.push("");return Y.forEach(function(we){we.match(/^\d+$/)||ne.push(y(b,I,$,K,we,!0))}),ne}(D,O,L,q,V):V.map(function(b){return y(D,O,L,q,b,k)}),D.seen.pop(),function(b,I,$){return b.reduce(function(K,Y){return Y.indexOf(`
6
+ `)>=0,K+Y.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?$[0]+(I===""?"":I+`
7
+ `)+" "+b.join(`,
8
+ `)+" "+$[1]:$[0]+I+" "+b.join(", ")+" "+$[1]}(ee,te,x)):x[0]+te+x[1]}function v(D){return"["+Error.prototype.toString.call(D)+"]"}function y(D,O,L,U,A,V){var q,Q,ee;if((ee=Object.getOwnPropertyDescriptor(O,A)||{value:O[A]}).get?Q=ee.set?D.stylize("[Getter/Setter]","special"):D.stylize("[Getter]","special"):ee.set&&(Q=D.stylize("[Setter]","special")),C(U,A)||(q="["+A+"]"),Q||(D.seen.indexOf(ee.value)<0?(Q=S(L)?w(D,ee.value,null):w(D,ee.value,L-1)).indexOf(`
9
+ `)>-1&&(Q=V?Q.split(`
10
+ `).map(function(te){return" "+te}).join(`
11
11
  `).substr(2):`
12
12
  `+Q.split(`
13
- `).map(function(ne){return" "+ne}).join(`
14
- `)):Q=N.stylize("[Circular]","special")),O(W)){if(B&&b.match(/^\d+$/))return Q;(W=JSON.stringify(""+b)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.substr(1,W.length-2),W=N.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=N.stylize(W,"string"))}return W+": "+Q}function d(N){return Array.isArray(N)}function h(N){return typeof N=="boolean"}function S(N){return N===null}function I(N){return typeof N=="number"}function L(N){return typeof N=="string"}function O(N){return N===void 0}function R(N){return m(N)&&_(N)==="[object RegExp]"}function m(N){return typeof N=="object"&&N!==null}function M(N){return m(N)&&_(N)==="[object Date]"}function G(N){return m(N)&&(_(N)==="[object Error]"||N instanceof Error)}function Z(N){return typeof N=="function"}function _(N){return Object.prototype.toString.call(N)}function y(N){return N<10?"0"+N.toString(10):N.toString(10)}t.debuglog=function(N){if(O(u)&&(u=r.env.NODE_DEBUG||""),N=N.toUpperCase(),!s[N])if(new RegExp("\\b"+N+"\\b","i").test(u)){var k=r.pid;s[N]=function(){var F=t.format.apply(t,arguments);console.error("%s %d: %s",N,k,F)}}else s[N]=function(){};return s[N]},t.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=h,t.isNull=S,t.isNullOrUndefined=function(N){return N==null},t.isNumber=I,t.isString=L,t.isSymbol=function(N){return typeof N=="symbol"},t.isUndefined=O,t.isRegExp=R,t.isObject=m,t.isDate=M,t.isError=G,t.isFunction=Z,t.isPrimitive=function(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||N===void 0},t.isBuffer=n(106);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function w(){var N=new Date,k=[y(N.getHours()),y(N.getMinutes()),y(N.getSeconds())].join(":");return[N.getDate(),C[N.getMonth()],k].join(" ")}function x(N,k){return Object.prototype.hasOwnProperty.call(N,k)}t.log=function(){console.log("%s - %s",w(),t.format.apply(t,arguments))},t.inherits=n(107),t._extend=function(N,k){if(!k||!m(k))return N;for(var F=Object.keys(k),A=F.length;A--;)N[F[A]]=k[F[A]];return N};var H=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function U(N,k){if(!N){var F=new Error("Promise was rejected with a falsy value");F.reason=N,N=F}return k(N)}t.promisify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');if(H&&N[H]){var k;if(typeof(k=N[H])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(k,H,{value:k,enumerable:!1,writable:!1,configurable:!0}),k}function k(){for(var F,A,b=new Promise(function(Q,ee){F=Q,A=ee}),B=[],W=0;W<arguments.length;W++)B.push(arguments[W]);B.push(function(Q,ee){Q?A(Q):F(ee)});try{N.apply(this,B)}catch(Q){A(Q)}return b}return Object.setPrototypeOf(k,Object.getPrototypeOf(N)),H&&Object.defineProperty(k,H,{value:k,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(k,o(N))},t.promisify.custom=H,t.callbackify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');function k(){for(var F=[],A=0;A<arguments.length;A++)F.push(arguments[A]);var b=F.pop();if(typeof b!="function")throw new TypeError("The last argument must be of type Function");var B=this,W=function(){return b.apply(B,arguments)};N.apply(this,F).then(function(Q){r.nextTick(W,null,Q)},function(Q){r.nextTick(U,Q,W)})}return Object.setPrototypeOf(k,Object.getPrototypeOf(N)),Object.defineProperties(k,o(N)),k}}).call(this,n(2))},function(e,t,n){e.exports=function(r,o){o||(o={}),typeof o=="function"&&(o={cmp:o});var l,u=typeof o.cycles=="boolean"&&o.cycles,s=o.cmp&&(l=o.cmp,function(c){return function(f,T){var v={key:f,value:c[f]},p={key:T,value:c[T]};return l(v,p)}}),g=[];return function c(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var T,v;if(Array.isArray(f)){for(v="[",T=0;T<f.length;T++)T&&(v+=","),v+=c(f[T])||"null";return v+"]"}if(f===null)return"null";if(g.indexOf(f)!==-1){if(u)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var p=g.push(f)-1,d=Object.keys(f).sort(s&&s(f));for(v="",T=0;T<d.length;T++){var h=d[T],S=c(f[h]);S&&(v&&(v+=","),v+=JSON.stringify(h)+":"+S)}return g.splice(p,1),"{"+v+"}"}}(r)}},function(e,t,n){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,l=Function.prototype.apply;function u(s,g){this._id=s,this._clearFn=g}t.setTimeout=function(){return new u(l.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new u(l.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(s){s&&s.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(s,g){clearTimeout(s._idleTimeoutId),s._idleTimeout=g},t.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},t._unrefActive=t.active=function(s){clearTimeout(s._idleTimeoutId);var g=s._idleTimeout;g>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},g))},n(140),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(6))},function(e,t,n){(function(r){r===void 0||!r.version||r.version.indexOf("v0.")===0||r.version.indexOf("v1.")===0&&r.version.indexOf("v1.8.")!==0?e.exports={nextTick:function(o,l,u,s){if(typeof o!="function")throw new TypeError('"callback" argument must be a function');var g,c,f=arguments.length;switch(f){case 0:case 1:return r.nextTick(o);case 2:return r.nextTick(function(){o.call(null,l)});case 3:return r.nextTick(function(){o.call(null,l,u)});case 4:return r.nextTick(function(){o.call(null,l,u,s)});default:for(g=new Array(f-1),c=0;c<g.length;)g[c++]=arguments[c];return r.nextTick(function(){o.apply(null,g)})}}}:e.exports=r}).call(this,n(2))},function(e,t,n){(function(r){function o(l){return Object.prototype.toString.call(l)}t.isArray=function(l){return Array.isArray?Array.isArray(l):o(l)==="[object Array]"},t.isBoolean=function(l){return typeof l=="boolean"},t.isNull=function(l){return l===null},t.isNullOrUndefined=function(l){return l==null},t.isNumber=function(l){return typeof l=="number"},t.isString=function(l){return typeof l=="string"},t.isSymbol=function(l){return typeof l=="symbol"},t.isUndefined=function(l){return l===void 0},t.isRegExp=function(l){return o(l)==="[object RegExp]"},t.isObject=function(l){return typeof l=="object"&&l!==null},t.isDate=function(l){return o(l)==="[object Date]"},t.isError=function(l){return o(l)==="[object Error]"||l instanceof Error},t.isFunction=function(l){return typeof l=="function"},t.isPrimitive=function(l){return l===null||typeof l=="boolean"||typeof l=="number"||typeof l=="string"||typeof l=="symbol"||l===void 0},t.isBuffer=r.isBuffer}).call(this,n(5).Buffer)},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return typeof location<"u"?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return typeof navigator<"u"?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL=`
15
- `,t.homedir=function(){return"/"}},function(e,t,n){var r=n(58),o=n(61).warn,l=t;l.version=n(137).version,l.transports=n(138),l.config=n(50),l.addColors=r.levels,l.format=r.format,l.createLogger=n(88),l.ExceptionHandler=n(89),l.RejectionHandler=n(93),l.Container=n(209),l.Transport=n(20),l.loggers=new l.Container;var u=l.createLogger();Object.keys(l.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(s){return l[s]=function(){return u[s].apply(u,arguments)}}),Object.defineProperty(l,"level",{get:function(){return u.level},set:function(s){u.level=s}}),Object.defineProperty(l,"exceptions",{get:function(){return u.exceptions}}),["exitOnError"].forEach(function(s){Object.defineProperty(l,s,{get:function(){return u[s]},set:function(g){u[s]=g}})}),Object.defineProperty(l,"default",{get:function(){return{exceptionHandlers:u.exceptionHandlers,rejectionHandlers:u.rejectionHandlers,transports:u.transports}}}),o.deprecated(l,"setLevels"),o.forFunctions(l,"useFormat",["cli"]),o.forProperties(l,"useFormat",["padLevels","stripColors"]),o.forFunctions(l,"deprecated",["addRewriter","addFilter","clone","extend"]),o.forProperties(l,"deprecated",["emitErrs","levelLength"]),o.moved(l,"createLogger","Logger")},function(e,t,n){var r=n(13),o=n(141),l=n(3).LEVEL,u=e.exports=function(){var s=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.call(this,{objectMode:!0,highWaterMark:g.highWaterMark}),this.format=g.format,this.level=g.level,this.handleExceptions=g.handleExceptions,this.handleRejections=g.handleRejections,this.silent=g.silent,g.log&&(this.log=g.log),g.logv&&(this.logv=g.logv),g.close&&(this.close=g.close),this.once("pipe",function(c){s.levels=c.levels,s.parent=c}),this.once("unpipe",function(c){c===s.parent&&(s.parent=null,s.close&&s.close())})};r.inherits(u,o),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);var f=this.level||this.parent&&this.parent.level;if(!f||this.levels[f]>=this.levels[s[l]]){if(s&&!this.format)return this.log(s,c);var T=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s),this.format.options)}catch(p){T=p}if(T||!v){if(c(),T)throw T;return}return this.log(v,c)}return c(null)},u.prototype._writev=function(s,g){if(this.logv){var c=s.filter(this._accept,this);return c.length?this.logv(c,g):g(null)}for(var f=0;f<s.length;f++)if(this._accept(s[f]))if(!s[f].chunk||this.format){var T=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s[f].chunk),this.format.options)}catch(p){T=p}if(T||!v){if(s[f].callback(),T)throw g(null),T}else this.log(v,s[f].callback)}else this.log(s[f].chunk,s[f].callback);return g(null)},u.prototype._accept=function(s){var g=s.chunk;if(this.silent)return!1;var c=this.level||this.parent&&this.parent.level;return!(g.exception!==!0&&c&&!(this.levels[c]>=this.levels[g[l]])||!this.handleExceptions&&g.exception===!0)},u.prototype._nop=function(){},e.exports.LegacyTransportStream=n(147)},function(e,t,n){var r,o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(S,I,L){return Function.prototype.apply.call(S,I,L)};r=o&&typeof o.ownKeys=="function"?o.ownKeys:Object.getOwnPropertySymbols?function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:function(S){return Object.getOwnPropertyNames(S)};var u=Number.isNaN||function(S){return S!=S};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var g=10;function c(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}function f(S,I,L,O){var R,m,M,G;if(typeof L!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof L);if((m=S._events)===void 0?(m=S._events=Object.create(null),S._eventsCount=0):(m.newListener!==void 0&&(S.emit("newListener",I,L.listener?L.listener:L),m=S._events),M=m[I]),M===void 0)M=m[I]=L,++S._eventsCount;else if(typeof M=="function"?M=m[I]=O?[L,M]:[M,L]:O?M.unshift(L):M.push(L),(R=c(S))>0&&M.length>R&&!M.warned){M.warned=!0;var Z=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");Z.name="MaxListenersExceededWarning",Z.emitter=S,Z.type=I,Z.count=M.length,G=Z,console&&console.warn&&console.warn(G)}return S}function T(){for(var S=[],I=0;I<arguments.length;I++)S.push(arguments[I]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,l(this.listener,this.target,S))}function v(S,I,L){var O={fired:!1,wrapFn:void 0,target:S,type:I,listener:L},R=T.bind(O);return R.listener=L,O.wrapFn=R,R}function p(S,I,L){var O=S._events;if(O===void 0)return[];var R=O[I];return R===void 0?[]:typeof R=="function"?L?[R.listener||R]:[R]:L?function(m){for(var M=new Array(m.length),G=0;G<M.length;++G)M[G]=m[G].listener||m[G];return M}(R):h(R,R.length)}function d(S){var I=this._events;if(I!==void 0){var L=I[S];if(typeof L=="function")return 1;if(L!==void 0)return L.length}return 0}function h(S,I){for(var L=new Array(I),O=0;O<I;++O)L[O]=S[O];return L}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(S){if(typeof S!="number"||S<0||u(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");g=S}}),s.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||u(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(S){for(var I=[],L=1;L<arguments.length;L++)I.push(arguments[L]);var O=S==="error",R=this._events;if(R!==void 0)O=O&&R.error===void 0;else if(!O)return!1;if(O){var m;if(I.length>0&&(m=I[0]),m instanceof Error)throw m;var M=new Error("Unhandled error."+(m?" ("+m.message+")":""));throw M.context=m,M}var G=R[S];if(G===void 0)return!1;if(typeof G=="function")l(G,this,I);else{var Z=G.length,_=h(G,Z);for(L=0;L<Z;++L)l(_[L],this,I)}return!0},s.prototype.addListener=function(S,I){return f(this,S,I,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,I){return f(this,S,I,!0)},s.prototype.once=function(S,I){if(typeof I!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof I);return this.on(S,v(this,S,I)),this},s.prototype.prependOnceListener=function(S,I){if(typeof I!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof I);return this.prependListener(S,v(this,S,I)),this},s.prototype.removeListener=function(S,I){var L,O,R,m,M;if(typeof I!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof I);if((O=this._events)===void 0)return this;if((L=O[S])===void 0)return this;if(L===I||L.listener===I)--this._eventsCount==0?this._events=Object.create(null):(delete O[S],O.removeListener&&this.emit("removeListener",S,L.listener||I));else if(typeof L!="function"){for(R=-1,m=L.length-1;m>=0;m--)if(L[m]===I||L[m].listener===I){M=L[m].listener,R=m;break}if(R<0)return this;R===0?L.shift():function(G,Z){for(;Z+1<G.length;Z++)G[Z]=G[Z+1];G.pop()}(L,R),L.length===1&&(O[S]=L[0]),O.removeListener!==void 0&&this.emit("removeListener",S,M||I)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var I,L,O;if((L=this._events)===void 0)return this;if(L.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):L[S]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete L[S]),this;if(arguments.length===0){var R,m=Object.keys(L);for(O=0;O<m.length;++O)(R=m[O])!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(I=L[S])=="function")this.removeListener(S,I);else if(I!==void 0)for(O=I.length-1;O>=0;O--)this.removeListener(S,I[O]);return this},s.prototype.listeners=function(S){return p(this,S,!0)},s.prototype.rawListeners=function(S){return p(this,S,!1)},s.listenerCount=function(S,I){return typeof S.listenerCount=="function"?S.listenerCount(I):d.call(S,I)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(146).Buffer,o=r.isEncoding||function(d){switch((d=""+d)&&d.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function l(d){var h;switch(this.encoding=function(S){var I=function(L){if(!L)return"utf8";for(var O;;)switch(L){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return L;default:if(O)return;L=(""+L).toLowerCase(),O=!0}}(S);if(typeof I!="string"&&(r.isEncoding===o||!o(S)))throw new Error("Unknown encoding: "+S);return I||S}(d),this.encoding){case"utf16le":this.text=g,this.end=c,h=4;break;case"utf8":this.fillLast=s,h=4;break;case"base64":this.text=f,this.end=T,h=3;break;default:return this.write=v,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(h)}function u(d){return d<=127?0:d>>5==6?2:d>>4==14?3:d>>3==30?4:d>>6==2?-1:-2}function s(d){var h=this.lastTotal-this.lastNeed,S=function(I,L,O){if((192&L[0])!=128)return I.lastNeed=0,"�";if(I.lastNeed>1&&L.length>1){if((192&L[1])!=128)return I.lastNeed=1,"�";if(I.lastNeed>2&&L.length>2&&(192&L[2])!=128)return I.lastNeed=2,"�"}}(this,d);return S!==void 0?S:this.lastNeed<=d.length?(d.copy(this.lastChar,h,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(d.copy(this.lastChar,h,0,d.length),void(this.lastNeed-=d.length))}function g(d,h){if((d.length-h)%2==0){var S=d.toString("utf16le",h);if(S){var I=S.charCodeAt(S.length-1);if(I>=55296&&I<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=d[d.length-1],d.toString("utf16le",h,d.length-1)}function c(d){var h=d&&d.length?this.write(d):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return h+this.lastChar.toString("utf16le",0,S)}return h}function f(d,h){var S=(d.length-h)%3;return S===0?d.toString("base64",h):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=d[d.length-1]:(this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1]),d.toString("base64",h,d.length-S))}function T(d){var h=d&&d.length?this.write(d):"";return this.lastNeed?h+this.lastChar.toString("base64",0,3-this.lastNeed):h}function v(d){return d.toString(this.encoding)}function p(d){return d&&d.length?this.write(d):""}t.StringDecoder=l,l.prototype.write=function(d){if(d.length===0)return"";var h,S;if(this.lastNeed){if((h=this.fillLast(d))===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<d.length?h?h+this.text(d,S):this.text(d,S):h||""},l.prototype.end=function(d){var h=d&&d.length?this.write(d):"";return this.lastNeed?h+"�":h},l.prototype.text=function(d,h){var S=function(L,O,R){var m=O.length-1;if(m<R)return 0;var M=u(O[m]);return M>=0?(M>0&&(L.lastNeed=M-1),M):--m<R||M===-2?0:(M=u(O[m]))>=0?(M>0&&(L.lastNeed=M-2),M):--m<R||M===-2?0:(M=u(O[m]))>=0?(M>0&&(M===2?M=0:L.lastNeed=M-3),M):0}(this,d,h);if(!this.lastNeed)return d.toString("utf8",h);this.lastTotal=S;var I=d.length-(S-this.lastNeed);return d.copy(this.lastChar,0,I),d.toString("utf8",h,I)},l.prototype.fillLast=function(d){if(this.lastNeed<=d.length)return d.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);d.copy(this.lastChar,this.lastTotal-this.lastNeed,0,d.length),this.lastNeed-=d.length}},function(e,t,n){var r=n(16),o=Object.keys||function(d){var h=[];for(var S in d)h.push(S);return h};e.exports=T;var l=n(17);l.inherits=n(7);var u=n(69),s=n(48);l.inherits(T,u);for(var g=o(s.prototype),c=0;c<g.length;c++){var f=g[c];T.prototype[f]||(T.prototype[f]=s.prototype[f])}function T(d){if(!(this instanceof T))return new T(d);u.call(this,d),s.call(this,d),d&&d.readable===!1&&(this.readable=!1),d&&d.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,d&&d.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",v)}function v(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(d){d.end()}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),T.prototype._destroy=function(d,h){this.push(null),this.end(),r.nextTick(h,d)}},function(e,t,n){(function(r){function o(D){var q=0;return function(){return q<D.length?{done:!1,value:D[q++]}:{done:!0}}}var l=typeof Object.defineProperties=="function"?Object.defineProperty:function(D,q,te){D!=Array.prototype&&D!=Object.prototype&&(D[q]=te.value)},u=function(D){D=[typeof window=="object"&&window,typeof self=="object"&&self,typeof r=="object"&&r,D];for(var q=0;q<D.length;++q){var te=D[q];if(te&&te.Math==Math)return te}throw Error("Cannot find global object")}(this);function s(D,q){if(q){var te=u;D=D.split(".");for(var ae=0;ae<D.length-1;ae++){var de=D[ae];de in te||(te[de]={}),te=te[de]}(q=q(ae=te[D=D[D.length-1]]))!=ae&&q!=null&&l(te,D,{configurable:!0,writable:!0,value:q})}}function g(D){var q=typeof Symbol<"u"&&Symbol.iterator&&D[Symbol.iterator];return q?q.call(D):{next:o(D)}}s("Object.is",function(D){return D||function(q,te){return q===te?q!==0||1/q==1/te:q!=q&&te!=te}}),s("Array.prototype.includes",function(D){return D||function(q,te){var ae=this;ae instanceof String&&(ae=String(ae));var de=ae.length;for(0>(te=te||0)&&(te=Math.max(te+de,0));te<de;te++){var pe=ae[te];if(pe===q||Object.is(pe,q))return!0}return!1}}),s("Promise",function(D){function q(ce){this.b=0,this.c=void 0,this.a=[];var he=this.f();try{ce(he.resolve,he.reject)}catch(Se){he.reject(Se)}}function te(){this.a=null}function ae(ce){return ce instanceof q?ce:new q(function(he){he(ce)})}if(D)return D;te.prototype.b=function(ce){if(this.a==null){this.a=[];var he=this;this.c(function(){he.g()})}this.a.push(ce)};var de=u.setTimeout;te.prototype.c=function(ce){de(ce,0)},te.prototype.g=function(){for(;this.a&&this.a.length;){var ce=this.a;this.a=[];for(var he=0;he<ce.length;++he){var Se=ce[he];ce[he]=null;try{Se()}catch(we){this.f(we)}}}this.a=null},te.prototype.f=function(ce){this.c(function(){throw ce})},q.prototype.f=function(){function ce(we){return function(Ae){Se||(Se=!0,we.call(he,Ae))}}var he=this,Se=!1;return{resolve:ce(this.m),reject:ce(this.g)}},q.prototype.m=function(ce){if(ce===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(ce instanceof q)this.o(ce);else{e:switch(typeof ce){case"object":var he=ce!=null;break e;case"function":he=!0;break e;default:he=!1}he?this.l(ce):this.h(ce)}},q.prototype.l=function(ce){var he=void 0;try{he=ce.then}catch(Se){return void this.g(Se)}typeof he=="function"?this.u(he,ce):this.h(ce)},q.prototype.g=function(ce){this.i(2,ce)},q.prototype.h=function(ce){this.i(1,ce)},q.prototype.i=function(ce,he){if(this.b!=0)throw Error("Cannot settle("+ce+", "+he+"): Promise already settled in state"+this.b);this.b=ce,this.c=he,this.j()},q.prototype.j=function(){if(this.a!=null){for(var ce=0;ce<this.a.length;++ce)pe.b(this.a[ce]);this.a=null}};var pe=new te;return q.prototype.o=function(ce){var he=this.f();ce.w(he.resolve,he.reject)},q.prototype.u=function(ce,he){var Se=this.f();try{ce.call(he,Se.resolve,Se.reject)}catch(we){Se.reject(we)}},q.prototype.then=function(ce,he){function Se(xe,We){return typeof xe=="function"?function(ze){try{we(xe(ze))}catch(Ge){Ae(Ge)}}:We}var we,Ae,Pe=new q(function(xe,We){we=xe,Ae=We});return this.w(Se(ce,we),Se(he,Ae)),Pe},q.prototype.catch=function(ce){return this.then(void 0,ce)},q.prototype.w=function(ce,he){function Se(){switch(we.b){case 1:ce(we.c);break;case 2:he(we.c);break;default:throw Error("Unexpected state: "+we.b)}}var we=this;this.a==null?pe.b(Se):this.a.push(Se)},q.resolve=ae,q.reject=function(ce){return new q(function(he,Se){Se(ce)})},q.race=function(ce){return new q(function(he,Se){for(var we=g(ce),Ae=we.next();!Ae.done;Ae=we.next())ae(Ae.value).w(he,Se)})},q.all=function(ce){var he=g(ce),Se=he.next();return Se.done?ae([]):new q(function(we,Ae){function Pe(ze){return function(Ge){xe[ze]=Ge,--We==0&&we(xe)}}var xe=[],We=0;do xe.push(void 0),We++,ae(Se.value).w(Pe(xe.length-1),Ae),Se=he.next();while(!Se.done)})},q});var c=c||{},f=this||self;function T(D,q){D=D.split("."),q=q||f;for(var te=0;te<D.length;te++)if((q=q[D[te]])==null)return null;return q}function v(){}function p(D){var q=typeof D;if(q=="object"){if(!D)return"null";if(D instanceof Array)return"array";if(D instanceof Object)return q;var te=Object.prototype.toString.call(D);if(te=="[object Window]")return"object";if(te=="[object Array]"||typeof D.length=="number"&&D.splice!==void 0&&D.propertyIsEnumerable!==void 0&&!D.propertyIsEnumerable("splice"))return"array";if(te=="[object Function]"||D.call!==void 0&&D.propertyIsEnumerable!==void 0&&!D.propertyIsEnumerable("call"))return"function"}else if(q=="function"&&D.call===void 0)return"object";return q}function d(D){var q=typeof D;return q=="object"&&D!=null||q=="function"}function h(D,q,te){return D.call.apply(D.bind,arguments)}function S(D,q,te){if(!D)throw Error();if(2<arguments.length){var ae=Array.prototype.slice.call(arguments,2);return function(){var de=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(de,ae),D.apply(q,de)}}return function(){return D.apply(q,arguments)}}function I(D,q,te){return(I=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?h:S).apply(null,arguments)}function L(D,q){function te(){}te.prototype=q.prototype,D.S=q.prototype,D.prototype=new te,D.prototype.constructor=D}function O(){this.a={}}function R(D,q,te,ae){this.f=D,this.c=q,this.b=te,this.a=ae}function m(D,q,te,ae){te=te===void 0?{}:te,this.c=D,this.a=te,this.b=q,this.f=ae===void 0?null:ae}function M(D,q,te,ae,de,pe){this.name=D,this.a=de,this.b=pe}function G(D,q,te){te=te===void 0?{}:te;var ae=ae===void 0?new O:ae;return new R(q,D,te,ae)}function Z(D,q,te,ae){return ae instanceof M?ae:new M(D,te,ae.b||q.constructor,ae.f,ae.a,ae.c)}function _(D){this.a=D}function y(D){switch(D){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}}function C(D){if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var q=Error().stack;q&&(this.stack=q)}D&&(this.message=String(D))}function w(D,q){for(var te="",ae=(D=D.split("%s")).length-1,de=0;de<ae;de++)te+=D[de]+(de<q.length?q[de]:"%s");C.call(this,te+D[ae])}function x(){this.j=null,this.i=[],this.l=0,this.b=H,this.f=this.a=this.h=0,this.c=null,this.g=0}O.prototype.get=function(D){return this.a[D]},O.prototype.f=function(){return Object.keys(this.a)},R.prototype.getRequestMessage=function(){return this.f},R.prototype.getMethodDescriptor=function(){return this.c},R.prototype.getMetadata=function(){return this.b},R.prototype.getCallOptions=function(){return this.a},m.prototype.getResponseMessage=function(){return this.c},m.prototype.getMetadata=function(){return this.a},m.prototype.getMethodDescriptor=function(){return this.b},m.prototype.getStatus=function(){return this.f},_.prototype.on=function(D,q){return D=="data"||D=="error"?this:this.a.on(D,q)},_.prototype.removeListener=function(D,q){return this.a.removeListener(D,q)},_.prototype.cancel=function(){this.a.cancel()},L(C,Error),C.prototype.name="CustomError",L(w,C),w.prototype.name="AssertionError";var H=0,U=1,N=2,k=3,F=0,A=128;function b(D,q,te,ae){throw D.b=k,D.j="The stream is broken @"+D.l+"/"+te+". Error: "+ae+`. With input:
16
- `+q,Error(D.j)}var B=Array.prototype.indexOf?function(D,q){return Array.prototype.indexOf.call(D,q,void 0)}:function(D,q){if(typeof D=="string")return typeof q!="string"||q.length!=1?-1:D.indexOf(q,0);for(var te=0;te<D.length;te++)if(te in D&&D[te]===q)return te;return-1},W,Q=String.prototype.trim?function(D){return D.trim()}:function(D){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(D)[1]};function ee(D,q){return D.indexOf(q)!=-1}function ne(D,q){return D<q?-1:D>q?1:0}e:{var X=f.navigator;if(X){var $=X.userAgent;if($){W=$;break e}}W=""}var E="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function j(D){var q=1;D=D.split(":");for(var te=[];0<q&&D.length;)te.push(D.shift()),q--;return D.length&&te.push(D.join(":")),te}function V(D){return V[" "](D),D}V[" "]=v;var K,Y,re=ee(W,"Opera"),oe=ee(W,"Trident")||ee(W,"MSIE"),ue=ee(W,"Edge"),ve=ee(W,"Gecko")&&!(ee(W.toLowerCase(),"webkit")&&!ee(W,"Edge"))&&!(ee(W,"Trident")||ee(W,"MSIE"))&&!ee(W,"Edge"),Re=ee(W.toLowerCase(),"webkit")&&!ee(W,"Edge");function Te(){var D=f.document;return D?D.documentMode:void 0}e:{var Ne="",Oe=(Y=W,ve?/rv:([^\);]+)(\)|;)/.exec(Y):ue?/Edge\/([\d\.]+)/.exec(Y):oe?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Y):Re?/WebKit\/(\S+)/.exec(Y):re?/(?:Version)[ \/]?(\S+)/.exec(Y):void 0);if(Oe&&(Ne=Oe?Oe[1]:""),oe){var Ce=Te();if(Ce!=null&&Ce>parseFloat(Ne)){K=String(Ce);break e}}K=Ne}var Me,Fe={};function $e(D){return function(q,te){var ae=Fe;return Object.prototype.hasOwnProperty.call(ae,q)?ae[q]:ae[q]=te(q)}(D,function(){for(var q=0,te=Q(String(K)).split("."),ae=Q(String(D)).split("."),de=Math.max(te.length,ae.length),pe=0;q==0&&pe<de;pe++){var ce=te[pe]||"",he=ae[pe]||"";do{if(ce=/(\d*)(\D*)(.*)/.exec(ce)||["","","",""],he=/(\d*)(\D*)(.*)/.exec(he)||["","","",""],ce[0].length==0&&he[0].length==0)break;q=ne(ce[1].length==0?0:parseInt(ce[1],10),he[1].length==0?0:parseInt(he[1],10))||ne(ce[2].length==0,he[2].length==0)||ne(ce[2],he[2]),ce=ce[3],he=he[3]}while(q==0)}return 0<=q})}if(f.document&&oe){var nt=Te();Me=nt||parseInt(K,10)||void 0}else Me=void 0;var Et=Me;function ut(){this.F=this.F}ut.prototype.F=!1;var Tt,ct=Object.freeze||function(D){return D};(Tt=!oe)||(Tt=9<=Number(Et));var bt=Tt,dt=oe&&!$e("9"),kt=function(){if(!f.addEventListener||!Object.defineProperty)return!1;var D=!1,q=Object.defineProperty({},"passive",{get:function(){D=!0}});try{f.addEventListener("test",v,q),f.removeEventListener("test",v,q)}catch{}return D}();function gt(D,q){this.type=D,this.a=this.target=q,this.defaultPrevented=!1}function ht(D,q){if(gt.call(this,D?D.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,D){var te=this.type=D.type,ae=D.changedTouches&&D.changedTouches.length?D.changedTouches[0]:null;if(this.target=D.target||D.srcElement,this.a=q,q=D.relatedTarget){if(ve){e:{try{V(q.nodeName);var de=!0;break e}catch{}de=!1}de||(q=null)}}else te=="mouseover"?q=D.fromElement:te=="mouseout"&&(q=D.toElement);this.relatedTarget=q,ae?(this.clientX=ae.clientX!==void 0?ae.clientX:ae.pageX,this.clientY=ae.clientY!==void 0?ae.clientY:ae.pageY,this.screenX=ae.screenX||0,this.screenY=ae.screenY||0):(this.clientX=D.clientX!==void 0?D.clientX:D.pageX,this.clientY=D.clientY!==void 0?D.clientY:D.pageY,this.screenX=D.screenX||0,this.screenY=D.screenY||0),this.button=D.button,this.key=D.key||"",this.ctrlKey=D.ctrlKey,this.altKey=D.altKey,this.shiftKey=D.shiftKey,this.metaKey=D.metaKey,this.pointerId=D.pointerId||0,this.pointerType=typeof D.pointerType=="string"?D.pointerType:ke[D.pointerType]||"",this.c=D,D.defaultPrevented&&this.b()}}gt.prototype.b=function(){this.defaultPrevented=!0},L(ht,gt);var ke=ct({2:"touch",3:"pen",4:"mouse"});ht.prototype.b=function(){ht.S.b.call(this);var D=this.c;if(D.preventDefault)D.preventDefault();else if(D.returnValue=!1,dt)try{(D.ctrlKey||112<=D.keyCode&&123>=D.keyCode)&&(D.keyCode=-1)}catch{}};var vt="closure_listenable_"+(1e6*Math.random()|0),pt=0;function mt(D,q,te,ae,de){this.listener=D,this.proxy=null,this.src=q,this.type=te,this.capture=!!ae,this.A=de,this.key=++pt,this.s=this.v=!1}function jt(D){D.s=!0,D.listener=null,D.proxy=null,D.src=null,D.A=null}function At(D){this.src=D,this.a={},this.b=0}function Rt(D,q){var te=q.type;if(te in D.a){var ae,de=D.a[te],pe=B(de,q);(ae=0<=pe)&&Array.prototype.splice.call(de,pe,1),ae&&(jt(q),D.a[te].length==0&&(delete D.a[te],D.b--))}}function rt(D,q,te,ae){for(var de=0;de<D.length;++de){var pe=D[de];if(!pe.s&&pe.listener==q&&pe.capture==!!te&&pe.A==ae)return de}return-1}At.prototype.add=function(D,q,te,ae,de){var pe=D.toString();(D=this.a[pe])||(D=this.a[pe]=[],this.b++);var ce=rt(D,q,ae,de);return-1<ce?(q=D[ce],te||(q.v=!1)):((q=new mt(q,this.src,pe,!!ae,de)).v=te,D.push(q)),q};var Nt="closure_lm_"+(1e6*Math.random()|0),Ue={};function Ot(D,q,te,ae,de){if(ae&&ae.once)(function ce(he,Se,we,Ae,Pe){if(Array.isArray(Se))for(var xe=0;xe<Se.length;xe++)ce(he,Se[xe],we,Ae,Pe);else we=ye(we),he&&he[vt]?he.f.add(String(Se),we,!0,d(Ae)?!!Ae.capture:!!Ae,Pe):be(he,Se,we,!0,Ae,Pe)})(D,q,te,ae,de);else if(Array.isArray(q))for(var pe=0;pe<q.length;pe++)Ot(D,q[pe],te,ae,de);else te=ye(te),D&&D[vt]?D.f.add(String(q),te,!1,d(ae)?!!ae.capture:!!ae,de):be(D,q,te,!1,ae,de)}function be(D,q,te,ae,de,pe){if(!q)throw Error("Invalid event type");var ce=d(de)?!!de.capture:!!de,he=ge(D);if(he||(D[Nt]=he=new At(D)),!(te=he.add(q,te,ae,ce,pe)).proxy)if(ae=function(){var Se=se,we=bt?function(Ae){return Se.call(we.src,we.listener,Ae)}:function(Ae){if(!(Ae=Se.call(we.src,we.listener,Ae)))return Ae};return we}(),te.proxy=ae,ae.src=D,ae.listener=te,D.addEventListener)kt||(de=ce),de===void 0&&(de=!1),D.addEventListener(q.toString(),ae,de);else if(D.attachEvent)D.attachEvent(z(q.toString()),ae);else{if(!D.addListener||!D.removeListener)throw Error("addEventListener and attachEvent are unavailable.");D.addListener(ae)}}function P(D){if(typeof D!="number"&&D&&!D.s){var q=D.src;if(q&&q[vt])Rt(q.f,D);else{var te=D.type,ae=D.proxy;q.removeEventListener?q.removeEventListener(te,ae,D.capture):q.detachEvent?q.detachEvent(z(te),ae):q.addListener&&q.removeListener&&q.removeListener(ae),(te=ge(q))?(Rt(te,D),te.b==0&&(te.src=null,q[Nt]=null)):jt(D)}}}function z(D){return D in Ue?Ue[D]:Ue[D]="on"+D}function J(D,q,te,ae){var de=!0;if((D=ge(D))&&(q=D.a[q.toString()]))for(q=q.concat(),D=0;D<q.length;D++){var pe=q[D];pe&&pe.capture==te&&!pe.s&&(pe=ie(pe,ae),de=de&&pe!==!1)}return de}function ie(D,q){var te=D.listener,ae=D.A||D.src;return D.v&&P(D),te.call(ae,q)}function se(D,q){if(D.s)return!0;if(!bt){var te=q||T("window.event");q=new ht(te,this);var ae=!0;if(!(0>te.keyCode||te.returnValue!=null)){e:{var de=!1;if(te.keyCode==0)try{te.keyCode=-1;break e}catch{de=!0}(de||te.returnValue==null)&&(te.returnValue=!0)}for(te=[],de=q.a;de;de=de.parentNode)te.push(de);for(D=D.type,de=te.length-1;0<=de;de--){q.a=te[de];var pe=J(te[de],D,!0,q);ae=ae&&pe}for(de=0;de<te.length;de++)q.a=te[de],pe=J(te[de],D,!1,q),ae=ae&&pe}return ae}return ie(D,new ht(q,this))}function ge(D){return(D=D[Nt])instanceof At?D:null}var me="__closure_events_fn_"+(1e9*Math.random()>>>0);function ye(D){return p(D)=="function"?D:(D[me]||(D[me]=function(q){return D.handleEvent(q)}),D[me])}function fe(){ut.call(this),this.f=new At(this),this.N=this}function le(D,q){D=D.N;var te=q.type||q;if(typeof q=="string")q=new gt(q,D);else if(q instanceof gt)q.target=q.target||D;else{var ae=q;(function(de,pe){for(var ce,he,Se=1;Se<arguments.length;Se++){for(ce in he=arguments[Se])de[ce]=he[ce];for(var we=0;we<E.length;we++)ce=E[we],Object.prototype.hasOwnProperty.call(he,ce)&&(de[ce]=he[ce])}})(q=new gt(te,D),ae)}Ee(D=q.a=D,te,!0,q),Ee(D,te,!1,q)}function Ee(D,q,te,ae){if(q=D.f.a[String(q)]){q=q.concat();for(var de=!0,pe=0;pe<q.length;++pe){var ce=q[pe];if(ce&&!ce.s&&ce.capture==te){var he=ce.listener,Se=ce.A||ce.src;ce.v&&Rt(D.f,ce),de=he.call(Se,ae)!==!1&&de}}}}function Ie(D,q,te){if(p(D)=="function")te&&(D=I(D,te));else{if(!D||typeof D.handleEvent!="function")throw Error("Invalid listener argument");D=I(D.handleEvent,D)}return 2147483647<Number(q)?-1:f.setTimeout(D,q||0)}function De(D,q,te){this.reset(D,q,te,void 0,void 0)}L(fe,ut),fe.prototype[vt]=!0,fe.prototype.addEventListener=function(D,q,te,ae){Ot(this,D,q,te,ae)},fe.prototype.removeEventListener=function(D,q,te,ae){(function de(pe,ce,he,Se,we){if(Array.isArray(ce))for(var Ae=0;Ae<ce.length;Ae++)de(pe,ce[Ae],he,Se,we);else Se=d(Se)?!!Se.capture:!!Se,he=ye(he),pe&&pe[vt]?(pe=pe.f,(ce=String(ce).toString())in pe.a&&-1<(he=rt(Ae=pe.a[ce],he,Se,we))&&(jt(Ae[he]),Array.prototype.splice.call(Ae,he,1),Ae.length==0&&(delete pe.a[ce],pe.b--))):pe&&(pe=ge(pe))&&(ce=pe.a[ce.toString()],pe=-1,ce&&(pe=rt(ce,he,Se,we)),(he=-1<pe?ce[pe]:null)&&P(he))})(this,D,q,te,ae)},De.prototype.a=null;function Ve(D){this.f=D,this.b=this.c=this.a=null}function Ze(D,q){this.name=D,this.value=q}De.prototype.reset=function(D,q,te,ae,de){delete this.a},Ze.prototype.toString=function(){return this.name};var Xe=new Ze("SEVERE",1e3),ot=new Ze("CONFIG",700),Le=new Ze("FINE",500);function Be(D){return D.c?D.c:D.a?Be(D.a):(function(q,te){throw new w("Failure"+(q?": "+q:""),Array.prototype.slice.call(arguments,1))}("Root logger has no level set."),null)}Ve.prototype.log=function(D,q,te){if(D.value>=Be(this).value)for(p(q)=="function"&&(q=q()),D=new De(D,String(q),this.f),te&&(D.a=te),te=this;te;)te=te.a};var qe,Ye={},Ke=null;function He(D,q){D&&D.log(Le,q,void 0)}function at(){}function it(D){var q;return(q=D.a)||(q={},Lt(D)&&(q[0]=!0,q[1]=!0),q=D.a=q),q}function yt(){}function Dt(D){return(D=Lt(D))?new ActiveXObject(D):new XMLHttpRequest}function Lt(D){if(!D.b&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var q=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],te=0;te<q.length;te++){var ae=q[te];try{return new ActiveXObject(ae),D.b=ae}catch{}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return D.b}function wt(D,q){this.b={},this.a=[],this.c=0;var te=arguments.length;if(1<te){if(te%2)throw Error("Uneven number of arguments");for(var ae=0;ae<te;ae+=2)this.set(arguments[ae],arguments[ae+1])}else D&&Ht(this,D)}function Ut(D){if(D.c!=D.a.length){for(var q=0,te=0;q<D.a.length;){var ae=D.a[q];Ct(D.b,ae)&&(D.a[te++]=ae),q++}D.a.length=te}if(D.c!=D.a.length){var de={};for(te=q=0;q<D.a.length;)Ct(de,ae=D.a[q])||(D.a[te++]=ae,de[ae]=1),q++;D.a.length=te}}function Ht(D,q){if(q instanceof wt)for(var te=q.f(),ae=0;ae<te.length;ae++)D.set(te[ae],q.get(te[ae]));else for(te in q)D.set(te,q[te])}function Ct(D,q){return Object.prototype.hasOwnProperty.call(D,q)}at.prototype.a=null,L(yt,at),qe=new yt,wt.prototype.f=function(){return Ut(this),this.a.concat()},wt.prototype.get=function(D,q){return Ct(this.b,D)?this.b[D]:q},wt.prototype.set=function(D,q){Ct(this.b,D)||(this.c++,this.a.push(D)),this.b[D]=q},wt.prototype.forEach=function(D,q){for(var te=this.f(),ae=0;ae<te.length;ae++){var de=te[ae],pe=this.get(de);D.call(q,pe,de,this)}};var Jt=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function _t(D){fe.call(this),this.headers=new wt,this.D=D||null,this.c=!1,this.C=this.a=null,this.J=this.o="",this.g=0,this.i="",this.h=this.I=this.m=this.G=!1,this.l=0,this.u=null,this.j=Wt,this.B=this.H=!1}L(_t,fe);var Wt="",Qt=_t.prototype,en=function D(q){var te;if(Ke||(Ke=new Ve(""),Ye[""]=Ke,Ke.c=ot),!(te=Ye[q])){te=new Ve(q);var ae=q.lastIndexOf("."),de=q.substr(ae+1);(ae=D(q.substr(0,ae))).b||(ae.b={}),ae.b[de]=te,te.a=ae,Ye[q]=te}return te}("goog.net.XhrIo");Qt.b=en;var tn=/^https?$/i,nn=["POST","PUT"];function rn(D,q,te){if(D.a)throw Error("[goog.net.XhrIo] Object is active with another request="+D.o+"; newUri="+q);D.o=q,D.i="",D.g=0,D.J="POST",D.G=!1,D.c=!0,D.a=D.D?Dt(D.D):Dt(qe),D.C=D.D?it(D.D):it(qe),D.a.onreadystatechange=I(D.K,D);try{He(D.b,ft(D,"Opening Xhr")),D.I=!0,D.a.open("POST",String(q),!0),D.I=!1}catch(pe){return He(D.b,ft(D,"Error opening Xhr: "+pe.message)),void Vt(D,pe)}q=te||"";var ae=function(pe){e:{for(var ce=on,he=pe.length,Se=typeof pe=="string"?pe.split(""):pe,we=0;we<he;we++)if(we in Se&&ce.call(void 0,Se[we],we,pe)){ce=we;break e}ce=-1}return 0>ce?null:typeof pe=="string"?pe.charAt(ce):pe[ce]}((te=new wt(D.headers)).f()),de=f.FormData&&q instanceof f.FormData;!(0<=B(nn,"POST"))||ae||de||te.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),te.forEach(function(pe,ce){this.a.setRequestHeader(ce,pe)},D),D.j&&(D.a.responseType=D.j),"withCredentials"in D.a&&D.a.withCredentials!==D.H&&(D.a.withCredentials=D.H);try{qt(D),0<D.l&&(D.B=function(pe){return oe&&$e(9)&&typeof pe.timeout=="number"&&pe.ontimeout!==void 0}(D.a),He(D.b,ft(D,"Will abort after "+D.l+"ms if incomplete, xhr2 "+D.B)),D.B?(D.a.timeout=D.l,D.a.ontimeout=I(D.L,D)):D.u=Ie(D.L,D.l,D)),He(D.b,ft(D,"Sending request")),D.m=!0,D.a.send(q),D.m=!1}catch(pe){He(D.b,ft(D,"Send error: "+pe.message)),Vt(D,pe)}}function on(D){return D.toLowerCase()=="content-type"}function Vt(D,q){D.c=!1,D.a&&(D.h=!0,D.a.abort(),D.h=!1),D.i=q,D.g=5,Gt(D),Bt(D)}function Gt(D){D.G||(D.G=!0,le(D,"complete"),le(D,"error"))}function $t(D){if(D.c&&c!==void 0){if(D.C[1]&&St(D)==4&&D.getStatus()==2)He(D.b,ft(D,"Local request error detected and ignored"));else if(D.m&&St(D)==4)Ie(D.K,0,D);else if(le(D,"readystatechange"),St(D)==4){He(D.b,ft(D,"Request complete")),D.c=!1;try{var q,te=D.getStatus();e:switch(te){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var ae=!0;break e;default:ae=!1}if(!(q=ae)){var de;if(de=te===0){var pe=String(D.o).match(Jt)[1]||null;if(!pe&&f.self&&f.self.location){var ce=f.self.location.protocol;pe=ce.substr(0,ce.length-1)}de=!tn.test(pe?pe.toLowerCase():"")}q=de}if(q)le(D,"complete"),le(D,"success");else{D.g=6;try{var he=2<St(D)?D.a.statusText:""}catch(Se){He(D.b,"Can not get status: "+Se.message),he=""}D.i=he+" ["+D.getStatus()+"]",Gt(D)}}finally{Bt(D)}}}}function Bt(D){if(D.a){qt(D);var q=D.a,te=D.C[0]?v:null;D.a=null,D.C=null,le(D,"ready");try{q.onreadystatechange=te}catch(ae){(D=D.b)&&D.log(Xe,"Problem encountered resetting onreadystatechange: "+ae.message,void 0)}}}function qt(D){D.a&&D.B&&(D.a.ontimeout=null),D.u&&(f.clearTimeout(D.u),D.u=null)}function St(D){return D.a?D.a.readyState:0}function Zt(D,q){if(D.a&&St(D)==4)return(D=D.a.getResponseHeader(q))===null?void 0:D}function ft(D,q){return q+" ["+D.J+" "+D.o+" "+D.getStatus()+"]"}_t.prototype.L=function(){c!==void 0&&this.a&&(this.i="Timed out after "+this.l+"ms, aborting",this.g=8,He(this.b,ft(this,this.i)),le(this,"timeout"),this.abort(8))},_t.prototype.abort=function(D){this.a&&this.c&&(He(this.b,ft(this,"Aborting")),this.c=!1,this.h=!0,this.a.abort(),this.h=!1,this.g=D||7,le(this,"complete"),le(this,"abort"),Bt(this))},_t.prototype.K=function(){this.F||(this.I||this.m||this.h?$t(this):this.O())},_t.prototype.O=function(){$t(this)},_t.prototype.getStatus=function(){try{return 2<St(this)?this.a.status:-1}catch{return-1}};var Yt={},xt=null;function an(D){var q=D.length,te=3*q/4;te%3?te=Math.floor(te):ee("=.",D[q-1])&&(te=ee("=.",D[q-2])?te-2:te-1);var ae=new Uint8Array(te),de=0;return function(pe,ce){function he(We){for(;Se<pe.length;){var ze=pe.charAt(Se++),Ge=xt[ze];if(Ge!=null)return Ge;if(!/^[\s\xa0]*$/.test(ze))throw Error("Unknown base64 encoding at char: "+ze)}return We}Kt();for(var Se=0;;){var we=he(-1),Ae=he(0),Pe=he(64),xe=he(64);if(xe===64&&we===-1)break;ce(we<<2|Ae>>4),Pe!=64&&(ce(Ae<<4&240|Pe>>2),xe!=64&&ce(Pe<<6&192|xe))}}(D,function(pe){ae[de++]=pe}),ae.subarray(0,de)}function Kt(){if(!xt){xt={};for(var D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),q=["+/=","+/","-_=","-_.","-_"],te=0;5>te;te++){var ae=D.concat(q[te].split(""));Yt[te]=ae;for(var de=0;de<ae.length;de++){var pe=ae[de];xt[pe]===void 0&&(xt[pe]=de)}}}}var sn=["content-type","grpc-status","grpc-message"];function st(D){this.a=D.T,this.l=null,this.b=[],this.h=[],this.g=[],this.f=[],this.c=[],this.j=!1,this.i=0,this.m=new x;var q=this;Ot(this.a,"readystatechange",function(){var te=q.a;if(te=te.a?te.a.getResponseHeader("Content-Type"):null){if((te=te.toLowerCase()).lastIndexOf("application/grpc-web-text",0)==0){te=q.a;try{var ae=te.a?te.a.responseText:""}catch(we){He(te.b,"Can not get responseText: "+we.message),ae=""}if(ae=(te=ae||"").length-te.length%4,(te=te.substr(q.i,ae-q.i)).length==0)return;q.i=ae,te=an(te)}else{if(te.lastIndexOf("application/grpc",0)!=0)return void It(q,{code:2,message:"Unknown Content-type received.",metadata:{}});te=new Uint8Array(function(we){try{if(!we.a)return null;if("response"in we.a)return we.a.response;switch(we.j){case Wt:case"text":return we.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in we.a)return we.a.mozResponseArrayBuffer}var Ae=we.b;return Ae&&Ae.log(Xe,"Response type "+we.j+" is not supported on this browser",void 0),null}catch(Pe){return He(we.b,"Can not get response: "+Pe.message),null}}(q.a))}ae=null;try{ae=function(we,Ae){function Pe(Mt){je.f++,je.a=(je.a<<8)+Mt,je.f==4&&(je.b=N,je.g=0,typeof Uint8Array<"u"?je.c=new Uint8Array(je.a):je.c=Array(je.a),je.a==0&&We())}function xe(Mt){je.c[je.g++]=Mt,je.g==je.a&&We()}function We(){var Mt={};Mt[je.h]=je.c,je.i.push(Mt),je.b=H}var ze,Ge,je=we,lt=0;for(ze=Ae instanceof Uint8Array||Ae instanceof Array?Ae:new Uint8Array(Ae);lt<ze.length;){switch(je.b){case k:b(je,ze,lt,"stream already broken");break;case H:(Ge=ze[lt])==F||Ge==A?je.h=Ge:b(je,ze,lt,"invalid frame byte"),je.b=U,je.a=0,je.f=0;break;case U:Pe(ze[lt]);break;case N:xe(ze[lt]);break;default:throw Error("unexpected parser state: "+je.b)}je.l++,lt++}return we=je.i,je.i=[],0<we.length?we:null}(q.m,te)}catch{It(q,{code:2,message:"Error in parsing response body",metadata:{}})}if(ae)for(te=0;te<ae.length;te++){if(F in ae[te]){var de=ae[te][F];if(de)try{var pe=q.l(de);if(pe){de=q;for(var ce=pe,he=0;he<de.b.length;he++)de.b[he](ce)}}catch{It(q,{code:2,message:"Error in response deserializer function.",metadata:{}})}}if(A in ae[te]&&0<ae[te][A].length){for(de="",ce=0;ce<ae[te][A].length;ce++)de+=String.fromCharCode(ae[te][A][ce]);for(de=de.trim().split(`\r
17
- `),ce={},he=0;he<de.length;he++){var Se=de[he].indexOf(":");ce[de[he].substring(0,Se).trim()]=de[he].substring(Se+1).trim()}de=ce,ce=0,he="","grpc-status"in de&&(ce=de["grpc-status"],delete de["grpc-status"]),"grpc-message"in de&&(he=de["grpc-message"],delete de["grpc-message"]),It(q,{code:Number(ce),message:he,metadata:de})}}}}),Ot(this.a,"complete",function(){var te=q.a.g,ae="",de={},pe=function(he){var Se={};he=(he.a&&St(he)==4&&he.a.getAllResponseHeaders()||"").split(`\r
18
- `);for(var we=0;we<he.length;we++)if(!/^[\s\xa0]*$/.test(he[we])){var Ae=j(he[we]),Pe=Ae[0];if(typeof(Ae=Ae[1])=="string"){Ae=Ae.trim();var xe=Se[Pe]||[];Se[Pe]=xe,xe.push(Ae)}}return function(We,ze){var Ge,je={};for(Ge in We)je[Ge]=ze.call(void 0,We[Ge],Ge,We);return je}(Se,function(We){return We.join(", ")})}(q.a);if(Object.keys(pe).forEach(function(he){sn.includes(he)||(de[he]=pe[he])}),function(he,Se){for(var we=0;we<he.g.length;we++)he.g[we](Se)}(q,de),te!=0){switch(te){case 7:var ce=10;break;case 8:ce=4;break;case 6:ce=function(he){switch(he){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}}(q.a.getStatus());break;default:ce=14}ce==10&&q.j||It(q,{code:ce,message:y(te),metadata:{}})}else te=!1,"grpc-status"in pe&&(ce=Zt(q.a,"grpc-status"),"grpc-message"in pe&&(ae=Zt(q.a,"grpc-message")),Number(ce)!=0&&(It(q,{code:Number(ce),message:ae,metadata:pe}),te=!0)),te||function(he){for(var Se=0;Se<he.c.length;Se++)he.c[Se]()}(q)})}function Pt(D,q){-1<(q=D.indexOf(q))&&D.splice(q,1)}function It(D,q){if(q.code!=0)for(var te={code:q.code,message:decodeURIComponent(q.message||""),metadata:q.metadata},ae=0;ae<D.f.length;ae++)D.f[ae](te);for(q={code:q.code,details:decodeURIComponent(q.message||""),metadata:q.metadata},te=0;te<D.h.length;te++)D.h[te](q)}function tt(D){this.a=T("format",D)||"text",this.f=T("suppressCorsPreflight",D)||!1,this.c=T("withCredentials",D)||!1,this.b=T("streamInterceptors",D)||[],this.g=T("unaryInterceptors",D)||[]}function Ft(D,q,te){var ae=q.getMethodDescriptor(),de=te+ae.name;(te=new _t).H=D.c;var pe=new st({T:te});if(pe.l=ae.b,Ht(te.headers,q.getMetadata()),D.a=="text"?(te.headers.set("Content-Type","application/grpc-web-text"),te.headers.set("Accept","application/grpc-web-text")):te.headers.set("Content-Type","application/grpc-web+proto"),te.headers.set("X-User-Agent","grpc-web-javascript/0.1"),te.headers.set("X-Grpc-Web","1"),Ct(te.headers.b,"deadline")){var ce=te.headers.get("deadline");ce=Math.round(ce-new Date().getTime());var he=te.headers;Ct(he.b,"deadline")&&(delete he.b.deadline,he.c--,he.a.length>2*he.c&&Ut(he)),1/0===ce&&(ce=0),0<ce&&te.headers.set("grpc-timeout",ce+"m")}if(D.f){Ut(he=te.headers),ce={};for(var Se=0;Se<he.a.length;Se++){var we=he.a[Se];ce[we]=he.b[we]}(he=te.headers).b={},he.a.length=0,he.c=0;e:{for(Ae in ce){var Ae=!1;break e}Ae=!0}Ae||(ce=function(We){var ze="";return function(Ge,je){for(var lt in Ge)je.call(void 0,Ge[lt],lt,Ge)}(We,function(Ge,je){ze+=je,ze+=":",ze+=Ge,ze+=`\r
19
- `}),ze}(ce),typeof de=="string"?(Ae=encodeURIComponent("$httpHeaders"),(Ae+=ce=ce!=null?"="+encodeURIComponent(String(ce)):"")&&(0>(ce=de.indexOf("#"))&&(ce=de.length),0>(he=de.indexOf("?"))||he>ce?(he=ce,Se=""):Se=de.substring(he+1,ce),ce=(de=[de.substr(0,he),Se,de.substr(ce)])[1],de[1]=Ae?ce?ce+"&"+Ae:Ae:ce,de=de[0]+(de[1]?"?"+de[1]:"")+de[2])):de.a("$httpHeaders",ce))}for(ae=(q=(0,ae.a)(q.getRequestMessage())).length,Ae=[0,0,0,0],ce=new Uint8Array(5+ae),he=3;0<=he;he--)Ae[he]=ae%256,ae>>>=8;if(ce.set(new Uint8Array(Ae),1),ce.set(q,5),q=ce,D.a=="text"){var Pe;for(D=q,Pe===void 0&&(Pe=0),Kt(),Pe=Yt[Pe],q=[],ae=0;ae<D.length;ae+=3){we=D[ae];var xe=(Ae=ae+1<D.length)?D[ae+1]:0;he=we>>2,we=(3&we)<<4|xe>>4,xe=(15&xe)<<2|(Se=(ce=ae+2<D.length)?D[ae+2]:0)>>6,Se&=63,ce||(Se=64,Ae||(xe=64)),q.push(Pe[he],Pe[we],Pe[xe]||"",Pe[Se]||"")}q=q.join("")}else D.a=="binary"&&(te.j="arraybuffer");return rn(te,de,q),pe}function Xt(D,q,te){var ae=null,de=!1;D.on("data",function(pe){ae=pe}),D.on("error",function(pe){pe.code==0||de||(de=!0,q(pe,null))}),D.on("status",function(pe){pe.code==0||de?te&&q(null,null,pe):(de=!0,q({code:pe.code,message:pe.details,metadata:pe.metadata},null))}),te&&D.on("metadata",function(pe){q(null,null,null,pe)}),D.on("end",function(){de||(ae==null?q({code:2,message:"Incomplete response"}):q(null,ae)),te&&q(null,null)})}function zt(D,q){var te=D;return q.forEach(function(ae){var de=te;te=function(pe){return ae.intercept(pe,de)}}),te}st.prototype.on=function(D,q){return D=="data"?this.b.push(q):D=="status"?this.h.push(q):D=="metadata"?this.g.push(q):D=="end"?this.c.push(q):D=="error"&&this.f.push(q),this},st.prototype.removeListener=function(D,q){return D=="data"?Pt(this.b,q):D=="status"?Pt(this.h,q):D=="metadata"?Pt(this.g,q):D=="end"?Pt(this.c,q):D=="error"&&Pt(this.f,q),this},st.prototype.cancel=function(){this.j=!0,this.a.abort()},st.prototype.cancel=st.prototype.cancel,st.prototype.removeListener=st.prototype.removeListener,st.prototype.on=st.prototype.on,tt.prototype.P=function(D,q,te,ae,de){var pe=this;ae=Z(D,q,"unary",ae);var ce=D.substr(0,D.length-ae.name.length);return Xt(D=zt(function(he){return Ft(pe,he,ce)},this.b).call(this,G(ae,q,te)),de,!1),new _(D)},tt.prototype.M=function(D,q,te,ae){var de=this;ae=Z(D,q,"unary",ae);var pe=D.substr(0,D.length-ae.name.length);return zt(function(ce){return new Promise(function(he,Se){var we,Ae,Pe;Xt(Ft(de,ce,pe),function(xe,We,ze,Ge){xe?Se(xe):We?Pe=We:ze?Ae=ze:Ge?we=Ge:(xe=ce.getMethodDescriptor(),he(new m(Pe,xe,We=(We=we)===void 0?{}:We,Ae===void 0?null:Ae)))},!0)})},this.g).call(this,G(ae,q,te)).then(function(ce){return ce.getResponseMessage()})},tt.prototype.unaryCall=function(D,q,te,ae){return this.M(D,q,te,ae)},tt.prototype.R=function(D,q,te,ae){var de=this;ae=Z(D,q,"server_streaming",ae);var pe=D.substr(0,D.length-ae.name.length);return zt(function(ce){return Ft(de,ce,pe)},this.b).call(this,G(ae,q,te))},tt.prototype.serverStreaming=tt.prototype.R,tt.prototype.unaryCall=tt.prototype.unaryCall,tt.prototype.thenableCall=tt.prototype.M,tt.prototype.rpcCall=tt.prototype.P,e.exports.AbstractClientBase={MethodInfo:function(D,q,te,ae,de){this.name=ae,this.b=de,this.f=D,this.a=q,this.c=te}},e.exports.GrpcWebClientBase=tt,e.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15},e.exports.MethodDescriptor=M,e.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming"}}).call(this,n(6))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,o=n(151),l=(r=o)&&r.__esModule?r:{default:r};function u(s){return s[Symbol.toStringTag]==="AsyncFunction"}t.default=function(s){if(typeof s!="function")throw new Error("expected a function");return u(s)?(0,l.default)(s):s},t.isAsync=u,t.isAsyncGenerator=function(s){return s[Symbol.toStringTag]==="AsyncGenerator"},t.isAsyncIterable=function(s){return typeof s[Symbol.asyncIterator]=="function"}},function(e,t,n){var r={};function o(u,s,g){g||(g=Error);var c=function(f){var T,v;function p(d,h,S){return f.call(this,function(I,L,O){return typeof s=="string"?s:s(I,L,O)}(d,h,S))||this}return v=f,(T=p).prototype=Object.create(v.prototype),T.prototype.constructor=T,T.__proto__=v,p}(g);c.prototype.name=g.name,c.prototype.code=u,r[u]=c}function l(u,s){if(Array.isArray(u)){var g=u.length;return u=u.map(function(c){return String(c)}),g>2?"one of ".concat(s," ").concat(u.slice(0,g-1).join(", "),", or ")+u[g-1]:g===2?"one of ".concat(s," ").concat(u[0]," or ").concat(u[1]):"of ".concat(s," ").concat(u[0])}return"of ".concat(s," ").concat(String(u))}o("ERR_INVALID_OPT_VALUE",function(u,s){return'The value "'+s+'" is invalid for option "'+u+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(u,s,g){var c,f,T;if(typeof s=="string"&&(f="not ",s.substr(0,f.length)===f)?(c="must not be",s=s.replace(/^not /,"")):c="must be",function(p,d,h){return(h===void 0||h>p.length)&&(h=p.length),p.substring(h-d.length,h)===d}(u," argument"))T="The ".concat(u," ").concat(c," ").concat(l(s,"type"));else{var v=function(p,d,h){return typeof h!="number"&&(h=0),!(h+d.length>p.length)&&p.indexOf(d,h)!==-1}(u,".")?"property":"argument";T='The "'.concat(u,'" ').concat(v," ").concat(c," ").concat(l(s,"type"))}return T+=". Received type ".concat(typeof g)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var o=Object.keys||function(p){var d=[];for(var h in p)d.push(h);return d};e.exports=f;var l=n(77),u=n(81);n(7)(f,l);for(var s=o(u.prototype),g=0;g<s.length;g++){var c=s[g];f.prototype[c]||(f.prototype[c]=u.prototype[c])}function f(p){if(!(this instanceof f))return new f(p);l.call(this,p),u.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||r.nextTick(v,this)}function v(p){p.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}})}).call(this,n(2))},function(e,t,n){n.d(t,"a",function(){return u});var r=n(40),o=n(4);const l={"app-id":["app-id must match formant/*"]};class u extends r.a{constructor(g,c={}){super(g,Object.assign({validateHeaders:f=>`${f.get("app-id")}`.startsWith("formant/")?{}:l},c)),this.endpoint=g}getHeaders(){return Object.assign(Object.assign({},u.headers),{"App-ID":`formant/${o.a}`,"App-Version":o.j})}}u.headers={}},function(e,t,n){n(226),e.exports={encode:r=>new TextEncoder().encode(r),decode:r=>new TextDecoder().decode(r)}},function(e,t,n){n.d(t,"a",function(){return l});const r=["password","secret","token","key","buffer","authorization"],o=u=>r.some(s=>u.toLowerCase().includes(s.toLowerCase()));function l(u,s=new WeakSet){return s.has(u)?"[ RECURSIVE ]":Array.isArray(u)?(s.add(u),u.map(c=>l(c,s))):!(g=u)||typeof g!="object"&&typeof g!="function"?typeof u=="string"&&o(u)?"[ REDACTED ]":u:(s.add(u),Object.keys(u).reduce((c,f)=>(c[f]=o(f)?"[ REDACTED ]":l(u[f],s),c),{}));var g}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r,o=r.length){if(!o)throw new Error("arity is undefined");return function(...l){return typeof l[o-1]=="function"?r.apply(this,l):new Promise((u,s)=>{l[o-1]=(g,...c)=>{if(g)return s(g);u(c.length>1?c:c[0])},r.apply(this,l)})}},e.exports=t.default},function(e,t,n){(t=e.exports=n(69)).Stream=t,t.Readable=t,t.Writable=n(48),t.Duplex=n(23),t.Transform=n(72),t.PassThrough=n(164)},function(e,t,n){(t=e.exports=n(77)).Stream=t,t.Readable=t,t.Writable=n(81),t.Duplex=n(27),t.Transform=n(82),t.PassThrough=n(183),t.finished=n(49),t.pipeline=n(184)},function(e,t,n){e.exports=function(r){return r}},function(e,t){e.exports=r,r.default=r,r.stable=l,r.stableStringify=l;var n=[];function r(u,s,g){(function T(v,p,d,h){var S;if(typeof v=="object"&&v!==null){for(S=0;S<d.length;S++)if(d[S]===v)return h[p]="[Circular]",void n.push([h,p,v]);if(d.push(v),Array.isArray(v))for(S=0;S<v.length;S++)T(v[S],S,d,v);else{var I=Object.keys(v);for(S=0;S<I.length;S++){var L=I[S];T(v[L],L,d,v)}}d.pop()}})(u,"",[],void 0);for(var c=JSON.stringify(u,s,g);n.length!==0;){var f=n.pop();f[0][f[1]]=f[2]}return c}function o(u,s){return u<s?-1:u>s?1:0}function l(u,s,g){for(var c=function v(p,d,h,S){var I;if(typeof p=="object"&&p!==null){for(I=0;I<h.length;I++)if(h[I]===p)return S[d]="[Circular]",void n.push([S,d,p]);if(typeof p.toJSON=="function")return;if(h.push(p),Array.isArray(p))for(I=0;I<p.length;I++)v(p[I],I,h,p);else{var L={},O=Object.keys(p).sort(o);for(I=0;I<O.length;I++){var R=O[I];v(p[R],R,h,p),L[R]=p[R]}if(S===void 0)return L;n.push([S,d,p]),S[d]=L}h.pop()}}(u,"",[],void 0)||u,f=JSON.stringify(c,s,g);n.length!==0;){var T=n.pop();T[0][T[1]]=T[2]}return f}},function(e,t,n){var r=n(16),o=Object.keys||function(d){var h=[];for(var S in d)h.push(S);return h};e.exports=T;var l=Object.create(n(17));l.inherits=n(7);var u=n(142),s=n(62);l.inherits(T,u);for(var g=o(s.prototype),c=0;c<g.length;c++){var f=g[c];T.prototype[f]||(T.prototype[f]=s.prototype[f])}function T(d){if(!(this instanceof T))return new T(d);u.call(this,d),s.call(this,d),d&&d.readable===!1&&(this.readable=!1),d&&d.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,d&&d.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",v)}function v(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(d){d.end()}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),T.prototype._destroy=function(d,h){this.push(null),this.end(),r.nextTick(h,d)}},function(e,t,n){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function o(s,g){return Object.prototype.hasOwnProperty.call(s,g)}t.assign=function(s){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var c=g.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var f in c)o(c,f)&&(s[f]=c[f])}}return s},t.shrinkBuf=function(s,g){return s.length===g?s:s.subarray?s.subarray(0,g):(s.length=g,s)};var l={arraySet:function(s,g,c,f,T){if(g.subarray&&s.subarray)s.set(g.subarray(c,c+f),T);else for(var v=0;v<f;v++)s[T+v]=g[c+v]},flattenChunks:function(s){var g,c,f,T,v,p;for(f=0,g=0,c=s.length;g<c;g++)f+=s[g].length;for(p=new Uint8Array(f),T=0,g=0,c=s.length;g<c;g++)v=s[g],p.set(v,T),T+=v.length;return p}},u={arraySet:function(s,g,c,f,T){for(var v=0;v<f;v++)s[T+v]=g[c+v]},flattenChunks:function(s){return[].concat.apply([],s)}};t.setTyped=function(s){s?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,l)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,u))},t.setTyped(r)},function(e,t,n){e.exports=n(185)},function(e,t,n){n.d(t,"a",function(){return o});var r=n(228);const o=Object(r.a)()},function(e,t,n){n.d(t,"a",function(){return h});var r=n(100),o=n.n(r),l=n(1);class u extends Error{constructor(I,L,O){super(`Connection failure: ${I.message}`),this.cause=I,this.url=L,this.retryable=O}}var s=n(8),g=n(0),c=n(11),f=n(10);class T extends Error{constructor(I,L){super(`Invalid headers (${JSON.stringify(I)}) for response: ${L.message}`),this.validationErrors=I,this.responseError=L}}var v=function(S,I,L,O){return new(L||(L=Promise))(function(R,m){function M(_){try{Z(O.next(_))}catch(y){m(y)}}function G(_){try{Z(O.throw(_))}catch(y){m(y)}}function Z(_){var y;_.done?R(_.value):(y=_.value,y instanceof L?y:new L(function(C){C(y)})).then(M,G)}Z((O=O.apply(S,I||[])).next())})},p=function(S,I){var L={};for(var O in S)Object.prototype.hasOwnProperty.call(S,O)&&I.indexOf(O)<0&&(L[O]=S[O]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(O=Object.getOwnPropertySymbols(S);R<O.length;R++)I.indexOf(O[R])<0&&Object.prototype.propertyIsEnumerable.call(S,O[R])&&(L[O[R]]=S[O[R]])}return L};const d=new Set(["GET","HEAD","PUT","QUERY","DELETE","OPTIONS","TRACE"]);class h{constructor(I,L={}){if(this.endpoint=I,this.validateHeaders=O=>L.validateHeaders?L.validateHeaders(O):{},this.verbose=L.verbose!==!1,L.retries!==void 0&&!(L.retries>=0))throw new Error("retries must be positive or zero");if(this.configuredRetries=L.retries,L.timeoutMs!==void 0&&!(L.timeoutMs>0))throw new Error("timeoutMs must be positive");if(this.timeoutMs=L.timeoutMs,L.maxBackoffDelayMs!==void 0&&!(L.maxBackoffDelayMs>0))throw new Error("maxBackoffDelayMs must be positive");this.maxBackoffDelayMs=L.maxBackoffDelayMs||30*l.a.second,this.json=L.json!==!1}getRetries(){return this.configuredRetries!==void 0?this.configuredRetries:this.getConstructor().retries}getHeaders(){return{}}fetch(I,L={}){return v(this,void 0,void 0,function*(){return(yield this.fetchVerbose(I,L)).body})}fetchVerbose(I,L={}){return v(this,void 0,void 0,function*(){let O=100*l.a.millisecond,R=0;const m=this.timeoutMs!==void 0?new Date().getTime()+this.timeoutMs:void 0,M=m?()=>Math.max(m-new Date().getTime(),0):void 0;for(;;)try{return yield this.doFetch(I,L,M)}catch(G){const Z=G,_=Object(c.a)(Z,u);if((M==null?void 0:M())===0||R===this.getRetries()||!_.retryable)throw _;R++,O=Math.min(...M?[M()]:[],O*(2+.1*(Math.random()-.5)),this.maxBackoffDelayMs),yield Object(s.a)(O),this.verbose&&g.a.warn(`Connection failure, retrying. Error: ${Z.cause.message}`,{url:Z.url,error:Z.cause,attempt:R})}})}doFetch(I,L,O){return v(this,void 0,void 0,function*(){const{token:R,json:m=this.json,allowUnsafeRetries:M}=L,G=p(L,["token","json","allowUnsafeRetries"]),Z=(G.method||"GET").toUpperCase(),_=this.endpoint!==void 0?`${this.endpoint}${I?`/${I}`:""}`:I,y=new AbortController;let C;if(O){const w=O();w>0?C=setTimeout(()=>{y.abort()},w):y.abort()}try{let w;yield Promise.race([this.getConstructor().waitForConnectivity(),new Promise(A=>{w=setTimeout(A,O?Math.min(l.a.minute,O()):l.a.minute)})]),w&&clearTimeout(w);const x=yield o()(_,Object.assign(Object.assign(Object.assign({},G),G.body!==void 0?{body:m!==!1?JSON.stringify(G.body):G.body}:{}),{headers:Object.assign(Object.assign(Object.assign(Object.assign({},m!==!1?{"Content-Type":"application/json"}:{}),this.getHeaders()),G.headers||{}),R!==void 0?{Authorization:`Bearer ${R}`}:{}),signal:y.signal})),H=x.headers.get("content-type")||"",U=H&&H.startsWith("application/json"),N=U?yield x.json():yield x.text(),k=()=>new f.a(Z,_,G.body,x.status,x.headers,N,N&&N.validationErrors||{});if(!x.ok)throw this.verbose&&g.a[x.status>=500?"warn":"info"]("Response error",{method:Z,url:_,statusCode:x.status}),k();const F=this.validateHeaders(x.headers);if(Object.keys(F).length!==0)throw new T(F,k());if(x.status===204)return{body:void 0,headers:x.headers};if(m&&!U)throw new Error(`Response is not JSON: ${JSON.stringify(N)}`);return{body:N,headers:x.headers}}catch(w){const x=w,H=M||d.has(Z);if(x.message==="Network request failed")throw new u(x,_,H);if(x.type==="system"&&["EAI_AGAIN","ECONNREFUSED","EHOSTUNREACH","ENOTFOUND"].find(F=>F===x.code))throw new u(x,_,!0);if(x.type==="system"&&["ETIMEDOUT","ECONNRESET","ESOCKETTIMEDOUT","EPIPE"].find(F=>F===x.code))throw new u(x,_,H);if(x.name==="AbortError")throw new u(x,_,H);const U=Object(c.a)(x,f.a),{statusCode:N}=U;if(N===408||N===429||N===502||N===503||N===504)throw this.verbose&&!H&&g.a.warn("Potentially unsafe retry"),new u(x,_,!0);const k=this.validateHeaders(U.headers);throw Object.keys(k).length!==0?new T(k,U):(yield this.getConstructor().onResponseError(U),x)}finally{C&&clearTimeout(C)}})}getConstructor(){return Object.getPrototypeOf(this).constructor}}h.retries=8,h.waitForConnectivity=()=>v(void 0,void 0,void 0,function*(){}),h.onResponseError=()=>v(void 0,void 0,void 0,function*(){})},function(e,t,n){function r(T,v){if(!(T instanceof v))throw new TypeError("Cannot call a class as a function")}function o(T,v){for(var p=0;p<v.length;p++){var d=v[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}var l=n(59),u=n(3),s=u.LEVEL,g=u.MESSAGE;l.enabled=!0;var c=/\s+/,f=function(){function T(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,T),h.colors&&this.addColors(h.colors),this.options=h}var v,p,d;return v=T,d=[{key:"addColors",value:function(h){var S=Object.keys(h).reduce(function(I,L){return I[L]=c.test(h[L])?h[L].split(c):h[L],I},{});return T.allColors=Object.assign({},T.allColors||{},S),T.allColors}}],(p=[{key:"addColors",value:function(h){return T.addColors(h)}},{key:"colorize",value:function(h,S,I){if(I===void 0&&(I=S),!Array.isArray(T.allColors[h]))return l[T.allColors[h]](I);for(var L=0,O=T.allColors[h].length;L<O;L++)I=l[T.allColors[h][L]](I);return I}},{key:"transform",value:function(h,S){return S.all&&typeof h[g]=="string"&&(h[g]=this.colorize(h[s],h.level,h[g])),(S.level||S.all||!S.message)&&(h.level=this.colorize(h[s],h.level)),(S.all||S.message)&&(h.message=this.colorize(h[s],h.level,h.message)),h}}])&&o(v.prototype,p),d&&o(v,d),T}();e.exports=function(T){return new f(T)},e.exports.Colorizer=e.exports.Format=f},function(e,t){var n={}.toString;e.exports=Array.isArray||function(r){return n.call(r)=="[object Array]"}},function(e,t,n){(function(r){function o(l){try{if(!r.localStorage)return!1}catch{return!1}var u=r.localStorage[l];return u!=null&&String(u).toLowerCase()==="true"}e.exports=function(l,u){if(o("noDeprecation"))return l;var s=!1;return function(){if(!s){if(o("throwDeprecation"))throw new Error(u);o("traceDeprecation")?console.trace(u):console.warn(u),s=!0}return l.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=o(s);return g!==void 0?typeof c=="string"?f.fill(g,c):f.fill(g):f.fill(0),f},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1==0},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=o(s);return g!==void 0?typeof c=="string"?f.fill(g,c):f.fill(g):f.fill(0),f},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){(function(r,o,l){var u=n(16);function s(y){var C=this;this.next=null,this.entry=null,this.finish=function(){(function(w,x,H){var U=w.entry;for(w.entry=null;U;){var N=U.callback;x.pendingcb--,N(H),U=U.next}x.corkedRequestsFree?x.corkedRequestsFree.next=w:x.corkedRequestsFree=w})(C,y)}}e.exports=O;var g,c=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?o:u.nextTick;O.WritableState=L;var f=n(17);f.inherits=n(7);var T={deprecate:n(43)},v=n(70),p=n(47).Buffer,d=l.Uint8Array||function(){},h,S=n(71);function I(){}function L(y,C){g=g||n(23),y=y||{};var w=C instanceof g;this.objectMode=!!y.objectMode,w&&(this.objectMode=this.objectMode||!!y.writableObjectMode);var x=y.highWaterMark,H=y.writableHighWaterMark,U=this.objectMode?16:16384;this.highWaterMark=x||x===0?x:w&&(H||H===0)?H:U,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var N=y.decodeStrings===!1;this.decodeStrings=!N,this.defaultEncoding=y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(k){(function(F,A){var b=F._writableState,B=b.sync,W=b.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(b),A)(function(ee,ne,X,$,E){--ne.pendingcb,X?(u.nextTick(E,$),u.nextTick(_,ee,ne),ee._writableState.errorEmitted=!0,ee.emit("error",$)):(E($),ee._writableState.errorEmitted=!0,ee.emit("error",$),_(ee,ne))})(F,b,B,A,W);else{var Q=G(b);Q||b.corked||b.bufferProcessing||!b.bufferedRequest||M(F,b),B?c(m,F,b,Q,W):m(F,b,Q,W)}})(C,k)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function O(y){if(g=g||n(23),!(h.call(O,this)||this instanceof g))return new O(y);this._writableState=new L(y,this),this.writable=!0,y&&(typeof y.write=="function"&&(this._write=y.write),typeof y.writev=="function"&&(this._writev=y.writev),typeof y.destroy=="function"&&(this._destroy=y.destroy),typeof y.final=="function"&&(this._final=y.final)),v.call(this)}function R(y,C,w,x,H,U,N){C.writelen=x,C.writecb=N,C.writing=!0,C.sync=!0,w?y._writev(H,C.onwrite):y._write(H,U,C.onwrite),C.sync=!1}function m(y,C,w,x){w||function(H,U){U.length===0&&U.needDrain&&(U.needDrain=!1,H.emit("drain"))}(y,C),C.pendingcb--,x(),_(y,C)}function M(y,C){C.bufferProcessing=!0;var w=C.bufferedRequest;if(y._writev&&w&&w.next){var x=C.bufferedRequestCount,H=new Array(x),U=C.corkedRequestsFree;U.entry=w;for(var N=0,k=!0;w;)H[N]=w,w.isBuf||(k=!1),w=w.next,N+=1;H.allBuffers=k,R(y,C,!0,C.length,H,"",U.finish),C.pendingcb++,C.lastBufferedRequest=null,U.next?(C.corkedRequestsFree=U.next,U.next=null):C.corkedRequestsFree=new s(C),C.bufferedRequestCount=0}else{for(;w;){var F=w.chunk,A=w.encoding,b=w.callback;if(R(y,C,!1,C.objectMode?1:F.length,F,A,b),w=w.next,C.bufferedRequestCount--,C.writing)break}w===null&&(C.lastBufferedRequest=null)}C.bufferedRequest=w,C.bufferProcessing=!1}function G(y){return y.ending&&y.length===0&&y.bufferedRequest===null&&!y.finished&&!y.writing}function Z(y,C){y._final(function(w){C.pendingcb--,w&&y.emit("error",w),C.prefinished=!0,y.emit("prefinish"),_(y,C)})}function _(y,C){var w=G(C);return w&&(function(x,H){H.prefinished||H.finalCalled||(typeof x._final=="function"?(H.pendingcb++,H.finalCalled=!0,u.nextTick(Z,x,H)):(H.prefinished=!0,x.emit("prefinish")))}(y,C),C.pendingcb===0&&(C.finished=!0,y.emit("finish"))),w}f.inherits(O,v),L.prototype.getBuffer=function(){for(var y=this.bufferedRequest,C=[];y;)C.push(y),y=y.next;return C},function(){try{Object.defineProperty(L.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(y){return!!h.call(this,y)||this===O&&y&&y._writableState instanceof L}})):h=function(y){return y instanceof this},O.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},O.prototype.write=function(y,C,w){var x,H=this._writableState,U=!1,N=!H.objectMode&&(x=y,p.isBuffer(x)||x instanceof d);return N&&!p.isBuffer(y)&&(y=function(k){return p.from(k)}(y)),typeof C=="function"&&(w=C,C=null),N?C="buffer":C||(C=H.defaultEncoding),typeof w!="function"&&(w=I),H.ended?function(k,F){var A=new Error("write after end");k.emit("error",A),u.nextTick(F,A)}(this,w):(N||function(k,F,A,b){var B=!0,W=!1;return A===null?W=new TypeError("May not write null values to stream"):typeof A=="string"||A===void 0||F.objectMode||(W=new TypeError("Invalid non-string/buffer chunk")),W&&(k.emit("error",W),u.nextTick(b,W),B=!1),B}(this,H,y,w))&&(H.pendingcb++,U=function(k,F,A,b,B,W){if(!A){var Q=function($,E,j){return $.objectMode||$.decodeStrings===!1||typeof E!="string"||(E=p.from(E,j)),E}(F,b,B);b!==Q&&(A=!0,B="buffer",b=Q)}var ee=F.objectMode?1:b.length;F.length+=ee;var ne=F.length<F.highWaterMark;if(ne||(F.needDrain=!0),F.writing||F.corked){var X=F.lastBufferedRequest;F.lastBufferedRequest={chunk:b,encoding:B,isBuf:A,callback:W,next:null},X?X.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else R(k,F,!1,ee,b,B,W);return ne}(this,H,N,y,C,w)),U},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var y=this._writableState;y.corked&&(y.corked--,y.writing||y.corked||y.finished||y.bufferProcessing||!y.bufferedRequest||M(this,y))},O.prototype.setDefaultEncoding=function(y){if(typeof y=="string"&&(y=y.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((y+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+y);return this._writableState.defaultEncoding=y,this},Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(y,C,w){w(new Error("_write() is not implemented"))},O.prototype._writev=null,O.prototype.end=function(y,C,w){var x=this._writableState;typeof y=="function"?(w=y,y=null,C=null):typeof C=="function"&&(w=C,C=null),y!=null&&this.write(y,C),x.corked&&(x.corked=1,this.uncork()),x.ending||x.finished||function(H,U,N){U.ending=!0,_(H,U),N&&(U.finished?u.nextTick(N):H.once("finish",N)),U.ended=!0,H.writable=!1}(this,x,w)},Object.defineProperty(O.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(y){this._writableState&&(this._writableState.destroyed=y)}}),O.prototype.destroy=S.destroy,O.prototype._undestroy=S.undestroy,O.prototype._destroy=function(y,C){this.end(),C(y)}}).call(this,n(2),n(15).setImmediate,n(6))},function(e,t,n){var r=n(26).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function l(u,s,g){if(typeof s=="function")return l(u,null,s);s||(s={}),g=function(O){var R=!1;return function(){if(!R){R=!0;for(var m=arguments.length,M=new Array(m),G=0;G<m;G++)M[G]=arguments[G];O.apply(this,M)}}}(g||o);var c=s.readable||s.readable!==!1&&u.readable,f=s.writable||s.writable!==!1&&u.writable,T=function(){u.writable||p()},v=u._writableState&&u._writableState.finished,p=function(){f=!1,v=!0,c||g.call(u)},d=u._readableState&&u._readableState.endEmitted,h=function(){c=!1,d=!0,f||g.call(u)},S=function(O){g.call(u,O)},I=function(){var O;return c&&!d?(u._readableState&&u._readableState.ended||(O=new r),g.call(u,O)):f&&!v?(u._writableState&&u._writableState.ended||(O=new r),g.call(u,O)):void 0},L=function(){u.req.on("finish",p)};return function(O){return O.setHeader&&typeof O.abort=="function"}(u)?(u.on("complete",p),u.on("abort",I),u.req?L():u.on("request",L)):f&&!u._writableState&&(u.on("end",T),u.on("close",T)),u.on("end",h),u.on("finish",p),s.error!==!1&&u.on("error",S),u.on("close",I),function(){u.removeListener("complete",p),u.removeListener("abort",I),u.removeListener("request",L),u.req&&u.req.removeListener("finish",p),u.removeListener("end",T),u.removeListener("close",T),u.removeListener("finish",p),u.removeListener("end",h),u.removeListener("error",S),u.removeListener("close",I)}}},function(e,t,n){var r=n(58),o=n(3).configs;t.cli=r.levels(o.cli),t.npm=r.levels(o.npm),t.syslog=r.levels(o.syslog),t.addColors=r.levels},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(202)),o=s(n(203)),l=s(n(25)),u=s(n(31));function s(g){return g&&g.__esModule?g:{default:g}}t.default=(0,u.default)(function(g,c,f){return(0,r.default)(g,(0,o.default)((0,l.default)(c)),f)},3),e.exports=t.default},function(e,t,n){class r extends Error{constructor(l,...u){super(`env-var: ${l}`,...u),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="EnvVarError"}}e.exports=r},function(e,t,n){e.exports=function(r){const o=parseInt(r,10);if(isNaN(o)||o.toString(10)!==r)throw new Error("should be a valid integer");return o}},function(e,t,n){e.exports=function(r){const o=parseFloat(r);if(isNaN(o)||isNaN(r))throw new Error("should be a valid float");return o}},function(e,t,n){e.exports=function(r){try{return JSON.parse(r)}catch{throw new Error("should be valid (parseable) JSON")}}},function(e,t,n){(function(r){function o(s,g){for(var c=0,f=s.length-1;f>=0;f--){var T=s[f];T==="."?s.splice(f,1):T===".."?(s.splice(f,1),c++):c&&(s.splice(f,1),c--)}if(g)for(;c--;c)s.unshift("..");return s}function l(s,g){if(s.filter)return s.filter(g);for(var c=[],f=0;f<s.length;f++)g(s[f],f,s)&&c.push(s[f]);return c}t.resolve=function(){for(var s="",g=!1,c=arguments.length-1;c>=-1&&!g;c--){var f=c>=0?arguments[c]:r.cwd();if(typeof f!="string")throw new TypeError("Arguments to path.resolve must be strings");f&&(s=f+"/"+s,g=f.charAt(0)==="/")}return(g?"/":"")+(s=o(l(s.split("/"),function(T){return!!T}),!g).join("/"))||"."},t.normalize=function(s){var g=t.isAbsolute(s),c=u(s,-1)==="/";return(s=o(l(s.split("/"),function(f){return!!f}),!g).join("/"))||g||(s="."),s&&c&&(s+="/"),(g?"/":"")+s},t.isAbsolute=function(s){return s.charAt(0)==="/"},t.join=function(){var s=Array.prototype.slice.call(arguments,0);return t.normalize(l(s,function(g,c){if(typeof g!="string")throw new TypeError("Arguments to path.join must be strings");return g}).join("/"))},t.relative=function(s,g){function c(S){for(var I=0;I<S.length&&S[I]==="";I++);for(var L=S.length-1;L>=0&&S[L]==="";L--);return I>L?[]:S.slice(I,L-I+1)}s=t.resolve(s).substr(1),g=t.resolve(g).substr(1);for(var f=c(s.split("/")),T=c(g.split("/")),v=Math.min(f.length,T.length),p=v,d=0;d<v;d++)if(f[d]!==T[d]){p=d;break}var h=[];for(d=p;d<f.length;d++)h.push("..");return(h=h.concat(T.slice(p))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(s){if(typeof s!="string"&&(s+=""),s.length===0)return".";for(var g=s.charCodeAt(0),c=g===47,f=-1,T=!0,v=s.length-1;v>=1;--v)if((g=s.charCodeAt(v))===47){if(!T){f=v;break}}else T=!1;return f===-1?c?"/":".":c&&f===1?"/":s.slice(0,f)},t.basename=function(s,g){var c=function(f){typeof f!="string"&&(f+="");var T,v=0,p=-1,d=!0;for(T=f.length-1;T>=0;--T)if(f.charCodeAt(T)===47){if(!d){v=T+1;break}}else p===-1&&(d=!1,p=T+1);return p===-1?"":f.slice(v,p)}(s);return g&&c.substr(-1*g.length)===g&&(c=c.substr(0,c.length-g.length)),c},t.extname=function(s){typeof s!="string"&&(s+="");for(var g=-1,c=0,f=-1,T=!0,v=0,p=s.length-1;p>=0;--p){var d=s.charCodeAt(p);if(d!==47)f===-1&&(T=!1,f=p+1),d===46?g===-1?g=p:v!==1&&(v=1):g!==-1&&(v=-1);else if(!T){c=p+1;break}}return g===-1||f===-1||v===0||v===1&&g===f-1&&g===c+1?"":s.slice(g,f)};var u="ab".substr(-1)==="b"?function(s,g,c){return s.substr(g,c)}:function(s,g,c){return g<0&&(g=s.length+g),s.substr(g,c)}}).call(this,n(2))},,function(e,t,n){var r=t.format=n(12);t.levels=n(104),Object.defineProperty(r,"align",{value:n(121)}),Object.defineProperty(r,"cli",{value:n(122)}),Object.defineProperty(r,"combine",{value:n(123)}),Object.defineProperty(r,"colorize",{value:n(41)}),Object.defineProperty(r,"json",{value:n(124)}),Object.defineProperty(r,"label",{value:n(127)}),Object.defineProperty(r,"logstash",{value:n(128)}),Object.defineProperty(r,"metadata",{value:n(129)}),Object.defineProperty(r,"padLevels",{value:n(60)}),Object.defineProperty(r,"prettyPrint",{value:n(130)}),Object.defineProperty(r,"printf",{value:n(131)}),Object.defineProperty(r,"simple",{value:n(132)}),Object.defineProperty(r,"splat",{value:n(133)}),Object.defineProperty(r,"timestamp",{value:n(134)}),Object.defineProperty(r,"uncolorize",{value:n(136)})},function(e,t,n){var r=n(105);e.exports=r},function(e,t,n){function r(v){return function(p){if(Array.isArray(p))return o(p)}(v)||function(p){if(typeof Symbol<"u"&&Symbol.iterator in Object(p))return Array.from(p)}(v)||function(p,d){if(p){if(typeof p=="string")return o(p,d);var h=Object.prototype.toString.call(p).slice(8,-1);if(h==="Object"&&p.constructor&&(h=p.constructor.name),h==="Map"||h==="Set")return Array.from(p);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return o(p,d)}}(v)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
20
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(v,p){(p==null||p>v.length)&&(p=v.length);for(var d=0,h=new Array(p);d<p;d++)h[d]=v[d];return h}function l(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function u(v,p){for(var d=0;d<p.length;d++){var h=p[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(v,h.key,h)}}var s=n(3),g=s.configs,c=s.LEVEL,f=s.MESSAGE,T=function(){function v(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{levels:g.npm.levels};l(this,v),this.paddings=v.paddingForLevels(S.levels,S.filler),this.options=S}var p,d,h;return p=v,h=[{key:"getLongestLevel",value:function(S){var I=Object.keys(S).map(function(L){return L.length});return Math.max.apply(Math,r(I))}},{key:"paddingForLevel",value:function(S,I,L){var O=L+1-S.length,R=Math.floor(O/I.length);return"".concat(I).concat(I.repeat(R)).slice(0,O)}},{key:"paddingForLevels",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ",L=v.getLongestLevel(S);return Object.keys(S).reduce(function(O,R){return O[R]=v.paddingForLevel(R,I,L),O},{})}}],(d=[{key:"transform",value:function(S,I){return S.message="".concat(this.paddings[S[c]]).concat(S.message),S[f]&&(S[f]="".concat(this.paddings[S[c]]).concat(S[f])),S}}])&&u(p.prototype,d),h&&u(p,h),v}();e.exports=function(v){return new T(v)},e.exports.Padder=e.exports.Format=T},function(e,t,n){var r=n(13).format;t.warn={deprecated:function(o){return function(){throw new Error(r("{ %s } was removed in winston@3.0.0.",o))}},useFormat:function(o){return function(){throw new Error([r("{ %s } was removed in winston@3.0.0.",o),"Use a custom winston.format = winston.format(function) instead."].join(`
13
+ `).map(function(te){return" "+te}).join(`
14
+ `)):Q=D.stylize("[Circular]","special")),E(q)){if(V&&A.match(/^\d+$/))return Q;(q=JSON.stringify(""+A)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(q=q.substr(1,q.length-2),q=D.stylize(q,"name")):(q=q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),q=D.stylize(q,"string"))}return q+": "+Q}function f(D){return Array.isArray(D)}function p(D){return typeof D=="boolean"}function S(D){return D===null}function N(D){return typeof D=="number"}function B(D){return typeof D=="string"}function E(D){return D===void 0}function T(D){return h(D)&&m(D)==="[object RegExp]"}function h(D){return typeof D=="object"&&D!==null}function R(D){return h(D)&&m(D)==="[object Date]"}function W(D){return h(D)&&(m(D)==="[object Error]"||D instanceof Error)}function X(D){return typeof D=="function"}function m(D){return Object.prototype.toString.call(D)}function _(D){return D<10?"0"+D.toString(10):D.toString(10)}t.debuglog=function(D){if(E(u)&&(u=r.env.NODE_DEBUG||""),D=D.toUpperCase(),!s[D])if(new RegExp("\\b"+D+"\\b","i").test(u)){var O=r.pid;s[D]=function(){var L=t.format.apply(t,arguments);console.error("%s %d: %s",D,O,L)}}else s[D]=function(){};return s[D]},t.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=f,t.isBoolean=p,t.isNull=S,t.isNullOrUndefined=function(D){return D==null},t.isNumber=N,t.isString=B,t.isSymbol=function(D){return typeof D=="symbol"},t.isUndefined=E,t.isRegExp=T,t.isObject=h,t.isDate=R,t.isError=W,t.isFunction=X,t.isPrimitive=function(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||D===void 0},t.isBuffer=n(105);var G=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function j(){var D=new Date,O=[_(D.getHours()),_(D.getMinutes()),_(D.getSeconds())].join(":");return[D.getDate(),G[D.getMonth()],O].join(" ")}function C(D,O){return Object.prototype.hasOwnProperty.call(D,O)}t.log=function(){console.log("%s - %s",j(),t.format.apply(t,arguments))},t.inherits=n(106),t._extend=function(D,O){if(!O||!h(O))return D;for(var L=Object.keys(O),U=L.length;U--;)D[L[U]]=O[L[U]];return D};var z=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function P(D,O){if(!D){var L=new Error("Promise was rejected with a falsy value");L.reason=D,D=L}return O(D)}t.promisify=function(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');if(z&&D[z]){var O;if(typeof(O=D[z])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(O,z,{value:O,enumerable:!1,writable:!1,configurable:!0}),O}function O(){for(var L,U,A=new Promise(function(Q,ee){L=Q,U=ee}),V=[],q=0;q<arguments.length;q++)V.push(arguments[q]);V.push(function(Q,ee){Q?U(Q):L(ee)});try{D.apply(this,V)}catch(Q){U(Q)}return A}return Object.setPrototypeOf(O,Object.getPrototypeOf(D)),z&&Object.defineProperty(O,z,{value:O,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(O,o(D))},t.promisify.custom=z,t.callbackify=function(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function O(){for(var L=[],U=0;U<arguments.length;U++)L.push(arguments[U]);var A=L.pop();if(typeof A!="function")throw new TypeError("The last argument must be of type Function");var V=this,q=function(){return A.apply(V,arguments)};D.apply(this,L).then(function(Q){r.nextTick(q,null,Q)},function(Q){r.nextTick(P,Q,q)})}return Object.setPrototypeOf(O,Object.getPrototypeOf(D)),Object.defineProperties(O,o(D)),O}}).call(this,n(2))},function(e,t,n){var r=n(13),o=n(61),l=n(3).LEVEL,u=e.exports=function(){var s=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.call(this,{objectMode:!0,highWaterMark:g.highWaterMark}),this.format=g.format,this.level=g.level,this.handleExceptions=g.handleExceptions,this.handleRejections=g.handleRejections,this.silent=g.silent,g.log&&(this.log=g.log),g.logv&&(this.logv=g.logv),g.close&&(this.close=g.close),this.once("pipe",function(c){s.levels=c.levels,s.parent=c}),this.once("unpipe",function(c){c===s.parent&&(s.parent=null,s.close&&s.close())})};r.inherits(u,o),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);var d=this.level||this.parent&&this.parent.level;if(!d||this.levels[d]>=this.levels[s[l]]){if(s&&!this.format)return this.log(s,c);var w=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s),this.format.options)}catch(y){w=y}if(w||!v){if(c(),w)throw w;return}return this.log(v,c)}return this._writableState.sync=!1,c(null)},u.prototype._writev=function(s,g){if(this.logv){var c=s.filter(this._accept,this);return c.length?this.logv(c,g):g(null)}for(var d=0;d<s.length;d++)if(this._accept(s[d]))if(!s[d].chunk||this.format){var w=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s[d].chunk),this.format.options)}catch(y){w=y}if(w||!v){if(s[d].callback(),w)throw g(null),w}else this.log(v,s[d].callback)}else this.log(s[d].chunk,s[d].callback);return g(null)},u.prototype._accept=function(s){var g=s.chunk;if(this.silent)return!1;var c=this.level||this.parent&&this.parent.level;return!(g.exception!==!0&&c&&!(this.levels[c]>=this.levels[g[l]])||!this.handleExceptions&&g.exception===!0)},u.prototype._nop=function(){},e.exports.LegacyTransportStream=n(151)},function(e,t,n){e.exports=function(r,o){o||(o={}),typeof o=="function"&&(o={cmp:o});var l,u=typeof o.cycles=="boolean"&&o.cycles,s=o.cmp&&(l=o.cmp,function(c){return function(d,w){var v={key:d,value:c[d]},y={key:w,value:c[w]};return l(v,y)}}),g=[];return function c(d){if(d&&d.toJSON&&typeof d.toJSON=="function"&&(d=d.toJSON()),d!==void 0){if(typeof d=="number")return isFinite(d)?""+d:"null";if(typeof d!="object")return JSON.stringify(d);var w,v;if(Array.isArray(d)){for(v="[",w=0;w<d.length;w++)w&&(v+=","),v+=c(d[w])||"null";return v+"]"}if(d===null)return"null";if(g.indexOf(d)!==-1){if(u)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var y=g.push(d)-1,f=Object.keys(d).sort(s&&s(d));for(v="",w=0;w<f.length;w++){var p=f[w],S=c(d[p]);S&&(v&&(v+=","),v+=JSON.stringify(p)+":"+S)}return g.splice(y,1),"{"+v+"}"}}(r)}},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return typeof location<"u"?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return typeof navigator<"u"?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL=`
15
+ `,t.homedir=function(){return"/"}},function(e,t,n){(function(r){var o;function l(M){var Z=0;return function(){return Z<M.length?{done:!1,value:M[Z++]}:{done:!0}}}var u=typeof Object.defineProperties=="function"?Object.defineProperty:function(M,Z,re){M!=Array.prototype&&M!=Object.prototype&&(M[Z]=re.value)},s=function(M){M=[typeof window=="object"&&window,typeof self=="object"&&self,typeof r=="object"&&r,M];for(var Z=0;Z<M.length;++Z){var re=M[Z];if(re&&re.Math==Math)return re}throw Error("Cannot find global object")}(this);function g(){g=function(){},s.Symbol||(s.Symbol=w)}function c(M,Z){this.a=M,u(this,"description",{configurable:!0,writable:!0,value:Z})}c.prototype.toString=function(){return this.a};var d,w=(d=0,function M(Z){if(this instanceof M)throw new TypeError("Symbol is not a constructor");return new c("jscomp_symbol_"+(Z||"")+"_"+d++,Z)});function v(){g();var M=s.Symbol.iterator;M||(M=s.Symbol.iterator=s.Symbol("Symbol.iterator")),typeof Array.prototype[M]!="function"&&u(Array.prototype,M,{configurable:!0,writable:!0,value:function(){return function(Z){return v(),(Z={next:Z})[s.Symbol.iterator]=function(){return this},Z}(l(this))}}),v=function(){}}function y(M){var Z=typeof Symbol<"u"&&Symbol.iterator&&M[Symbol.iterator];return Z?Z.call(M):{next:l(M)}}var f,p=typeof Object.create=="function"?Object.create:function(M){function Z(){}return Z.prototype=M,new Z};if(typeof Object.setPrototypeOf=="function")f=Object.setPrototypeOf;else{var S;e:{var N={};try{N.__proto__={V:!0},S=N.V;break e}catch{}S=!1}f=S?function(M,Z){if(M.__proto__=Z,M.__proto__!==Z)throw new TypeError(M+" is not extensible");return M}:null}var B=f;function E(M,Z){if(M.prototype=p(Z.prototype),M.prototype.constructor=M,B)B(M,Z);else for(var re in Z)if(re!="prototype")if(Object.defineProperties){var ae=Object.getOwnPropertyDescriptor(Z,re);ae&&Object.defineProperty(M,re,ae)}else M[re]=Z[re];M.O=Z.prototype}function T(M,Z){if(Z){var re=s;M=M.split(".");for(var ae=0;ae<M.length-1;ae++){var de=M[ae];de in re||(re[de]={}),re=re[de]}(Z=Z(ae=re[M=M[M.length-1]]))!=ae&&Z!=null&&u(re,M,{configurable:!0,writable:!0,value:Z})}}T("Array.prototype.keys",function(M){return M||function(){return function(Z,re){v(),Z instanceof String&&(Z+="");var ae=0,de={next:function(){if(ae<Z.length){var me=ae++;return{value:re(me,Z[me]),done:!1}}return de.next=function(){return{done:!0,value:void 0}},de.next()}};return de[Symbol.iterator]=function(){return de},de}(this,function(Z){return Z})}}),T("Array.prototype.find",function(M){return M||function(Z,re){e:{var ae=this;ae instanceof String&&(ae=String(ae));for(var de=ae.length,me=0;me<de;me++){var ge=ae[me];if(Z.call(re,ge,me,ae)){Z=ge;break e}}Z=void 0}return Z}}),T("Object.is",function(M){return M||function(Z,re){return Z===re?Z!==0||1/Z==1/re:Z!=Z&&re!=re}}),T("Array.prototype.includes",function(M){return M||function(Z,re){var ae=this;ae instanceof String&&(ae=String(ae));var de=ae.length;for(0>(re=re||0)&&(re=Math.max(re+de,0));re<de;re++){var me=ae[re];if(me===Z||Object.is(me,Z))return!0}return!1}}),T("Promise",function(M){function Z(ge){this.b=0,this.c=void 0,this.a=[];var ye=this.f();try{ge(ye.resolve,ye.reject)}catch(ve){ye.reject(ve)}}function re(){this.a=null}function ae(ge){return ge instanceof Z?ge:new Z(function(ye){ye(ge)})}if(M)return M;re.prototype.b=function(ge){if(this.a==null){this.a=[];var ye=this;this.c(function(){ye.g()})}this.a.push(ge)};var de=s.setTimeout;re.prototype.c=function(ge){de(ge,0)},re.prototype.g=function(){for(;this.a&&this.a.length;){var ge=this.a;this.a=[];for(var ye=0;ye<ge.length;++ye){var ve=ge[ye];ge[ye]=null;try{ve()}catch(Re){this.f(Re)}}}this.a=null},re.prototype.f=function(ge){this.c(function(){throw ge})},Z.prototype.f=function(){function ge(Re){return function(Ce){ve||(ve=!0,Re.call(ye,Ce))}}var ye=this,ve=!1;return{resolve:ge(this.s),reject:ge(this.g)}},Z.prototype.s=function(ge){if(ge===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(ge instanceof Z)this.v(ge);else{e:switch(typeof ge){case"object":var ye=ge!=null;break e;case"function":ye=!0;break e;default:ye=!1}ye?this.m(ge):this.h(ge)}},Z.prototype.m=function(ge){var ye=void 0;try{ye=ge.then}catch(ve){return void this.g(ve)}typeof ye=="function"?this.w(ye,ge):this.h(ge)},Z.prototype.g=function(ge){this.i(2,ge)},Z.prototype.h=function(ge){this.i(1,ge)},Z.prototype.i=function(ge,ye){if(this.b!=0)throw Error("Cannot settle("+ge+", "+ye+"): Promise already settled in state"+this.b);this.b=ge,this.c=ye,this.l()},Z.prototype.l=function(){if(this.a!=null){for(var ge=0;ge<this.a.length;++ge)me.b(this.a[ge]);this.a=null}};var me=new re;return Z.prototype.v=function(ge){var ye=this.f();ge.F(ye.resolve,ye.reject)},Z.prototype.w=function(ge,ye){var ve=this.f();try{ge.call(ye,ve.resolve,ve.reject)}catch(Re){ve.reject(Re)}},Z.prototype.then=function(ge,ye){function ve(xe,ze){return typeof xe=="function"?function(He){try{Re(xe(He))}catch(Me){Ce(Me)}}:ze}var Re,Ce,De=new Z(function(xe,ze){Re=xe,Ce=ze});return this.F(ve(ge,Re),ve(ye,Ce)),De},Z.prototype.catch=function(ge){return this.then(void 0,ge)},Z.prototype.F=function(ge,ye){function ve(){switch(Re.b){case 1:ge(Re.c);break;case 2:ye(Re.c);break;default:throw Error("Unexpected state: "+Re.b)}}var Re=this;this.a==null?me.b(ve):this.a.push(ve)},Z.resolve=ae,Z.reject=function(ge){return new Z(function(ye,ve){ve(ge)})},Z.race=function(ge){return new Z(function(ye,ve){for(var Re=y(ge),Ce=Re.next();!Ce.done;Ce=Re.next())ae(Ce.value).F(ye,ve)})},Z.all=function(ge){var ye=y(ge),ve=ye.next();return ve.done?ae([]):new Z(function(Re,Ce){function De(He){return function(Me){xe[He]=Me,--ze==0&&Re(xe)}}var xe=[],ze=0;do xe.push(void 0),ze++,ae(ve.value).F(De(xe.length-1),Ce),ve=ye.next();while(!ve.done)})},Z});var h=h||{},R=this||self;function W(M,Z){M=M.split("."),Z=Z||R;for(var re=0;re<M.length;re++)if((Z=Z[M[re]])==null)return null;return Z}function X(){}function m(M){var Z=typeof M;return Z=="object"&&M!=null||Z=="function"}function _(M,Z,re){return M.call.apply(M.bind,arguments)}function G(M,Z,re){if(!M)throw Error();if(2<arguments.length){var ae=Array.prototype.slice.call(arguments,2);return function(){var de=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(de,ae),M.apply(Z,de)}}return function(){return M.apply(Z,arguments)}}function j(M,Z,re){return(j=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?_:G).apply(null,arguments)}function C(M,Z){function re(){}re.prototype=Z.prototype,M.O=Z.prototype,M.prototype=new re,M.prototype.constructor=M}function z(M){this.a=M||{}}function P(M,Z,re,ae){this.f=M,this.c=Z,this.b=re,this.a=ae}function D(M,Z,re,ae){re=re===void 0?{}:re,this.c=M,this.a=re,this.b=Z,this.f=ae===void 0?null:ae}function O(M,Z,re,ae,de,me){this.name=M,this.a=de,this.b=me}function L(M,Z,re){re=re===void 0?{}:re;var ae=ae===void 0?new z:ae;return new P(Z,M,re,ae)}function U(M,Z,re){re=re===void 0?{}:re,Z=Error.call(this,Z),this.message=Z.message,"stack"in Z&&(this.stack=Z.stack),this.code=M,this.metadata=re}function A(M){this.a=M}function V(M){if(Error.captureStackTrace)Error.captureStackTrace(this,V);else{var Z=Error().stack;Z&&(this.stack=Z)}M&&(this.message=String(M))}function q(M,Z){for(var re="",ae=(M=M.split("%s")).length-1,de=0;de<ae;de++)re+=M[de]+(de<Z.length?Z[de]:"%s");V.call(this,re+M[ae])}function Q(){this.l=null,this.i=[],this.m=0,this.b=ee,this.f=this.a=this.h=0,this.c=null,this.g=0}z.prototype.get=function(M){return this.a[M]},z.prototype.G=function(){return Object.keys(this.a)},P.prototype.getRequestMessage=function(){return this.f},P.prototype.getMethodDescriptor=function(){return this.c},P.prototype.getMetadata=function(){return this.b},P.prototype.getCallOptions=function(){return this.a},D.prototype.getResponseMessage=function(){return this.c},D.prototype.getMetadata=function(){return this.a},D.prototype.getMethodDescriptor=function(){return this.b},D.prototype.getStatus=function(){return this.f},O.prototype.getName=function(){return this.name},O.prototype.getName=O.prototype.getName,E(U,Error),U.prototype.name="RpcError",A.prototype.on=function(M,Z){return M=="data"||M=="error"?this:this.a.on(M,Z)},A.prototype.removeListener=function(M,Z){return this.a.removeListener(M,Z)},A.prototype.cancel=function(){this.a.cancel()},C(V,Error),V.prototype.name="CustomError",C(q,V),q.prototype.name="AssertionError";var ee=0,te=1,k=2,x=3,b=0,I=128;function $(M,Z,re,ae){throw M.b=x,M.l="The stream is broken @"+M.m+"/"+re+". Error: "+ae+`. With input:
16
+ `+Z,Error(M.l)}var K,Y=Array.prototype.indexOf?function(M,Z){return Array.prototype.indexOf.call(M,Z,void 0)}:function(M,Z){if(typeof M=="string")return typeof Z!="string"||Z.length!=1?-1:M.indexOf(Z,0);for(var re=0;re<M.length;re++)if(re in M&&M[re]===Z)return re;return-1},ne=String.prototype.trim?function(M){return M.trim()}:function(M){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(M)[1]};function ie(M,Z){return M.indexOf(Z)!=-1}function ue(M,Z){return M<Z?-1:M>Z?1:0}e:{var we=R.navigator;if(we){var Oe=we.userAgent;if(Oe){K=Oe;break e}}K=""}var Ee="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ne(M){var Z=1;M=M.split(":");for(var re=[];0<Z&&M.length;)re.push(M.shift()),Z--;return M.length&&re.push(M.join(":")),re}function Te(M){return Te[" "](M),M}Te[" "]=X;var Ae,Ie,Fe=ie(K,"Opera"),Ve=ie(K,"Trident")||ie(K,"MSIE"),rt=ie(K,"Edge"),vt=ie(K,"Gecko")&&!(ie(K.toLowerCase(),"webkit")&&!ie(K,"Edge"))&&!(ie(K,"Trident")||ie(K,"MSIE"))&&!ie(K,"Edge"),wt=ie(K.toLowerCase(),"webkit")&&!ie(K,"Edge");e:{var Ot="",lt=(Ie=K,vt?/rv:([^\);]+)(\)|;)/.exec(Ie):rt?/Edge\/([\d\.]+)/.exec(Ie):Ve?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Ie):wt?/WebKit\/(\S+)/.exec(Ie):Fe?/(?:Version)[ \/]?(\S+)/.exec(Ie):void 0);if(lt&&(Ot=lt?lt[1]:""),Ve){var mt,ft=R.document;if((mt=ft?ft.documentMode:void 0)!=null&&mt>parseFloat(Ot)){Ae=String(mt);break e}}Ae=Ot}var xt={};function Lt(){return function(M){var Z=xt;return Object.prototype.hasOwnProperty.call(Z,9)?Z[9]:Z[9]=M(9)}(function(){for(var M=0,Z=ne(String(Ae)).split("."),re=ne("9").split("."),ae=Math.max(Z.length,re.length),de=0;M==0&&de<ae;de++){var me=Z[de]||"",ge=re[de]||"";do{if(me=/(\d*)(\D*)(.*)/.exec(me)||["","","",""],ge=/(\d*)(\D*)(.*)/.exec(ge)||["","","",""],me[0].length==0&&ge[0].length==0)break;M=ue(me[1].length==0?0:parseInt(me[1],10),ge[1].length==0?0:parseInt(ge[1],10))||ue(me[2].length==0,ge[2].length==0)||ue(me[2],ge[2]),me=me[3],ge=ge[3]}while(M==0)}return 0<=M})}function Ct(){this.K=this.K}Ct.prototype.K=!1;var ke=Object.freeze||function(M){return M};function dt(M,Z){this.type=M,this.a=this.target=Z,this.defaultPrevented=!1}dt.prototype.b=function(){this.defaultPrevented=!0};var Ht=function(){if(!R.addEventListener||!Object.defineProperty)return!1;var M=!1,Z=Object.defineProperty({},"passive",{get:function(){M=!0}});try{R.addEventListener("test",X,Z),R.removeEventListener("test",X,Z)}catch{}return M}();function it(M,Z){if(dt.call(this,M?M.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,M){var re=this.type=M.type,ae=M.changedTouches&&M.changedTouches.length?M.changedTouches[0]:null;if(this.target=M.target||M.srcElement,this.a=Z,Z=M.relatedTarget){if(vt){e:{try{Te(Z.nodeName);var de=!0;break e}catch{}de=!1}de||(Z=null)}}else re=="mouseover"?Z=M.fromElement:re=="mouseout"&&(Z=M.toElement);this.relatedTarget=Z,ae?(this.clientX=ae.clientX!==void 0?ae.clientX:ae.pageX,this.clientY=ae.clientY!==void 0?ae.clientY:ae.pageY,this.screenX=ae.screenX||0,this.screenY=ae.screenY||0):(this.clientX=M.clientX!==void 0?M.clientX:M.pageX,this.clientY=M.clientY!==void 0?M.clientY:M.pageY,this.screenX=M.screenX||0,this.screenY=M.screenY||0),this.button=M.button,this.key=M.key||"",this.ctrlKey=M.ctrlKey,this.altKey=M.altKey,this.shiftKey=M.shiftKey,this.metaKey=M.metaKey,this.pointerId=M.pointerId||0,this.pointerType=typeof M.pointerType=="string"?M.pointerType:yt[M.pointerType]||"",this.c=M,M.defaultPrevented&&it.O.b.call(this)}}C(it,dt);var yt=ke({2:"touch",3:"pen",4:"mouse"});it.prototype.b=function(){it.O.b.call(this);var M=this.c;M.preventDefault?M.preventDefault():M.returnValue=!1};var St="closure_listenable_"+(1e6*Math.random()|0),Wt=0;function kt(M,Z,re,ae,de){this.listener=M,this.proxy=null,this.src=Z,this.type=re,this.capture=!!ae,this.H=de,this.key=++Wt,this.A=this.D=!1}function ot(M){M.A=!0,M.listener=null,M.proxy=null,M.src=null,M.H=null}function Et(M){this.src=M,this.a={},this.b=0}function Ue(M,Z){var re=Z.type;if(re in M.a){var ae,de=M.a[re],me=Y(de,Z);(ae=0<=me)&&Array.prototype.splice.call(de,me,1),ae&&(ot(Z),M.a[re].length==0&&(delete M.a[re],M.b--))}}function Nt(M,Z,re,ae){for(var de=0;de<M.length;++de){var me=M[de];if(!me.A&&me.listener==Z&&me.capture==!!re&&me.H==ae)return de}return-1}Et.prototype.add=function(M,Z,re,ae,de){var me=M.toString();(M=this.a[me])||(M=this.a[me]=[],this.b++);var ge=Nt(M,Z,ae,de);return-1<ge?(Z=M[ge],re||(Z.D=!1)):((Z=new kt(Z,this.src,me,!!ae,de)).D=re,M.push(Z)),Z},Et.prototype.remove=function(M,Z,re,ae){if(!((M=M.toString())in this.a))return!1;var de=this.a[M];return-1<(Z=Nt(de,Z,re,ae))&&(ot(de[Z]),Array.prototype.splice.call(de,Z,1),de.length==0&&(delete this.a[M],this.b--),!0)};var be="closure_lm_"+(1e6*Math.random()|0),F={};function H(M,Z,re,ae,de){if(ae&&ae.once)(function ge(ye,ve,Re,Ce,De){if(Array.isArray(ve))for(var xe=0;xe<ve.length;xe++)ge(ye,ve[xe],Re,Ce,De);else Re=fe(Re),ye&&ye[St]?ye.f.add(String(ve),Re,!0,m(Ce)?!!Ce.capture:!!Ce,De):J(ye,ve,Re,!0,Ce,De)})(M,Z,re,ae,de);else if(Array.isArray(Z))for(var me=0;me<Z.length;me++)H(M,Z[me],re,ae,de);else re=fe(re),M&&M[St]?M.f.add(String(Z),re,!1,m(ae)?!!ae.capture:!!ae,de):J(M,Z,re,!1,ae,de)}function J(M,Z,re,ae,de,me){if(!Z)throw Error("Invalid event type");var ge=m(de)?!!de.capture:!!de,ye=he(M);if(ye||(M[be]=ye=new Et(M)),!(re=ye.add(Z,re,ae,ge,me)).proxy)if(ae=function(){var ve=ce;return function Re(Ce){return ve.call(Re.src,Re.listener,Ce)}}(),re.proxy=ae,ae.src=M,ae.listener=re,M.addEventListener)Ht||(de=ge),de===void 0&&(de=!1),M.addEventListener(Z.toString(),ae,de);else if(M.attachEvent)M.attachEvent(se(Z.toString()),ae);else{if(!M.addListener||!M.removeListener)throw Error("addEventListener and attachEvent are unavailable.");M.addListener(ae)}}function oe(M){if(typeof M!="number"&&M&&!M.A){var Z=M.src;if(Z&&Z[St])Ue(Z.f,M);else{var re=M.type,ae=M.proxy;Z.removeEventListener?Z.removeEventListener(re,ae,M.capture):Z.detachEvent?Z.detachEvent(se(re),ae):Z.addListener&&Z.removeListener&&Z.removeListener(ae),(re=he(Z))?(Ue(re,M),re.b==0&&(re.src=null,Z[be]=null)):ot(M)}}}function se(M){return M in F?F[M]:F[M]="on"+M}function ce(M,Z){if(M.A)M=!0;else{Z=new it(Z,this);var re=M.listener,ae=M.H||M.src;M.D&&oe(M),M=re.call(ae,Z)}return M}function he(M){return(M=M[be])instanceof Et?M:null}var pe="__closure_events_fn_"+(1e9*Math.random()>>>0);function fe(M){return typeof M=="function"?M:(M[pe]||(M[pe]=function(Z){return M.handleEvent(Z)}),M[pe])}function le(){Ct.call(this),this.f=new Et(this),this.U=this}function Se(M,Z){M=M.U;var re=Z.type||Z;if(typeof Z=="string")Z=new dt(Z,M);else if(Z instanceof dt)Z.target=Z.target||M;else{var ae=Z;(function(de,me){for(var ge,ye,ve=1;ve<arguments.length;ve++){for(ge in ye=arguments[ve])de[ge]=ye[ge];for(var Re=0;Re<Ee.length;Re++)ge=Ee[Re],Object.prototype.hasOwnProperty.call(ye,ge)&&(de[ge]=ye[ge])}})(Z=new dt(re,M),ae)}je(M=Z.a=M,re,!0,Z),je(M,re,!1,Z)}function je(M,Z,re,ae){if(Z=M.f.a[String(Z)]){Z=Z.concat();for(var de=!0,me=0;me<Z.length;++me){var ge=Z[me];if(ge&&!ge.A&&ge.capture==re){var ye=ge.listener,ve=ge.H||ge.src;ge.D&&Ue(M.f,ge),de=ye.call(ve,ae)!==!1&&de}}}}C(le,Ct),le.prototype[St]=!0,le.prototype.addEventListener=function(M,Z,re,ae){H(this,M,Z,re,ae)},le.prototype.removeEventListener=function(M,Z,re,ae){(function de(me,ge,ye,ve,Re){if(Array.isArray(ge))for(var Ce=0;Ce<ge.length;Ce++)de(me,ge[Ce],ye,ve,Re);else ve=m(ve)?!!ve.capture:!!ve,ye=fe(ye),me&&me[St]?me.f.remove(String(ge),ye,ve,Re):me&&(me=he(me))&&(ge=me.a[ge.toString()],me=-1,ge&&(me=Nt(ge,ye,ve,Re)),(ye=-1<me?ge[me]:null)&&oe(ye))})(this,M,Z,re,ae)};var Pe=R;function We(M,Z,re){if(typeof M=="function")re&&(M=j(M,re));else{if(!M||typeof M.handleEvent!="function")throw Error("Invalid listener argument");M=j(M.handleEvent,M)}return 2147483647<Number(Z)?-1:Pe.setTimeout(M,Z||0)}function Ge(M,Z){this.name=M,this.value=Z}Ge.prototype.toString=function(){return this.name};var Ye,tt,Le,Be=new Ge("OFF",1/0),$e=new Ge("SEVERE",1e3),Ze=new Ge("CONFIG",700),Ke=new Ge("FINE",500);function Xe(){this.clear()}function ct(M,Z,re){this.reset(M||Be,Z,re,void 0,void 0)}function ut(M,Z){this.a=null,this.f=[],this.b=(Z===void 0?null:Z)||null,this.c=[],this.g={getName:function(){return M}}}function _t(M){return M.a?M.a:M.b?_t(M.b):(function(Z,re){throw new q("Failure"+(Z?": "+Z:""),Array.prototype.slice.call(arguments,1))}("Root logger has no level set."),Be)}function Bt(){this.entries={};var M=new ut("");M.a=Ze,this.entries[""]=M}function It(M,Z,re){var ae=M.entries[Z];if(ae)return re!==void 0&&(ae.a=re),ae;ae=It(M,Z.substr(0,Z.lastIndexOf(".")));var de=new ut(Z,ae);return M.entries[Z]=de,ae.c.push(de),re!==void 0&&(de.a=re),de}function Vt(){return tt||(tt=new Bt),tt}function Gt(M,Z,re){var ae;(ae=M)&&(ae=M&&Z)&&(ae=(ae=Z.value)>=(M?_t(It(Vt(),M.getName())):Be).value),ae&&(Z=Z||Be,ae=It(Vt(),M.getName()),typeof re=="function"&&(re=re()),Ye||(Ye=new Xe),function(de,me){for(;de;)de.f.forEach(function(ge){ge(me)}),de=de.b}(ae,M=new ct(Z,re,M=M.getName())))}function at(M,Z){M&&Gt(M,Ke,Z)}function Xt(){}function Jt(M){var Z;return(Z=M.a)||(Z={},tn(M)&&(Z[0]=!0,Z[1]=!0),Z=M.a=Z),Z}function Qt(){}function en(M){return(M=tn(M))?new ActiveXObject(M):new XMLHttpRequest}function tn(M){if(!M.b&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var Z=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],re=0;re<Z.length;re++){var ae=Z[re];try{return new ActiveXObject(ae),M.b=ae}catch{}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return M.b}function $t(M,Z){this.b=M[R.Symbol.iterator](),this.c=Z,this.f=0}Xe.prototype.clear=function(){},ct.prototype.reset=function(){},Xt.prototype.a=null,C(Qt,Xt),Le=new Qt,g(),v(),$t.prototype[Symbol.iterator]=function(){return this},$t.prototype.next=function(){var M=this.b.next();return{value:M.done?void 0:this.c.call(void 0,M.value,this.f++),done:M.done}},g(),v(),g(),v();var Ut="StopIteration"in R?R.StopIteration:{message:"StopIteration",stack:""};function Tt(){}function nn(M){if(M instanceof ht||M instanceof bt||M instanceof At)return M;if(typeof M.next=="function")return new ht(function(){return rn(M)});if(g(),v(),typeof M[Symbol.iterator]=="function")return g(),v(),new ht(function(){return M[Symbol.iterator]()});if(typeof M.u=="function")return new ht(function(){return rn(M.u())});throw Error("Not an iterator or iterable.")}function rn(M){if(!(M instanceof Tt))return M;var Z=!1;return{next:function(){for(var re;!Z;)try{re=M.a();break}catch(ae){if(ae!==Ut)throw ae;Z=!0}return{value:re,done:Z}}}}function ht(M){this.b=M}function bt(M){this.b=M}function At(M){ht.call(this,function(){return M}),this.f=M}function Ft(M,Z){this.o={},this.j=[],this.B=this.size=0;var re=arguments.length;if(1<re){if(re%2)throw Error("Uneven number of arguments");for(var ae=0;ae<re;ae+=2)this.set(arguments[ae],arguments[ae+1])}else M&&this.addAll(M)}function qt(M){if(M.size!=M.j.length){for(var Z=0,re=0;Z<M.j.length;){var ae=M.j[Z];Mt(M.o,ae)&&(M.j[re++]=ae),Z++}M.j.length=re}if(M.size!=M.j.length){var de={};for(re=Z=0;Z<M.j.length;)Mt(de,ae=M.j[Z])||(M.j[re++]=ae,de[ae]=1),Z++;M.j.length=re}}function Mt(M,Z){return Object.prototype.hasOwnProperty.call(M,Z)}Tt.prototype.next=function(){return Tt.prototype.a.call(this)},Tt.prototype.a=function(){throw Ut},Tt.prototype.u=function(){return this},g(),v(),ht.prototype.u=function(){return new bt(this.b())},ht.prototype[Symbol.iterator]=function(){return new At(this.b())},ht.prototype.c=function(){return new At(this.b())},g(),v(),E(bt,Tt),bt.prototype.a=function(){var M=this.b.next();if(M.done)throw Ut;return M.value},bt.prototype.next=function(){return bt.prototype.a.call(this)},bt.prototype[Symbol.iterator]=function(){return new At(this.b)},bt.prototype.c=function(){return new At(this.b)},E(At,ht),At.prototype.next=function(){return this.f.next()},(o=Ft.prototype).G=function(){return qt(this),this.j.concat()},o.has=function(M){return Mt(this.o,M)},o.clear=function(){this.o={},this.B=this.size=this.j.length=0},o.remove=function(M){return this.delete(M)},o.delete=function(M){return!!Mt(this.o,M)&&(delete this.o[M],--this.size,this.B++,this.j.length>2*this.size&&qt(this),!0)},o.get=function(M,Z){return Mt(this.o,M)?this.o[M]:Z},o.set=function(M,Z){Mt(this.o,M)||(this.size+=1,this.j.push(M),this.B++),this.o[M]=Z},o.addAll=function(M){if(M instanceof Ft)for(var Z=M.G(),re=0;re<Z.length;re++)this.set(Z[re],M.get(Z[re]));else for(Z in M)this.set(Z,M[Z])},o.forEach=function(M,Z){for(var re=this.G(),ae=0;ae<re.length;ae++){var de=re[ae],me=this.get(de);M.call(Z,me,de,this)}},o.clone=function(){return new Ft(this)},o.keys=function(){return nn(this.u(!0)).c()},o.values=function(){return nn(this.u(!1)).c()},o.entries=function(){var M=this;return function(Z,re){return new $t(Z,re)}(this.keys(),function(Z){return[Z,M.get(Z)]})},o.u=function(M){qt(this);var Z=0,re=this.B,ae=this,de=new Tt;return de.a=function(){if(re!=ae.B)throw Error("The map has changed since the iterator was created");if(Z>=ae.j.length)throw Ut;var me=ae.j[Z++];return M?me:ae.o[me]},de.next=de.a.bind(de),de};var hn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function zt(M){le.call(this),this.headers=new Ft,this.C=M||null,this.c=!1,this.J=this.a=null,this.P=this.v="",this.g=0,this.l="",this.i=this.N=this.s=this.L=!1,this.h=0,this.w=null,this.m=on,this.I=this.M=!1}C(zt,le);var on="";zt.prototype.b=It(Vt(),"goog.net.XhrIo",void 0).g;var pn=/^https?$/i,mn=["POST","PUT"];function yn(M,Z,re){if(M.a)throw Error("[goog.net.XhrIo] Object is active with another request="+M.v+"; newUri="+Z);M.v=Z,M.l="",M.g=0,M.P="POST",M.L=!1,M.c=!0,M.a=M.C?en(M.C):en(Le),M.J=M.C?Jt(M.C):Jt(Le),M.a.onreadystatechange=j(M.R,M);try{at(M.b,pt(M,"Opening Xhr")),M.N=!0,M.a.open("POST",String(Z),!0),M.N=!1}catch(me){return at(M.b,pt(M,"Error opening Xhr: "+me.message)),void an(M,me)}Z=re||"";var ae=(re=M.headers.clone()).G().find(function(me){return me.toLowerCase()=="content-type"}),de=R.FormData&&Z instanceof R.FormData;!(0<=Y(mn,"POST"))||ae||de||re.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),re.forEach(function(me,ge){this.a.setRequestHeader(ge,me)},M),M.m&&(M.a.responseType=M.m),"withCredentials"in M.a&&M.a.withCredentials!==M.M&&(M.a.withCredentials=M.M);try{un(M),0<M.h&&(M.I=function(me){return Ve&&Lt()&&typeof me.timeout=="number"&&me.ontimeout!==void 0}(M.a),at(M.b,pt(M,"Will abort after "+M.h+"ms if incomplete, xhr2 "+M.I)),M.I?(M.a.timeout=M.h,M.a.ontimeout=j(M.T,M)):M.w=We(M.T,M.h,M)),at(M.b,pt(M,"Sending request")),M.s=!0,M.a.send(Z),M.s=!1}catch(me){at(M.b,pt(M,"Send error: "+me.message)),an(M,me)}}function an(M,Z){M.c=!1,M.a&&(M.i=!0,M.a.abort(),M.i=!1),M.l=Z,M.g=5,sn(M),Zt(M)}function sn(M){M.L||(M.L=!0,Se(M,"complete"),Se(M,"error"))}function ln(M){if(M.c&&h!==void 0){if(M.J[1]&&Rt(M)==4&&M.getStatus()==2)at(M.b,pt(M,"Local request error detected and ignored"));else if(M.s&&Rt(M)==4)We(M.R,0,M);else if(Se(M,"readystatechange"),Rt(M)==4){at(M.b,pt(M,"Request complete")),M.c=!1;try{var Z,re=M.getStatus();e:switch(re){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var ae=!0;break e;default:ae=!1}if(!(Z=ae)){var de;if(de=re===0){var me=String(M.v).match(hn)[1]||null;if(!me&&R.self&&R.self.location){var ge=R.self.location.protocol;me=ge.substr(0,ge.length-1)}de=!pn.test(me?me.toLowerCase():"")}Z=de}if(Z)Se(M,"complete"),Se(M,"success");else{M.g=6;try{var ye=2<Rt(M)?M.a.statusText:""}catch(ve){at(M.b,"Can not get status: "+ve.message),ye=""}M.l=ye+" ["+M.getStatus()+"]",sn(M)}}finally{Zt(M)}}}}function Zt(M){if(M.a){un(M);var Z=M.a,re=M.J[0]?X:null;M.a=null,M.J=null,Se(M,"ready");try{Z.onreadystatechange=re}catch(ae){(M=M.b)&&Gt(M,$e,"Problem encountered resetting onreadystatechange: "+ae.message)}}}function un(M){M.a&&M.I&&(M.a.ontimeout=null),M.w&&(Pe.clearTimeout(M.w),M.w=null)}function Rt(M){return M.a?M.a.readyState:0}function cn(M,Z){if(M.a&&Rt(M)==4)return(M=M.a.getResponseHeader(Z))===null?void 0:M}function pt(M,Z){return Z+" ["+M.P+" "+M.v+" "+M.getStatus()+"]"}(o=zt.prototype).T=function(){h!==void 0&&this.a&&(this.l="Timed out after "+this.h+"ms, aborting",this.g=8,at(this.b,pt(this,this.l)),Se(this,"timeout"),this.abort(8))},o.abort=function(M){this.a&&this.c&&(at(this.b,pt(this,"Aborting")),this.c=!1,this.i=!0,this.a.abort(),this.i=!1,this.g=M||7,Se(this,"complete"),Se(this,"abort"),Zt(this))},o.R=function(){this.K||(this.N||this.s||this.i?ln(this):this.W())},o.W=function(){ln(this)},o.getStatus=function(){try{return 2<Rt(this)?this.a.status:-1}catch{return-1}};var gn={},Dt=null;function _n(M){var Z=M.length,re=3*Z/4;re%3?re=Math.floor(re):ie("=.",M[Z-1])&&(re=ie("=.",M[Z-2])?re-2:re-1);var ae=new Uint8Array(re),de=0;return function(me,ge){function ye(ze){for(;ve<me.length;){var He=me.charAt(ve++),Me=Dt[He];if(Me!=null)return Me;if(!/^[\s\xa0]*$/.test(He))throw Error("Unknown base64 encoding at char: "+He)}return ze}fn();for(var ve=0;;){var Re=ye(-1),Ce=ye(0),De=ye(64),xe=ye(64);if(xe===64&&Re===-1)break;ge(Re<<2|Ce>>4),De!=64&&(ge(Ce<<4&240|De>>2),xe!=64&&ge(De<<6&192|xe))}}(M,function(me){ae[de++]=me}),ae.subarray(0,de)}function fn(){if(!Dt){Dt={};for(var M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Z=["+/=","+/","-_=","-_.","-_"],re=0;5>re;re++){var ae=M.concat(Z[re].split(""));gn[re]=ae;for(var de=0;de<ae.length;de++){var me=ae[de];Dt[me]===void 0&&(Dt[me]=de)}}}}var bn=["content-type","grpc-status","grpc-message"];function gt(M){this.a=M.Z,this.m=null,this.b=[],this.h=[],this.g=[],this.f=[],this.c=[],this.l=!1,this.i=0,this.s=new Q;var Z=this;H(this.a,"readystatechange",function(){var re=Z.a;if(re=re.a?re.a.getResponseHeader("Content-Type"):null){if((re=re.toLowerCase()).lastIndexOf("application/grpc-web-text",0)==0){re=Z.a;try{var ae=re.a?re.a.responseText:""}catch(ve){at(re.b,"Can not get responseText: "+ve.message),ae=""}if(ae=(re=ae||"").length-re.length%4,(re=re.substr(Z.i,ae-Z.i)).length==0)return;Z.i=ae,re=_n(re)}else{if(re.lastIndexOf("application/grpc",0)!=0)return void jt(Z,new U(2,"Unknown Content-type received."));re=new Uint8Array(function(ve){try{if(!ve.a)return null;if("response"in ve.a)return ve.a.response;switch(ve.m){case on:case"text":return ve.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in ve.a)return ve.a.mozResponseArrayBuffer}var Re=ve.b;return Re&&Gt(Re,$e,"Response type "+ve.m+" is not supported on this browser"),null}catch(Ce){return at(ve.b,"Can not get response: "+Ce.message),null}}(Z.a))}ae=null;try{ae=function(ve,Re){function Ce(st){Me.f++,Me.a=(Me.a<<8)+st,Me.f==4&&(Me.b=k,Me.g=0,typeof Uint8Array<"u"?Me.c=new Uint8Array(Me.a):Me.c=Array(Me.a),Me.a==0&&xe())}function De(st){Me.c[Me.g++]=st,Me.g==Me.a&&xe()}function xe(){var st={};st[Me.h]=Me.c,Me.i.push(st),Me.b=ee}var ze,He,Me=ve,qe=0;for(ze=Re instanceof Uint8Array||Re instanceof Array?Re:new Uint8Array(Re);qe<ze.length;){switch(Me.b){case x:$(Me,ze,qe,"stream already broken");break;case ee:(He=ze[qe])==b||He==I?Me.h=He:$(Me,ze,qe,"invalid frame byte"),Me.b=te,Me.a=0,Me.f=0;break;case te:Ce(ze[qe]);break;case k:De(ze[qe]);break;default:throw Error("unexpected parser state: "+Me.b)}Me.m++,qe++}return ve=Me.i,Me.i=[],0<ve.length?ve:null}(Z.s,re)}catch{jt(Z,new U(2,"Error in parsing response body"))}if(ae)for(re=0;re<ae.length;re++){if(b in ae[re]){var de=ae[re][b];if(de){var me=!1,ge=void 0;try{ge=Z.m(de),me=!0}catch(ve){jt(Z,new U(13,"Error when deserializing response data; error: "+ve+", response: "+ge))}if(me)for(de=ge,me=0;me<Z.b.length;me++)Z.b[me](de)}}if(I in ae[re]&&0<ae[re][I].length){for(de="",me=0;me<ae[re][I].length;me++)de+=String.fromCharCode(ae[re][I][me]);for(de=de.trim().split(`\r
17
+ `),me={},ge=0;ge<de.length;ge++){var ye=de[ge].indexOf(":");me[de[ge].substring(0,ye).trim()]=de[ge].substring(ye+1).trim()}de=me,me=0,ge="","grpc-status"in de&&(me=Number(de["grpc-status"]),delete de["grpc-status"]),"grpc-message"in de&&(ge=de["grpc-message"],delete de["grpc-message"]),jt(Z,new U(me,ge,de))}}}}),H(this.a,"complete",function(){var re=Z.a.g,ae=2,de="",me={},ge=function(ve){var Re={};ve=(ve.a&&Rt(ve)==4&&ve.a.getAllResponseHeaders()||"").split(`\r
18
+ `);for(var Ce=0;Ce<ve.length;Ce++)if(!/^[\s\xa0]*$/.test(ve[Ce])){var De=Ne(ve[Ce]),xe=De[0];if(typeof(De=De[1])=="string"){De=De.trim();var ze=Re[xe]||[];Re[xe]=ze,ze.push(De)}}return function(He,Me){var qe,st={};for(qe in He)st[qe]=Me.call(void 0,He[qe],qe,He);return st}(Re,function(He){return He.join(", ")})}(Z.a);Object.keys(ge).forEach(function(ve){bn.includes(ve)||(me[ve]=ge[ve])}),function(ve,Re){for(var Ce=0;Ce<ve.g.length;Ce++)ve.g[Ce](Re)}(Z,me);var ye=-1;if(re!=0){switch(re){case 7:ae=10;break;case 8:ae=4;break;case 6:ae=function(ve){switch(ve){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}}(ye=Z.a.getStatus());break;default:ae=14}ae==10&&Z.l||(de=function(ve){switch(ve){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}}(re),ye!=-1&&(de+=", http status code: "+ye),jt(Z,new U(ae,de)))}else ye=!1,"grpc-status"in ge&&(ae=Number(cn(Z.a,"grpc-status")),"grpc-message"in ge&&(de=cn(Z.a,"grpc-message")),ae!=0&&(jt(Z,new U(ae,de||"",ge)),ye=!0)),ye||function(ve){for(var Re=0;Re<ve.c.length;Re++)ve.c[Re]()}(Z)})}function Pt(M,Z){-1<(Z=M.indexOf(Z))&&M.splice(Z,1)}function jt(M,Z){if(Z.code!=0)for(var re=new U(Z.code,decodeURIComponent(Z.message||""),Z.metadata),ae=0;ae<M.f.length;ae++)M.f[ae](re);for(Z={code:Z.code,details:decodeURIComponent(Z.message||""),metadata:Z.metadata},re=0;re<M.h.length;re++)M.h[re](Z)}function nt(M,Z){M=M===void 0?{}:M,this.a=M.format||W("format",M)||"text",this.g=M.aa||W("suppressCorsPreflight",M)||!1,this.f=M.withCredentials||W("withCredentials",M)||!1,this.b=M.$||W("streamInterceptors",M)||[],this.h=M.ba||W("unaryInterceptors",M)||[],this.c=Z||null}function Yt(M,Z,re){var ae=Z.getMethodDescriptor(),de=re+ae.getName();(re=M.c?M.c:new zt).M=M.f;var me=new gt({Z:re});me.m=ae.b;var ge=Z.getMetadata();for(ye in ge)re.headers.set(ye,ge[ye]);if(M.a=="text"?(re.headers.set("Content-Type","application/grpc-web-text"),re.headers.set("Accept","application/grpc-web-text")):re.headers.set("Content-Type","application/grpc-web+proto"),re.headers.set("X-User-Agent","grpc-web-javascript/0.1"),re.headers.set("X-Grpc-Web","1"),re.headers.has("deadline")){var ye=Number(re.headers.get("deadline"));ye=Math.ceil(ye-new Date().getTime()),re.headers.delete("deadline"),1/0===ye&&(ye=0),0<ye&&(re.headers.set("grpc-timeout",ye+"m"),re.h=Math.max(0,Math.max(1e3,Math.ceil(1.1*ye))))}if(M.g){ye={};for(var ve=y((ge=re.headers).keys()),Re=ve.next();!Re.done;Re=ve.next())ye[Re=Re.value]=ge.get(Re);re.headers.clear();e:{for(Ce in ye){var Ce=!1;break e}Ce=!0}Ce||(ye=function(ze){var He="";return function(Me,qe){for(var st in Me)qe.call(void 0,Me[st],st,Me)}(ze,function(Me,qe){He+=qe,He+=":",He+=Me,He+=`\r
19
+ `}),He}(ye),typeof de=="string"?(Ce=encodeURIComponent("$httpHeaders"),(Ce+=ye=ye!=null?"="+encodeURIComponent(String(ye)):"")&&(0>(ye=de.indexOf("#"))&&(ye=de.length),0>(ge=de.indexOf("?"))||ge>ye?(ge=ye,ve=""):ve=de.substring(ge+1,ye),ye=(de=[de.substr(0,ge),ve,de.substr(ye)])[1],de[1]=Ce?ye?ye+"&"+Ce:Ce:ye,de=de[0]+(de[1]?"?"+de[1]:"")+de[2])):de.a("$httpHeaders",ye))}for(ae=(Z=(0,ae.a)(Z.getRequestMessage())).length,Ce=[0,0,0,0],ye=new Uint8Array(5+ae),ge=3;0<=ge;ge--)Ce[ge]=ae%256,ae>>>=8;if(ye.set(new Uint8Array(Ce),1),ye.set(Z,5),Z=ye,M.a=="text"){var De;for(M=Z,De===void 0&&(De=0),fn(),De=gn[De],Z=Array(Math.floor(M.length/3)),ae=De[64]||"",Ce=ye=0;ye<M.length-2;ye+=3){Re=M[ye];var xe=M[ye+1];ve=M[ye+2],ge=De[Re>>2],Re=De[(3&Re)<<4|xe>>4],xe=De[(15&xe)<<2|ve>>6],ve=De[63&ve],Z[Ce++]=ge+Re+xe+ve}switch(ge=0,ve=ae,M.length-ye){case 2:ve=De[(15&(ge=M[ye+1]))<<2]||ae;case 1:M=M[ye],Z[Ce]=De[M>>2]+De[(3&M)<<4|ge>>4]+ve+ae}Z=Z.join("")}else M.a=="binary"&&(re.m="arraybuffer");return yn(re,de,Z),me}function dn(M,Z,re){var ae=!1,de=null,me=!1;M.on("data",function(ge){ae=!0,de=ge}),M.on("error",function(ge){ge.code==0||me||(me=!0,Z(ge,null))}),M.on("status",function(ge){ge.code==0||me?re&&Z(null,null,ge):(me=!0,Z({code:ge.code,message:ge.details,metadata:ge.metadata},null))}),re&&M.on("metadata",function(ge){Z(null,null,null,ge)}),M.on("end",function(){me||(ae?re?Z(null,de,null,null,!0):Z(null,de):Z({code:2,message:"Incomplete response"})),re&&Z(null,null)})}function Kt(M,Z){var re=M;return Z.forEach(function(ae){var de=re;re=function(me){return ae.intercept(me,de)}}),re}gt.prototype.on=function(M,Z){return M=="data"?this.b.push(Z):M=="status"?this.h.push(Z):M=="metadata"?this.g.push(Z):M=="end"?this.c.push(Z):M=="error"&&this.f.push(Z),this},gt.prototype.removeListener=function(M,Z){return M=="data"?Pt(this.b,Z):M=="status"?Pt(this.h,Z):M=="metadata"?Pt(this.g,Z):M=="end"?Pt(this.c,Z):M=="error"&&Pt(this.f,Z),this},gt.prototype.cancel=function(){this.l=!0,this.a.abort()},gt.prototype.cancel=gt.prototype.cancel,gt.prototype.removeListener=gt.prototype.removeListener,gt.prototype.on=gt.prototype.on,nt.prototype.X=function(M,Z,re,ae,de){var me=this,ge=M.substr(0,M.length-ae.name.length);return dn(M=Kt(function(ye){return Yt(me,ye,ge)},this.b).call(this,L(ae,Z,re)),de,!1),new A(M)},nt.prototype.S=function(M,Z,re,ae){var de=this,me=M.substr(0,M.length-ae.name.length);return Kt(function(ge){return new Promise(function(ye,ve){var Re,Ce,De;dn(Yt(de,ge,me),function(xe,ze,He,Me,qe){xe?ve(xe):qe?De=ze:He?Ce=He:Me?Re=Me:(xe=ge.getMethodDescriptor(),ye(new D(De,xe,ze=(ze=Re)===void 0?{}:ze,Ce===void 0?null:Ce)))},!0)})},this.h).call(this,L(ae,Z,re)).then(function(ge){return ge.getResponseMessage()})},nt.prototype.unaryCall=function(M,Z,re,ae){return this.S(M,Z,re,ae)},nt.prototype.Y=function(M,Z,re,ae){var de=this,me=M.substr(0,M.length-ae.name.length);return Kt(function(ge){return Yt(de,ge,me)},this.b).call(this,L(ae,Z,re))},nt.prototype.serverStreaming=nt.prototype.Y,nt.prototype.unaryCall=nt.prototype.unaryCall,nt.prototype.thenableCall=nt.prototype.S,nt.prototype.rpcCall=nt.prototype.X,e.exports.CallOptions=z,e.exports.MethodDescriptor=O,e.exports.GrpcWebClientBase=nt,e.exports.RpcError=U,e.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15},e.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming",BIDI_STREAMING:"bidi_streaming"},Pe=typeof globalThis<"u"&&globalThis||self}).call(this,n(6))},function(e,t,n){var r=n(57),o=n(60).warn;t.version=n(137).version,t.transports=n(138),t.config=n(49),t.addColors=r.levels,t.format=r.format,t.createLogger=n(88),t.ExceptionHandler=n(89),t.RejectionHandler=n(93),t.Container=n(214),t.Transport=n(14),t.loggers=new t.Container;var l=t.createLogger();Object.keys(t.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(u){return t[u]=function(){return l[u].apply(l,arguments)}}),Object.defineProperty(t,"level",{get:function(){return l.level},set:function(u){l.level=u}}),Object.defineProperty(t,"exceptions",{get:function(){return l.exceptions}}),["exitOnError"].forEach(function(u){Object.defineProperty(t,u,{get:function(){return l[u]},set:function(s){l[u]=s}})}),Object.defineProperty(t,"default",{get:function(){return{exceptionHandlers:l.exceptionHandlers,rejectionHandlers:l.rejectionHandlers,transports:l.transports}}}),o.deprecated(t,"setLevels"),o.forFunctions(t,"useFormat",["cli"]),o.forProperties(t,"useFormat",["padLevels","stripColors"]),o.forFunctions(t,"deprecated",["addRewriter","addFilter","clone","extend"]),o.forProperties(t,"deprecated",["emitErrs","levelLength"]),o.moved(t,"createLogger","Logger")},function(e,t,n){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,l=Function.prototype.apply;function u(s,g){this._id=s,this._clearFn=g}t.setTimeout=function(){return new u(l.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new u(l.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(s){s&&s.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(s,g){clearTimeout(s._idleTimeoutId),s._idleTimeout=g},t.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},t._unrefActive=t.active=function(s){clearTimeout(s._idleTimeoutId);var g=s._idleTimeout;g>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},g))},n(140),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(6))},function(e,t,n){var r,o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(S,N,B){return Function.prototype.apply.call(S,N,B)};r=o&&typeof o.ownKeys=="function"?o.ownKeys:Object.getOwnPropertySymbols?function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:function(S){return Object.getOwnPropertyNames(S)};var u=Number.isNaN||function(S){return S!=S};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var g=10;function c(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}function d(S,N,B,E){var T,h,R,W;if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B);if((h=S._events)===void 0?(h=S._events=Object.create(null),S._eventsCount=0):(h.newListener!==void 0&&(S.emit("newListener",N,B.listener?B.listener:B),h=S._events),R=h[N]),R===void 0)R=h[N]=B,++S._eventsCount;else if(typeof R=="function"?R=h[N]=E?[B,R]:[R,B]:E?R.unshift(B):R.push(B),(T=c(S))>0&&R.length>T&&!R.warned){R.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=S,X.type=N,X.count=R.length,W=X,console&&console.warn&&console.warn(W)}return S}function w(){for(var S=[],N=0;N<arguments.length;N++)S.push(arguments[N]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,l(this.listener,this.target,S))}function v(S,N,B){var E={fired:!1,wrapFn:void 0,target:S,type:N,listener:B},T=w.bind(E);return T.listener=B,E.wrapFn=T,T}function y(S,N,B){var E=S._events;if(E===void 0)return[];var T=E[N];return T===void 0?[]:typeof T=="function"?B?[T.listener||T]:[T]:B?function(h){for(var R=new Array(h.length),W=0;W<R.length;++W)R[W]=h[W].listener||h[W];return R}(T):p(T,T.length)}function f(S){var N=this._events;if(N!==void 0){var B=N[S];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}function p(S,N){for(var B=new Array(N),E=0;E<N;++E)B[E]=S[E];return B}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(S){if(typeof S!="number"||S<0||u(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");g=S}}),s.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||u(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(S){for(var N=[],B=1;B<arguments.length;B++)N.push(arguments[B]);var E=S==="error",T=this._events;if(T!==void 0)E=E&&T.error===void 0;else if(!E)return!1;if(E){var h;if(N.length>0&&(h=N[0]),h instanceof Error)throw h;var R=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw R.context=h,R}var W=T[S];if(W===void 0)return!1;if(typeof W=="function")l(W,this,N);else{var X=W.length,m=p(W,X);for(B=0;B<X;++B)l(m[B],this,N)}return!0},s.prototype.addListener=function(S,N){return d(this,S,N,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,N){return d(this,S,N,!0)},s.prototype.once=function(S,N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N);return this.on(S,v(this,S,N)),this},s.prototype.prependOnceListener=function(S,N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N);return this.prependListener(S,v(this,S,N)),this},s.prototype.removeListener=function(S,N){var B,E,T,h,R;if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N);if((E=this._events)===void 0)return this;if((B=E[S])===void 0)return this;if(B===N||B.listener===N)--this._eventsCount==0?this._events=Object.create(null):(delete E[S],E.removeListener&&this.emit("removeListener",S,B.listener||N));else if(typeof B!="function"){for(T=-1,h=B.length-1;h>=0;h--)if(B[h]===N||B[h].listener===N){R=B[h].listener,T=h;break}if(T<0)return this;T===0?B.shift():function(W,X){for(;X+1<W.length;X++)W[X]=W[X+1];W.pop()}(B,T),B.length===1&&(E[S]=B[0]),E.removeListener!==void 0&&this.emit("removeListener",S,R||N)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var N,B,E;if((B=this._events)===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[S]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete B[S]),this;if(arguments.length===0){var T,h=Object.keys(B);for(E=0;E<h.length;++E)(T=h[E])!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(N=B[S])=="function")this.removeListener(S,N);else if(N!==void 0)for(E=N.length-1;E>=0;E--)this.removeListener(S,N[E]);return this},s.prototype.listeners=function(S){return y(this,S,!0)},s.prototype.rawListeners=function(S){return y(this,S,!1)},s.listenerCount=function(S,N){return typeof S.listenerCount=="function"?S.listenerCount(N):f.call(S,N)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(147).Buffer,o=r.isEncoding||function(f){switch((f=""+f)&&f.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function l(f){var p;switch(this.encoding=function(S){var N=function(B){if(!B)return"utf8";for(var E;;)switch(B){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return B;default:if(E)return;B=(""+B).toLowerCase(),E=!0}}(S);if(typeof N!="string"&&(r.isEncoding===o||!o(S)))throw new Error("Unknown encoding: "+S);return N||S}(f),this.encoding){case"utf16le":this.text=g,this.end=c,p=4;break;case"utf8":this.fillLast=s,p=4;break;case"base64":this.text=d,this.end=w,p=3;break;default:return this.write=v,void(this.end=y)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(p)}function u(f){return f<=127?0:f>>5==6?2:f>>4==14?3:f>>3==30?4:f>>6==2?-1:-2}function s(f){var p=this.lastTotal-this.lastNeed,S=function(N,B,E){if((192&B[0])!=128)return N.lastNeed=0,"�";if(N.lastNeed>1&&B.length>1){if((192&B[1])!=128)return N.lastNeed=1,"�";if(N.lastNeed>2&&B.length>2&&(192&B[2])!=128)return N.lastNeed=2,"�"}}(this,f);return S!==void 0?S:this.lastNeed<=f.length?(f.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(f.copy(this.lastChar,p,0,f.length),void(this.lastNeed-=f.length))}function g(f,p){if((f.length-p)%2==0){var S=f.toString("utf16le",p);if(S){var N=S.charCodeAt(S.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=f[f.length-2],this.lastChar[1]=f[f.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=f[f.length-1],f.toString("utf16le",p,f.length-1)}function c(f){var p=f&&f.length?this.write(f):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,S)}return p}function d(f,p){var S=(f.length-p)%3;return S===0?f.toString("base64",p):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=f[f.length-1]:(this.lastChar[0]=f[f.length-2],this.lastChar[1]=f[f.length-1]),f.toString("base64",p,f.length-S))}function w(f){var p=f&&f.length?this.write(f):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function v(f){return f.toString(this.encoding)}function y(f){return f&&f.length?this.write(f):""}t.StringDecoder=l,l.prototype.write=function(f){if(f.length===0)return"";var p,S;if(this.lastNeed){if((p=this.fillLast(f))===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<f.length?p?p+this.text(f,S):this.text(f,S):p||""},l.prototype.end=function(f){var p=f&&f.length?this.write(f):"";return this.lastNeed?p+"�":p},l.prototype.text=function(f,p){var S=function(B,E,T){var h=E.length-1;if(h<T)return 0;var R=u(E[h]);return R>=0?(R>0&&(B.lastNeed=R-1),R):--h<T||R===-2?0:(R=u(E[h]))>=0?(R>0&&(B.lastNeed=R-2),R):--h<T||R===-2?0:(R=u(E[h]))>=0?(R>0&&(R===2?R=0:B.lastNeed=R-3),R):0}(this,f,p);if(!this.lastNeed)return f.toString("utf8",p);this.lastTotal=S;var N=f.length-(S-this.lastNeed);return f.copy(this.lastChar,0,N),f.toString("utf8",p,N)},l.prototype.fillLast=function(f){if(this.lastNeed<=f.length)return f.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);f.copy(this.lastChar,this.lastTotal-this.lastNeed,0,f.length),this.lastNeed-=f.length}},function(e,t,n){var r=n(37),o=Object.keys||function(f){var p=[];for(var S in f)p.push(S);return p};e.exports=w;var l=Object.create(n(32));l.inherits=n(7);var u=n(70),s=n(47);l.inherits(w,u);for(var g=o(s.prototype),c=0;c<g.length;c++){var d=g[c];w.prototype[d]||(w.prototype[d]=s.prototype[d])}function w(f){if(!(this instanceof w))return new w(f);u.call(this,f),s.call(this,f),f&&f.readable===!1&&(this.readable=!1),f&&f.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,f&&f.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",v)}function v(){this.allowHalfOpen||this._writableState.ended||r.nextTick(y,this)}function y(f){f.end()}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),w.prototype._destroy=function(f,p){this.push(null),this.end(),r.nextTick(p,f)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,o=n(155),l=(r=o)&&r.__esModule?r:{default:r};function u(s){return s[Symbol.toStringTag]==="AsyncFunction"}t.default=function(s){if(typeof s!="function")throw new Error("expected a function");return u(s)?(0,l.default)(s):s},t.isAsync=u,t.isAsyncGenerator=function(s){return s[Symbol.toStringTag]==="AsyncGenerator"},t.isAsyncIterable=function(s){return typeof s[Symbol.asyncIterator]=="function"}},function(e,t,n){var r={};function o(u,s,g){g||(g=Error);var c=function(d){var w,v;function y(f,p,S){return d.call(this,function(N,B,E){return typeof s=="string"?s:s(N,B,E)}(f,p,S))||this}return v=d,(w=y).prototype=Object.create(v.prototype),w.prototype.constructor=w,w.__proto__=v,y}(g);c.prototype.name=g.name,c.prototype.code=u,r[u]=c}function l(u,s){if(Array.isArray(u)){var g=u.length;return u=u.map(function(c){return String(c)}),g>2?"one of ".concat(s," ").concat(u.slice(0,g-1).join(", "),", or ")+u[g-1]:g===2?"one of ".concat(s," ").concat(u[0]," or ").concat(u[1]):"of ".concat(s," ").concat(u[0])}return"of ".concat(s," ").concat(String(u))}o("ERR_INVALID_OPT_VALUE",function(u,s){return'The value "'+s+'" is invalid for option "'+u+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(u,s,g){var c,d,w;if(typeof s=="string"&&(d="not ",s.substr(0,d.length)===d)?(c="must not be",s=s.replace(/^not /,"")):c="must be",function(y,f,p){return(p===void 0||p>y.length)&&(p=y.length),y.substring(p-f.length,p)===f}(u," argument"))w="The ".concat(u," ").concat(c," ").concat(l(s,"type"));else{var v=function(y,f,p){return typeof p!="number"&&(p=0),!(p+f.length>y.length)&&y.indexOf(f,p)!==-1}(u,".")?"property":"argument";w='The "'.concat(u,'" ').concat(v," ").concat(c," ").concat(l(s,"type"))}return w+=". Received type ".concat(typeof g)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var o=Object.keys||function(y){var f=[];for(var p in y)f.push(p);return f};e.exports=d;var l=n(77),u=n(81);n(7)(d,l);for(var s=o(u.prototype),g=0;g<s.length;g++){var c=s[g];d.prototype[c]||(d.prototype[c]=u.prototype[c])}function d(y){if(!(this instanceof d))return new d(y);l.call(this,y),u.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",w)))}function w(){this._writableState.ended||r.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this,n(2))},function(e,t,n){n.d(t,"a",function(){return u});var r=n(41),o=n(4);const l={"app-id":["app-id must match formant/*"]};class u extends r.a{constructor(g,c={}){super(g,Object.assign({validateHeaders:d=>`${d.get("app-id")}`.startsWith("formant/")?{}:l},c)),this.endpoint=g}getHeaders(){return Object.assign(Object.assign({},u.headers),{"App-ID":`formant/${o.a}`,"App-Version":o.j})}}u.headers={}},function(e,t,n){n(231),e.exports={encode:r=>new TextEncoder().encode(r),decode:r=>new TextDecoder().decode(r)}},function(e,t,n){n.d(t,"a",function(){return l});const r=["password","secret","token","key","buffer","authorization"],o=u=>r.some(s=>u.toLowerCase().includes(s.toLowerCase()));function l(u,s=new WeakSet){return s.has(u)?"[ RECURSIVE ]":Array.isArray(u)?(s.add(u),u.map(c=>l(c,s))):!(g=u)||typeof g!="object"&&typeof g!="function"?typeof u=="string"&&o(u)?"[ REDACTED ]":u:(s.add(u),Object.keys(u).reduce((c,d)=>(c[d]=o(d)?"[ REDACTED ]":l(u[d],s),c),{}));var g}},function(e,t,n){const{hasOwnProperty:r}=Object.prototype,o=B();o.configure=B,o.stringify=o,o.default=o,t.stringify=o,t.configure=B,e.exports=o;const l=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/,u=new RegExp(l,"g"),s=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\"];function g(E){if(E.length===2){const h=E.charCodeAt(1);return`${E[0]}\\u${h.toString(16)}`}const T=E.charCodeAt(0);return s.length>T?s[T]:`\\u${T.toString(16)}`}function c(E){if(E.length<5e3&&!l.test(E))return E;if(E.length>100)return E.replace(u,g);let T="",h=0;for(let R=0;R<E.length;R++){const W=E.charCodeAt(R);if(W===34||W===92||W<32)T+=`${E.slice(h,R)}${s[W]}`,h=R+1;else if(W>=55296&&W<=57343){if(W<=56319&&R+1<E.length){const X=E.charCodeAt(R+1);if(X>=56320&&X<=57343){R++;continue}}T+=`${E.slice(h,R)}\\u${W.toString(16)}`,h=R+1}}return T+=E.slice(h),T}function d(E){if(E.length>200)return E.sort();for(let T=1;T<E.length;T++){const h=E[T];let R=T;for(;R!==0&&E[R-1]>h;)E[R]=E[R-1],R--;E[R]=h}return E}const w=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function v(E){return w.call(E)!==void 0&&E.length!==0}function y(E,T,h){E.length<h&&(h=E.length);const R=T===","?"":" ";let W=`"0":${R}${E[0]}`;for(let X=1;X<h;X++)W+=`${T}"${X}":${R}${E[X]}`;return W}function f(E,T){let h;if(r.call(E,T)&&(h=E[T],typeof h!="boolean"))throw new TypeError(`The "${T}" argument must be of type boolean`);return h===void 0||h}function p(E,T){let h;if(r.call(E,T)){if(h=E[T],typeof h!="number")throw new TypeError(`The "${T}" argument must be of type number`);if(!Number.isInteger(h))throw new TypeError(`The "${T}" argument must be an integer`);if(h<1)throw new RangeError(`The "${T}" argument must be >= 1`)}return h===void 0?1/0:h}function S(E){return E===1?"1 item":`${E} items`}function N(E){const T=new Set;for(const h of E)typeof h!="string"&&typeof h!="number"||T.add(String(h));return T}function B(E){const T=function(z){if(r.call(z,"strict")){const P=z.strict;if(typeof P!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(P)return D=>{let O=`Object can not safely be stringified. Received type ${typeof D}`;throw typeof D!="function"&&(O+=` (${D.toString()})`),new Error(O)}}}(E={...E});T&&(E.bigint===void 0&&(E.bigint=!1),"circularValue"in E||(E.circularValue=Error));const h=function(z){if(r.call(z,"circularValue")){const P=z.circularValue;if(typeof P=="string")return`"${P}"`;if(P==null)return P;if(P===Error||P===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}(E),R=f(E,"bigint"),W=f(E,"deterministic"),X=p(E,"maximumDepth"),m=p(E,"maximumBreadth");function _(z,P,D,O,L,U){let A=P[z];switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(z)),A=O.call(P,z,A),typeof A){case"string":return`"${c(A)}"`;case"object":{if(A===null)return"null";if(D.indexOf(A)!==-1)return h;let V="",q=",";const Q=U;if(Array.isArray(A)){if(A.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(A),L!==""&&(V+=`
20
+ ${U+=L}`,q=`,
21
+ ${U}`);const I=Math.min(A.length,m);let $=0;for(;$<I-1;$++){const Y=_($,A,D,O,L,U);V+=Y!==void 0?Y:"null",V+=q}const K=_($,A,D,O,L,U);return V+=K!==void 0?K:"null",A.length-1>m&&(V+=`${q}"... ${S(A.length-m-1)} not stringified"`),L!==""&&(V+=`
22
+ ${Q}`),D.pop(),`[${V}]`}let ee=Object.keys(A);const te=ee.length;if(te===0)return"{}";if(X<D.length+1)return'"[Object]"';let k="",x="";L!==""&&(q=`,
23
+ ${U+=L}`,k=" ");let b=Math.min(te,m);v(A)&&(V+=y(A,q,m),ee=ee.slice(A.length),b-=A.length,x=q),W&&(ee=d(ee)),D.push(A);for(let I=0;I<b;I++){const $=ee[I],K=_($,A,D,O,L,U);K!==void 0&&(V+=`${x}"${c($)}":${k}${K}`,x=q)}return te>m&&(V+=`${x}"...":${k}"${S(te-m)} not stringified"`,x=q),L!==""&&x.length>1&&(V=`
24
+ ${U}${V}
25
+ ${Q}`),D.pop(),`{${V}}`}case"number":return isFinite(A)?String(A):T?T(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(A);default:return T?T(A):void 0}}function G(z,P,D,O,L,U){switch(typeof P=="object"&&P!==null&&typeof P.toJSON=="function"&&(P=P.toJSON(z)),typeof P){case"string":return`"${c(P)}"`;case"object":{if(P===null)return"null";if(D.indexOf(P)!==-1)return h;const A=U;let V="",q=",";if(Array.isArray(P)){if(P.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(P),L!==""&&(V+=`
26
+ ${U+=L}`,q=`,
27
+ ${U}`);const te=Math.min(P.length,m);let k=0;for(;k<te-1;k++){const b=G(k,P[k],D,O,L,U);V+=b!==void 0?b:"null",V+=q}const x=G(k,P[k],D,O,L,U);return V+=x!==void 0?x:"null",P.length-1>m&&(V+=`${q}"... ${S(P.length-m-1)} not stringified"`),L!==""&&(V+=`
28
+ ${A}`),D.pop(),`[${V}]`}D.push(P);let Q="";L!==""&&(q=`,
29
+ ${U+=L}`,Q=" ");let ee="";for(const te of O){const k=G(te,P[te],D,O,L,U);k!==void 0&&(V+=`${ee}"${c(te)}":${Q}${k}`,ee=q)}return L!==""&&ee.length>1&&(V=`
30
+ ${U}${V}
31
+ ${A}`),D.pop(),`{${V}}`}case"number":return isFinite(P)?String(P):T?T(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(P);default:return T?T(P):void 0}}function j(z,P,D,O,L){switch(typeof P){case"string":return`"${c(P)}"`;case"object":{if(P===null)return"null";if(typeof P.toJSON=="function"){if(typeof(P=P.toJSON(z))!="object")return j(z,P,D,O,L);if(P===null)return"null"}if(D.indexOf(P)!==-1)return h;const U=L;if(Array.isArray(P)){if(P.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(P);let k=`
32
+ ${L+=O}`;const x=`,
33
+ ${L}`,b=Math.min(P.length,m);let I=0;for(;I<b-1;I++){const K=j(I,P[I],D,O,L);k+=K!==void 0?K:"null",k+=x}const $=j(I,P[I],D,O,L);return k+=$!==void 0?$:"null",P.length-1>m&&(k+=`${x}"... ${S(P.length-m-1)} not stringified"`),k+=`
34
+ ${U}`,D.pop(),`[${k}]`}let A=Object.keys(P);const V=A.length;if(V===0)return"{}";if(X<D.length+1)return'"[Object]"';const q=`,
35
+ ${L+=O}`;let Q="",ee="",te=Math.min(V,m);v(P)&&(Q+=y(P,q,m),A=A.slice(P.length),te-=P.length,ee=q),W&&(A=d(A)),D.push(P);for(let k=0;k<te;k++){const x=A[k],b=j(x,P[x],D,O,L);b!==void 0&&(Q+=`${ee}"${c(x)}": ${b}`,ee=q)}return V>m&&(Q+=`${ee}"...": "${S(V-m)} not stringified"`,ee=q),ee!==""&&(Q=`
36
+ ${L}${Q}
37
+ ${U}`),D.pop(),`{${Q}}`}case"number":return isFinite(P)?String(P):T?T(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(P);default:return T?T(P):void 0}}function C(z,P,D){switch(typeof P){case"string":return`"${c(P)}"`;case"object":{if(P===null)return"null";if(typeof P.toJSON=="function"){if(typeof(P=P.toJSON(z))!="object")return C(z,P,D);if(P===null)return"null"}if(D.indexOf(P)!==-1)return h;let O="";if(Array.isArray(P)){if(P.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(P);const q=Math.min(P.length,m);let Q=0;for(;Q<q-1;Q++){const te=C(Q,P[Q],D);O+=te!==void 0?te:"null",O+=","}const ee=C(Q,P[Q],D);return O+=ee!==void 0?ee:"null",P.length-1>m&&(O+=`,"... ${S(P.length-m-1)} not stringified"`),D.pop(),`[${O}]`}let L=Object.keys(P);const U=L.length;if(U===0)return"{}";if(X<D.length+1)return'"[Object]"';let A="",V=Math.min(U,m);v(P)&&(O+=y(P,",",m),L=L.slice(P.length),V-=P.length,A=","),W&&(L=d(L)),D.push(P);for(let q=0;q<V;q++){const Q=L[q],ee=C(Q,P[Q],D);ee!==void 0&&(O+=`${A}"${c(Q)}":${ee}`,A=",")}return U>m&&(O+=`${A}"...":"${S(U-m)} not stringified"`),D.pop(),`{${O}}`}case"number":return isFinite(P)?String(P):T?T(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(P);default:return T?T(P):void 0}}return function(z,P,D){if(arguments.length>1){let O="";if(typeof D=="number"?O=" ".repeat(Math.min(D,10)):typeof D=="string"&&(O=D.slice(0,10)),P!=null){if(typeof P=="function")return _("",{"":z},[],P,O,"");if(Array.isArray(P))return G("",z,[],N(P),O,"")}if(O.length!==0)return j("",z,[],O,"")}return C("",z,[])}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r,o=r.length){if(!o)throw new Error("arity is undefined");return function(...l){return typeof l[o-1]=="function"?r.apply(this,l):new Promise((u,s)=>{l[o-1]=(g,...c)=>{if(g)return s(g);u(c.length>1?c:c[0])},r.apply(this,l)})}},e.exports=t.default},function(e,t,n){(t=e.exports=n(70)).Stream=t,t.Readable=t,t.Writable=n(47),t.Duplex=n(22),t.Transform=n(73),t.PassThrough=n(168)},function(e,t,n){(function(r){function o(l){return Object.prototype.toString.call(l)}t.isArray=function(l){return Array.isArray?Array.isArray(l):o(l)==="[object Array]"},t.isBoolean=function(l){return typeof l=="boolean"},t.isNull=function(l){return l===null},t.isNullOrUndefined=function(l){return l==null},t.isNumber=function(l){return typeof l=="number"},t.isString=function(l){return typeof l=="string"},t.isSymbol=function(l){return typeof l=="symbol"},t.isUndefined=function(l){return l===void 0},t.isRegExp=function(l){return o(l)==="[object RegExp]"},t.isObject=function(l){return typeof l=="object"&&l!==null},t.isDate=function(l){return o(l)==="[object Date]"},t.isError=function(l){return o(l)==="[object Error]"||l instanceof Error},t.isFunction=function(l){return typeof l=="function"},t.isPrimitive=function(l){return l===null||typeof l=="boolean"||typeof l=="number"||typeof l=="string"||typeof l=="symbol"||l===void 0},t.isBuffer=r.isBuffer}).call(this,n(5).Buffer)},function(e,t,n){(t=e.exports=n(77)).Stream=t,t.Readable=t,t.Writable=n(81),t.Duplex=n(25),t.Transform=n(82),t.PassThrough=n(188),t.finished=n(48),t.pipeline=n(189)},function(e,t,n){e.exports=function(r){return r}},function(e,t,n){var r={};function o(u,s,g){g||(g=Error);var c=function(d){var w,v;function y(f,p,S){return d.call(this,function(N,B,E){return typeof s=="string"?s:s(N,B,E)}(f,p,S))||this}return v=d,(w=y).prototype=Object.create(v.prototype),w.prototype.constructor=w,w.__proto__=v,y}(g);c.prototype.name=g.name,c.prototype.code=u,r[u]=c}function l(u,s){if(Array.isArray(u)){var g=u.length;return u=u.map(function(c){return String(c)}),g>2?"one of ".concat(s," ").concat(u.slice(0,g-1).join(", "),", or ")+u[g-1]:g===2?"one of ".concat(s," ").concat(u[0]," or ").concat(u[1]):"of ".concat(s," ").concat(u[0])}return"of ".concat(s," ").concat(String(u))}o("ERR_INVALID_OPT_VALUE",function(u,s){return'The value "'+s+'" is invalid for option "'+u+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(u,s,g){var c,d,w;if(typeof s=="string"&&(d="not ",s.substr(0,d.length)===d)?(c="must not be",s=s.replace(/^not /,"")):c="must be",function(y,f,p){return(p===void 0||p>y.length)&&(p=y.length),y.substring(p-f.length,p)===f}(u," argument"))w="The ".concat(u," ").concat(c," ").concat(l(s,"type"));else{var v=function(y,f,p){return typeof p!="number"&&(p=0),!(p+f.length>y.length)&&y.indexOf(f,p)!==-1}(u,".")?"property":"argument";w='The "'.concat(u,'" ').concat(v," ").concat(c," ").concat(l(s,"type"))}return w+=". Received type ".concat(typeof g)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var o=Object.keys||function(y){var f=[];for(var p in y)f.push(p);return f};e.exports=d;var l=n(143),u=n(61);n(7)(d,l);for(var s=o(u.prototype),g=0;g<s.length;g++){var c=s[g];d.prototype[c]||(d.prototype[c]=u.prototype[c])}function d(y){if(!(this instanceof d))return new d(y);l.call(this,y),u.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",w)))}function w(){this._writableState.ended||r.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this,n(2))},function(e,t,n){(function(r){r===void 0||!r.version||r.version.indexOf("v0.")===0||r.version.indexOf("v1.")===0&&r.version.indexOf("v1.8.")!==0?e.exports={nextTick:function(o,l,u,s){if(typeof o!="function")throw new TypeError('"callback" argument must be a function');var g,c,d=arguments.length;switch(d){case 0:case 1:return r.nextTick(o);case 2:return r.nextTick(function(){o.call(null,l)});case 3:return r.nextTick(function(){o.call(null,l,u)});case 4:return r.nextTick(function(){o.call(null,l,u,s)});default:for(g=new Array(d-1),c=0;c<g.length;)g[c++]=arguments[c];return r.nextTick(function(){o.apply(null,g)})}}}:e.exports=r}).call(this,n(2))},function(e,t,n){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function o(s,g){return Object.prototype.hasOwnProperty.call(s,g)}t.assign=function(s){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var c=g.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var d in c)o(c,d)&&(s[d]=c[d])}}return s},t.shrinkBuf=function(s,g){return s.length===g?s:s.subarray?s.subarray(0,g):(s.length=g,s)};var l={arraySet:function(s,g,c,d,w){if(g.subarray&&s.subarray)s.set(g.subarray(c,c+d),w);else for(var v=0;v<d;v++)s[w+v]=g[c+v]},flattenChunks:function(s){var g,c,d,w,v,y;for(d=0,g=0,c=s.length;g<c;g++)d+=s[g].length;for(y=new Uint8Array(d),w=0,g=0,c=s.length;g<c;g++)v=s[g],y.set(v,w),w+=v.length;return y}},u={arraySet:function(s,g,c,d,w){for(var v=0;v<d;v++)s[w+v]=g[c+v]},flattenChunks:function(s){return[].concat.apply([],s)}};t.setTyped=function(s){s?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,l)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,u))},t.setTyped(r)},function(e,t,n){e.exports=n(190)},function(e,t,n){n.d(t,"a",function(){return o});var r=n(233);const o=Object(r.a)()},function(e,t,n){n.d(t,"a",function(){return p});var r=n(100),o=n.n(r),l=n(1);class u extends Error{constructor(N,B,E){super(`Connection failure: ${N.message}`),this.cause=N,this.url=B,this.retryable=E,this.name="ConnectionError",Object.setPrototypeOf(this,new.target.prototype)}}var s=n(9),g=n(0),c=n(12),d=n(11);class w extends Error{constructor(N,B){super(`Invalid headers (${JSON.stringify(N)}) for response: ${B.message}`),this.validationErrors=N,this.responseError=B}}var v=function(S,N,B,E){return new(B||(B=Promise))(function(T,h){function R(m){try{X(E.next(m))}catch(_){h(_)}}function W(m){try{X(E.throw(m))}catch(_){h(_)}}function X(m){var _;m.done?T(m.value):(_=m.value,_ instanceof B?_:new B(function(G){G(_)})).then(R,W)}X((E=E.apply(S,N||[])).next())})},y=function(S,N){var B={};for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&N.indexOf(E)<0&&(B[E]=S[E]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var T=0;for(E=Object.getOwnPropertySymbols(S);T<E.length;T++)N.indexOf(E[T])<0&&Object.prototype.propertyIsEnumerable.call(S,E[T])&&(B[E[T]]=S[E[T]])}return B};const f=new Set(["GET","HEAD","PUT","QUERY","DELETE","OPTIONS","TRACE"]);class p{constructor(N,B={}){if(this.endpoint=N,this.validateHeaders=E=>B.validateHeaders?B.validateHeaders(E):{},this.verbose=B.verbose!==!1,B.retries!==void 0&&!(B.retries>=0))throw new Error("retries must be positive or zero");if(this.configuredRetries=B.retries,B.timeoutMs!==void 0&&!(B.timeoutMs>0))throw new Error("timeoutMs must be positive");if(this.timeoutMs=B.timeoutMs,B.maxBackoffDelayMs!==void 0&&!(B.maxBackoffDelayMs>0))throw new Error("maxBackoffDelayMs must be positive");this.maxBackoffDelayMs=B.maxBackoffDelayMs||30*l.a.second,this.json=B.json!==!1}getRetries(){return this.configuredRetries!==void 0?this.configuredRetries:this.getConstructor().retries}getHeaders(){return{}}fetch(N,B={}){return v(this,void 0,void 0,function*(){return(yield this.fetchVerbose(N,B)).body})}fetchVerbose(N,B={}){return v(this,void 0,void 0,function*(){let E=100*l.a.millisecond,T=0;const h=this.timeoutMs!==void 0?new Date().getTime()+this.timeoutMs:void 0,R=h?()=>Math.max(h-new Date().getTime(),0):void 0;for(;;)try{return yield this.doFetch(N,B,R)}catch(W){const X=W,m=Object(c.a)(X,u);if((R==null?void 0:R())===0||T===this.getRetries()||!m.retryable)throw m;T++,E=Math.min(...R?[R()]:[],E*(2+.1*(Math.random()-.5)),this.maxBackoffDelayMs),yield Object(s.a)(E),this.verbose&&g.a.warn(`Connection failure, retrying. Error: ${X.cause.message}`,{url:X.url,error:X.cause,attempt:T})}})}doFetch(N,B,E){return v(this,void 0,void 0,function*(){const{token:T,json:h=this.json,allowUnsafeRetries:R}=B,W=y(B,["token","json","allowUnsafeRetries"]),X=(W.method||"GET").toUpperCase(),m=this.endpoint!==void 0?`${this.endpoint}${N?`/${N}`:""}`:N,_=new AbortController;let G;if(E){const j=E();j>0?G=setTimeout(()=>{_.abort()},j):_.abort()}try{let j;yield Promise.race([this.getConstructor().waitForConnectivity(),new Promise(U=>{j=setTimeout(U,E?Math.min(l.a.minute,E()):l.a.minute)})]),j&&clearTimeout(j);const C=yield o()(m,Object.assign(Object.assign(Object.assign({},W),W.body!==void 0?{body:h!==!1?JSON.stringify(W.body):W.body}:{}),{headers:Object.assign(Object.assign(Object.assign(Object.assign({},h!==!1?{"Content-Type":"application/json"}:{}),this.getHeaders()),W.headers||{}),T!==void 0?{Authorization:`Bearer ${T}`}:{}),signal:_.signal})),z=C.headers.get("content-type")||"",P=z&&z.startsWith("application/json"),D=P?yield C.json():yield C.text(),O=()=>new d.a(X,m,W.body,C.status,C.headers,D,D&&D.validationErrors||{});if(!C.ok)throw this.verbose&&g.a[C.status>=500?"warn":"info"]("Response error",{method:X,url:m,statusCode:C.status}),O();const L=this.validateHeaders(C.headers);if(Object.keys(L).length!==0)throw new w(L,O());if(C.status===204)return{body:void 0,headers:C.headers};if(h&&!P)throw new Error(`Response is not JSON: ${JSON.stringify(D)}`);return{body:D,headers:C.headers}}catch(j){const C=j,z=R||f.has(X);if(C.message==="Network request failed")throw new u(C,m,z);if(C.type==="system"&&["EAI_AGAIN","ECONNREFUSED","EHOSTUNREACH","ENOTFOUND"].find(L=>L===C.code))throw new u(C,m,!0);if(C.type==="system"&&["ETIMEDOUT","ECONNRESET","ESOCKETTIMEDOUT","EPIPE"].find(L=>L===C.code))throw new u(C,m,z);if(C.name==="AbortError")throw new u(C,m,z);const P=Object(c.a)(C,d.a),{statusCode:D}=P;if(D===408||D===429||D===502||D===503||D===504)throw this.verbose&&!z&&g.a.warn("Potentially unsafe retry"),new u(C,m,!0);const O=this.validateHeaders(P.headers);throw Object.keys(O).length!==0?new w(O,P):(yield this.getConstructor().onResponseError(P),C)}finally{G&&clearTimeout(G)}})}getConstructor(){return Object.getPrototypeOf(this).constructor}}p.retries=8,p.waitForConnectivity=()=>v(void 0,void 0,void 0,function*(){}),p.onResponseError=()=>v(void 0,void 0,void 0,function*(){})},function(e,t,n){function r(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(58),u=n(3),s=u.LEVEL,g=u.MESSAGE;l.enabled=!0;var c=/\s+/,d=function(){function w(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,w),p.colors&&this.addColors(p.colors),this.options=p}var v,y,f;return v=w,f=[{key:"addColors",value:function(p){var S=Object.keys(p).reduce(function(N,B){return N[B]=c.test(p[B])?p[B].split(c):p[B],N},{});return w.allColors=Object.assign({},w.allColors||{},S),w.allColors}}],(y=[{key:"addColors",value:function(p){return w.addColors(p)}},{key:"colorize",value:function(p,S,N){if(N===void 0&&(N=S),!Array.isArray(w.allColors[p]))return l[w.allColors[p]](N);for(var B=0,E=w.allColors[p].length;B<E;B++)N=l[w.allColors[p][B]](N);return N}},{key:"transform",value:function(p,S){return S.all&&typeof p[g]=="string"&&(p[g]=this.colorize(p[s],p.level,p[g])),(S.level||S.all||!S.message)&&(p.level=this.colorize(p[s],p.level)),(S.all||S.message)&&(p.message=this.colorize(p[s],p.level,p.message)),p}}])&&o(v.prototype,y),f&&o(v,f),Object.defineProperty(v,"prototype",{writable:!1}),w}();e.exports=function(w){return new d(w)},e.exports.Colorizer=e.exports.Format=d},function(e,t,n){(function(r){function o(l){try{if(!r.localStorage)return!1}catch{return!1}var u=r.localStorage[l];return u!=null&&String(u).toLowerCase()==="true"}e.exports=function(l,u){if(o("noDeprecation"))return l;var s=!1;return function(){if(!s){if(o("throwDeprecation"))throw new Error(u);o("traceDeprecation")?console.trace(u):console.warn(u),s=!0}return l.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1==0},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var d=o(s);return g!==void 0?typeof c=="string"?d.fill(g,c):d.fill(g):d.fill(0),d},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){(function(r,o,l){var u=n(37);function s(_){var G=this;this.next=null,this.entry=null,this.finish=function(){(function(j,C,z){var P=j.entry;for(j.entry=null;P;){var D=P.callback;C.pendingcb--,D(z),P=P.next}C.corkedRequestsFree?C.corkedRequestsFree.next=j:C.corkedRequestsFree=j})(G,_)}}e.exports=E;var g,c=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?o:u.nextTick;E.WritableState=B;var d=Object.create(n(32));d.inherits=n(7);var w={deprecate:n(43)},v=n(71),y=n(46).Buffer,f=l.Uint8Array||function(){},p,S=n(72);function N(){}function B(_,G){g=g||n(22),_=_||{};var j=G instanceof g;this.objectMode=!!_.objectMode,j&&(this.objectMode=this.objectMode||!!_.writableObjectMode);var C=_.highWaterMark,z=_.writableHighWaterMark,P=this.objectMode?16:16384;this.highWaterMark=C||C===0?C:j&&(z||z===0)?z:P,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=_.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(O){(function(L,U){var A=L._writableState,V=A.sync,q=A.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(A),U)(function(ee,te,k,x,b){--te.pendingcb,k?(u.nextTick(b,x),u.nextTick(m,ee,te),ee._writableState.errorEmitted=!0,ee.emit("error",x)):(b(x),ee._writableState.errorEmitted=!0,ee.emit("error",x),m(ee,te))})(L,A,V,U,q);else{var Q=W(A);Q||A.corked||A.bufferProcessing||!A.bufferedRequest||R(L,A),V?c(h,L,A,Q,q):h(L,A,Q,q)}})(G,O)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function E(_){if(g=g||n(22),!(p.call(E,this)||this instanceof g))return new E(_);this._writableState=new B(_,this),this.writable=!0,_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final)),v.call(this)}function T(_,G,j,C,z,P,D){G.writelen=C,G.writecb=D,G.writing=!0,G.sync=!0,j?_._writev(z,G.onwrite):_._write(z,P,G.onwrite),G.sync=!1}function h(_,G,j,C){j||function(z,P){P.length===0&&P.needDrain&&(P.needDrain=!1,z.emit("drain"))}(_,G),G.pendingcb--,C(),m(_,G)}function R(_,G){G.bufferProcessing=!0;var j=G.bufferedRequest;if(_._writev&&j&&j.next){var C=G.bufferedRequestCount,z=new Array(C),P=G.corkedRequestsFree;P.entry=j;for(var D=0,O=!0;j;)z[D]=j,j.isBuf||(O=!1),j=j.next,D+=1;z.allBuffers=O,T(_,G,!0,G.length,z,"",P.finish),G.pendingcb++,G.lastBufferedRequest=null,P.next?(G.corkedRequestsFree=P.next,P.next=null):G.corkedRequestsFree=new s(G),G.bufferedRequestCount=0}else{for(;j;){var L=j.chunk,U=j.encoding,A=j.callback;if(T(_,G,!1,G.objectMode?1:L.length,L,U,A),j=j.next,G.bufferedRequestCount--,G.writing)break}j===null&&(G.lastBufferedRequest=null)}G.bufferedRequest=j,G.bufferProcessing=!1}function W(_){return _.ending&&_.length===0&&_.bufferedRequest===null&&!_.finished&&!_.writing}function X(_,G){_._final(function(j){G.pendingcb--,j&&_.emit("error",j),G.prefinished=!0,_.emit("prefinish"),m(_,G)})}function m(_,G){var j=W(G);return j&&(function(C,z){z.prefinished||z.finalCalled||(typeof C._final=="function"?(z.pendingcb++,z.finalCalled=!0,u.nextTick(X,C,z)):(z.prefinished=!0,C.emit("prefinish")))}(_,G),G.pendingcb===0&&(G.finished=!0,_.emit("finish"))),j}d.inherits(E,v),B.prototype.getBuffer=function(){for(var _=this.bufferedRequest,G=[];_;)G.push(_),_=_.next;return G},function(){try{Object.defineProperty(B.prototype,"buffer",{get:w.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(_){return!!p.call(this,_)||this===E&&_&&_._writableState instanceof B}})):p=function(_){return _ instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(_,G,j){var C,z=this._writableState,P=!1,D=!z.objectMode&&(C=_,y.isBuffer(C)||C instanceof f);return D&&!y.isBuffer(_)&&(_=function(O){return y.from(O)}(_)),typeof G=="function"&&(j=G,G=null),D?G="buffer":G||(G=z.defaultEncoding),typeof j!="function"&&(j=N),z.ended?function(O,L){var U=new Error("write after end");O.emit("error",U),u.nextTick(L,U)}(this,j):(D||function(O,L,U,A){var V=!0,q=!1;return U===null?q=new TypeError("May not write null values to stream"):typeof U=="string"||U===void 0||L.objectMode||(q=new TypeError("Invalid non-string/buffer chunk")),q&&(O.emit("error",q),u.nextTick(A,q),V=!1),V}(this,z,_,j))&&(z.pendingcb++,P=function(O,L,U,A,V,q){if(!U){var Q=function(x,b,I){return x.objectMode||x.decodeStrings===!1||typeof b!="string"||(b=y.from(b,I)),b}(L,A,V);A!==Q&&(U=!0,V="buffer",A=Q)}var ee=L.objectMode?1:A.length;L.length+=ee;var te=L.length<L.highWaterMark;if(te||(L.needDrain=!0),L.writing||L.corked){var k=L.lastBufferedRequest;L.lastBufferedRequest={chunk:A,encoding:V,isBuf:U,callback:q,next:null},k?k.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else T(O,L,!1,ee,A,V,q);return te}(this,z,D,_,G,j)),P},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var _=this._writableState;_.corked&&(_.corked--,_.writing||_.corked||_.finished||_.bufferProcessing||!_.bufferedRequest||R(this,_))},E.prototype.setDefaultEncoding=function(_){if(typeof _=="string"&&(_=_.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+_);return this._writableState.defaultEncoding=_,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(_,G,j){j(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(_,G,j){var C=this._writableState;typeof _=="function"?(j=_,_=null,G=null):typeof G=="function"&&(j=G,G=null),_!=null&&this.write(_,G),C.corked&&(C.corked=1,this.uncork()),C.ending||C.finished||function(z,P,D){P.ending=!0,m(z,P),D&&(P.finished?u.nextTick(D):z.once("finish",D)),P.ended=!0,z.writable=!1}(this,C,j)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(_){this._writableState&&(this._writableState.destroyed=_)}}),E.prototype.destroy=S.destroy,E.prototype._undestroy=S.undestroy,E.prototype._destroy=function(_,G){this.end(),G(_)}}).call(this,n(2),n(19).setImmediate,n(6))},function(e,t,n){var r=n(24).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function l(u,s,g){if(typeof s=="function")return l(u,null,s);s||(s={}),g=function(E){var T=!1;return function(){if(!T){T=!0;for(var h=arguments.length,R=new Array(h),W=0;W<h;W++)R[W]=arguments[W];E.apply(this,R)}}}(g||o);var c=s.readable||s.readable!==!1&&u.readable,d=s.writable||s.writable!==!1&&u.writable,w=function(){u.writable||y()},v=u._writableState&&u._writableState.finished,y=function(){d=!1,v=!0,c||g.call(u)},f=u._readableState&&u._readableState.endEmitted,p=function(){c=!1,f=!0,d||g.call(u)},S=function(E){g.call(u,E)},N=function(){var E;return c&&!f?(u._readableState&&u._readableState.ended||(E=new r),g.call(u,E)):d&&!v?(u._writableState&&u._writableState.ended||(E=new r),g.call(u,E)):void 0},B=function(){u.req.on("finish",y)};return function(E){return E.setHeader&&typeof E.abort=="function"}(u)?(u.on("complete",y),u.on("abort",N),u.req?B():u.on("request",B)):d&&!u._writableState&&(u.on("end",w),u.on("close",w)),u.on("end",p),u.on("finish",y),s.error!==!1&&u.on("error",S),u.on("close",N),function(){u.removeListener("complete",y),u.removeListener("abort",N),u.removeListener("request",B),u.req&&u.req.removeListener("finish",y),u.removeListener("end",w),u.removeListener("close",w),u.removeListener("finish",y),u.removeListener("end",p),u.removeListener("error",S),u.removeListener("close",N)}}},function(e,t,n){var r=n(57),o=n(3).configs;t.cli=r.levels(o.cli),t.npm=r.levels(o.npm),t.syslog=r.levels(o.syslog),t.addColors=r.levels},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(207)),o=s(n(208)),l=s(n(23)),u=s(n(30));function s(g){return g&&g.__esModule?g:{default:g}}t.default=(0,u.default)(function(g,c,d){return(0,r.default)(g,(0,o.default)((0,l.default)(c)),d)},3),e.exports=t.default},function(e,t,n){class r extends Error{constructor(l,...u){super(`env-var: ${l}`,...u),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="EnvVarError"}}e.exports=r},function(e,t,n){e.exports=function(r){const o=parseInt(r,10);if(isNaN(o)||o.toString(10)!==r)throw new Error("should be a valid integer");return o}},function(e,t,n){e.exports=function(r){const o=parseFloat(r);if(isNaN(o)||isNaN(r))throw new Error("should be a valid float");return o}},function(e,t,n){e.exports=function(r){try{return JSON.parse(r)}catch{throw new Error("should be valid (parseable) JSON")}}},function(e,t,n){(function(r){function o(s,g){for(var c=0,d=s.length-1;d>=0;d--){var w=s[d];w==="."?s.splice(d,1):w===".."?(s.splice(d,1),c++):c&&(s.splice(d,1),c--)}if(g)for(;c--;c)s.unshift("..");return s}function l(s,g){if(s.filter)return s.filter(g);for(var c=[],d=0;d<s.length;d++)g(s[d],d,s)&&c.push(s[d]);return c}t.resolve=function(){for(var s="",g=!1,c=arguments.length-1;c>=-1&&!g;c--){var d=c>=0?arguments[c]:r.cwd();if(typeof d!="string")throw new TypeError("Arguments to path.resolve must be strings");d&&(s=d+"/"+s,g=d.charAt(0)==="/")}return(g?"/":"")+(s=o(l(s.split("/"),function(w){return!!w}),!g).join("/"))||"."},t.normalize=function(s){var g=t.isAbsolute(s),c=u(s,-1)==="/";return(s=o(l(s.split("/"),function(d){return!!d}),!g).join("/"))||g||(s="."),s&&c&&(s+="/"),(g?"/":"")+s},t.isAbsolute=function(s){return s.charAt(0)==="/"},t.join=function(){var s=Array.prototype.slice.call(arguments,0);return t.normalize(l(s,function(g,c){if(typeof g!="string")throw new TypeError("Arguments to path.join must be strings");return g}).join("/"))},t.relative=function(s,g){function c(S){for(var N=0;N<S.length&&S[N]==="";N++);for(var B=S.length-1;B>=0&&S[B]==="";B--);return N>B?[]:S.slice(N,B-N+1)}s=t.resolve(s).substr(1),g=t.resolve(g).substr(1);for(var d=c(s.split("/")),w=c(g.split("/")),v=Math.min(d.length,w.length),y=v,f=0;f<v;f++)if(d[f]!==w[f]){y=f;break}var p=[];for(f=y;f<d.length;f++)p.push("..");return(p=p.concat(w.slice(y))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(s){if(typeof s!="string"&&(s+=""),s.length===0)return".";for(var g=s.charCodeAt(0),c=g===47,d=-1,w=!0,v=s.length-1;v>=1;--v)if((g=s.charCodeAt(v))===47){if(!w){d=v;break}}else w=!1;return d===-1?c?"/":".":c&&d===1?"/":s.slice(0,d)},t.basename=function(s,g){var c=function(d){typeof d!="string"&&(d+="");var w,v=0,y=-1,f=!0;for(w=d.length-1;w>=0;--w)if(d.charCodeAt(w)===47){if(!f){v=w+1;break}}else y===-1&&(f=!1,y=w+1);return y===-1?"":d.slice(v,y)}(s);return g&&c.substr(-1*g.length)===g&&(c=c.substr(0,c.length-g.length)),c},t.extname=function(s){typeof s!="string"&&(s+="");for(var g=-1,c=0,d=-1,w=!0,v=0,y=s.length-1;y>=0;--y){var f=s.charCodeAt(y);if(f!==47)d===-1&&(w=!1,d=y+1),f===46?g===-1?g=y:v!==1&&(v=1):g!==-1&&(v=-1);else if(!w){c=y+1;break}}return g===-1||d===-1||v===0||v===1&&g===d-1&&g===c+1?"":s.slice(g,d)};var u="ab".substr(-1)==="b"?function(s,g,c){return s.substr(g,c)}:function(s,g,c){return g<0&&(g=s.length+g),s.substr(g,c)}}).call(this,n(2))},,function(e,t,n){var r=t.format=n(8);t.levels=n(103),Object.defineProperty(r,"align",{value:n(120)}),Object.defineProperty(r,"cli",{value:n(121)}),Object.defineProperty(r,"colorize",{value:n(42)}),Object.defineProperty(r,"combine",{value:n(122)}),Object.defineProperty(r,"errors",{value:n(123)}),Object.defineProperty(r,"json",{value:n(124)}),Object.defineProperty(r,"label",{value:n(125)}),Object.defineProperty(r,"logstash",{value:n(126)}),Object.defineProperty(r,"metadata",{value:n(127)}),Object.defineProperty(r,"ms",{value:n(128)}),Object.defineProperty(r,"padLevels",{value:n(59)}),Object.defineProperty(r,"prettyPrint",{value:n(130)}),Object.defineProperty(r,"printf",{value:n(131)}),Object.defineProperty(r,"simple",{value:n(132)}),Object.defineProperty(r,"splat",{value:n(133)}),Object.defineProperty(r,"timestamp",{value:n(134)}),Object.defineProperty(r,"uncolorize",{value:n(136)})},function(e,t,n){var r=n(104);e.exports=r},function(e,t,n){function r(v){return function(y){if(Array.isArray(y))return o(y)}(v)||function(y){if(typeof Symbol<"u"&&y[Symbol.iterator]!=null||y["@@iterator"]!=null)return Array.from(y)}(v)||function(y,f){if(y){if(typeof y=="string")return o(y,f);var p=Object.prototype.toString.call(y).slice(8,-1);if(p==="Object"&&y.constructor&&(p=y.constructor.name),p==="Map"||p==="Set")return Array.from(y);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return o(y,f)}}(v)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(v,y){(y==null||y>v.length)&&(y=v.length);for(var f=0,p=new Array(y);f<y;f++)p[f]=v[f];return p}function l(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function u(v,y){for(var f=0;f<y.length;f++){var p=y[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(v,p.key,p)}}var s=n(3),g=s.configs,c=s.LEVEL,d=s.MESSAGE,w=function(){function v(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{levels:g.npm.levels};l(this,v),this.paddings=v.paddingForLevels(S.levels,S.filler),this.options=S}var y,f,p;return y=v,p=[{key:"getLongestLevel",value:function(S){var N=Object.keys(S).map(function(B){return B.length});return Math.max.apply(Math,r(N))}},{key:"paddingForLevel",value:function(S,N,B){var E=B+1-S.length,T=Math.floor(E/N.length);return"".concat(N).concat(N.repeat(T)).slice(0,E)}},{key:"paddingForLevels",value:function(S){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ",B=v.getLongestLevel(S);return Object.keys(S).reduce(function(E,T){return E[T]=v.paddingForLevel(T,N,B),E},{})}}],(f=[{key:"transform",value:function(S,N){return S.message="".concat(this.paddings[S[c]]).concat(S.message),S[d]&&(S[d]="".concat(this.paddings[S[c]]).concat(S[d])),S}}])&&u(y.prototype,f),p&&u(y,p),Object.defineProperty(y,"prototype",{writable:!1}),v}();e.exports=function(v){return new w(v)},e.exports.Padder=e.exports.Format=w},function(e,t,n){var r=n(13).format;t.warn={deprecated:function(o){return function(){throw new Error(r("{ %s } was removed in winston@3.0.0.",o))}},useFormat:function(o){return function(){throw new Error([r("{ %s } was removed in winston@3.0.0.",o),"Use a custom winston.format = winston.format(function) instead."].join(`
21
39
  `))}},forFunctions:function(o,l,u){u.forEach(function(s){o[s]=t.warn[l](s)})},moved:function(o,l,u){function s(){return function(){throw new Error([r("winston.%s was moved in winston@3.0.0.",u),r("Use a winston.%s instead.",l)].join(`
22
- `))}}Object.defineProperty(o,u,{get:s,set:s})},forProperties:function(o,l,u){u.forEach(function(s){var g=t.warn[l](s);Object.defineProperty(o,s,{get:g,set:g})})}}},function(e,t,n){(function(r,o,l){var u=n(16);function s(y){var C=this;this.next=null,this.entry=null,this.finish=function(){(function(w,x,H){var U=w.entry;for(w.entry=null;U;){var N=U.callback;x.pendingcb--,N(H),U=U.next}x.corkedRequestsFree?x.corkedRequestsFree.next=w:x.corkedRequestsFree=w})(C,y)}}e.exports=O;var g,c=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?o:u.nextTick;O.WritableState=L;var f=Object.create(n(17));f.inherits=n(7);var T={deprecate:n(43)},v=n(63),p=n(44).Buffer,d=l.Uint8Array||function(){},h,S=n(64);function I(){}function L(y,C){g=g||n(36),y=y||{};var w=C instanceof g;this.objectMode=!!y.objectMode,w&&(this.objectMode=this.objectMode||!!y.writableObjectMode);var x=y.highWaterMark,H=y.writableHighWaterMark,U=this.objectMode?16:16384;this.highWaterMark=x||x===0?x:w&&(H||H===0)?H:U,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var N=y.decodeStrings===!1;this.decodeStrings=!N,this.defaultEncoding=y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(k){(function(F,A){var b=F._writableState,B=b.sync,W=b.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(b),A)(function(ee,ne,X,$,E){--ne.pendingcb,X?(u.nextTick(E,$),u.nextTick(_,ee,ne),ee._writableState.errorEmitted=!0,ee.emit("error",$)):(E($),ee._writableState.errorEmitted=!0,ee.emit("error",$),_(ee,ne))})(F,b,B,A,W);else{var Q=G(b);Q||b.corked||b.bufferProcessing||!b.bufferedRequest||M(F,b),B?c(m,F,b,Q,W):m(F,b,Q,W)}})(C,k)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function O(y){if(g=g||n(36),!(h.call(O,this)||this instanceof g))return new O(y);this._writableState=new L(y,this),this.writable=!0,y&&(typeof y.write=="function"&&(this._write=y.write),typeof y.writev=="function"&&(this._writev=y.writev),typeof y.destroy=="function"&&(this._destroy=y.destroy),typeof y.final=="function"&&(this._final=y.final)),v.call(this)}function R(y,C,w,x,H,U,N){C.writelen=x,C.writecb=N,C.writing=!0,C.sync=!0,w?y._writev(H,C.onwrite):y._write(H,U,C.onwrite),C.sync=!1}function m(y,C,w,x){w||function(H,U){U.length===0&&U.needDrain&&(U.needDrain=!1,H.emit("drain"))}(y,C),C.pendingcb--,x(),_(y,C)}function M(y,C){C.bufferProcessing=!0;var w=C.bufferedRequest;if(y._writev&&w&&w.next){var x=C.bufferedRequestCount,H=new Array(x),U=C.corkedRequestsFree;U.entry=w;for(var N=0,k=!0;w;)H[N]=w,w.isBuf||(k=!1),w=w.next,N+=1;H.allBuffers=k,R(y,C,!0,C.length,H,"",U.finish),C.pendingcb++,C.lastBufferedRequest=null,U.next?(C.corkedRequestsFree=U.next,U.next=null):C.corkedRequestsFree=new s(C),C.bufferedRequestCount=0}else{for(;w;){var F=w.chunk,A=w.encoding,b=w.callback;if(R(y,C,!1,C.objectMode?1:F.length,F,A,b),w=w.next,C.bufferedRequestCount--,C.writing)break}w===null&&(C.lastBufferedRequest=null)}C.bufferedRequest=w,C.bufferProcessing=!1}function G(y){return y.ending&&y.length===0&&y.bufferedRequest===null&&!y.finished&&!y.writing}function Z(y,C){y._final(function(w){C.pendingcb--,w&&y.emit("error",w),C.prefinished=!0,y.emit("prefinish"),_(y,C)})}function _(y,C){var w=G(C);return w&&(function(x,H){H.prefinished||H.finalCalled||(typeof x._final=="function"?(H.pendingcb++,H.finalCalled=!0,u.nextTick(Z,x,H)):(H.prefinished=!0,x.emit("prefinish")))}(y,C),C.pendingcb===0&&(C.finished=!0,y.emit("finish"))),w}f.inherits(O,v),L.prototype.getBuffer=function(){for(var y=this.bufferedRequest,C=[];y;)C.push(y),y=y.next;return C},function(){try{Object.defineProperty(L.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(y){return!!h.call(this,y)||this===O&&y&&y._writableState instanceof L}})):h=function(y){return y instanceof this},O.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},O.prototype.write=function(y,C,w){var x,H=this._writableState,U=!1,N=!H.objectMode&&(x=y,p.isBuffer(x)||x instanceof d);return N&&!p.isBuffer(y)&&(y=function(k){return p.from(k)}(y)),typeof C=="function"&&(w=C,C=null),N?C="buffer":C||(C=H.defaultEncoding),typeof w!="function"&&(w=I),H.ended?function(k,F){var A=new Error("write after end");k.emit("error",A),u.nextTick(F,A)}(this,w):(N||function(k,F,A,b){var B=!0,W=!1;return A===null?W=new TypeError("May not write null values to stream"):typeof A=="string"||A===void 0||F.objectMode||(W=new TypeError("Invalid non-string/buffer chunk")),W&&(k.emit("error",W),u.nextTick(b,W),B=!1),B}(this,H,y,w))&&(H.pendingcb++,U=function(k,F,A,b,B,W){if(!A){var Q=function($,E,j){return $.objectMode||$.decodeStrings===!1||typeof E!="string"||(E=p.from(E,j)),E}(F,b,B);b!==Q&&(A=!0,B="buffer",b=Q)}var ee=F.objectMode?1:b.length;F.length+=ee;var ne=F.length<F.highWaterMark;if(ne||(F.needDrain=!0),F.writing||F.corked){var X=F.lastBufferedRequest;F.lastBufferedRequest={chunk:b,encoding:B,isBuf:A,callback:W,next:null},X?X.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else R(k,F,!1,ee,b,B,W);return ne}(this,H,N,y,C,w)),U},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var y=this._writableState;y.corked&&(y.corked--,y.writing||y.corked||y.finished||y.bufferProcessing||!y.bufferedRequest||M(this,y))},O.prototype.setDefaultEncoding=function(y){if(typeof y=="string"&&(y=y.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((y+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+y);return this._writableState.defaultEncoding=y,this},Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(y,C,w){w(new Error("_write() is not implemented"))},O.prototype._writev=null,O.prototype.end=function(y,C,w){var x=this._writableState;typeof y=="function"?(w=y,y=null,C=null):typeof C=="function"&&(w=C,C=null),y!=null&&this.write(y,C),x.corked&&(x.corked=1,this.uncork()),x.ending||x.finished||function(H,U,N){U.ending=!0,_(H,U),N&&(U.finished?u.nextTick(N):H.once("finish",N)),U.ended=!0,H.writable=!1}(this,x,w)},Object.defineProperty(O.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(y){this._writableState&&(this._writableState.destroyed=y)}}),O.prototype.destroy=S.destroy,O.prototype._undestroy=S.undestroy,O.prototype._destroy=function(y,C){this.end(),C(y)}}).call(this,n(2),n(15).setImmediate,n(6))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){var r=n(16);function o(l,u){l.emit("error",u)}e.exports={destroy:function(l,u){var s=this,g=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return g||c?(u?u(l):!l||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,l),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(f){!u&&f?(r.nextTick(o,s,f),s._writableState&&(s._writableState.errorEmitted=!0)):u&&u(f)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t){},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(155)),o=u(n(25)),l=u(n(31));function u(s){return s&&s.__esModule?s:{default:s}}t.default=(0,l.default)(function(s,g,c,f){return(0,r.default)(g)(s,(0,o.default)(c),f)},4),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){function o(...l){if(r!==null){var u=r;r=null,u.apply(this,l)}}return Object.assign(o,r),o},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...o){if(r===null)throw new Error("Callback was already called.");var l=r;r=null,l.apply(this,o)}},e.exports=t.default},function(e,t,n){(function(r,o){var l=n(16);e.exports=R;var u,s=n(42);R.ReadableState=O,n(21).EventEmitter;var g=function(A,b){return A.listeners(b).length},c=n(70),f=n(47).Buffer,T=r.Uint8Array||function(){},v=n(17);v.inherits=n(7);var p=n(161),d=void 0;d=p&&p.debuglog?p.debuglog("stream"):function(){};var h,S=n(162),I=n(71);v.inherits(R,c);var L=["error","close","destroy","pause","resume"];function O(A,b){A=A||{};var B=b instanceof(u=u||n(23));this.objectMode=!!A.objectMode,B&&(this.objectMode=this.objectMode||!!A.readableObjectMode);var W=A.highWaterMark,Q=A.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=W||W===0?W:B&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new S,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=A.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,A.encoding&&(h||(h=n(22).StringDecoder),this.decoder=new h(A.encoding),this.encoding=A.encoding)}function R(A){if(u=u||n(23),!(this instanceof R))return new R(A);this._readableState=new O(A,this),this.readable=!0,A&&(typeof A.read=="function"&&(this._read=A.read),typeof A.destroy=="function"&&(this._destroy=A.destroy)),c.call(this)}function m(A,b,B,W,Q){var ee,ne=A._readableState;return b===null?(ne.reading=!1,function(X,$){if(!$.ended){if($.decoder){var E=$.decoder.end();E&&E.length&&($.buffer.push(E),$.length+=$.objectMode?1:E.length)}$.ended=!0,Z(X)}}(A,ne)):(Q||(ee=function(X,$){var E;j=$,f.isBuffer(j)||j instanceof T||typeof $=="string"||$===void 0||X.objectMode||(E=new TypeError("Invalid non-string/buffer chunk"));var j;return E}(ne,b)),ee?A.emit("error",ee):ne.objectMode||b&&b.length>0?(typeof b=="string"||ne.objectMode||Object.getPrototypeOf(b)===f.prototype||(b=function(X){return f.from(X)}(b)),W?ne.endEmitted?A.emit("error",new Error("stream.unshift() after end event")):M(A,ne,b,!0):ne.ended?A.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!B?(b=ne.decoder.write(b),ne.objectMode||b.length!==0?M(A,ne,b,!1):y(A,ne)):M(A,ne,b,!1))):W||(ne.reading=!1)),function(X){return!X.ended&&(X.needReadable||X.length<X.highWaterMark||X.length===0)}(ne)}function M(A,b,B,W){b.flowing&&b.length===0&&!b.sync?(A.emit("data",B),A.read(0)):(b.length+=b.objectMode?1:B.length,W?b.buffer.unshift(B):b.buffer.push(B),b.needReadable&&Z(A)),y(A,b)}Object.defineProperty(R.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(A){this._readableState&&(this._readableState.destroyed=A)}}),R.prototype.destroy=I.destroy,R.prototype._undestroy=I.undestroy,R.prototype._destroy=function(A,b){this.push(null),b(A)},R.prototype.push=function(A,b){var B,W=this._readableState;return W.objectMode?B=!0:typeof A=="string"&&((b=b||W.defaultEncoding)!==W.encoding&&(A=f.from(A,b),b=""),B=!0),m(this,A,b,!1,B)},R.prototype.unshift=function(A){return m(this,A,null,!0,!1)},R.prototype.isPaused=function(){return this._readableState.flowing===!1},R.prototype.setEncoding=function(A){return h||(h=n(22).StringDecoder),this._readableState.decoder=new h(A),this._readableState.encoding=A,this};function G(A,b){return A<=0||b.length===0&&b.ended?0:b.objectMode?1:A!=A?b.flowing&&b.length?b.buffer.head.data.length:b.length:(A>b.highWaterMark&&(b.highWaterMark=function(B){return B>=8388608?B=8388608:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}(A)),A<=b.length?A:b.ended?b.length:(b.needReadable=!0,0))}function Z(A){var b=A._readableState;b.needReadable=!1,b.emittedReadable||(d("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?l.nextTick(_,A):_(A))}function _(A){d("emit readable"),A.emit("readable"),H(A)}function y(A,b){b.readingMore||(b.readingMore=!0,l.nextTick(C,A,b))}function C(A,b){for(var B=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length<b.highWaterMark&&(d("maybeReadMore read 0"),A.read(0),B!==b.length);)B=b.length;b.readingMore=!1}function w(A){d("readable nexttick read 0"),A.read(0)}function x(A,b){b.reading||(d("resume read 0"),A.read(0)),b.resumeScheduled=!1,b.awaitDrain=0,A.emit("resume"),H(A),b.flowing&&!b.reading&&A.read(0)}function H(A){var b=A._readableState;for(d("flow",b.flowing);b.flowing&&A.read()!==null;);}function U(A,b){return b.length===0?null:(b.objectMode?B=b.buffer.shift():!A||A>=b.length?(B=b.decoder?b.buffer.join(""):b.buffer.length===1?b.buffer.head.data:b.buffer.concat(b.length),b.buffer.clear()):B=function(W,Q,ee){var ne;return W<Q.head.data.length?(ne=Q.head.data.slice(0,W),Q.head.data=Q.head.data.slice(W)):ne=W===Q.head.data.length?Q.shift():ee?function(X,$){var E=$.head,j=1,V=E.data;for(X-=V.length;E=E.next;){var K=E.data,Y=X>K.length?K.length:X;if(Y===K.length?V+=K:V+=K.slice(0,X),(X-=Y)===0){Y===K.length?(++j,E.next?$.head=E.next:$.head=$.tail=null):($.head=E,E.data=K.slice(Y));break}++j}return $.length-=j,V}(W,Q):function(X,$){var E=f.allocUnsafe(X),j=$.head,V=1;for(j.data.copy(E),X-=j.data.length;j=j.next;){var K=j.data,Y=X>K.length?K.length:X;if(K.copy(E,E.length-X,0,Y),(X-=Y)===0){Y===K.length?(++V,j.next?$.head=j.next:$.head=$.tail=null):($.head=j,j.data=K.slice(Y));break}++V}return $.length-=V,E}(W,Q),ne}(A,b.buffer,b.decoder),B);var B}function N(A){var b=A._readableState;if(b.length>0)throw new Error('"endReadable()" called on non-empty stream');b.endEmitted||(b.ended=!0,l.nextTick(k,b,A))}function k(A,b){A.endEmitted||A.length!==0||(A.endEmitted=!0,b.readable=!1,b.emit("end"))}function F(A,b){for(var B=0,W=A.length;B<W;B++)if(A[B]===b)return B;return-1}R.prototype.read=function(A){d("read",A),A=parseInt(A,10);var b=this._readableState,B=A;if(A!==0&&(b.emittedReadable=!1),A===0&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return d("read: emitReadable",b.length,b.ended),b.length===0&&b.ended?N(this):Z(this),null;if((A=G(A,b))===0&&b.ended)return b.length===0&&N(this),null;var W,Q=b.needReadable;return d("need readable",Q),(b.length===0||b.length-A<b.highWaterMark)&&d("length less than watermark",Q=!0),b.ended||b.reading?d("reading or ended",Q=!1):Q&&(d("do read"),b.reading=!0,b.sync=!0,b.length===0&&(b.needReadable=!0),this._read(b.highWaterMark),b.sync=!1,b.reading||(A=G(B,b))),(W=A>0?U(A,b):null)===null?(b.needReadable=!0,A=0):b.length-=A,b.length===0&&(b.ended||(b.needReadable=!0),B!==A&&b.ended&&N(this)),W!==null&&this.emit("data",W),W},R.prototype._read=function(A){this.emit("error",new Error("_read() is not implemented"))},R.prototype.pipe=function(A,b){var B=this,W=this._readableState;switch(W.pipesCount){case 0:W.pipes=A;break;case 1:W.pipes=[W.pipes,A];break;default:W.pipes.push(A)}W.pipesCount+=1,d("pipe count=%d opts=%j",W.pipesCount,b);var Q=(!b||b.end!==!1)&&A!==o.stdout&&A!==o.stderr?ne:re;function ee(oe,ue){d("onunpipe"),oe===B&&ue&&ue.hasUnpiped===!1&&(ue.hasUnpiped=!0,d("cleanup"),A.removeListener("close",K),A.removeListener("finish",Y),A.removeListener("drain",X),A.removeListener("error",V),A.removeListener("unpipe",ee),B.removeListener("end",ne),B.removeListener("end",re),B.removeListener("data",j),$=!0,!W.awaitDrain||A._writableState&&!A._writableState.needDrain||X())}function ne(){d("onend"),A.end()}W.endEmitted?l.nextTick(Q):B.once("end",Q),A.on("unpipe",ee);var X=function(oe){return function(){var ue=oe._readableState;d("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&g(oe,"data")&&(ue.flowing=!0,H(oe))}}(B);A.on("drain",X);var $=!1,E=!1;function j(oe){d("ondata"),E=!1,A.write(oe)!==!1||E||((W.pipesCount===1&&W.pipes===A||W.pipesCount>1&&F(W.pipes,A)!==-1)&&!$&&(d("false write response, pause",B._readableState.awaitDrain),B._readableState.awaitDrain++,E=!0),B.pause())}function V(oe){d("onerror",oe),re(),A.removeListener("error",V),g(A,"error")===0&&A.emit("error",oe)}function K(){A.removeListener("finish",Y),re()}function Y(){d("onfinish"),A.removeListener("close",K),re()}function re(){d("unpipe"),B.unpipe(A)}return B.on("data",j),function(oe,ue,ve){if(typeof oe.prependListener=="function")return oe.prependListener(ue,ve);oe._events&&oe._events[ue]?s(oe._events[ue])?oe._events[ue].unshift(ve):oe._events[ue]=[ve,oe._events[ue]]:oe.on(ue,ve)}(A,"error",V),A.once("close",K),A.once("finish",Y),A.emit("pipe",B),W.flowing||(d("pipe resume"),B.resume()),A},R.prototype.unpipe=function(A){var b=this._readableState,B={hasUnpiped:!1};if(b.pipesCount===0)return this;if(b.pipesCount===1)return A&&A!==b.pipes||(A||(A=b.pipes),b.pipes=null,b.pipesCount=0,b.flowing=!1,A&&A.emit("unpipe",this,B)),this;if(!A){var W=b.pipes,Q=b.pipesCount;b.pipes=null,b.pipesCount=0,b.flowing=!1;for(var ee=0;ee<Q;ee++)W[ee].emit("unpipe",this,B);return this}var ne=F(b.pipes,A);return ne===-1||(b.pipes.splice(ne,1),b.pipesCount-=1,b.pipesCount===1&&(b.pipes=b.pipes[0]),A.emit("unpipe",this,B)),this},R.prototype.on=function(A,b){var B=c.prototype.on.call(this,A,b);if(A==="data")this._readableState.flowing!==!1&&this.resume();else if(A==="readable"){var W=this._readableState;W.endEmitted||W.readableListening||(W.readableListening=W.needReadable=!0,W.emittedReadable=!1,W.reading?W.length&&Z(this):l.nextTick(w,this))}return B},R.prototype.addListener=R.prototype.on,R.prototype.resume=function(){var A=this._readableState;return A.flowing||(d("resume"),A.flowing=!0,function(b,B){B.resumeScheduled||(B.resumeScheduled=!0,l.nextTick(x,b,B))}(this,A)),this},R.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},R.prototype.wrap=function(A){var b=this,B=this._readableState,W=!1;for(var Q in A.on("end",function(){if(d("wrapped end"),B.decoder&&!B.ended){var ne=B.decoder.end();ne&&ne.length&&b.push(ne)}b.push(null)}),A.on("data",function(ne){d("wrapped data"),B.decoder&&(ne=B.decoder.write(ne)),B.objectMode&&ne==null||(B.objectMode||ne&&ne.length)&&(b.push(ne)||(W=!0,A.pause()))}),A)this[Q]===void 0&&typeof A[Q]=="function"&&(this[Q]=function(ne){return function(){return A[ne].apply(A,arguments)}}(Q));for(var ee=0;ee<L.length;ee++)A.on(L[ee],this.emit.bind(this,L[ee]));return this._read=function(ne){d("wrapped _read",ne),W&&(W=!1,A.resume())},this},Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),R._fromList=U}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){var r=n(16);function o(l,u){l.emit("error",u)}e.exports={destroy:function(l,u){var s=this,g=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return g||c?(u?u(l):!l||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,l),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(f){!u&&f?(r.nextTick(o,s,f),s._writableState&&(s._writableState.errorEmitted=!0)):u&&u(f)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){e.exports=u;var r=n(23),o=n(17);function l(c,f){var T=this._transformState;T.transforming=!1;var v=T.writecb;if(!v)return this.emit("error",new Error("write callback called multiple times"));T.writechunk=null,T.writecb=null,f!=null&&this.push(f),v(c);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function u(c){if(!(this instanceof u))return new u(c);r.call(this,c),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",s)}function s(){var c=this;typeof this._flush=="function"?this._flush(function(f,T){g(c,f,T)}):g(this,null,null)}function g(c,f,T){if(f)return c.emit("error",f);if(T!=null&&c.push(T),c._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(c._transformState.transforming)throw new Error("Calling transform done when still transforming");return c.push(null)}o.inherits=n(7),o.inherits(u,r),u.prototype.push=function(c,f){return this._transformState.needTransform=!1,r.prototype.push.call(this,c,f)},u.prototype._transform=function(c,f,T){throw new Error("_transform() is not implemented")},u.prototype._write=function(c,f,T){var v=this._transformState;if(v.writecb=T,v.writechunk=c,v.writeencoding=f,!v.transforming){var p=this._readableState;(v.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},u.prototype._read=function(c){var f=this._transformState;f.writechunk!==null&&f.writecb&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},u.prototype._destroy=function(c,f){var T=this;r.prototype._destroy.call(this,c,function(v){f(v),T.emit("close")})}},function(e,t,n){e.exports=n(48)},function(e,t,n){(function(r){var o=n(169);function l(_,y){if(_===y)return 0;for(var C=_.length,w=y.length,x=0,H=Math.min(C,w);x<H;++x)if(_[x]!==y[x]){C=_[x],w=y[x];break}return C<w?-1:w<C?1:0}function u(_){return r.Buffer&&typeof r.Buffer.isBuffer=="function"?r.Buffer.isBuffer(_):!(_==null||!_._isBuffer)}var s=n(13),g=Object.prototype.hasOwnProperty,c=Array.prototype.slice,f=function(){}.name==="foo";function T(_){return Object.prototype.toString.call(_)}function v(_){return!u(_)&&typeof r.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(_):!!_&&(_ instanceof DataView||!!(_.buffer&&_.buffer instanceof ArrayBuffer)))}var p=e.exports=O,d=/\s*function\s+([^\(\s]*)\s*/;function h(_){if(s.isFunction(_)){if(f)return _.name;var y=_.toString().match(d);return y&&y[1]}}function S(_,y){return typeof _=="string"?_.length<y?_:_.slice(0,y):_}function I(_){if(f||!s.isFunction(_))return s.inspect(_);var y=h(_);return"[Function"+(y?": "+y:"")+"]"}function L(_,y,C,w,x){throw new p.AssertionError({message:C,actual:_,expected:y,operator:w,stackStartFunction:x})}function O(_,y){_||L(_,!0,y,"==",p.ok)}function R(_,y,C,w){if(_===y)return!0;if(u(_)&&u(y))return l(_,y)===0;if(s.isDate(_)&&s.isDate(y))return _.getTime()===y.getTime();if(s.isRegExp(_)&&s.isRegExp(y))return _.source===y.source&&_.global===y.global&&_.multiline===y.multiline&&_.lastIndex===y.lastIndex&&_.ignoreCase===y.ignoreCase;if(_!==null&&typeof _=="object"||y!==null&&typeof y=="object"){if(v(_)&&v(y)&&T(_)===T(y)&&!(_ instanceof Float32Array||_ instanceof Float64Array))return l(new Uint8Array(_.buffer),new Uint8Array(y.buffer))===0;if(u(_)!==u(y))return!1;var x=(w=w||{actual:[],expected:[]}).actual.indexOf(_);return x!==-1&&x===w.expected.indexOf(y)||(w.actual.push(_),w.expected.push(y),function(H,U,N,k){if(H==null||U==null)return!1;if(s.isPrimitive(H)||s.isPrimitive(U))return H===U;if(N&&Object.getPrototypeOf(H)!==Object.getPrototypeOf(U))return!1;var F=m(H),A=m(U);if(F&&!A||!F&&A)return!1;if(F)return H=c.call(H),U=c.call(U),R(H,U,N);var b,B,W=Z(H),Q=Z(U);if(W.length!==Q.length)return!1;for(W.sort(),Q.sort(),B=W.length-1;B>=0;B--)if(W[B]!==Q[B])return!1;for(B=W.length-1;B>=0;B--)if(b=W[B],!R(H[b],U[b],N,k))return!1;return!0}(_,y,C,w))}return C?_===y:_==y}function m(_){return Object.prototype.toString.call(_)=="[object Arguments]"}function M(_,y){if(!_||!y)return!1;if(Object.prototype.toString.call(y)=="[object RegExp]")return y.test(_);try{if(_ instanceof y)return!0}catch{}return!Error.isPrototypeOf(y)&&y.call({},_)===!0}function G(_,y,C,w){var x;if(typeof y!="function")throw new TypeError('"block" argument must be a function');typeof C=="string"&&(w=C,C=null),x=function(N){var k;try{N()}catch(F){k=F}return k}(y),w=(C&&C.name?" ("+C.name+").":".")+(w?" "+w:"."),_&&!x&&L(x,C,"Missing expected exception"+w);var H=typeof w=="string",U=!_&&x&&!C;if((!_&&s.isError(x)&&H&&M(x,C)||U)&&L(x,C,"Got unwanted exception"+w),_&&x&&C&&!M(x,C)||!_&&x)throw x}p.AssertionError=function(_){this.name="AssertionError",this.actual=_.actual,this.expected=_.expected,this.operator=_.operator,_.message?(this.message=_.message,this.generatedMessage=!1):(this.message=function(N){return S(I(N.actual),128)+" "+N.operator+" "+S(I(N.expected),128)}(this),this.generatedMessage=!0);var y=_.stackStartFunction||L;if(Error.captureStackTrace)Error.captureStackTrace(this,y);else{var C=new Error;if(C.stack){var w=C.stack,x=h(y),H=w.indexOf(`
23
- `+x);if(H>=0){var U=w.indexOf(`
24
- `,H+1);w=w.substring(U+1)}this.stack=w}}},s.inherits(p.AssertionError,Error),p.fail=L,p.ok=O,p.equal=function(_,y,C){_!=y&&L(_,y,C,"==",p.equal)},p.notEqual=function(_,y,C){_==y&&L(_,y,C,"!=",p.notEqual)},p.deepEqual=function(_,y,C){R(_,y,!1)||L(_,y,C,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(_,y,C){R(_,y,!0)||L(_,y,C,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(_,y,C){R(_,y,!1)&&L(_,y,C,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function _(y,C,w){R(y,C,!0)&&L(y,C,w,"notDeepStrictEqual",_)},p.strictEqual=function(_,y,C){_!==y&&L(_,y,C,"===",p.strictEqual)},p.notStrictEqual=function(_,y,C){_===y&&L(_,y,C,"!==",p.notStrictEqual)},p.throws=function(_,y,C){G(!0,_,y,C)},p.doesNotThrow=function(_,y,C){G(!1,_,y,C)},p.ifError=function(_){if(_)throw _},p.strict=o(function _(y,C){y||L(y,!0,C,"==",_)},p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var Z=Object.keys||function(_){var y=[];for(var C in _)g.call(_,C)&&y.push(C);return y}}).call(this,n(6))},function(e,t,n){e.exports=function(r,o,l,u){for(var s=65535&r|0,g=r>>>16&65535|0,c=0;l!==0;){l-=c=l>2e3?2e3:l;do g=g+(s=s+o[u++]|0)|0;while(--c);s%=65521,g%=65521}return s|g<<16|0}},function(e,t,n){var r=function(){for(var o,l=[],u=0;u<256;u++){o=u;for(var s=0;s<8;s++)o=1&o?3988292384^o>>>1:o>>>1;l[u]=o}return l}();e.exports=function(o,l,u,s){var g=r,c=s+u;o^=-1;for(var f=s;f<c;f++)o=o>>>8^g[255&(o^l[f])];return-1^o}},function(e,t,n){(function(r,o){var l;e.exports=y,y.ReadableState=_,n(21).EventEmitter;var u=function(X,$){return X.listeners($).length},s=n(78),g=n(5).Buffer,c=r.Uint8Array||function(){},f,T=n(178);f=T&&T.debuglog?T.debuglog("stream"):function(){};var v,p,d,h=n(179),S=n(79),I=n(80).getHighWaterMark,L=n(26).codes,O=L.ERR_INVALID_ARG_TYPE,R=L.ERR_STREAM_PUSH_AFTER_EOF,m=L.ERR_METHOD_NOT_IMPLEMENTED,M=L.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(y,s);var G=S.errorOrDestroy,Z=["error","close","destroy","pause","resume"];function _(X,$,E){l=l||n(27),X=X||{},typeof E!="boolean"&&(E=$ instanceof l),this.objectMode=!!X.objectMode,E&&(this.objectMode=this.objectMode||!!X.readableObjectMode),this.highWaterMark=I(this,X,"readableHighWaterMark",E),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=X.emitClose!==!1,this.autoDestroy=!!X.autoDestroy,this.destroyed=!1,this.defaultEncoding=X.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,X.encoding&&(v||(v=n(22).StringDecoder),this.decoder=new v(X.encoding),this.encoding=X.encoding)}function y(X){if(l=l||n(27),!(this instanceof y))return new y(X);var $=this instanceof l;this._readableState=new _(X,this,$),this.readable=!0,X&&(typeof X.read=="function"&&(this._read=X.read),typeof X.destroy=="function"&&(this._destroy=X.destroy)),s.call(this)}function C(X,$,E,j,V){f("readableAddChunk",$);var K,Y=X._readableState;if($===null)Y.reading=!1,function(re,oe){if(f("onEofChunk"),!oe.ended){if(oe.decoder){var ue=oe.decoder.end();ue&&ue.length&&(oe.buffer.push(ue),oe.length+=oe.objectMode?1:ue.length)}oe.ended=!0,oe.sync?H(re):(oe.needReadable=!1,oe.emittedReadable||(oe.emittedReadable=!0,U(re)))}}(X,Y);else if(V||(K=function(re,oe){var ue;ve=oe,g.isBuffer(ve)||ve instanceof c||typeof oe=="string"||oe===void 0||re.objectMode||(ue=new O("chunk",["string","Buffer","Uint8Array"],oe));var ve;return ue}(Y,$)),K)G(X,K);else if(Y.objectMode||$&&$.length>0)if(typeof $=="string"||Y.objectMode||Object.getPrototypeOf($)===g.prototype||($=function(re){return g.from(re)}($)),j)Y.endEmitted?G(X,new M):w(X,Y,$,!0);else if(Y.ended)G(X,new R);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!E?($=Y.decoder.write($),Y.objectMode||$.length!==0?w(X,Y,$,!1):N(X,Y)):w(X,Y,$,!1)}else j||(Y.reading=!1,N(X,Y));return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function w(X,$,E,j){$.flowing&&$.length===0&&!$.sync?($.awaitDrain=0,X.emit("data",E)):($.length+=$.objectMode?1:E.length,j?$.buffer.unshift(E):$.buffer.push(E),$.needReadable&&H(X)),N(X,$)}Object.defineProperty(y.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(X){this._readableState&&(this._readableState.destroyed=X)}}),y.prototype.destroy=S.destroy,y.prototype._undestroy=S.undestroy,y.prototype._destroy=function(X,$){$(X)},y.prototype.push=function(X,$){var E,j=this._readableState;return j.objectMode?E=!0:typeof X=="string"&&(($=$||j.defaultEncoding)!==j.encoding&&(X=g.from(X,$),$=""),E=!0),C(this,X,$,!1,E)},y.prototype.unshift=function(X){return C(this,X,null,!0,!1)},y.prototype.isPaused=function(){return this._readableState.flowing===!1},y.prototype.setEncoding=function(X){v||(v=n(22).StringDecoder);var $=new v(X);this._readableState.decoder=$,this._readableState.encoding=this._readableState.decoder.encoding;for(var E=this._readableState.buffer.head,j="";E!==null;)j+=$.write(E.data),E=E.next;return this._readableState.buffer.clear(),j!==""&&this._readableState.buffer.push(j),this._readableState.length=j.length,this};function x(X,$){return X<=0||$.length===0&&$.ended?0:$.objectMode?1:X!=X?$.flowing&&$.length?$.buffer.head.data.length:$.length:(X>$.highWaterMark&&($.highWaterMark=function(E){return E>=1073741824?E=1073741824:(E--,E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E++),E}(X)),X<=$.length?X:$.ended?$.length:($.needReadable=!0,0))}function H(X){var $=X._readableState;f("emitReadable",$.needReadable,$.emittedReadable),$.needReadable=!1,$.emittedReadable||(f("emitReadable",$.flowing),$.emittedReadable=!0,o.nextTick(U,X))}function U(X){var $=X._readableState;f("emitReadable_",$.destroyed,$.length,$.ended),$.destroyed||!$.length&&!$.ended||(X.emit("readable"),$.emittedReadable=!1),$.needReadable=!$.flowing&&!$.ended&&$.length<=$.highWaterMark,B(X)}function N(X,$){$.readingMore||($.readingMore=!0,o.nextTick(k,X,$))}function k(X,$){for(;!$.reading&&!$.ended&&($.length<$.highWaterMark||$.flowing&&$.length===0);){var E=$.length;if(f("maybeReadMore read 0"),X.read(0),E===$.length)break}$.readingMore=!1}function F(X){var $=X._readableState;$.readableListening=X.listenerCount("readable")>0,$.resumeScheduled&&!$.paused?$.flowing=!0:X.listenerCount("data")>0&&X.resume()}function A(X){f("readable nexttick read 0"),X.read(0)}function b(X,$){f("resume",$.reading),$.reading||X.read(0),$.resumeScheduled=!1,X.emit("resume"),B(X),$.flowing&&!$.reading&&X.read(0)}function B(X){var $=X._readableState;for(f("flow",$.flowing);$.flowing&&X.read()!==null;);}function W(X,$){return $.length===0?null:($.objectMode?E=$.buffer.shift():!X||X>=$.length?(E=$.decoder?$.buffer.join(""):$.buffer.length===1?$.buffer.first():$.buffer.concat($.length),$.buffer.clear()):E=$.buffer.consume(X,$.decoder),E);var E}function Q(X){var $=X._readableState;f("endReadable",$.endEmitted),$.endEmitted||($.ended=!0,o.nextTick(ee,$,X))}function ee(X,$){if(f("endReadableNT",X.endEmitted,X.length),!X.endEmitted&&X.length===0&&(X.endEmitted=!0,$.readable=!1,$.emit("end"),X.autoDestroy)){var E=$._writableState;(!E||E.autoDestroy&&E.finished)&&$.destroy()}}function ne(X,$){for(var E=0,j=X.length;E<j;E++)if(X[E]===$)return E;return-1}y.prototype.read=function(X){f("read",X),X=parseInt(X,10);var $=this._readableState,E=X;if(X!==0&&($.emittedReadable=!1),X===0&&$.needReadable&&(($.highWaterMark!==0?$.length>=$.highWaterMark:$.length>0)||$.ended))return f("read: emitReadable",$.length,$.ended),$.length===0&&$.ended?Q(this):H(this),null;if((X=x(X,$))===0&&$.ended)return $.length===0&&Q(this),null;var j,V=$.needReadable;return f("need readable",V),($.length===0||$.length-X<$.highWaterMark)&&f("length less than watermark",V=!0),$.ended||$.reading?f("reading or ended",V=!1):V&&(f("do read"),$.reading=!0,$.sync=!0,$.length===0&&($.needReadable=!0),this._read($.highWaterMark),$.sync=!1,$.reading||(X=x(E,$))),(j=X>0?W(X,$):null)===null?($.needReadable=$.length<=$.highWaterMark,X=0):($.length-=X,$.awaitDrain=0),$.length===0&&($.ended||($.needReadable=!0),E!==X&&$.ended&&Q(this)),j!==null&&this.emit("data",j),j},y.prototype._read=function(X){G(this,new m("_read()"))},y.prototype.pipe=function(X,$){var E=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=X;break;case 1:j.pipes=[j.pipes,X];break;default:j.pipes.push(X)}j.pipesCount+=1,f("pipe count=%d opts=%j",j.pipesCount,$);var V=(!$||$.end!==!1)&&X!==o.stdout&&X!==o.stderr?Y:Ne;function K(Oe,Ce){f("onunpipe"),Oe===E&&Ce&&Ce.hasUnpiped===!1&&(Ce.hasUnpiped=!0,f("cleanup"),X.removeListener("close",Re),X.removeListener("finish",Te),X.removeListener("drain",re),X.removeListener("error",ve),X.removeListener("unpipe",K),E.removeListener("end",Y),E.removeListener("end",Ne),E.removeListener("data",ue),oe=!0,!j.awaitDrain||X._writableState&&!X._writableState.needDrain||re())}function Y(){f("onend"),X.end()}j.endEmitted?o.nextTick(V):E.once("end",V),X.on("unpipe",K);var re=function(Oe){return function(){var Ce=Oe._readableState;f("pipeOnDrain",Ce.awaitDrain),Ce.awaitDrain&&Ce.awaitDrain--,Ce.awaitDrain===0&&u(Oe,"data")&&(Ce.flowing=!0,B(Oe))}}(E);X.on("drain",re);var oe=!1;function ue(Oe){f("ondata");var Ce=X.write(Oe);f("dest.write",Ce),Ce===!1&&((j.pipesCount===1&&j.pipes===X||j.pipesCount>1&&ne(j.pipes,X)!==-1)&&!oe&&(f("false write response, pause",j.awaitDrain),j.awaitDrain++),E.pause())}function ve(Oe){f("onerror",Oe),Ne(),X.removeListener("error",ve),u(X,"error")===0&&G(X,Oe)}function Re(){X.removeListener("finish",Te),Ne()}function Te(){f("onfinish"),X.removeListener("close",Re),Ne()}function Ne(){f("unpipe"),E.unpipe(X)}return E.on("data",ue),function(Oe,Ce,Me){if(typeof Oe.prependListener=="function")return Oe.prependListener(Ce,Me);Oe._events&&Oe._events[Ce]?Array.isArray(Oe._events[Ce])?Oe._events[Ce].unshift(Me):Oe._events[Ce]=[Me,Oe._events[Ce]]:Oe.on(Ce,Me)}(X,"error",ve),X.once("close",Re),X.once("finish",Te),X.emit("pipe",E),j.flowing||(f("pipe resume"),E.resume()),X},y.prototype.unpipe=function(X){var $=this._readableState,E={hasUnpiped:!1};if($.pipesCount===0)return this;if($.pipesCount===1)return X&&X!==$.pipes||(X||(X=$.pipes),$.pipes=null,$.pipesCount=0,$.flowing=!1,X&&X.emit("unpipe",this,E)),this;if(!X){var j=$.pipes,V=$.pipesCount;$.pipes=null,$.pipesCount=0,$.flowing=!1;for(var K=0;K<V;K++)j[K].emit("unpipe",this,{hasUnpiped:!1});return this}var Y=ne($.pipes,X);return Y===-1||($.pipes.splice(Y,1),$.pipesCount-=1,$.pipesCount===1&&($.pipes=$.pipes[0]),X.emit("unpipe",this,E)),this},y.prototype.on=function(X,$){var E=s.prototype.on.call(this,X,$),j=this._readableState;return X==="data"?(j.readableListening=this.listenerCount("readable")>0,j.flowing!==!1&&this.resume()):X==="readable"&&(j.endEmitted||j.readableListening||(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,f("on readable",j.length,j.reading),j.length?H(this):j.reading||o.nextTick(A,this))),E},y.prototype.addListener=y.prototype.on,y.prototype.removeListener=function(X,$){var E=s.prototype.removeListener.call(this,X,$);return X==="readable"&&o.nextTick(F,this),E},y.prototype.removeAllListeners=function(X){var $=s.prototype.removeAllListeners.apply(this,arguments);return X!=="readable"&&X!==void 0||o.nextTick(F,this),$},y.prototype.resume=function(){var X=this._readableState;return X.flowing||(f("resume"),X.flowing=!X.readableListening,function($,E){E.resumeScheduled||(E.resumeScheduled=!0,o.nextTick(b,$,E))}(this,X)),X.paused=!1,this},y.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},y.prototype.wrap=function(X){var $=this,E=this._readableState,j=!1;for(var V in X.on("end",function(){if(f("wrapped end"),E.decoder&&!E.ended){var Y=E.decoder.end();Y&&Y.length&&$.push(Y)}$.push(null)}),X.on("data",function(Y){f("wrapped data"),E.decoder&&(Y=E.decoder.write(Y)),E.objectMode&&Y==null||(E.objectMode||Y&&Y.length)&&($.push(Y)||(j=!0,X.pause()))}),X)this[V]===void 0&&typeof X[V]=="function"&&(this[V]=function(Y){return function(){return X[Y].apply(X,arguments)}}(V));for(var K=0;K<Z.length;K++)X.on(Z[K],this.emit.bind(this,Z[K]));return this._read=function(Y){f("wrapped _read",Y),j&&(j=!1,X.resume())},this},typeof Symbol=="function"&&(y.prototype[Symbol.asyncIterator]=function(){return p===void 0&&(p=n(181)),p(this)}),Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(y.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(y.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(X){this._readableState&&(this._readableState.flowing=X)}}),y._fromList=W,Object.defineProperty(y.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(y.from=function(X,$){return d===void 0&&(d=n(182)),d(y,X,$)})}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(21).EventEmitter},function(e,t,n){(function(r){function o(s,g){u(s,g),l(s)}function l(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function u(s,g){s.emit("error",g)}e.exports={destroy:function(s,g){var c=this,f=this._readableState&&this._readableState.destroyed,T=this._writableState&&this._writableState.destroyed;return f||T?(g?g(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(u,this,s)):r.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(v){!g&&v?c._writableState?c._writableState.errorEmitted?r.nextTick(l,c):(c._writableState.errorEmitted=!0,r.nextTick(o,c,v)):r.nextTick(o,c,v):g?(r.nextTick(l,c),g(v)):r.nextTick(l,c)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(s,g){var c=s._readableState,f=s._writableState;c&&c.autoDestroy||f&&f.autoDestroy?s.destroy(g):s.emit("error",g)}}}).call(this,n(2))},function(e,t,n){var r=n(26).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(o,l,u,s){var g=function(c,f,T){return c.highWaterMark!=null?c.highWaterMark:f?c[T]:null}(l,s,u);if(g!=null){if(!isFinite(g)||Math.floor(g)!==g||g<0)throw new r(s?u:"highWaterMark",g);return Math.floor(g)}return o.objectMode?16:16384}}},function(e,t,n){(function(r,o){function l(k){var F=this;this.next=null,this.entry=null,this.finish=function(){(function(A,b,B){var W=A.entry;for(A.entry=null;W;){var Q=W.callback;b.pendingcb--,Q(B),W=W.next}b.corkedRequestsFree.next=A})(F,k)}}var u;e.exports=y,y.WritableState=_;var s={deprecate:n(43)},g=n(78),c=n(5).Buffer,f=r.Uint8Array||function(){},T,v=n(79),p=n(80).getHighWaterMark,d=n(26).codes,h=d.ERR_INVALID_ARG_TYPE,S=d.ERR_METHOD_NOT_IMPLEMENTED,I=d.ERR_MULTIPLE_CALLBACK,L=d.ERR_STREAM_CANNOT_PIPE,O=d.ERR_STREAM_DESTROYED,R=d.ERR_STREAM_NULL_VALUES,m=d.ERR_STREAM_WRITE_AFTER_END,M=d.ERR_UNKNOWN_ENCODING,G=v.errorOrDestroy;function Z(){}function _(k,F,A){u=u||n(27),k=k||{},typeof A!="boolean"&&(A=F instanceof u),this.objectMode=!!k.objectMode,A&&(this.objectMode=this.objectMode||!!k.writableObjectMode),this.highWaterMark=p(this,k,"writableHighWaterMark",A),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var b=k.decodeStrings===!1;this.decodeStrings=!b,this.defaultEncoding=k.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(B){(function(W,Q){var ee=W._writableState,ne=ee.sync,X=ee.writecb;if(typeof X!="function")throw new I;if(function(E){E.writing=!1,E.writecb=null,E.length-=E.writelen,E.writelen=0}(ee),Q)(function(E,j,V,K,Y){--j.pendingcb,V?(o.nextTick(Y,K),o.nextTick(N,E,j),E._writableState.errorEmitted=!0,G(E,K)):(Y(K),E._writableState.errorEmitted=!0,G(E,K),N(E,j))})(W,ee,ne,Q,X);else{var $=H(ee)||W.destroyed;$||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||x(W,ee),ne?o.nextTick(w,W,ee,$,X):w(W,ee,$,X)}})(F,B)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function y(k){var F=this instanceof(u=u||n(27));if(!F&&!T.call(y,this))return new y(k);this._writableState=new _(k,this,F),this.writable=!0,k&&(typeof k.write=="function"&&(this._write=k.write),typeof k.writev=="function"&&(this._writev=k.writev),typeof k.destroy=="function"&&(this._destroy=k.destroy),typeof k.final=="function"&&(this._final=k.final)),g.call(this)}function C(k,F,A,b,B,W,Q){F.writelen=b,F.writecb=Q,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new O("write")):A?k._writev(B,F.onwrite):k._write(B,W,F.onwrite),F.sync=!1}function w(k,F,A,b){A||function(B,W){W.length===0&&W.needDrain&&(W.needDrain=!1,B.emit("drain"))}(k,F),F.pendingcb--,b(),N(k,F)}function x(k,F){F.bufferProcessing=!0;var A=F.bufferedRequest;if(k._writev&&A&&A.next){var b=F.bufferedRequestCount,B=new Array(b),W=F.corkedRequestsFree;W.entry=A;for(var Q=0,ee=!0;A;)B[Q]=A,A.isBuf||(ee=!1),A=A.next,Q+=1;B.allBuffers=ee,C(k,F,!0,F.length,B,"",W.finish),F.pendingcb++,F.lastBufferedRequest=null,W.next?(F.corkedRequestsFree=W.next,W.next=null):F.corkedRequestsFree=new l(F),F.bufferedRequestCount=0}else{for(;A;){var ne=A.chunk,X=A.encoding,$=A.callback;if(C(k,F,!1,F.objectMode?1:ne.length,ne,X,$),A=A.next,F.bufferedRequestCount--,F.writing)break}A===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=A,F.bufferProcessing=!1}function H(k){return k.ending&&k.length===0&&k.bufferedRequest===null&&!k.finished&&!k.writing}function U(k,F){k._final(function(A){F.pendingcb--,A&&G(k,A),F.prefinished=!0,k.emit("prefinish"),N(k,F)})}function N(k,F){var A=H(F);if(A&&(function(B,W){W.prefinished||W.finalCalled||(typeof B._final!="function"||W.destroyed?(W.prefinished=!0,B.emit("prefinish")):(W.pendingcb++,W.finalCalled=!0,o.nextTick(U,B,W)))}(k,F),F.pendingcb===0&&(F.finished=!0,k.emit("finish"),F.autoDestroy))){var b=k._readableState;(!b||b.autoDestroy&&b.endEmitted)&&k.destroy()}return A}n(7)(y,g),_.prototype.getBuffer=function(){for(var k=this.bufferedRequest,F=[];k;)F.push(k),k=k.next;return F},function(){try{Object.defineProperty(_.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(k){return!!T.call(this,k)||this===y&&k&&k._writableState instanceof _}})):T=function(k){return k instanceof this},y.prototype.pipe=function(){G(this,new L)},y.prototype.write=function(k,F,A){var b,B=this._writableState,W=!1,Q=!B.objectMode&&(b=k,c.isBuffer(b)||b instanceof f);return Q&&!c.isBuffer(k)&&(k=function(ee){return c.from(ee)}(k)),typeof F=="function"&&(A=F,F=null),Q?F="buffer":F||(F=B.defaultEncoding),typeof A!="function"&&(A=Z),B.ending?function(ee,ne){var X=new m;G(ee,X),o.nextTick(ne,X)}(this,A):(Q||function(ee,ne,X,$){var E;return X===null?E=new R:typeof X=="string"||ne.objectMode||(E=new h("chunk",["string","Buffer"],X)),!E||(G(ee,E),o.nextTick($,E),!1)}(this,B,k,A))&&(B.pendingcb++,W=function(ee,ne,X,$,E,j){if(!X){var V=function(oe,ue,ve){return oe.objectMode||oe.decodeStrings===!1||typeof ue!="string"||(ue=c.from(ue,ve)),ue}(ne,$,E);$!==V&&(X=!0,E="buffer",$=V)}var K=ne.objectMode?1:$.length;ne.length+=K;var Y=ne.length<ne.highWaterMark;if(Y||(ne.needDrain=!0),ne.writing||ne.corked){var re=ne.lastBufferedRequest;ne.lastBufferedRequest={chunk:$,encoding:E,isBuf:X,callback:j,next:null},re?re.next=ne.lastBufferedRequest:ne.bufferedRequest=ne.lastBufferedRequest,ne.bufferedRequestCount+=1}else C(ee,ne,!1,K,$,E,j);return Y}(this,B,Q,k,F,A)),W},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var k=this._writableState;k.corked&&(k.corked--,k.writing||k.corked||k.bufferProcessing||!k.bufferedRequest||x(this,k))},y.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new M(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(k,F,A){A(new S("_write()"))},y.prototype._writev=null,y.prototype.end=function(k,F,A){var b=this._writableState;return typeof k=="function"?(A=k,k=null,F=null):typeof F=="function"&&(A=F,F=null),k!=null&&this.write(k,F),b.corked&&(b.corked=1,this.uncork()),b.ending||function(B,W,Q){W.ending=!0,N(B,W),Q&&(W.finished?o.nextTick(Q):B.once("finish",Q)),W.ended=!0,B.writable=!1}(this,b,A),this},Object.defineProperty(y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(y.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(k){this._writableState&&(this._writableState.destroyed=k)}}),y.prototype.destroy=v.destroy,y.prototype._undestroy=v.undestroy,y.prototype._destroy=function(k,F){F(k)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=f;var r=n(26).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,l=r.ERR_MULTIPLE_CALLBACK,u=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,g=n(27);function c(p,d){var h=this._transformState;h.transforming=!1;var S=h.writecb;if(S===null)return this.emit("error",new l);h.writechunk=null,h.writecb=null,d!=null&&this.push(d),S(p);var I=this._readableState;I.reading=!1,(I.needReadable||I.length<I.highWaterMark)&&this._read(I.highWaterMark)}function f(p){if(!(this instanceof f))return new f(p);g.call(this,p),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",T)}function T(){var p=this;typeof this._flush!="function"||this._readableState.destroyed?v(this,null,null):this._flush(function(d,h){v(p,d,h)})}function v(p,d,h){if(d)return p.emit("error",d);if(h!=null&&p.push(h),p._writableState.length)throw new s;if(p._transformState.transforming)throw new u;return p.push(null)}n(7)(f,g),f.prototype.push=function(p,d){return this._transformState.needTransform=!1,g.prototype.push.call(this,p,d)},f.prototype._transform=function(p,d,h){h(new o("_transform()"))},f.prototype._write=function(p,d,h){var S=this._transformState;if(S.writecb=h,S.writechunk=p,S.writeencoding=d,!S.transforming){var I=this._readableState;(S.needTransform||I.needReadable||I.length<I.highWaterMark)&&this._read(I.highWaterMark)}},f.prototype._read=function(p){var d=this._transformState;d.writechunk===null||d.transforming?d.needTransform=!0:(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform))},f.prototype._destroy=function(p,d){g.prototype._destroy.call(this,p,function(h){d(h)})}},function(e,t,n){(function(r){var o=n(189),l=n(85),u=n(191),s=n(192),g=n(86),c=t;c.request=function(f,T){f=typeof f=="string"?g.parse(f):u(f);var v=r.location.protocol.search(/^https?:$/)===-1?"http:":"",p=f.protocol||v,d=f.hostname||f.host,h=f.port,S=f.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),f.url=(d?p+"//"+d:"")+(h?":"+h:"")+S,f.method=(f.method||"GET").toUpperCase(),f.headers=f.headers||{};var I=new o(f);return T&&I.on("response",T),I},c.get=function(f,T){var v=c.request(f,T);return v.end(),v},c.ClientRequest=o,c.IncomingMessage=l.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(6))},function(e,t,n){(function(r){t.fetch=c(r.fetch)&&c(r.ReadableStream),t.writableStream=c(r.WritableStream),t.abortController=c(r.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch{}var o;function l(){if(o!==void 0)return o;if(r.XMLHttpRequest){o=new r.XMLHttpRequest;try{o.open("GET",r.XDomainRequest?"/":"https://example.com")}catch{o=null}}else o=null;return o}function u(f){var T=l();if(!T)return!1;try{return T.responseType=f,T.responseType===f}catch{}return!1}var s=r.ArrayBuffer!==void 0,g=s&&c(r.ArrayBuffer.prototype.slice);function c(f){return typeof f=="function"}t.arraybuffer=t.fetch||s&&u("arraybuffer"),t.msstream=!t.fetch&&g&&u("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&s&&u("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!l()&&c(l().overrideMimeType),t.vbArray=c(r.VBArray),o=null}).call(this,n(6))},function(e,t,n){(function(r,o,l){var u=n(84),s=n(7),g=n(32),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=t.IncomingMessage=function(T,v,p,d){var h=this;if(g.Readable.call(h),h._mode=p,h.headers={},h.rawHeaders=[],h.trailers={},h.rawTrailers=[],h.on("end",function(){r.nextTick(function(){h.emit("close")})}),p==="fetch"){if(h._fetchResponse=v,h.url=v.url,h.statusCode=v.status,h.statusMessage=v.statusText,v.headers.forEach(function(R,m){h.headers[m.toLowerCase()]=R,h.rawHeaders.push(m,R)}),u.writableStream){var S=new WritableStream({write:function(R){return new Promise(function(m,M){h._destroyed?M():h.push(new o(R))?m():h._resumeFetch=m})},close:function(){l.clearTimeout(d),h._destroyed||h.push(null)},abort:function(R){h._destroyed||h.emit("error",R)}});try{return void v.body.pipeTo(S).catch(function(R){l.clearTimeout(d),h._destroyed||h.emit("error",R)})}catch{}}var I=v.body.getReader();(function R(){I.read().then(function(m){if(!h._destroyed){if(m.done)return l.clearTimeout(d),void h.push(null);h.push(new o(m.value)),R()}}).catch(function(m){l.clearTimeout(d),h._destroyed||h.emit("error",m)})})()}else if(h._xhr=T,h._pos=0,h.url=T.responseURL,h.statusCode=T.status,h.statusMessage=T.statusText,T.getAllResponseHeaders().split(/\r?\n/).forEach(function(R){var m=R.match(/^([^:]+):\s*(.*)/);if(m){var M=m[1].toLowerCase();M==="set-cookie"?(h.headers[M]===void 0&&(h.headers[M]=[]),h.headers[M].push(m[2])):h.headers[M]!==void 0?h.headers[M]+=", "+m[2]:h.headers[M]=m[2],h.rawHeaders.push(m[1],m[2])}}),h._charset="x-user-defined",!u.overrideMimeType){var L=h.rawHeaders["mime-type"];if(L){var O=L.match(/;\s*charset=([^;])(;|$)/);O&&(h._charset=O[1].toLowerCase())}h._charset||(h._charset="utf-8")}};s(f,g.Readable),f.prototype._read=function(){var T=this._resumeFetch;T&&(this._resumeFetch=null,T())},f.prototype._onXHRProgress=function(){var T=this,v=T._xhr,p=null;switch(T._mode){case"text:vbarray":if(v.readyState!==c.DONE)break;try{p=new l.VBArray(v.responseBody).toArray()}catch{}if(p!==null){T.push(new o(p));break}case"text":try{p=v.responseText}catch{T._mode="text:vbarray";break}if(p.length>T._pos){var d=p.substr(T._pos);if(T._charset==="x-user-defined"){for(var h=new o(d.length),S=0;S<d.length;S++)h[S]=255&d.charCodeAt(S);T.push(h)}else T.push(d,T._charset);T._pos=p.length}break;case"arraybuffer":if(v.readyState!==c.DONE||!v.response)break;p=v.response,T.push(new o(new Uint8Array(p)));break;case"moz-chunked-arraybuffer":if(p=v.response,v.readyState!==c.LOADING||!p)break;T.push(new o(new Uint8Array(p)));break;case"ms-stream":if(p=v.response,v.readyState!==c.LOADING)break;var I=new l.MSStreamReader;I.onprogress=function(){I.result.byteLength>T._pos&&(T.push(new o(new Uint8Array(I.result.slice(T._pos)))),T._pos=I.result.byteLength)},I.onload=function(){T.push(null)},I.readAsArrayBuffer(p)}T._xhr.readyState===c.DONE&&T._mode!=="ms-stream"&&T.push(null)}}).call(this,n(2),n(5).Buffer,n(6))},function(e,t,n){var r=n(193),o=n(195);function l(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=O,t.resolve=function(R,m){return O(R,!1,!0).resolve(m)},t.resolveObject=function(R,m){return R?O(R,!1,!0).resolveObject(m):m},t.format=function(R){return o.isString(R)&&(R=O(R)),R instanceof l?R.format():l.prototype.format.call(R)},t.Url=l;var u=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,g=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
25
- `," "]),f=["'"].concat(c),T=["%","/","?",";","#"].concat(f),v=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},I={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},L=n(196);function O(R,m,M){if(R&&o.isObject(R)&&R instanceof l)return R;var G=new l;return G.parse(R,m,M),G}l.prototype.parse=function(R,m,M){if(!o.isString(R))throw new TypeError("Parameter 'url' must be a string, not "+typeof R);var G=R.indexOf("?"),Z=G!==-1&&G<R.indexOf("#")?"?":"#",_=R.split(Z);_[0]=_[0].replace(/\\/g,"/");var y=R=_.join(Z);if(y=y.trim(),!M&&R.split("#").length===1){var C=g.exec(y);if(C)return this.path=y,this.href=y,this.pathname=C[1],C[2]?(this.search=C[2],this.query=m?L.parse(this.search.substr(1)):this.search.substr(1)):m&&(this.search="",this.query={}),this}var w=u.exec(y);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,y=y.substr(w.length)}if(M||w||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var H=y.substr(0,2)==="//";!H||w&&S[w]||(y=y.substr(2),this.slashes=!0)}if(!S[w]&&(H||w&&!I[w])){for(var U,N,k=-1,F=0;F<v.length;F++)(A=y.indexOf(v[F]))!==-1&&(k===-1||A<k)&&(k=A);for((N=k===-1?y.lastIndexOf("@"):y.lastIndexOf("@",k))!==-1&&(U=y.slice(0,N),y=y.slice(N+1),this.auth=decodeURIComponent(U)),k=-1,F=0;F<T.length;F++){var A;(A=y.indexOf(T[F]))!==-1&&(k===-1||A<k)&&(k=A)}k===-1&&(k=y.length),this.host=y.slice(0,k),y=y.slice(k),this.parseHost(),this.hostname=this.hostname||"";var b=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!b)for(var B=this.hostname.split(/\./),W=(F=0,B.length);F<W;F++){var Q=B[F];if(Q&&!Q.match(p)){for(var ee="",ne=0,X=Q.length;ne<X;ne++)Q.charCodeAt(ne)>127?ee+="x":ee+=Q[ne];if(!ee.match(p)){var $=B.slice(0,F),E=B.slice(F+1),j=Q.match(d);j&&($.push(j[1]),E.unshift(j[2])),E.length&&(y="/"+E.join(".")+y),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),b||(this.hostname=r.toASCII(this.hostname));var V=this.port?":"+this.port:"",K=this.hostname||"";this.host=K+V,this.href+=this.host,b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),y[0]!=="/"&&(y="/"+y))}if(!h[x])for(F=0,W=f.length;F<W;F++){var Y=f[F];if(y.indexOf(Y)!==-1){var re=encodeURIComponent(Y);re===Y&&(re=escape(Y)),y=y.split(Y).join(re)}}var oe=y.indexOf("#");oe!==-1&&(this.hash=y.substr(oe),y=y.slice(0,oe));var ue=y.indexOf("?");if(ue!==-1?(this.search=y.substr(ue),this.query=y.substr(ue+1),m&&(this.query=L.parse(this.query)),y=y.slice(0,ue)):m&&(this.search="",this.query={}),y&&(this.pathname=y),I[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){V=this.pathname||"";var ve=this.search||"";this.path=V+ve}return this.href=this.format(),this},l.prototype.format=function(){var R=this.auth||"";R&&(R=(R=encodeURIComponent(R)).replace(/%3A/i,":"),R+="@");var m=this.protocol||"",M=this.pathname||"",G=this.hash||"",Z=!1,_="";this.host?Z=R+this.host:this.hostname&&(Z=R+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(Z+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(_=L.stringify(this.query));var y=this.search||_&&"?"+_||"";return m&&m.substr(-1)!==":"&&(m+=":"),this.slashes||(!m||I[m])&&Z!==!1?(Z="//"+(Z||""),M&&M.charAt(0)!=="/"&&(M="/"+M)):Z||(Z=""),G&&G.charAt(0)!=="#"&&(G="#"+G),y&&y.charAt(0)!=="?"&&(y="?"+y),m+Z+(M=M.replace(/[?#]/g,function(C){return encodeURIComponent(C)}))+(y=y.replace("#","%23"))+G},l.prototype.resolve=function(R){return this.resolveObject(O(R,!1,!0)).format()},l.prototype.resolveObject=function(R){if(o.isString(R)){var m=new l;m.parse(R,!1,!0),R=m}for(var M=new l,G=Object.keys(this),Z=0;Z<G.length;Z++){var _=G[Z];M[_]=this[_]}if(M.hash=R.hash,R.href==="")return M.href=M.format(),M;if(R.slashes&&!R.protocol){for(var y=Object.keys(R),C=0;C<y.length;C++){var w=y[C];w!=="protocol"&&(M[w]=R[w])}return I[M.protocol]&&M.hostname&&!M.pathname&&(M.path=M.pathname="/"),M.href=M.format(),M}if(R.protocol&&R.protocol!==M.protocol){if(!I[R.protocol]){for(var x=Object.keys(R),H=0;H<x.length;H++){var U=x[H];M[U]=R[U]}return M.href=M.format(),M}if(M.protocol=R.protocol,R.host||S[R.protocol])M.pathname=R.pathname;else{for(var N=(R.pathname||"").split("/");N.length&&!(R.host=N.shift()););R.host||(R.host=""),R.hostname||(R.hostname=""),N[0]!==""&&N.unshift(""),N.length<2&&N.unshift(""),M.pathname=N.join("/")}if(M.search=R.search,M.query=R.query,M.host=R.host||"",M.auth=R.auth,M.hostname=R.hostname||R.host,M.port=R.port,M.pathname||M.search){var k=M.pathname||"",F=M.search||"";M.path=k+F}return M.slashes=M.slashes||R.slashes,M.href=M.format(),M}var A=M.pathname&&M.pathname.charAt(0)==="/",b=R.host||R.pathname&&R.pathname.charAt(0)==="/",B=b||A||M.host&&R.pathname,W=B,Q=M.pathname&&M.pathname.split("/")||[],ee=(N=R.pathname&&R.pathname.split("/")||[],M.protocol&&!I[M.protocol]);if(ee&&(M.hostname="",M.port=null,M.host&&(Q[0]===""?Q[0]=M.host:Q.unshift(M.host)),M.host="",R.protocol&&(R.hostname=null,R.port=null,R.host&&(N[0]===""?N[0]=R.host:N.unshift(R.host)),R.host=null),B=B&&(N[0]===""||Q[0]==="")),b)M.host=R.host||R.host===""?R.host:M.host,M.hostname=R.hostname||R.hostname===""?R.hostname:M.hostname,M.search=R.search,M.query=R.query,Q=N;else if(N.length)Q||(Q=[]),Q.pop(),Q=Q.concat(N),M.search=R.search,M.query=R.query;else if(!o.isNullOrUndefined(R.search))return ee&&(M.hostname=M.host=Q.shift(),(j=!!(M.host&&M.host.indexOf("@")>0)&&M.host.split("@"))&&(M.auth=j.shift(),M.host=M.hostname=j.shift())),M.search=R.search,M.query=R.query,o.isNull(M.pathname)&&o.isNull(M.search)||(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.href=M.format(),M;if(!Q.length)return M.pathname=null,M.search?M.path="/"+M.search:M.path=null,M.href=M.format(),M;for(var ne=Q.slice(-1)[0],X=(M.host||R.host||Q.length>1)&&(ne==="."||ne==="..")||ne==="",$=0,E=Q.length;E>=0;E--)(ne=Q[E])==="."?Q.splice(E,1):ne===".."?(Q.splice(E,1),$++):$&&(Q.splice(E,1),$--);if(!B&&!W)for(;$--;$)Q.unshift("..");!B||Q[0]===""||Q[0]&&Q[0].charAt(0)==="/"||Q.unshift(""),X&&Q.join("/").substr(-1)!=="/"&&Q.push("");var j,V=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";return ee&&(M.hostname=M.host=V?"":Q.length?Q.shift():"",(j=!!(M.host&&M.host.indexOf("@")>0)&&M.host.split("@"))&&(M.auth=j.shift(),M.host=M.hostname=j.shift())),(B=B||M.host&&Q.length)&&!V&&Q.unshift(""),Q.length?M.pathname=Q.join("/"):(M.pathname=null,M.path=null),o.isNull(M.pathname)&&o.isNull(M.search)||(M.path=(M.pathname?M.pathname:"")+(M.search?M.search:"")),M.auth=R.auth||M.auth,M.slashes=M.slashes||R.slashes,M.href=M.format(),M},l.prototype.parseHost=function(){var R=this.host,m=s.exec(R);m&&((m=m[0])!==":"&&(this.port=m.substr(1)),R=R.substr(0,R.length-m.length)),R&&(this.hostname=R)}},function(e,t,n){const r=o=>o!==null&&typeof o=="object"&&typeof o.pipe=="function";r.writable=o=>r(o)&&o.writable!==!1&&typeof o._write=="function"&&typeof o._writableState=="object",r.readable=o=>r(o)&&o.readable!==!1&&typeof o._read=="function"&&typeof o._readableState=="object",r.duplex=o=>r.writable(o)&&r.readable(o),r.transform=o=>r.duplex(o)&&typeof o._transform=="function"&&typeof o._transformState=="object",e.exports=r},function(e,t,n){function r(h){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S})(h)}function o(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function l(h,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(S&&S.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),S&&u(h,S)}function u(h,S){return(u=Object.setPrototypeOf||function(I,L){return I.__proto__=L,I})(h,S)}function s(h){var S=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var I,L=c(h);if(S){var O=c(this).constructor;I=Reflect.construct(L,arguments,O)}else I=L.apply(this,arguments);return g(this,I)}}function g(h,S){return!S||r(S)!=="object"&&typeof S!="function"?function(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}(h):S}function c(h){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)})(h)}var f=n(3).LEVEL,T=n(50),v=n(201),p=n(38)("winston:create-logger");function d(h){return"is"+h.charAt(0).toUpperCase()+h.slice(1)+"Enabled"}e.exports=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};h.levels=h.levels||T.npm.levels;var S=function(L){l(R,L);var O=s(R);function R(m){return o(this,R),O.call(this,m)}return R}(v),I=new S(h);return Object.keys(h.levels).forEach(function(L){p('Define prototype method for "%s"',L),L!=="log"?(S.prototype[L]=function(){for(var O=this||I,R=arguments.length,m=new Array(R),M=0;M<R;M++)m[M]=arguments[M];if(m.length===1){var G=m[0],Z=G&&G.message&&G||{message:G};return Z.level=Z[f]=L,O._addDefaultMeta(Z),O.write(Z),this||I}return m.length===0?(O.log(L,""),O):O.log.apply(O,[L].concat(m))},S.prototype[d(L)]=function(){return(this||I).isLevelEnabled(L)}):console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.')}),I}},function(e,t,n){(function(r){function o(T,v){for(var p=0;p<v.length;p++){var d=v[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}var l=n(18),u=n(51),s=n(38)("winston:exception"),g=n(90),c=n(91),f=n(92);e.exports=function(){function T(d){if(function(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}(this,T),!d)throw new Error("Logger is required to handle exceptions");this.logger=d,this.handlers=new Map}var v,p;return v=T,(p=[{key:"handle",value:function(){for(var d=this,h=arguments.length,S=new Array(h),I=0;I<h;I++)S[I]=arguments[I];S.forEach(function(L){if(Array.isArray(L))return L.forEach(function(O){return d._addHandler(O)});d._addHandler(L)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),r.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var d=this;this.catcher&&(r.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(h){return d.logger.unpipe(h)}))}},{key:"getAllInfo",value:function(d){var h=d.message;return h||typeof d!="string"||(h=d),{error:d,level:"error",message:["uncaughtException: ".concat(h||"(no error message)"),d.stack||" No stack trace"].join(`
26
- `),stack:d.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(d)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(d){return(d?c.parse(d):c.get()).map(function(h){return{column:h.getColumnNumber(),file:h.getFileName(),function:h.getFunctionName(),line:h.getLineNumber(),method:h.getMethodName(),native:h.isNative()}})}},{key:"_addHandler",value:function(d){if(!this.handlers.has(d)){d.handleExceptions=!0;var h=new f(d);this.handlers.set(d,h),this.logger.pipe(h)}}},{key:"_uncaughtException",value:function(d){var h,S=this.getAllInfo(d),I=this._getExceptionHandlers(),L=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(d):this.logger.exitOnError;function O(){s("doExit",L),s("process._exiting",r._exiting),L&&!r._exiting&&(h&&clearTimeout(h),r.exit(1))}if(!I.length&&L&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),L=!1),!I||I.length===0)return r.nextTick(O);u(I,function(R,m){var M=g(m),G=R.transport||R;function Z(_){return function(){s(_),M()}}G._ending=!0,G.once("finish",Z("finished")),G.once("error",Z("error"))},function(){return L&&O()}),this.logger.log(S),L&&(h=setTimeout(O,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(d){return(d.transport||d).handleExceptions})}}])&&o(v.prototype,p),T}()}).call(this,n(2))},function(e,t,n){var r=n(204);e.exports=function(o){var l,u=0;function s(){return u||(u=1,l=o.apply(this,arguments),o=null),l}return s.displayName=r(o),s}},function(e,t){function n(r){for(var o in r)this[o]=r[o]}t.get=function(r){var o=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var l={},u=Error.prepareStackTrace;Error.prepareStackTrace=function(g,c){return c},Error.captureStackTrace(l,r||t.get);var s=l.stack;return Error.prepareStackTrace=u,Error.stackTraceLimit=o,s},t.parse=function(r){if(!r.stack)return[];var o=this;return r.stack.split(`
27
- `).slice(1).map(function(l){if(l.match(/^\s*[-]{4,}$/))return o._createParsedCallSite({fileName:l,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var u=l.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(u){var s=null,g=null,c=null,f=null,T=null,v=u[5]==="native";if(u[1]){var p=(c=u[1]).lastIndexOf(".");if(c[p-1]=="."&&p--,p>0){s=c.substr(0,p),g=c.substr(p+1);var d=s.indexOf(".Module");d>0&&(c=c.substr(d+1),s=s.substr(0,d))}f=null}g&&(f=s,T=g),g==="<anonymous>"&&(T=null,c=null);var h={fileName:u[2]||null,lineNumber:parseInt(u[3],10)||null,functionName:c,typeName:f,methodName:T,columnNumber:parseInt(u[4],10)||null,native:v};return o._createParsedCallSite(h)}}).filter(function(l){return!!l})},["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"].forEach(function(r){n.prototype[r]=null,n.prototype["get"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),["topLevel","eval","native","constructor"].forEach(function(r){n.prototype[r]=!1,n.prototype["is"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),t._createParsedCallSite=function(r){return new n(r)}},function(e,t,n){function r(f){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T})(f)}function o(f,T){for(var v=0;v<T.length;v++){var p=T[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(f,p.key,p)}}function l(f,T){return(l=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v})(f,T)}function u(f){var T=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var v,p=g(f);if(T){var d=g(this).constructor;v=Reflect.construct(p,arguments,d)}else v=p.apply(this,arguments);return s(this,v)}}function s(f,T){return!T||r(T)!=="object"&&typeof T!="function"?function(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(f):T}function g(f){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)})(f)}var c=n(33).Writable;e.exports=function(f){(function(h,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(S&&S.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),S&&l(h,S)})(d,f);var T,v,p=u(d);function d(h){var S;if(function(I,L){if(!(I instanceof L))throw new TypeError("Cannot call a class as a function")}(this,d),S=p.call(this,{objectMode:!0}),!h)throw new Error("ExceptionStream requires a TransportStream instance.");return S.handleExceptions=!0,S.transport=h,S}return T=d,(v=[{key:"_write",value:function(h,S,I){return h.exception?this.transport.log(h,I):(I(),!0)}}])&&o(T.prototype,v),d}(c)},function(e,t,n){(function(r){function o(T,v){for(var p=0;p<v.length;p++){var d=v[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}var l=n(18),u=n(51),s=n(38)("winston:rejection"),g=n(90),c=n(91),f=n(92);e.exports=function(){function T(d){if(function(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}(this,T),!d)throw new Error("Logger is required to handle rejections");this.logger=d,this.handlers=new Map}var v,p;return v=T,(p=[{key:"handle",value:function(){for(var d=this,h=arguments.length,S=new Array(h),I=0;I<h;I++)S[I]=arguments[I];S.forEach(function(L){if(Array.isArray(L))return L.forEach(function(O){return d._addHandler(O)});d._addHandler(L)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),r.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var d=this;this.catcher&&(r.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(h){return d.logger.unpipe(h)}))}},{key:"getAllInfo",value:function(d){var h=d.message;return h||typeof d!="string"||(h=d),{error:d,level:"error",message:["unhandledRejection: ".concat(h||"(no error message)"),d.stack||" No stack trace"].join(`
28
- `),stack:d.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(d)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(d){return(d?c.parse(d):c.get()).map(function(h){return{column:h.getColumnNumber(),file:h.getFileName(),function:h.getFunctionName(),line:h.getLineNumber(),method:h.getMethodName(),native:h.isNative()}})}},{key:"_addHandler",value:function(d){if(!this.handlers.has(d)){d.handleRejections=!0;var h=new f(d);this.handlers.set(d,h),this.logger.pipe(h)}}},{key:"_unhandledRejection",value:function(d){var h,S=this.getAllInfo(d),I=this._getRejectionHandlers(),L=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(d):this.logger.exitOnError;function O(){s("doExit",L),s("process._exiting",r._exiting),L&&!r._exiting&&(h&&clearTimeout(h),r.exit(1))}if(!I.length&&L&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),L=!1),!I||I.length===0)return r.nextTick(O);u(I,function(R,m){var M=g(m),G=R.transport||R;function Z(_){return function(){s(_),M()}}G._ending=!0,G.once("finish",Z("finished")),G.once("error",Z("error"))},function(){return L&&O()}),this.logger.log(S),L&&(h=setTimeout(O,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(d){return(d.transport||d).handleRejections})}}])&&o(v.prototype,p),T}()}).call(this,n(2))},function(e,t,n){e.exports={asArray:n(211),asBoolStrict:n(212),asBool:n(213),asPortNumber:n(214),asEnum:n(215),asFloatNegative:n(216),asFloatPositive:n(217),asFloat:n(54),asIntNegative:n(218),asIntPositive:n(95),asInt:n(53),asJsonArray:n(219),asJsonObject:n(220),asJson:n(55),asRegExp:n(221),asString:n(34),asUrlObject:n(96),asUrlString:n(222),asEmailString:n(223)}},function(e,t,n){const r=n(53);e.exports=function(o){const l=r(o);if(l<0)throw new Error("should be a positive integer");return l}},function(e,t,n){const r=n(34);e.exports=function(o){const l=r(o);try{return new URL(l)}catch{throw new Error("should be a valid URL")}}},function(e,t,n){const r={};r.web=n(24),n(98);const o={v1:{}};o.v1.signaling={},o.v1.signaling.api=n(9),o.v1.signaling.api.SignalingClient=function(p,d,h){h||(h={}),h.format="text",this.client_=new r.web.GrpcWebClientBase(h),this.hostname_=p.replace(/\/+$/,"")},o.v1.signaling.api.SignalingPromiseClient=function(p,d,h){h||(h={}),h.format="text",this.client_=new r.web.GrpcWebClientBase(h),this.hostname_=p.replace(/\/+$/,"")};const l=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetHealth",r.web.MethodType.UNARY,o.v1.signaling.api.GetHealthRequest,o.v1.signaling.api.GetHealthResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.GetHealthResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getHealth=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",p,d||{},l,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.getHealth=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",p,d||{},l)};const u=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/CreatePeer",r.web.MethodType.UNARY,o.v1.signaling.api.CreatePeerRequest,o.v1.signaling.api.CreatePeerResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.CreatePeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.createPeer=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",p,d||{},u,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.createPeer=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",p,d||{},u)};const s=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/DeletePeer",r.web.MethodType.UNARY,o.v1.signaling.api.DeletePeerRequest,o.v1.signaling.api.DeletePeerResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.DeletePeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.deletePeer=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",p,d||{},s,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.deletePeer=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",p,d||{},s)};const g=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/RefreshPeer",r.web.MethodType.UNARY,o.v1.signaling.api.RefreshPeerRequest,o.v1.signaling.api.RefreshPeerResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.RefreshPeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.refreshPeer=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",p,d||{},g,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.refreshPeer=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",p,d||{},g)};const c=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetPeers",r.web.MethodType.UNARY,o.v1.signaling.api.GetPeersRequest,o.v1.signaling.api.GetPeersResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.GetPeersResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getPeers=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",p,d||{},c,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.getPeers=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",p,d||{},c)};const f=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetIceServers",r.web.MethodType.UNARY,o.v1.signaling.api.GetIceServersRequest,o.v1.signaling.api.GetIceServersResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.GetIceServersResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getIceServers=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",p,d||{},f,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.getIceServers=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",p,d||{},f)};const T=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/SendSignal",r.web.MethodType.UNARY,o.v1.signaling.api.SendSignalRequest,o.v1.signaling.api.SendSignalResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.SendSignalResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.sendSignal=function(p,d,h){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",p,d||{},T,h)},o.v1.signaling.api.SignalingPromiseClient.prototype.sendSignal=function(p,d){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",p,d||{},T)};const v=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/ReceiveSignalStream",r.web.MethodType.SERVER_STREAMING,o.v1.signaling.api.ReceiveSignalStreamRequest,o.v1.signaling.api.ReceiveSignalStreamResponse,function(p){return p.serializeBinary()},o.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.receiveSignalStream=function(p,d){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",p,d||{},v)},o.v1.signaling.api.SignalingPromiseClient.prototype.receiveSignalStream=function(p,d){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",p,d||{},v)},e.exports=o.v1.signaling.api},function(e,t,n){var r=n(99),o=r,l=Function("return this")();o.exportSymbol("proto.google.protobuf.BoolValue",null,l),o.exportSymbol("proto.google.protobuf.BytesValue",null,l),o.exportSymbol("proto.google.protobuf.DoubleValue",null,l),o.exportSymbol("proto.google.protobuf.FloatValue",null,l),o.exportSymbol("proto.google.protobuf.Int32Value",null,l),o.exportSymbol("proto.google.protobuf.Int64Value",null,l),o.exportSymbol("proto.google.protobuf.StringValue",null,l),o.exportSymbol("proto.google.protobuf.UInt32Value",null,l),o.exportSymbol("proto.google.protobuf.UInt64Value",null,l),proto.google.protobuf.DoubleValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.DoubleValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.DoubleValue.displayName="proto.google.protobuf.DoubleValue"),proto.google.protobuf.FloatValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.FloatValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.FloatValue.displayName="proto.google.protobuf.FloatValue"),proto.google.protobuf.Int64Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.Int64Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int64Value.displayName="proto.google.protobuf.Int64Value"),proto.google.protobuf.UInt64Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt64Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt64Value.displayName="proto.google.protobuf.UInt64Value"),proto.google.protobuf.Int32Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.Int32Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int32Value.displayName="proto.google.protobuf.Int32Value"),proto.google.protobuf.UInt32Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt32Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt32Value.displayName="proto.google.protobuf.UInt32Value"),proto.google.protobuf.BoolValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.BoolValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BoolValue.displayName="proto.google.protobuf.BoolValue"),proto.google.protobuf.StringValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.StringValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.StringValue.displayName="proto.google.protobuf.StringValue"),proto.google.protobuf.BytesValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.BytesValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BytesValue.displayName="proto.google.protobuf.BytesValue"),r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.DoubleValue.prototype.toObject=function(u){return proto.google.protobuf.DoubleValue.toObject(u,this)},proto.google.protobuf.DoubleValue.toObject=function(u,s){var g={value:r.Message.getFloatingPointFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.DoubleValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.DoubleValue;return proto.google.protobuf.DoubleValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.DoubleValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readDouble();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.DoubleValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.DoubleValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.DoubleValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeDouble(1,g)},proto.google.protobuf.DoubleValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.DoubleValue.prototype.setValue=function(u){return r.Message.setProto3FloatField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.FloatValue.prototype.toObject=function(u){return proto.google.protobuf.FloatValue.toObject(u,this)},proto.google.protobuf.FloatValue.toObject=function(u,s){var g={value:r.Message.getFloatingPointFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.FloatValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.FloatValue;return proto.google.protobuf.FloatValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.FloatValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readFloat();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.FloatValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.FloatValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.FloatValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeFloat(1,g)},proto.google.protobuf.FloatValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.FloatValue.prototype.setValue=function(u){return r.Message.setProto3FloatField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int64Value.prototype.toObject=function(u){return proto.google.protobuf.Int64Value.toObject(u,this)},proto.google.protobuf.Int64Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.Int64Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.Int64Value;return proto.google.protobuf.Int64Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.Int64Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readInt64();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.Int64Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.Int64Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.Int64Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeInt64(1,g)},proto.google.protobuf.Int64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int64Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt64Value.prototype.toObject=function(u){return proto.google.protobuf.UInt64Value.toObject(u,this)},proto.google.protobuf.UInt64Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.UInt64Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.UInt64Value;return proto.google.protobuf.UInt64Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.UInt64Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readUint64();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.UInt64Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.UInt64Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.UInt64Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeUint64(1,g)},proto.google.protobuf.UInt64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt64Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int32Value.prototype.toObject=function(u){return proto.google.protobuf.Int32Value.toObject(u,this)},proto.google.protobuf.Int32Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.Int32Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.Int32Value;return proto.google.protobuf.Int32Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.Int32Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readInt32();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.Int32Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.Int32Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.Int32Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeInt32(1,g)},proto.google.protobuf.Int32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int32Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt32Value.prototype.toObject=function(u){return proto.google.protobuf.UInt32Value.toObject(u,this)},proto.google.protobuf.UInt32Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.UInt32Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.UInt32Value;return proto.google.protobuf.UInt32Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.UInt32Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readUint32();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.UInt32Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.UInt32Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.UInt32Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeUint32(1,g)},proto.google.protobuf.UInt32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt32Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BoolValue.prototype.toObject=function(u){return proto.google.protobuf.BoolValue.toObject(u,this)},proto.google.protobuf.BoolValue.toObject=function(u,s){var g={value:r.Message.getBooleanFieldWithDefault(s,1,!1)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.BoolValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.BoolValue;return proto.google.protobuf.BoolValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.BoolValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readBool();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.BoolValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.BoolValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.BoolValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())&&s.writeBool(1,g)},proto.google.protobuf.BoolValue.prototype.getValue=function(){return r.Message.getBooleanFieldWithDefault(this,1,!1)},proto.google.protobuf.BoolValue.prototype.setValue=function(u){return r.Message.setProto3BooleanField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.StringValue.prototype.toObject=function(u){return proto.google.protobuf.StringValue.toObject(u,this)},proto.google.protobuf.StringValue.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,"")};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.StringValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.StringValue;return proto.google.protobuf.StringValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.StringValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readString();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.StringValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.StringValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.StringValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue()).length>0&&s.writeString(1,g)},proto.google.protobuf.StringValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.StringValue.prototype.setValue=function(u){return r.Message.setProto3StringField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BytesValue.prototype.toObject=function(u){return proto.google.protobuf.BytesValue.toObject(u,this)},proto.google.protobuf.BytesValue.toObject=function(u,s){var g={value:s.getValue_asB64()};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.BytesValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.BytesValue;return proto.google.protobuf.BytesValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.BytesValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readBytes();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.BytesValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.BytesValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.BytesValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue_asU8()).length>0&&s.writeBytes(1,g)},proto.google.protobuf.BytesValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.BytesValue.prototype.getValue_asB64=function(){return r.Message.bytesAsB64(this.getValue())},proto.google.protobuf.BytesValue.prototype.getValue_asU8=function(){return r.Message.bytesAsU8(this.getValue())},proto.google.protobuf.BytesValue.prototype.setValue=function(u){return r.Message.setProto3BytesField(this,1,u)},o.object.extend(t,proto.google.protobuf)},function(module,exports,__webpack_require__){(function(global,Buffer){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,o=0;o<r;o++){var l=e[o];if(t.call(n,l,o,e))return{i:o,v:l}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},$jscomp.getGlobal=function(e){return typeof window<"u"&&window===e?e:global!==void 0&&global!=null?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,n,r){if(t){for(n=$jscomp.global,e=e.split("."),r=0;r<e.length-1;r++){var o=e[r];o in n||(n[o]={}),n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&t!=null&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).i}},"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(e==null)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"endsWith");t+="",n===void 0&&(n=r.length),n=Math.max(0,Math.min(0|n,r.length));for(var o=t.length;0<o&&0<n;)if(r[--n]!=t[--o])return!1;return 0>=o}},"es6","es3"),$jscomp.polyfill("Array.prototype.find",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).v}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var o=r.length,l=t.length;n=Math.max(0,Math.min(0|n,r.length));for(var u=0;u<l&&n<o;)if(r[n++]!=t[u++])return!1;return u>=l}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(e){return e||function(t){var n=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var r="";t;)1&t&&(r+=n),(t>>>=1)&&(n+=n);return r}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return e!==void 0},goog.isString=function(e){return typeof e=="string"},goog.isBoolean=function(e){return typeof e=="boolean"},goog.isNumber=function(e){return typeof e=="number"},goog.exportPath_=function(e,t,n){e=e.split("."),n=n||goog.global,e[0]in n||n.execScript===void 0||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)!e.length&&goog.isDef(t)?n[r]=t:n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}},goog.define=function(e,t){return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||e.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&typeof e.getCurrentModulePath=="function"&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(t=t[e[n]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var n in t=t||goog.global,e)t[n]=e[n]},goog.addDependency=function(e,t,n,r){},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+`
40
+ `))}}Object.defineProperty(o,u,{get:s,set:s})},forProperties:function(o,l,u){u.forEach(function(s){var g=t.warn[l](s);Object.defineProperty(o,s,{get:g,set:g})})}}},function(e,t,n){(function(r,o){function l(O){var L=this;this.next=null,this.entry=null,this.finish=function(){(function(U,A,V){var q=U.entry;for(U.entry=null;q;){var Q=q.callback;A.pendingcb--,Q(V),q=q.next}A.corkedRequestsFree.next=U})(L,O)}}var u;e.exports=_,_.WritableState=m;var s={deprecate:n(43)},g=n(62),c=n(5).Buffer,d=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},w,v=n(64),y=n(65).getHighWaterMark,f=n(35).codes,p=f.ERR_INVALID_ARG_TYPE,S=f.ERR_METHOD_NOT_IMPLEMENTED,N=f.ERR_MULTIPLE_CALLBACK,B=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,T=f.ERR_STREAM_NULL_VALUES,h=f.ERR_STREAM_WRITE_AFTER_END,R=f.ERR_UNKNOWN_ENCODING,W=v.errorOrDestroy;function X(){}function m(O,L,U){u=u||n(36),O=O||{},typeof U!="boolean"&&(U=L instanceof u),this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.writableObjectMode),this.highWaterMark=y(this,O,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var A=O.decodeStrings===!1;this.decodeStrings=!A,this.defaultEncoding=O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){(function(q,Q){var ee=q._writableState,te=ee.sync,k=ee.writecb;if(typeof k!="function")throw new N;if(function(b){b.writing=!1,b.writecb=null,b.length-=b.writelen,b.writelen=0}(ee),Q)(function(b,I,$,K,Y){--I.pendingcb,$?(o.nextTick(Y,K),o.nextTick(D,b,I),b._writableState.errorEmitted=!0,W(b,K)):(Y(K),b._writableState.errorEmitted=!0,W(b,K),D(b,I))})(q,ee,te,Q,k);else{var x=z(ee)||q.destroyed;x||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||C(q,ee),te?o.nextTick(j,q,ee,x,k):j(q,ee,x,k)}})(L,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=O.emitClose!==!1,this.autoDestroy=!!O.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function _(O){var L=this instanceof(u=u||n(36));if(!L&&!w.call(_,this))return new _(O);this._writableState=new m(O,this,L),this.writable=!0,O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final)),g.call(this)}function G(O,L,U,A,V,q,Q){L.writelen=A,L.writecb=Q,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new E("write")):U?O._writev(V,L.onwrite):O._write(V,q,L.onwrite),L.sync=!1}function j(O,L,U,A){U||function(V,q){q.length===0&&q.needDrain&&(q.needDrain=!1,V.emit("drain"))}(O,L),L.pendingcb--,A(),D(O,L)}function C(O,L){L.bufferProcessing=!0;var U=L.bufferedRequest;if(O._writev&&U&&U.next){var A=L.bufferedRequestCount,V=new Array(A),q=L.corkedRequestsFree;q.entry=U;for(var Q=0,ee=!0;U;)V[Q]=U,U.isBuf||(ee=!1),U=U.next,Q+=1;V.allBuffers=ee,G(O,L,!0,L.length,V,"",q.finish),L.pendingcb++,L.lastBufferedRequest=null,q.next?(L.corkedRequestsFree=q.next,q.next=null):L.corkedRequestsFree=new l(L),L.bufferedRequestCount=0}else{for(;U;){var te=U.chunk,k=U.encoding,x=U.callback;if(G(O,L,!1,L.objectMode?1:te.length,te,k,x),U=U.next,L.bufferedRequestCount--,L.writing)break}U===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=U,L.bufferProcessing=!1}function z(O){return O.ending&&O.length===0&&O.bufferedRequest===null&&!O.finished&&!O.writing}function P(O,L){O._final(function(U){L.pendingcb--,U&&W(O,U),L.prefinished=!0,O.emit("prefinish"),D(O,L)})}function D(O,L){var U=z(L);if(U&&(function(V,q){q.prefinished||q.finalCalled||(typeof V._final!="function"||q.destroyed?(q.prefinished=!0,V.emit("prefinish")):(q.pendingcb++,q.finalCalled=!0,o.nextTick(P,V,q)))}(O,L),L.pendingcb===0&&(L.finished=!0,O.emit("finish"),L.autoDestroy))){var A=O._readableState;(!A||A.autoDestroy&&A.endEmitted)&&O.destroy()}return U}n(7)(_,g),m.prototype.getBuffer=function(){for(var O=this.bufferedRequest,L=[];O;)L.push(O),O=O.next;return L},function(){try{Object.defineProperty(m.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(O){return!!w.call(this,O)||this===_&&O&&O._writableState instanceof m}})):w=function(O){return O instanceof this},_.prototype.pipe=function(){W(this,new B)},_.prototype.write=function(O,L,U){var A,V=this._writableState,q=!1,Q=!V.objectMode&&(A=O,c.isBuffer(A)||A instanceof d);return Q&&!c.isBuffer(O)&&(O=function(ee){return c.from(ee)}(O)),typeof L=="function"&&(U=L,L=null),Q?L="buffer":L||(L=V.defaultEncoding),typeof U!="function"&&(U=X),V.ending?function(ee,te){var k=new h;W(ee,k),o.nextTick(te,k)}(this,U):(Q||function(ee,te,k,x){var b;return k===null?b=new T:typeof k=="string"||te.objectMode||(b=new p("chunk",["string","Buffer"],k)),!b||(W(ee,b),o.nextTick(x,b),!1)}(this,V,O,U))&&(V.pendingcb++,q=function(ee,te,k,x,b,I){if(!k){var $=function(ie,ue,we){return ie.objectMode||ie.decodeStrings===!1||typeof ue!="string"||(ue=c.from(ue,we)),ue}(te,x,b);x!==$&&(k=!0,b="buffer",x=$)}var K=te.objectMode?1:x.length;te.length+=K;var Y=te.length<te.highWaterMark;if(Y||(te.needDrain=!0),te.writing||te.corked){var ne=te.lastBufferedRequest;te.lastBufferedRequest={chunk:x,encoding:b,isBuf:k,callback:I,next:null},ne?ne.next=te.lastBufferedRequest:te.bufferedRequest=te.lastBufferedRequest,te.bufferedRequestCount+=1}else G(ee,te,!1,K,x,b,I);return Y}(this,V,Q,O,L,U)),q},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var O=this._writableState;O.corked&&(O.corked--,O.writing||O.corked||O.bufferProcessing||!O.bufferedRequest||C(this,O))},_.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new R(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(O,L,U){U(new S("_write()"))},_.prototype._writev=null,_.prototype.end=function(O,L,U){var A=this._writableState;return typeof O=="function"?(U=O,O=null,L=null):typeof L=="function"&&(U=L,L=null),O!=null&&this.write(O,L),A.corked&&(A.corked=1,this.uncork()),A.ending||function(V,q,Q){q.ending=!0,D(V,q),Q&&(q.finished?o.nextTick(Q):V.once("finish",Q)),q.ended=!0,V.writable=!1}(this,A,U),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),_.prototype.destroy=v.destroy,_.prototype._undestroy=v.undestroy,_.prototype._destroy=function(O,L){L(O)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(20).EventEmitter},function(e,t){var n={}.toString;e.exports=Array.isArray||function(r){return n.call(r)=="[object Array]"}},function(e,t,n){(function(r){function o(s,g){u(s,g),l(s)}function l(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function u(s,g){s.emit("error",g)}e.exports={destroy:function(s,g){var c=this,d=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return d||w?(g?g(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(u,this,s)):r.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(v){!g&&v?c._writableState?c._writableState.errorEmitted?r.nextTick(l,c):(c._writableState.errorEmitted=!0,r.nextTick(o,c,v)):r.nextTick(o,c,v):g?(r.nextTick(l,c),g(v)):r.nextTick(l,c)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(s,g){var c=s._readableState,d=s._writableState;c&&c.autoDestroy||d&&d.autoDestroy?s.destroy(g):s.emit("error",g)}}}).call(this,n(2))},function(e,t,n){var r=n(35).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(o,l,u,s){var g=function(c,d,w){return c.highWaterMark!=null?c.highWaterMark:d?c[w]:null}(l,s,u);if(g!=null){if(!isFinite(g)||Math.floor(g)!==g||g<0)throw new r(s?u:"highWaterMark",g);return Math.floor(g)}return o.objectMode?16:16384}}},function(e,t){},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(159)),o=u(n(23)),l=u(n(30));function u(s){return s&&s.__esModule?s:{default:s}}t.default=(0,l.default)(function(s,g,c,d){return(0,r.default)(g)(s,(0,o.default)(c),d)},4),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){function o(...l){if(r!==null){var u=r;r=null,u.apply(this,l)}}return Object.assign(o,r),o},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...o){if(r===null)throw new Error("Callback was already called.");var l=r;r=null,l.apply(this,o)}},e.exports=t.default},function(e,t,n){(function(r,o){var l=n(37);e.exports=T;var u,s=n(63);T.ReadableState=E,n(20).EventEmitter;var g=function(U,A){return U.listeners(A).length},c=n(71),d=n(46).Buffer,w=r.Uint8Array||function(){},v=Object.create(n(32));v.inherits=n(7);var y=n(165),f=void 0;f=y&&y.debuglog?y.debuglog("stream"):function(){};var p,S=n(166),N=n(72);v.inherits(T,c);var B=["error","close","destroy","pause","resume"];function E(U,A){U=U||{};var V=A instanceof(u=u||n(22));this.objectMode=!!U.objectMode,V&&(this.objectMode=this.objectMode||!!U.readableObjectMode);var q=U.highWaterMark,Q=U.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=q||q===0?q:V&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new S,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=U.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,U.encoding&&(p||(p=n(21).StringDecoder),this.decoder=new p(U.encoding),this.encoding=U.encoding)}function T(U){if(u=u||n(22),!(this instanceof T))return new T(U);this._readableState=new E(U,this),this.readable=!0,U&&(typeof U.read=="function"&&(this._read=U.read),typeof U.destroy=="function"&&(this._destroy=U.destroy)),c.call(this)}function h(U,A,V,q,Q){var ee,te=U._readableState;return A===null?(te.reading=!1,function(k,x){if(!x.ended){if(x.decoder){var b=x.decoder.end();b&&b.length&&(x.buffer.push(b),x.length+=x.objectMode?1:b.length)}x.ended=!0,X(k)}}(U,te)):(Q||(ee=function(k,x){var b;I=x,d.isBuffer(I)||I instanceof w||typeof x=="string"||x===void 0||k.objectMode||(b=new TypeError("Invalid non-string/buffer chunk"));var I;return b}(te,A)),ee?U.emit("error",ee):te.objectMode||A&&A.length>0?(typeof A=="string"||te.objectMode||Object.getPrototypeOf(A)===d.prototype||(A=function(k){return d.from(k)}(A)),q?te.endEmitted?U.emit("error",new Error("stream.unshift() after end event")):R(U,te,A,!0):te.ended?U.emit("error",new Error("stream.push() after EOF")):(te.reading=!1,te.decoder&&!V?(A=te.decoder.write(A),te.objectMode||A.length!==0?R(U,te,A,!1):_(U,te)):R(U,te,A,!1))):q||(te.reading=!1)),function(k){return!k.ended&&(k.needReadable||k.length<k.highWaterMark||k.length===0)}(te)}function R(U,A,V,q){A.flowing&&A.length===0&&!A.sync?(U.emit("data",V),U.read(0)):(A.length+=A.objectMode?1:V.length,q?A.buffer.unshift(V):A.buffer.push(V),A.needReadable&&X(U)),_(U,A)}Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(U){this._readableState&&(this._readableState.destroyed=U)}}),T.prototype.destroy=N.destroy,T.prototype._undestroy=N.undestroy,T.prototype._destroy=function(U,A){this.push(null),A(U)},T.prototype.push=function(U,A){var V,q=this._readableState;return q.objectMode?V=!0:typeof U=="string"&&((A=A||q.defaultEncoding)!==q.encoding&&(U=d.from(U,A),A=""),V=!0),h(this,U,A,!1,V)},T.prototype.unshift=function(U){return h(this,U,null,!0,!1)},T.prototype.isPaused=function(){return this._readableState.flowing===!1},T.prototype.setEncoding=function(U){return p||(p=n(21).StringDecoder),this._readableState.decoder=new p(U),this._readableState.encoding=U,this};function W(U,A){return U<=0||A.length===0&&A.ended?0:A.objectMode?1:U!=U?A.flowing&&A.length?A.buffer.head.data.length:A.length:(U>A.highWaterMark&&(A.highWaterMark=function(V){return V>=8388608?V=8388608:(V--,V|=V>>>1,V|=V>>>2,V|=V>>>4,V|=V>>>8,V|=V>>>16,V++),V}(U)),U<=A.length?U:A.ended?A.length:(A.needReadable=!0,0))}function X(U){var A=U._readableState;A.needReadable=!1,A.emittedReadable||(f("emitReadable",A.flowing),A.emittedReadable=!0,A.sync?l.nextTick(m,U):m(U))}function m(U){f("emit readable"),U.emit("readable"),z(U)}function _(U,A){A.readingMore||(A.readingMore=!0,l.nextTick(G,U,A))}function G(U,A){for(var V=A.length;!A.reading&&!A.flowing&&!A.ended&&A.length<A.highWaterMark&&(f("maybeReadMore read 0"),U.read(0),V!==A.length);)V=A.length;A.readingMore=!1}function j(U){f("readable nexttick read 0"),U.read(0)}function C(U,A){A.reading||(f("resume read 0"),U.read(0)),A.resumeScheduled=!1,A.awaitDrain=0,U.emit("resume"),z(U),A.flowing&&!A.reading&&U.read(0)}function z(U){var A=U._readableState;for(f("flow",A.flowing);A.flowing&&U.read()!==null;);}function P(U,A){return A.length===0?null:(A.objectMode?V=A.buffer.shift():!U||U>=A.length?(V=A.decoder?A.buffer.join(""):A.buffer.length===1?A.buffer.head.data:A.buffer.concat(A.length),A.buffer.clear()):V=function(q,Q,ee){var te;return q<Q.head.data.length?(te=Q.head.data.slice(0,q),Q.head.data=Q.head.data.slice(q)):te=q===Q.head.data.length?Q.shift():ee?function(k,x){var b=x.head,I=1,$=b.data;for(k-=$.length;b=b.next;){var K=b.data,Y=k>K.length?K.length:k;if(Y===K.length?$+=K:$+=K.slice(0,k),(k-=Y)===0){Y===K.length?(++I,b.next?x.head=b.next:x.head=x.tail=null):(x.head=b,b.data=K.slice(Y));break}++I}return x.length-=I,$}(q,Q):function(k,x){var b=d.allocUnsafe(k),I=x.head,$=1;for(I.data.copy(b),k-=I.data.length;I=I.next;){var K=I.data,Y=k>K.length?K.length:k;if(K.copy(b,b.length-k,0,Y),(k-=Y)===0){Y===K.length?(++$,I.next?x.head=I.next:x.head=x.tail=null):(x.head=I,I.data=K.slice(Y));break}++$}return x.length-=$,b}(q,Q),te}(U,A.buffer,A.decoder),V);var V}function D(U){var A=U._readableState;if(A.length>0)throw new Error('"endReadable()" called on non-empty stream');A.endEmitted||(A.ended=!0,l.nextTick(O,A,U))}function O(U,A){U.endEmitted||U.length!==0||(U.endEmitted=!0,A.readable=!1,A.emit("end"))}function L(U,A){for(var V=0,q=U.length;V<q;V++)if(U[V]===A)return V;return-1}T.prototype.read=function(U){f("read",U),U=parseInt(U,10);var A=this._readableState,V=U;if(U!==0&&(A.emittedReadable=!1),U===0&&A.needReadable&&(A.length>=A.highWaterMark||A.ended))return f("read: emitReadable",A.length,A.ended),A.length===0&&A.ended?D(this):X(this),null;if((U=W(U,A))===0&&A.ended)return A.length===0&&D(this),null;var q,Q=A.needReadable;return f("need readable",Q),(A.length===0||A.length-U<A.highWaterMark)&&f("length less than watermark",Q=!0),A.ended||A.reading?f("reading or ended",Q=!1):Q&&(f("do read"),A.reading=!0,A.sync=!0,A.length===0&&(A.needReadable=!0),this._read(A.highWaterMark),A.sync=!1,A.reading||(U=W(V,A))),(q=U>0?P(U,A):null)===null?(A.needReadable=!0,U=0):A.length-=U,A.length===0&&(A.ended||(A.needReadable=!0),V!==U&&A.ended&&D(this)),q!==null&&this.emit("data",q),q},T.prototype._read=function(U){this.emit("error",new Error("_read() is not implemented"))},T.prototype.pipe=function(U,A){var V=this,q=this._readableState;switch(q.pipesCount){case 0:q.pipes=U;break;case 1:q.pipes=[q.pipes,U];break;default:q.pipes.push(U)}q.pipesCount+=1,f("pipe count=%d opts=%j",q.pipesCount,A);var Q=(!A||A.end!==!1)&&U!==o.stdout&&U!==o.stderr?te:ne;function ee(ie,ue){f("onunpipe"),ie===V&&ue&&ue.hasUnpiped===!1&&(ue.hasUnpiped=!0,f("cleanup"),U.removeListener("close",K),U.removeListener("finish",Y),U.removeListener("drain",k),U.removeListener("error",$),U.removeListener("unpipe",ee),V.removeListener("end",te),V.removeListener("end",ne),V.removeListener("data",I),x=!0,!q.awaitDrain||U._writableState&&!U._writableState.needDrain||k())}function te(){f("onend"),U.end()}q.endEmitted?l.nextTick(Q):V.once("end",Q),U.on("unpipe",ee);var k=function(ie){return function(){var ue=ie._readableState;f("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&g(ie,"data")&&(ue.flowing=!0,z(ie))}}(V);U.on("drain",k);var x=!1,b=!1;function I(ie){f("ondata"),b=!1,U.write(ie)!==!1||b||((q.pipesCount===1&&q.pipes===U||q.pipesCount>1&&L(q.pipes,U)!==-1)&&!x&&(f("false write response, pause",V._readableState.awaitDrain),V._readableState.awaitDrain++,b=!0),V.pause())}function $(ie){f("onerror",ie),ne(),U.removeListener("error",$),g(U,"error")===0&&U.emit("error",ie)}function K(){U.removeListener("finish",Y),ne()}function Y(){f("onfinish"),U.removeListener("close",K),ne()}function ne(){f("unpipe"),V.unpipe(U)}return V.on("data",I),function(ie,ue,we){if(typeof ie.prependListener=="function")return ie.prependListener(ue,we);ie._events&&ie._events[ue]?s(ie._events[ue])?ie._events[ue].unshift(we):ie._events[ue]=[we,ie._events[ue]]:ie.on(ue,we)}(U,"error",$),U.once("close",K),U.once("finish",Y),U.emit("pipe",V),q.flowing||(f("pipe resume"),V.resume()),U},T.prototype.unpipe=function(U){var A=this._readableState,V={hasUnpiped:!1};if(A.pipesCount===0)return this;if(A.pipesCount===1)return U&&U!==A.pipes||(U||(U=A.pipes),A.pipes=null,A.pipesCount=0,A.flowing=!1,U&&U.emit("unpipe",this,V)),this;if(!U){var q=A.pipes,Q=A.pipesCount;A.pipes=null,A.pipesCount=0,A.flowing=!1;for(var ee=0;ee<Q;ee++)q[ee].emit("unpipe",this,V);return this}var te=L(A.pipes,U);return te===-1||(A.pipes.splice(te,1),A.pipesCount-=1,A.pipesCount===1&&(A.pipes=A.pipes[0]),U.emit("unpipe",this,V)),this},T.prototype.on=function(U,A){var V=c.prototype.on.call(this,U,A);if(U==="data")this._readableState.flowing!==!1&&this.resume();else if(U==="readable"){var q=this._readableState;q.endEmitted||q.readableListening||(q.readableListening=q.needReadable=!0,q.emittedReadable=!1,q.reading?q.length&&X(this):l.nextTick(j,this))}return V},T.prototype.addListener=T.prototype.on,T.prototype.resume=function(){var U=this._readableState;return U.flowing||(f("resume"),U.flowing=!0,function(A,V){V.resumeScheduled||(V.resumeScheduled=!0,l.nextTick(C,A,V))}(this,U)),this},T.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},T.prototype.wrap=function(U){var A=this,V=this._readableState,q=!1;for(var Q in U.on("end",function(){if(f("wrapped end"),V.decoder&&!V.ended){var te=V.decoder.end();te&&te.length&&A.push(te)}A.push(null)}),U.on("data",function(te){f("wrapped data"),V.decoder&&(te=V.decoder.write(te)),V.objectMode&&te==null||(V.objectMode||te&&te.length)&&(A.push(te)||(q=!0,U.pause()))}),U)this[Q]===void 0&&typeof U[Q]=="function"&&(this[Q]=function(te){return function(){return U[te].apply(U,arguments)}}(Q));for(var ee=0;ee<B.length;ee++)U.on(B[ee],this.emit.bind(this,B[ee]));return this._read=function(te){f("wrapped _read",te),q&&(q=!1,U.resume())},this},Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),T._fromList=P}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(20).EventEmitter},function(e,t,n){var r=n(37);function o(l,u){l.emit("error",u)}e.exports={destroy:function(l,u){var s=this,g=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return g||c?(u?u(l):!l||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,l),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(d){!u&&d?(r.nextTick(o,s,d),s._writableState&&(s._writableState.errorEmitted=!0)):u&&u(d)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){e.exports=u;var r=n(22),o=Object.create(n(32));function l(c,d){var w=this._transformState;w.transforming=!1;var v=w.writecb;if(!v)return this.emit("error",new Error("write callback called multiple times"));w.writechunk=null,w.writecb=null,d!=null&&this.push(d),v(c);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function u(c){if(!(this instanceof u))return new u(c);r.call(this,c),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",s)}function s(){var c=this;typeof this._flush=="function"?this._flush(function(d,w){g(c,d,w)}):g(this,null,null)}function g(c,d,w){if(d)return c.emit("error",d);if(w!=null&&c.push(w),c._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(c._transformState.transforming)throw new Error("Calling transform done when still transforming");return c.push(null)}o.inherits=n(7),o.inherits(u,r),u.prototype.push=function(c,d){return this._transformState.needTransform=!1,r.prototype.push.call(this,c,d)},u.prototype._transform=function(c,d,w){throw new Error("_transform() is not implemented")},u.prototype._write=function(c,d,w){var v=this._transformState;if(v.writecb=w,v.writechunk=c,v.writeencoding=d,!v.transforming){var y=this._readableState;(v.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},u.prototype._read=function(c){var d=this._transformState;d.writechunk!==null&&d.writecb&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},u.prototype._destroy=function(c,d){var w=this;r.prototype._destroy.call(this,c,function(v){d(v),w.emit("close")})}},function(e,t,n){(function(r){var o=n(174);function l(m,_){if(m===_)return 0;for(var G=m.length,j=_.length,C=0,z=Math.min(G,j);C<z;++C)if(m[C]!==_[C]){G=m[C],j=_[C];break}return G<j?-1:j<G?1:0}function u(m){return r.Buffer&&typeof r.Buffer.isBuffer=="function"?r.Buffer.isBuffer(m):!(m==null||!m._isBuffer)}var s=n(13),g=Object.prototype.hasOwnProperty,c=Array.prototype.slice,d=function(){}.name==="foo";function w(m){return Object.prototype.toString.call(m)}function v(m){return!u(m)&&typeof r.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(m):!!m&&(m instanceof DataView||!!(m.buffer&&m.buffer instanceof ArrayBuffer)))}var y=e.exports=E,f=/\s*function\s+([^\(\s]*)\s*/;function p(m){if(s.isFunction(m)){if(d)return m.name;var _=m.toString().match(f);return _&&_[1]}}function S(m,_){return typeof m=="string"?m.length<_?m:m.slice(0,_):m}function N(m){if(d||!s.isFunction(m))return s.inspect(m);var _=p(m);return"[Function"+(_?": "+_:"")+"]"}function B(m,_,G,j,C){throw new y.AssertionError({message:G,actual:m,expected:_,operator:j,stackStartFunction:C})}function E(m,_){m||B(m,!0,_,"==",y.ok)}function T(m,_,G,j){if(m===_)return!0;if(u(m)&&u(_))return l(m,_)===0;if(s.isDate(m)&&s.isDate(_))return m.getTime()===_.getTime();if(s.isRegExp(m)&&s.isRegExp(_))return m.source===_.source&&m.global===_.global&&m.multiline===_.multiline&&m.lastIndex===_.lastIndex&&m.ignoreCase===_.ignoreCase;if(m!==null&&typeof m=="object"||_!==null&&typeof _=="object"){if(v(m)&&v(_)&&w(m)===w(_)&&!(m instanceof Float32Array||m instanceof Float64Array))return l(new Uint8Array(m.buffer),new Uint8Array(_.buffer))===0;if(u(m)!==u(_))return!1;var C=(j=j||{actual:[],expected:[]}).actual.indexOf(m);return C!==-1&&C===j.expected.indexOf(_)||(j.actual.push(m),j.expected.push(_),function(z,P,D,O){if(z==null||P==null)return!1;if(s.isPrimitive(z)||s.isPrimitive(P))return z===P;if(D&&Object.getPrototypeOf(z)!==Object.getPrototypeOf(P))return!1;var L=h(z),U=h(P);if(L&&!U||!L&&U)return!1;if(L)return z=c.call(z),P=c.call(P),T(z,P,D);var A,V,q=X(z),Q=X(P);if(q.length!==Q.length)return!1;for(q.sort(),Q.sort(),V=q.length-1;V>=0;V--)if(q[V]!==Q[V])return!1;for(V=q.length-1;V>=0;V--)if(A=q[V],!T(z[A],P[A],D,O))return!1;return!0}(m,_,G,j))}return G?m===_:m==_}function h(m){return Object.prototype.toString.call(m)=="[object Arguments]"}function R(m,_){if(!m||!_)return!1;if(Object.prototype.toString.call(_)=="[object RegExp]")return _.test(m);try{if(m instanceof _)return!0}catch{}return!Error.isPrototypeOf(_)&&_.call({},m)===!0}function W(m,_,G,j){var C;if(typeof _!="function")throw new TypeError('"block" argument must be a function');typeof G=="string"&&(j=G,G=null),C=function(D){var O;try{D()}catch(L){O=L}return O}(_),j=(G&&G.name?" ("+G.name+").":".")+(j?" "+j:"."),m&&!C&&B(C,G,"Missing expected exception"+j);var z=typeof j=="string",P=!m&&C&&!G;if((!m&&s.isError(C)&&z&&R(C,G)||P)&&B(C,G,"Got unwanted exception"+j),m&&C&&G&&!R(C,G)||!m&&C)throw C}y.AssertionError=function(m){this.name="AssertionError",this.actual=m.actual,this.expected=m.expected,this.operator=m.operator,m.message?(this.message=m.message,this.generatedMessage=!1):(this.message=function(D){return S(N(D.actual),128)+" "+D.operator+" "+S(N(D.expected),128)}(this),this.generatedMessage=!0);var _=m.stackStartFunction||B;if(Error.captureStackTrace)Error.captureStackTrace(this,_);else{var G=new Error;if(G.stack){var j=G.stack,C=p(_),z=j.indexOf(`
41
+ `+C);if(z>=0){var P=j.indexOf(`
42
+ `,z+1);j=j.substring(P+1)}this.stack=j}}},s.inherits(y.AssertionError,Error),y.fail=B,y.ok=E,y.equal=function(m,_,G){m!=_&&B(m,_,G,"==",y.equal)},y.notEqual=function(m,_,G){m==_&&B(m,_,G,"!=",y.notEqual)},y.deepEqual=function(m,_,G){T(m,_,!1)||B(m,_,G,"deepEqual",y.deepEqual)},y.deepStrictEqual=function(m,_,G){T(m,_,!0)||B(m,_,G,"deepStrictEqual",y.deepStrictEqual)},y.notDeepEqual=function(m,_,G){T(m,_,!1)&&B(m,_,G,"notDeepEqual",y.notDeepEqual)},y.notDeepStrictEqual=function m(_,G,j){T(_,G,!0)&&B(_,G,j,"notDeepStrictEqual",m)},y.strictEqual=function(m,_,G){m!==_&&B(m,_,G,"===",y.strictEqual)},y.notStrictEqual=function(m,_,G){m===_&&B(m,_,G,"!==",y.notStrictEqual)},y.throws=function(m,_,G){W(!0,m,_,G)},y.doesNotThrow=function(m,_,G){W(!1,m,_,G)},y.ifError=function(m){if(m)throw m},y.strict=o(function m(_,G){_||B(_,!0,G,"==",m)},y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict;var X=Object.keys||function(m){var _=[];for(var G in m)g.call(m,G)&&_.push(G);return _}}).call(this,n(6))},function(e,t,n){e.exports=function(r,o,l,u){for(var s=65535&r|0,g=r>>>16&65535|0,c=0;l!==0;){l-=c=l>2e3?2e3:l;do g=g+(s=s+o[u++]|0)|0;while(--c);s%=65521,g%=65521}return s|g<<16|0}},function(e,t,n){var r=function(){for(var o,l=[],u=0;u<256;u++){o=u;for(var s=0;s<8;s++)o=1&o?3988292384^o>>>1:o>>>1;l[u]=o}return l}();e.exports=function(o,l,u,s){var g=r,c=s+u;o^=-1;for(var d=s;d<c;d++)o=o>>>8^g[255&(o^l[d])];return-1^o}},function(e,t,n){(function(r,o){var l;e.exports=_,_.ReadableState=m,n(20).EventEmitter;var u=function(k,x){return k.listeners(x).length},s=n(78),g=n(5).Buffer,c=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},d,w=n(183);d=w&&w.debuglog?w.debuglog("stream"):function(){};var v,y,f,p=n(184),S=n(79),N=n(80).getHighWaterMark,B=n(24).codes,E=B.ERR_INVALID_ARG_TYPE,T=B.ERR_STREAM_PUSH_AFTER_EOF,h=B.ERR_METHOD_NOT_IMPLEMENTED,R=B.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(_,s);var W=S.errorOrDestroy,X=["error","close","destroy","pause","resume"];function m(k,x,b){l=l||n(25),k=k||{},typeof b!="boolean"&&(b=x instanceof l),this.objectMode=!!k.objectMode,b&&(this.objectMode=this.objectMode||!!k.readableObjectMode),this.highWaterMark=N(this,k,"readableHighWaterMark",b),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.destroyed=!1,this.defaultEncoding=k.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,k.encoding&&(v||(v=n(21).StringDecoder),this.decoder=new v(k.encoding),this.encoding=k.encoding)}function _(k){if(l=l||n(25),!(this instanceof _))return new _(k);var x=this instanceof l;this._readableState=new m(k,this,x),this.readable=!0,k&&(typeof k.read=="function"&&(this._read=k.read),typeof k.destroy=="function"&&(this._destroy=k.destroy)),s.call(this)}function G(k,x,b,I,$){d("readableAddChunk",x);var K,Y=k._readableState;if(x===null)Y.reading=!1,function(ne,ie){if(d("onEofChunk"),!ie.ended){if(ie.decoder){var ue=ie.decoder.end();ue&&ue.length&&(ie.buffer.push(ue),ie.length+=ie.objectMode?1:ue.length)}ie.ended=!0,ie.sync?z(ne):(ie.needReadable=!1,ie.emittedReadable||(ie.emittedReadable=!0,P(ne)))}}(k,Y);else if($||(K=function(ne,ie){var ue;we=ie,g.isBuffer(we)||we instanceof c||typeof ie=="string"||ie===void 0||ne.objectMode||(ue=new E("chunk",["string","Buffer","Uint8Array"],ie));var we;return ue}(Y,x)),K)W(k,K);else if(Y.objectMode||x&&x.length>0)if(typeof x=="string"||Y.objectMode||Object.getPrototypeOf(x)===g.prototype||(x=function(ne){return g.from(ne)}(x)),I)Y.endEmitted?W(k,new R):j(k,Y,x,!0);else if(Y.ended)W(k,new T);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!b?(x=Y.decoder.write(x),Y.objectMode||x.length!==0?j(k,Y,x,!1):D(k,Y)):j(k,Y,x,!1)}else I||(Y.reading=!1,D(k,Y));return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function j(k,x,b,I){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,k.emit("data",b)):(x.length+=x.objectMode?1:b.length,I?x.buffer.unshift(b):x.buffer.push(b),x.needReadable&&z(k)),D(k,x)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(k){this._readableState&&(this._readableState.destroyed=k)}}),_.prototype.destroy=S.destroy,_.prototype._undestroy=S.undestroy,_.prototype._destroy=function(k,x){x(k)},_.prototype.push=function(k,x){var b,I=this._readableState;return I.objectMode?b=!0:typeof k=="string"&&((x=x||I.defaultEncoding)!==I.encoding&&(k=g.from(k,x),x=""),b=!0),G(this,k,x,!1,b)},_.prototype.unshift=function(k){return G(this,k,null,!0,!1)},_.prototype.isPaused=function(){return this._readableState.flowing===!1},_.prototype.setEncoding=function(k){v||(v=n(21).StringDecoder);var x=new v(k);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var b=this._readableState.buffer.head,I="";b!==null;)I+=x.write(b.data),b=b.next;return this._readableState.buffer.clear(),I!==""&&this._readableState.buffer.push(I),this._readableState.length=I.length,this};function C(k,x){return k<=0||x.length===0&&x.ended?0:x.objectMode?1:k!=k?x.flowing&&x.length?x.buffer.head.data.length:x.length:(k>x.highWaterMark&&(x.highWaterMark=function(b){return b>=1073741824?b=1073741824:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}(k)),k<=x.length?k:x.ended?x.length:(x.needReadable=!0,0))}function z(k){var x=k._readableState;d("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(d("emitReadable",x.flowing),x.emittedReadable=!0,o.nextTick(P,k))}function P(k){var x=k._readableState;d("emitReadable_",x.destroyed,x.length,x.ended),x.destroyed||!x.length&&!x.ended||(k.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,V(k)}function D(k,x){x.readingMore||(x.readingMore=!0,o.nextTick(O,k,x))}function O(k,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var b=x.length;if(d("maybeReadMore read 0"),k.read(0),b===x.length)break}x.readingMore=!1}function L(k){var x=k._readableState;x.readableListening=k.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:k.listenerCount("data")>0&&k.resume()}function U(k){d("readable nexttick read 0"),k.read(0)}function A(k,x){d("resume",x.reading),x.reading||k.read(0),x.resumeScheduled=!1,k.emit("resume"),V(k),x.flowing&&!x.reading&&k.read(0)}function V(k){var x=k._readableState;for(d("flow",x.flowing);x.flowing&&k.read()!==null;);}function q(k,x){return x.length===0?null:(x.objectMode?b=x.buffer.shift():!k||k>=x.length?(b=x.decoder?x.buffer.join(""):x.buffer.length===1?x.buffer.first():x.buffer.concat(x.length),x.buffer.clear()):b=x.buffer.consume(k,x.decoder),b);var b}function Q(k){var x=k._readableState;d("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,o.nextTick(ee,x,k))}function ee(k,x){if(d("endReadableNT",k.endEmitted,k.length),!k.endEmitted&&k.length===0&&(k.endEmitted=!0,x.readable=!1,x.emit("end"),k.autoDestroy)){var b=x._writableState;(!b||b.autoDestroy&&b.finished)&&x.destroy()}}function te(k,x){for(var b=0,I=k.length;b<I;b++)if(k[b]===x)return b;return-1}_.prototype.read=function(k){d("read",k),k=parseInt(k,10);var x=this._readableState,b=k;if(k!==0&&(x.emittedReadable=!1),k===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return d("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Q(this):z(this),null;if((k=C(k,x))===0&&x.ended)return x.length===0&&Q(this),null;var I,$=x.needReadable;return d("need readable",$),(x.length===0||x.length-k<x.highWaterMark)&&d("length less than watermark",$=!0),x.ended||x.reading?d("reading or ended",$=!1):$&&(d("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(k=C(b,x))),(I=k>0?q(k,x):null)===null?(x.needReadable=x.length<=x.highWaterMark,k=0):(x.length-=k,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),b!==k&&x.ended&&Q(this)),I!==null&&this.emit("data",I),I},_.prototype._read=function(k){W(this,new h("_read()"))},_.prototype.pipe=function(k,x){var b=this,I=this._readableState;switch(I.pipesCount){case 0:I.pipes=k;break;case 1:I.pipes=[I.pipes,k];break;default:I.pipes.push(k)}I.pipesCount+=1,d("pipe count=%d opts=%j",I.pipesCount,x);var $=(!x||x.end!==!1)&&k!==o.stdout&&k!==o.stderr?Y:Ne;function K(Te,Ae){d("onunpipe"),Te===b&&Ae&&Ae.hasUnpiped===!1&&(Ae.hasUnpiped=!0,d("cleanup"),k.removeListener("close",Oe),k.removeListener("finish",Ee),k.removeListener("drain",ne),k.removeListener("error",we),k.removeListener("unpipe",K),b.removeListener("end",Y),b.removeListener("end",Ne),b.removeListener("data",ue),ie=!0,!I.awaitDrain||k._writableState&&!k._writableState.needDrain||ne())}function Y(){d("onend"),k.end()}I.endEmitted?o.nextTick($):b.once("end",$),k.on("unpipe",K);var ne=function(Te){return function(){var Ae=Te._readableState;d("pipeOnDrain",Ae.awaitDrain),Ae.awaitDrain&&Ae.awaitDrain--,Ae.awaitDrain===0&&u(Te,"data")&&(Ae.flowing=!0,V(Te))}}(b);k.on("drain",ne);var ie=!1;function ue(Te){d("ondata");var Ae=k.write(Te);d("dest.write",Ae),Ae===!1&&((I.pipesCount===1&&I.pipes===k||I.pipesCount>1&&te(I.pipes,k)!==-1)&&!ie&&(d("false write response, pause",I.awaitDrain),I.awaitDrain++),b.pause())}function we(Te){d("onerror",Te),Ne(),k.removeListener("error",we),u(k,"error")===0&&W(k,Te)}function Oe(){k.removeListener("finish",Ee),Ne()}function Ee(){d("onfinish"),k.removeListener("close",Oe),Ne()}function Ne(){d("unpipe"),b.unpipe(k)}return b.on("data",ue),function(Te,Ae,Ie){if(typeof Te.prependListener=="function")return Te.prependListener(Ae,Ie);Te._events&&Te._events[Ae]?Array.isArray(Te._events[Ae])?Te._events[Ae].unshift(Ie):Te._events[Ae]=[Ie,Te._events[Ae]]:Te.on(Ae,Ie)}(k,"error",we),k.once("close",Oe),k.once("finish",Ee),k.emit("pipe",b),I.flowing||(d("pipe resume"),b.resume()),k},_.prototype.unpipe=function(k){var x=this._readableState,b={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return k&&k!==x.pipes||(k||(k=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,k&&k.emit("unpipe",this,b)),this;if(!k){var I=x.pipes,$=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var K=0;K<$;K++)I[K].emit("unpipe",this,{hasUnpiped:!1});return this}var Y=te(x.pipes,k);return Y===-1||(x.pipes.splice(Y,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),k.emit("unpipe",this,b)),this},_.prototype.on=function(k,x){var b=s.prototype.on.call(this,k,x),I=this._readableState;return k==="data"?(I.readableListening=this.listenerCount("readable")>0,I.flowing!==!1&&this.resume()):k==="readable"&&(I.endEmitted||I.readableListening||(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,d("on readable",I.length,I.reading),I.length?z(this):I.reading||o.nextTick(U,this))),b},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(k,x){var b=s.prototype.removeListener.call(this,k,x);return k==="readable"&&o.nextTick(L,this),b},_.prototype.removeAllListeners=function(k){var x=s.prototype.removeAllListeners.apply(this,arguments);return k!=="readable"&&k!==void 0||o.nextTick(L,this),x},_.prototype.resume=function(){var k=this._readableState;return k.flowing||(d("resume"),k.flowing=!k.readableListening,function(x,b){b.resumeScheduled||(b.resumeScheduled=!0,o.nextTick(A,x,b))}(this,k)),k.paused=!1,this},_.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(k){var x=this,b=this._readableState,I=!1;for(var $ in k.on("end",function(){if(d("wrapped end"),b.decoder&&!b.ended){var Y=b.decoder.end();Y&&Y.length&&x.push(Y)}x.push(null)}),k.on("data",function(Y){d("wrapped data"),b.decoder&&(Y=b.decoder.write(Y)),b.objectMode&&Y==null||(b.objectMode||Y&&Y.length)&&(x.push(Y)||(I=!0,k.pause()))}),k)this[$]===void 0&&typeof k[$]=="function"&&(this[$]=function(Y){return function(){return k[Y].apply(k,arguments)}}($));for(var K=0;K<X.length;K++)k.on(X[K],this.emit.bind(this,X[K]));return this._read=function(Y){d("wrapped _read",Y),I&&(I=!1,k.resume())},this},typeof Symbol=="function"&&(_.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=n(186)),y(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(k){this._readableState&&(this._readableState.flowing=k)}}),_._fromList=q,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(_.from=function(k,x){return f===void 0&&(f=n(187)),f(_,k,x)})}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(20).EventEmitter},function(e,t,n){(function(r){function o(s,g){u(s,g),l(s)}function l(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function u(s,g){s.emit("error",g)}e.exports={destroy:function(s,g){var c=this,d=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return d||w?(g?g(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(u,this,s)):r.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(v){!g&&v?c._writableState?c._writableState.errorEmitted?r.nextTick(l,c):(c._writableState.errorEmitted=!0,r.nextTick(o,c,v)):r.nextTick(o,c,v):g?(r.nextTick(l,c),g(v)):r.nextTick(l,c)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(s,g){var c=s._readableState,d=s._writableState;c&&c.autoDestroy||d&&d.autoDestroy?s.destroy(g):s.emit("error",g)}}}).call(this,n(2))},function(e,t,n){var r=n(24).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(o,l,u,s){var g=function(c,d,w){return c.highWaterMark!=null?c.highWaterMark:d?c[w]:null}(l,s,u);if(g!=null){if(!isFinite(g)||Math.floor(g)!==g||g<0)throw new r(s?u:"highWaterMark",g);return Math.floor(g)}return o.objectMode?16:16384}}},function(e,t,n){(function(r,o){function l(O){var L=this;this.next=null,this.entry=null,this.finish=function(){(function(U,A,V){var q=U.entry;for(U.entry=null;q;){var Q=q.callback;A.pendingcb--,Q(V),q=q.next}A.corkedRequestsFree.next=U})(L,O)}}var u;e.exports=_,_.WritableState=m;var s={deprecate:n(43)},g=n(78),c=n(5).Buffer,d=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},w,v=n(79),y=n(80).getHighWaterMark,f=n(24).codes,p=f.ERR_INVALID_ARG_TYPE,S=f.ERR_METHOD_NOT_IMPLEMENTED,N=f.ERR_MULTIPLE_CALLBACK,B=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,T=f.ERR_STREAM_NULL_VALUES,h=f.ERR_STREAM_WRITE_AFTER_END,R=f.ERR_UNKNOWN_ENCODING,W=v.errorOrDestroy;function X(){}function m(O,L,U){u=u||n(25),O=O||{},typeof U!="boolean"&&(U=L instanceof u),this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.writableObjectMode),this.highWaterMark=y(this,O,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var A=O.decodeStrings===!1;this.decodeStrings=!A,this.defaultEncoding=O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){(function(q,Q){var ee=q._writableState,te=ee.sync,k=ee.writecb;if(typeof k!="function")throw new N;if(function(b){b.writing=!1,b.writecb=null,b.length-=b.writelen,b.writelen=0}(ee),Q)(function(b,I,$,K,Y){--I.pendingcb,$?(o.nextTick(Y,K),o.nextTick(D,b,I),b._writableState.errorEmitted=!0,W(b,K)):(Y(K),b._writableState.errorEmitted=!0,W(b,K),D(b,I))})(q,ee,te,Q,k);else{var x=z(ee)||q.destroyed;x||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||C(q,ee),te?o.nextTick(j,q,ee,x,k):j(q,ee,x,k)}})(L,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=O.emitClose!==!1,this.autoDestroy=!!O.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function _(O){var L=this instanceof(u=u||n(25));if(!L&&!w.call(_,this))return new _(O);this._writableState=new m(O,this,L),this.writable=!0,O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final)),g.call(this)}function G(O,L,U,A,V,q,Q){L.writelen=A,L.writecb=Q,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new E("write")):U?O._writev(V,L.onwrite):O._write(V,q,L.onwrite),L.sync=!1}function j(O,L,U,A){U||function(V,q){q.length===0&&q.needDrain&&(q.needDrain=!1,V.emit("drain"))}(O,L),L.pendingcb--,A(),D(O,L)}function C(O,L){L.bufferProcessing=!0;var U=L.bufferedRequest;if(O._writev&&U&&U.next){var A=L.bufferedRequestCount,V=new Array(A),q=L.corkedRequestsFree;q.entry=U;for(var Q=0,ee=!0;U;)V[Q]=U,U.isBuf||(ee=!1),U=U.next,Q+=1;V.allBuffers=ee,G(O,L,!0,L.length,V,"",q.finish),L.pendingcb++,L.lastBufferedRequest=null,q.next?(L.corkedRequestsFree=q.next,q.next=null):L.corkedRequestsFree=new l(L),L.bufferedRequestCount=0}else{for(;U;){var te=U.chunk,k=U.encoding,x=U.callback;if(G(O,L,!1,L.objectMode?1:te.length,te,k,x),U=U.next,L.bufferedRequestCount--,L.writing)break}U===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=U,L.bufferProcessing=!1}function z(O){return O.ending&&O.length===0&&O.bufferedRequest===null&&!O.finished&&!O.writing}function P(O,L){O._final(function(U){L.pendingcb--,U&&W(O,U),L.prefinished=!0,O.emit("prefinish"),D(O,L)})}function D(O,L){var U=z(L);if(U&&(function(V,q){q.prefinished||q.finalCalled||(typeof V._final!="function"||q.destroyed?(q.prefinished=!0,V.emit("prefinish")):(q.pendingcb++,q.finalCalled=!0,o.nextTick(P,V,q)))}(O,L),L.pendingcb===0&&(L.finished=!0,O.emit("finish"),L.autoDestroy))){var A=O._readableState;(!A||A.autoDestroy&&A.endEmitted)&&O.destroy()}return U}n(7)(_,g),m.prototype.getBuffer=function(){for(var O=this.bufferedRequest,L=[];O;)L.push(O),O=O.next;return L},function(){try{Object.defineProperty(m.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(O){return!!w.call(this,O)||this===_&&O&&O._writableState instanceof m}})):w=function(O){return O instanceof this},_.prototype.pipe=function(){W(this,new B)},_.prototype.write=function(O,L,U){var A,V=this._writableState,q=!1,Q=!V.objectMode&&(A=O,c.isBuffer(A)||A instanceof d);return Q&&!c.isBuffer(O)&&(O=function(ee){return c.from(ee)}(O)),typeof L=="function"&&(U=L,L=null),Q?L="buffer":L||(L=V.defaultEncoding),typeof U!="function"&&(U=X),V.ending?function(ee,te){var k=new h;W(ee,k),o.nextTick(te,k)}(this,U):(Q||function(ee,te,k,x){var b;return k===null?b=new T:typeof k=="string"||te.objectMode||(b=new p("chunk",["string","Buffer"],k)),!b||(W(ee,b),o.nextTick(x,b),!1)}(this,V,O,U))&&(V.pendingcb++,q=function(ee,te,k,x,b,I){if(!k){var $=function(ie,ue,we){return ie.objectMode||ie.decodeStrings===!1||typeof ue!="string"||(ue=c.from(ue,we)),ue}(te,x,b);x!==$&&(k=!0,b="buffer",x=$)}var K=te.objectMode?1:x.length;te.length+=K;var Y=te.length<te.highWaterMark;if(Y||(te.needDrain=!0),te.writing||te.corked){var ne=te.lastBufferedRequest;te.lastBufferedRequest={chunk:x,encoding:b,isBuf:k,callback:I,next:null},ne?ne.next=te.lastBufferedRequest:te.bufferedRequest=te.lastBufferedRequest,te.bufferedRequestCount+=1}else G(ee,te,!1,K,x,b,I);return Y}(this,V,Q,O,L,U)),q},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var O=this._writableState;O.corked&&(O.corked--,O.writing||O.corked||O.bufferProcessing||!O.bufferedRequest||C(this,O))},_.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new R(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(O,L,U){U(new S("_write()"))},_.prototype._writev=null,_.prototype.end=function(O,L,U){var A=this._writableState;return typeof O=="function"?(U=O,O=null,L=null):typeof L=="function"&&(U=L,L=null),O!=null&&this.write(O,L),A.corked&&(A.corked=1,this.uncork()),A.ending||function(V,q,Q){q.ending=!0,D(V,q),Q&&(q.finished?o.nextTick(Q):V.once("finish",Q)),q.ended=!0,V.writable=!1}(this,A,U),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),_.prototype.destroy=v.destroy,_.prototype._undestroy=v.undestroy,_.prototype._destroy=function(O,L){L(O)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=d;var r=n(24).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,l=r.ERR_MULTIPLE_CALLBACK,u=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,g=n(25);function c(y,f){var p=this._transformState;p.transforming=!1;var S=p.writecb;if(S===null)return this.emit("error",new l);p.writechunk=null,p.writecb=null,f!=null&&this.push(f),S(y);var N=this._readableState;N.reading=!1,(N.needReadable||N.length<N.highWaterMark)&&this._read(N.highWaterMark)}function d(y){if(!(this instanceof d))return new d(y);g.call(this,y),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,y&&(typeof y.transform=="function"&&(this._transform=y.transform),typeof y.flush=="function"&&(this._flush=y.flush)),this.on("prefinish",w)}function w(){var y=this;typeof this._flush!="function"||this._readableState.destroyed?v(this,null,null):this._flush(function(f,p){v(y,f,p)})}function v(y,f,p){if(f)return y.emit("error",f);if(p!=null&&y.push(p),y._writableState.length)throw new s;if(y._transformState.transforming)throw new u;return y.push(null)}n(7)(d,g),d.prototype.push=function(y,f){return this._transformState.needTransform=!1,g.prototype.push.call(this,y,f)},d.prototype._transform=function(y,f,p){p(new o("_transform()"))},d.prototype._write=function(y,f,p){var S=this._transformState;if(S.writecb=p,S.writechunk=y,S.writeencoding=f,!S.transforming){var N=this._readableState;(S.needTransform||N.needReadable||N.length<N.highWaterMark)&&this._read(N.highWaterMark)}},d.prototype._read=function(y){var f=this._transformState;f.writechunk===null||f.transforming?f.needTransform=!0:(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform))},d.prototype._destroy=function(y,f){g.prototype._destroy.call(this,y,function(p){f(p)})}},function(e,t,n){(function(r){var o=n(194),l=n(85),u=n(196),s=n(197),g=n(86),c=t;c.request=function(d,w){d=typeof d=="string"?g.parse(d):u(d);var v=r.location.protocol.search(/^https?:$/)===-1?"http:":"",y=d.protocol||v,f=d.hostname||d.host,p=d.port,S=d.path||"/";f&&f.indexOf(":")!==-1&&(f="["+f+"]"),d.url=(f?y+"//"+f:"")+(p?":"+p:"")+S,d.method=(d.method||"GET").toUpperCase(),d.headers=d.headers||{};var N=new o(d);return w&&N.on("response",w),N},c.get=function(d,w){var v=c.request(d,w);return v.end(),v},c.ClientRequest=o,c.IncomingMessage=l.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(6))},function(e,t,n){(function(r){t.fetch=c(r.fetch)&&c(r.ReadableStream),t.writableStream=c(r.WritableStream),t.abortController=c(r.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch{}var o;function l(){if(o!==void 0)return o;if(r.XMLHttpRequest){o=new r.XMLHttpRequest;try{o.open("GET",r.XDomainRequest?"/":"https://example.com")}catch{o=null}}else o=null;return o}function u(d){var w=l();if(!w)return!1;try{return w.responseType=d,w.responseType===d}catch{}return!1}var s=r.ArrayBuffer!==void 0,g=s&&c(r.ArrayBuffer.prototype.slice);function c(d){return typeof d=="function"}t.arraybuffer=t.fetch||s&&u("arraybuffer"),t.msstream=!t.fetch&&g&&u("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&s&&u("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!l()&&c(l().overrideMimeType),t.vbArray=c(r.VBArray),o=null}).call(this,n(6))},function(e,t,n){(function(r,o,l){var u=n(84),s=n(7),g=n(31),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},d=t.IncomingMessage=function(w,v,y,f){var p=this;if(g.Readable.call(p),p._mode=y,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",function(){r.nextTick(function(){p.emit("close")})}),y==="fetch"){if(p._fetchResponse=v,p.url=v.url,p.statusCode=v.status,p.statusMessage=v.statusText,v.headers.forEach(function(T,h){p.headers[h.toLowerCase()]=T,p.rawHeaders.push(h,T)}),u.writableStream){var S=new WritableStream({write:function(T){return new Promise(function(h,R){p._destroyed?R():p.push(new o(T))?h():p._resumeFetch=h})},close:function(){l.clearTimeout(f),p._destroyed||p.push(null)},abort:function(T){p._destroyed||p.emit("error",T)}});try{return void v.body.pipeTo(S).catch(function(T){l.clearTimeout(f),p._destroyed||p.emit("error",T)})}catch{}}var N=v.body.getReader();(function T(){N.read().then(function(h){if(!p._destroyed){if(h.done)return l.clearTimeout(f),void p.push(null);p.push(new o(h.value)),T()}}).catch(function(h){l.clearTimeout(f),p._destroyed||p.emit("error",h)})})()}else if(p._xhr=w,p._pos=0,p.url=w.responseURL,p.statusCode=w.status,p.statusMessage=w.statusText,w.getAllResponseHeaders().split(/\r?\n/).forEach(function(T){var h=T.match(/^([^:]+):\s*(.*)/);if(h){var R=h[1].toLowerCase();R==="set-cookie"?(p.headers[R]===void 0&&(p.headers[R]=[]),p.headers[R].push(h[2])):p.headers[R]!==void 0?p.headers[R]+=", "+h[2]:p.headers[R]=h[2],p.rawHeaders.push(h[1],h[2])}}),p._charset="x-user-defined",!u.overrideMimeType){var B=p.rawHeaders["mime-type"];if(B){var E=B.match(/;\s*charset=([^;])(;|$)/);E&&(p._charset=E[1].toLowerCase())}p._charset||(p._charset="utf-8")}};s(d,g.Readable),d.prototype._read=function(){var w=this._resumeFetch;w&&(this._resumeFetch=null,w())},d.prototype._onXHRProgress=function(){var w=this,v=w._xhr,y=null;switch(w._mode){case"text:vbarray":if(v.readyState!==c.DONE)break;try{y=new l.VBArray(v.responseBody).toArray()}catch{}if(y!==null){w.push(new o(y));break}case"text":try{y=v.responseText}catch{w._mode="text:vbarray";break}if(y.length>w._pos){var f=y.substr(w._pos);if(w._charset==="x-user-defined"){for(var p=new o(f.length),S=0;S<f.length;S++)p[S]=255&f.charCodeAt(S);w.push(p)}else w.push(f,w._charset);w._pos=y.length}break;case"arraybuffer":if(v.readyState!==c.DONE||!v.response)break;y=v.response,w.push(new o(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=v.response,v.readyState!==c.LOADING||!y)break;w.push(new o(new Uint8Array(y)));break;case"ms-stream":if(y=v.response,v.readyState!==c.LOADING)break;var N=new l.MSStreamReader;N.onprogress=function(){N.result.byteLength>w._pos&&(w.push(new o(new Uint8Array(N.result.slice(w._pos)))),w._pos=N.result.byteLength)},N.onload=function(){w.push(null)},N.readAsArrayBuffer(y)}w._xhr.readyState===c.DONE&&w._mode!=="ms-stream"&&w.push(null)}}).call(this,n(2),n(5).Buffer,n(6))},function(e,t,n){var r=n(198),o=n(200);function l(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=E,t.resolve=function(T,h){return E(T,!1,!0).resolve(h)},t.resolveObject=function(T,h){return T?E(T,!1,!0).resolveObject(h):h},t.format=function(T){return o.isString(T)&&(T=E(T)),T instanceof l?T.format():l.prototype.format.call(T)},t.Url=l;var u=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,g=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
43
+ `," "]),d=["'"].concat(c),w=["%","/","?",";","#"].concat(d),v=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},N={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},B=n(201);function E(T,h,R){if(T&&o.isObject(T)&&T instanceof l)return T;var W=new l;return W.parse(T,h,R),W}l.prototype.parse=function(T,h,R){if(!o.isString(T))throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var W=T.indexOf("?"),X=W!==-1&&W<T.indexOf("#")?"?":"#",m=T.split(X);m[0]=m[0].replace(/\\/g,"/");var _=T=m.join(X);if(_=_.trim(),!R&&T.split("#").length===1){var G=g.exec(_);if(G)return this.path=_,this.href=_,this.pathname=G[1],G[2]?(this.search=G[2],this.query=h?B.parse(this.search.substr(1)):this.search.substr(1)):h&&(this.search="",this.query={}),this}var j=u.exec(_);if(j){var C=(j=j[0]).toLowerCase();this.protocol=C,_=_.substr(j.length)}if(R||j||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var z=_.substr(0,2)==="//";!z||j&&S[j]||(_=_.substr(2),this.slashes=!0)}if(!S[j]&&(z||j&&!N[j])){for(var P,D,O=-1,L=0;L<v.length;L++)(U=_.indexOf(v[L]))!==-1&&(O===-1||U<O)&&(O=U);for((D=O===-1?_.lastIndexOf("@"):_.lastIndexOf("@",O))!==-1&&(P=_.slice(0,D),_=_.slice(D+1),this.auth=decodeURIComponent(P)),O=-1,L=0;L<w.length;L++){var U;(U=_.indexOf(w[L]))!==-1&&(O===-1||U<O)&&(O=U)}O===-1&&(O=_.length),this.host=_.slice(0,O),_=_.slice(O),this.parseHost(),this.hostname=this.hostname||"";var A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A)for(var V=this.hostname.split(/\./),q=(L=0,V.length);L<q;L++){var Q=V[L];if(Q&&!Q.match(y)){for(var ee="",te=0,k=Q.length;te<k;te++)Q.charCodeAt(te)>127?ee+="x":ee+=Q[te];if(!ee.match(y)){var x=V.slice(0,L),b=V.slice(L+1),I=Q.match(f);I&&(x.push(I[1]),b.unshift(I[2])),b.length&&(_="/"+b.join(".")+_),this.hostname=x.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var $=this.port?":"+this.port:"",K=this.hostname||"";this.host=K+$,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),_[0]!=="/"&&(_="/"+_))}if(!p[C])for(L=0,q=d.length;L<q;L++){var Y=d[L];if(_.indexOf(Y)!==-1){var ne=encodeURIComponent(Y);ne===Y&&(ne=escape(Y)),_=_.split(Y).join(ne)}}var ie=_.indexOf("#");ie!==-1&&(this.hash=_.substr(ie),_=_.slice(0,ie));var ue=_.indexOf("?");if(ue!==-1?(this.search=_.substr(ue),this.query=_.substr(ue+1),h&&(this.query=B.parse(this.query)),_=_.slice(0,ue)):h&&(this.search="",this.query={}),_&&(this.pathname=_),N[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){$=this.pathname||"";var we=this.search||"";this.path=$+we}return this.href=this.format(),this},l.prototype.format=function(){var T=this.auth||"";T&&(T=(T=encodeURIComponent(T)).replace(/%3A/i,":"),T+="@");var h=this.protocol||"",R=this.pathname||"",W=this.hash||"",X=!1,m="";this.host?X=T+this.host:this.hostname&&(X=T+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(X+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(m=B.stringify(this.query));var _=this.search||m&&"?"+m||"";return h&&h.substr(-1)!==":"&&(h+=":"),this.slashes||(!h||N[h])&&X!==!1?(X="//"+(X||""),R&&R.charAt(0)!=="/"&&(R="/"+R)):X||(X=""),W&&W.charAt(0)!=="#"&&(W="#"+W),_&&_.charAt(0)!=="?"&&(_="?"+_),h+X+(R=R.replace(/[?#]/g,function(G){return encodeURIComponent(G)}))+(_=_.replace("#","%23"))+W},l.prototype.resolve=function(T){return this.resolveObject(E(T,!1,!0)).format()},l.prototype.resolveObject=function(T){if(o.isString(T)){var h=new l;h.parse(T,!1,!0),T=h}for(var R=new l,W=Object.keys(this),X=0;X<W.length;X++){var m=W[X];R[m]=this[m]}if(R.hash=T.hash,T.href==="")return R.href=R.format(),R;if(T.slashes&&!T.protocol){for(var _=Object.keys(T),G=0;G<_.length;G++){var j=_[G];j!=="protocol"&&(R[j]=T[j])}return N[R.protocol]&&R.hostname&&!R.pathname&&(R.path=R.pathname="/"),R.href=R.format(),R}if(T.protocol&&T.protocol!==R.protocol){if(!N[T.protocol]){for(var C=Object.keys(T),z=0;z<C.length;z++){var P=C[z];R[P]=T[P]}return R.href=R.format(),R}if(R.protocol=T.protocol,T.host||S[T.protocol])R.pathname=T.pathname;else{for(var D=(T.pathname||"").split("/");D.length&&!(T.host=D.shift()););T.host||(T.host=""),T.hostname||(T.hostname=""),D[0]!==""&&D.unshift(""),D.length<2&&D.unshift(""),R.pathname=D.join("/")}if(R.search=T.search,R.query=T.query,R.host=T.host||"",R.auth=T.auth,R.hostname=T.hostname||T.host,R.port=T.port,R.pathname||R.search){var O=R.pathname||"",L=R.search||"";R.path=O+L}return R.slashes=R.slashes||T.slashes,R.href=R.format(),R}var U=R.pathname&&R.pathname.charAt(0)==="/",A=T.host||T.pathname&&T.pathname.charAt(0)==="/",V=A||U||R.host&&T.pathname,q=V,Q=R.pathname&&R.pathname.split("/")||[],ee=(D=T.pathname&&T.pathname.split("/")||[],R.protocol&&!N[R.protocol]);if(ee&&(R.hostname="",R.port=null,R.host&&(Q[0]===""?Q[0]=R.host:Q.unshift(R.host)),R.host="",T.protocol&&(T.hostname=null,T.port=null,T.host&&(D[0]===""?D[0]=T.host:D.unshift(T.host)),T.host=null),V=V&&(D[0]===""||Q[0]==="")),A)R.host=T.host||T.host===""?T.host:R.host,R.hostname=T.hostname||T.hostname===""?T.hostname:R.hostname,R.search=T.search,R.query=T.query,Q=D;else if(D.length)Q||(Q=[]),Q.pop(),Q=Q.concat(D),R.search=T.search,R.query=T.query;else if(!o.isNullOrUndefined(T.search))return ee&&(R.hostname=R.host=Q.shift(),(I=!!(R.host&&R.host.indexOf("@")>0)&&R.host.split("@"))&&(R.auth=I.shift(),R.host=R.hostname=I.shift())),R.search=T.search,R.query=T.query,o.isNull(R.pathname)&&o.isNull(R.search)||(R.path=(R.pathname?R.pathname:"")+(R.search?R.search:"")),R.href=R.format(),R;if(!Q.length)return R.pathname=null,R.search?R.path="/"+R.search:R.path=null,R.href=R.format(),R;for(var te=Q.slice(-1)[0],k=(R.host||T.host||Q.length>1)&&(te==="."||te==="..")||te==="",x=0,b=Q.length;b>=0;b--)(te=Q[b])==="."?Q.splice(b,1):te===".."?(Q.splice(b,1),x++):x&&(Q.splice(b,1),x--);if(!V&&!q)for(;x--;x)Q.unshift("..");!V||Q[0]===""||Q[0]&&Q[0].charAt(0)==="/"||Q.unshift(""),k&&Q.join("/").substr(-1)!=="/"&&Q.push("");var I,$=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";return ee&&(R.hostname=R.host=$?"":Q.length?Q.shift():"",(I=!!(R.host&&R.host.indexOf("@")>0)&&R.host.split("@"))&&(R.auth=I.shift(),R.host=R.hostname=I.shift())),(V=V||R.host&&Q.length)&&!$&&Q.unshift(""),Q.length?R.pathname=Q.join("/"):(R.pathname=null,R.path=null),o.isNull(R.pathname)&&o.isNull(R.search)||(R.path=(R.pathname?R.pathname:"")+(R.search?R.search:"")),R.auth=T.auth||R.auth,R.slashes=R.slashes||T.slashes,R.href=R.format(),R},l.prototype.parseHost=function(){var T=this.host,h=s.exec(T);h&&((h=h[0])!==":"&&(this.port=h.substr(1)),T=T.substr(0,T.length-h.length)),T&&(this.hostname=T)}},function(e,t,n){const r=o=>o!==null&&typeof o=="object"&&typeof o.pipe=="function";r.writable=o=>r(o)&&o.writable!==!1&&typeof o._write=="function"&&typeof o._writableState=="object",r.readable=o=>r(o)&&o.readable!==!1&&typeof o._read=="function"&&typeof o._readableState=="object",r.duplex=o=>r.writable(o)&&r.readable(o),r.transform=o=>r.duplex(o)&&typeof o._transform=="function"&&typeof o._transformState=="object",e.exports=r},function(e,t,n){function r(N){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(B){return typeof B}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B})(N)}function o(N,B){for(var E=0;E<B.length;E++){var T=B[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(N,T.key,T)}}function l(N,B,E){return B&&o(N.prototype,B),E&&o(N,E),Object.defineProperty(N,"prototype",{writable:!1}),N}function u(N,B){if(!(N instanceof B))throw new TypeError("Cannot call a class as a function")}function s(N,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(B&&B.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),B&&g(N,B)}function g(N,B){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E})(N,B)}function c(N){var B=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var E,T=w(N);if(B){var h=w(this).constructor;E=Reflect.construct(T,arguments,h)}else E=T.apply(this,arguments);return d(this,E)}}function d(N,B){if(B&&(r(B)==="object"||typeof B=="function"))return B;if(B!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(N)}function w(N){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(B){return B.__proto__||Object.getPrototypeOf(B)})(N)}var v=n(3).LEVEL,y=n(49),f=n(206),p=n(39)("winston:create-logger");function S(N){return"is"+N.charAt(0).toUpperCase()+N.slice(1)+"Enabled"}e.exports=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};N.levels=N.levels||y.npm.levels;var B=function(T){s(R,T);var h=c(R);function R(W){return u(this,R),h.call(this,W)}return l(R)}(f),E=new B(N);return Object.keys(N.levels).forEach(function(T){p('Define prototype method for "%s"',T),T!=="log"?(B.prototype[T]=function(){for(var h=this||E,R=arguments.length,W=new Array(R),X=0;X<R;X++)W[X]=arguments[X];if(W.length===1){var m=W[0],_=m&&m.message&&m||{message:m};return _.level=_[v]=T,h._addDefaultMeta(_),h.write(_),this||E}return W.length===0?(h.log(T,""),h):h.log.apply(h,[T].concat(W))},B.prototype[S(T)]=function(){return(this||E).isLevelEnabled(T)}):console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.')}),E}},function(e,t,n){(function(r){function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(16),u=n(50),s=n(39)("winston:exception"),g=n(90),c=n(91),d=n(92);e.exports=function(){function w(f){if(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}(this,w),!f)throw new Error("Logger is required to handle exceptions");this.logger=f,this.handlers=new Map}var v,y;return v=w,(y=[{key:"handle",value:function(){for(var f=this,p=arguments.length,S=new Array(p),N=0;N<p;N++)S[N]=arguments[N];S.forEach(function(B){if(Array.isArray(B))return B.forEach(function(E){return f._addHandler(E)});f._addHandler(B)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),r.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var f=this;this.catcher&&(r.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(p){return f.logger.unpipe(p)}))}},{key:"getAllInfo",value:function(f){var p=f.message;return p||typeof f!="string"||(p=f),{error:f,level:"error",message:["uncaughtException: ".concat(p||"(no error message)"),f.stack||" No stack trace"].join(`
44
+ `),stack:f.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(f)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(f){return(f?c.parse(f):c.get()).map(function(p){return{column:p.getColumnNumber(),file:p.getFileName(),function:p.getFunctionName(),line:p.getLineNumber(),method:p.getMethodName(),native:p.isNative()}})}},{key:"_addHandler",value:function(f){if(!this.handlers.has(f)){f.handleExceptions=!0;var p=new d(f);this.handlers.set(f,p),this.logger.pipe(p)}}},{key:"_uncaughtException",value:function(f){var p,S=this.getAllInfo(f),N=this._getExceptionHandlers(),B=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(f):this.logger.exitOnError;function E(){s("doExit",B),s("process._exiting",r._exiting),B&&!r._exiting&&(p&&clearTimeout(p),r.exit(1))}if(!N.length&&B&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),B=!1),!N||N.length===0)return r.nextTick(E);u(N,function(T,h){var R=g(h),W=T.transport||T;function X(m){return function(){s(m),R()}}W._ending=!0,W.once("finish",X("finished")),W.once("error",X("error"))},function(){return B&&E()}),this.logger.log(S),B&&(p=setTimeout(E,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(f){return(f.transport||f).handleExceptions})}}])&&o(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()}).call(this,n(2))},function(e,t,n){var r=n(209);e.exports=function(o){var l,u=0;function s(){return u||(u=1,l=o.apply(this,arguments),o=null),l}return s.displayName=r(o),s}},function(e,t){function n(r){for(var o in r)this[o]=r[o]}t.get=function(r){var o=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var l={},u=Error.prepareStackTrace;Error.prepareStackTrace=function(g,c){return c},Error.captureStackTrace(l,r||t.get);var s=l.stack;return Error.prepareStackTrace=u,Error.stackTraceLimit=o,s},t.parse=function(r){if(!r.stack)return[];var o=this;return r.stack.split(`
45
+ `).slice(1).map(function(l){if(l.match(/^\s*[-]{4,}$/))return o._createParsedCallSite({fileName:l,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var u=l.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(u){var s=null,g=null,c=null,d=null,w=null,v=u[5]==="native";if(u[1]){var y=(c=u[1]).lastIndexOf(".");if(c[y-1]=="."&&y--,y>0){s=c.substr(0,y),g=c.substr(y+1);var f=s.indexOf(".Module");f>0&&(c=c.substr(f+1),s=s.substr(0,f))}d=null}g&&(d=s,w=g),g==="<anonymous>"&&(w=null,c=null);var p={fileName:u[2]||null,lineNumber:parseInt(u[3],10)||null,functionName:c,typeName:d,methodName:w,columnNumber:parseInt(u[4],10)||null,native:v};return o._createParsedCallSite(p)}}).filter(function(l){return!!l})},["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"].forEach(function(r){n.prototype[r]=null,n.prototype["get"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),["topLevel","eval","native","constructor"].forEach(function(r){n.prototype[r]=!1,n.prototype["is"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),t._createParsedCallSite=function(r){return new n(r)}},function(e,t,n){function r(d){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w})(d)}function o(d,w){for(var v=0;v<w.length;v++){var y=w[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(d,y.key,y)}}function l(d,w){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,y){return v.__proto__=y,v})(d,w)}function u(d){var w=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var v,y=g(d);if(w){var f=g(this).constructor;v=Reflect.construct(y,arguments,f)}else v=y.apply(this,arguments);return s(this,v)}}function s(d,w){if(w&&(r(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(d)}function g(d){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(w){return w.__proto__||Object.getPrototypeOf(w)})(d)}var c=n(33).Writable;e.exports=function(d){(function(p,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(S&&S.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),Object.defineProperty(p,"prototype",{writable:!1}),S&&l(p,S)})(f,d);var w,v,y=u(f);function f(p){var S;if(function(N,B){if(!(N instanceof B))throw new TypeError("Cannot call a class as a function")}(this,f),S=y.call(this,{objectMode:!0}),!p)throw new Error("ExceptionStream requires a TransportStream instance.");return S.handleExceptions=!0,S.transport=p,S}return w=f,(v=[{key:"_write",value:function(p,S,N){return p.exception?this.transport.log(p,N):(N(),!0)}}])&&o(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),f}(c)},function(e,t,n){(function(r){function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(16),u=n(50),s=n(39)("winston:rejection"),g=n(90),c=n(91),d=n(92);e.exports=function(){function w(f){if(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}(this,w),!f)throw new Error("Logger is required to handle rejections");this.logger=f,this.handlers=new Map}var v,y;return v=w,(y=[{key:"handle",value:function(){for(var f=this,p=arguments.length,S=new Array(p),N=0;N<p;N++)S[N]=arguments[N];S.forEach(function(B){if(Array.isArray(B))return B.forEach(function(E){return f._addHandler(E)});f._addHandler(B)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),r.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var f=this;this.catcher&&(r.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(p){return f.logger.unpipe(p)}))}},{key:"getAllInfo",value:function(f){var p=null;return f&&(p=typeof f=="string"?f:f.message),{error:f,level:"error",message:["unhandledRejection: ".concat(p||"(no error message)"),f&&f.stack||" No stack trace"].join(`
46
+ `),stack:f&&f.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(f)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(f){return(f?c.parse(f):c.get()).map(function(p){return{column:p.getColumnNumber(),file:p.getFileName(),function:p.getFunctionName(),line:p.getLineNumber(),method:p.getMethodName(),native:p.isNative()}})}},{key:"_addHandler",value:function(f){if(!this.handlers.has(f)){f.handleRejections=!0;var p=new d(f);this.handlers.set(f,p),this.logger.pipe(p)}}},{key:"_unhandledRejection",value:function(f){var p,S=this.getAllInfo(f),N=this._getRejectionHandlers(),B=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(f):this.logger.exitOnError;function E(){s("doExit",B),s("process._exiting",r._exiting),B&&!r._exiting&&(p&&clearTimeout(p),r.exit(1))}if(!N.length&&B&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),B=!1),!N||N.length===0)return r.nextTick(E);u(N,function(T,h){var R=g(h),W=T.transport||T;function X(m){return function(){s(m),R()}}W._ending=!0,W.once("finish",X("finished")),W.once("error",X("error"))},function(){return B&&E()}),this.logger.log(S),B&&(p=setTimeout(E,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(f){return(f.transport||f).handleRejections})}}])&&o(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()}).call(this,n(2))},function(e,t,n){e.exports={asArray:n(216),asBoolStrict:n(217),asBool:n(218),asPortNumber:n(219),asEnum:n(220),asFloatNegative:n(221),asFloatPositive:n(222),asFloat:n(53),asIntNegative:n(223),asIntPositive:n(95),asInt:n(52),asJsonArray:n(224),asJsonObject:n(225),asJson:n(54),asRegExp:n(226),asString:n(34),asUrlObject:n(96),asUrlString:n(227),asEmailString:n(228)}},function(e,t,n){const r=n(52);e.exports=function(o){const l=r(o);if(l<0)throw new Error("should be a positive integer");return l}},function(e,t,n){const r=n(34);e.exports=function(o){const l=r(o);try{return new URL(l)}catch{throw new Error("should be a valid URL")}}},function(e,t,n){const r={};r.web=n(17),n(98);const o={v1:{}};o.v1.signaling={},o.v1.signaling.api=n(10),o.v1.signaling.api.SignalingClient=function(f,p,S){S||(S={}),S.format="text",this.client_=new r.web.GrpcWebClientBase(S),this.hostname_=f.replace(/\/+$/,"")},o.v1.signaling.api.SignalingPromiseClient=function(f,p,S){S||(S={}),S.format="text",this.client_=new r.web.GrpcWebClientBase(S),this.hostname_=f.replace(/\/+$/,"")};const l=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetHealth",r.web.MethodType.UNARY,o.v1.signaling.api.GetHealthRequest,o.v1.signaling.api.GetHealthResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetHealthResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getHealth=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",f,p||{},l,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getHealth=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",f,p||{},l)};const u=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/CreatePeer",r.web.MethodType.UNARY,o.v1.signaling.api.CreatePeerRequest,o.v1.signaling.api.CreatePeerResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.CreatePeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.createPeer=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",f,p||{},u,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.createPeer=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",f,p||{},u)};const s=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/DeletePeer",r.web.MethodType.UNARY,o.v1.signaling.api.DeletePeerRequest,o.v1.signaling.api.DeletePeerResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.DeletePeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.deletePeer=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",f,p||{},s,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.deletePeer=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",f,p||{},s)};const g=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/RefreshPeer",r.web.MethodType.UNARY,o.v1.signaling.api.RefreshPeerRequest,o.v1.signaling.api.RefreshPeerResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.RefreshPeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.refreshPeer=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",f,p||{},g,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.refreshPeer=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",f,p||{},g)};const c=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetPeers",r.web.MethodType.UNARY,o.v1.signaling.api.GetPeersRequest,o.v1.signaling.api.GetPeersResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetPeersResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getPeers=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",f,p||{},c,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getPeers=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",f,p||{},c)};const d=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetIceServers",r.web.MethodType.UNARY,o.v1.signaling.api.GetIceServersRequest,o.v1.signaling.api.GetIceServersResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetIceServersResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getIceServers=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",f,p||{},d,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getIceServers=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",f,p||{},d)};const w=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/SendSignal",r.web.MethodType.UNARY,o.v1.signaling.api.SendSignalRequest,o.v1.signaling.api.SendSignalResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.SendSignalResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.sendSignal=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",f,p||{},w,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.sendSignal=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",f,p||{},w)};const v=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/ReceiveSignalStream",r.web.MethodType.SERVER_STREAMING,o.v1.signaling.api.ReceiveSignalStreamRequest,o.v1.signaling.api.ReceiveSignalStreamResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.receiveSignalStream=function(f,p){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",f,p||{},v)},o.v1.signaling.api.SignalingPromiseClient.prototype.receiveSignalStream=function(f,p){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",f,p||{},v)};const y=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetSessions",r.web.MethodType.UNARY,o.v1.signaling.api.GetSessionsRequest,o.v1.signaling.api.GetSessionsResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetSessionsResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getSessions=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetSessions",f,p||{},y,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getSessions=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetSessions",f,p||{},y)},e.exports=o.v1.signaling.api},function(e,t,n){var r=n(99),o=r,l=Function("return this")();o.exportSymbol("proto.google.protobuf.BoolValue",null,l),o.exportSymbol("proto.google.protobuf.BytesValue",null,l),o.exportSymbol("proto.google.protobuf.DoubleValue",null,l),o.exportSymbol("proto.google.protobuf.FloatValue",null,l),o.exportSymbol("proto.google.protobuf.Int32Value",null,l),o.exportSymbol("proto.google.protobuf.Int64Value",null,l),o.exportSymbol("proto.google.protobuf.StringValue",null,l),o.exportSymbol("proto.google.protobuf.UInt32Value",null,l),o.exportSymbol("proto.google.protobuf.UInt64Value",null,l),proto.google.protobuf.DoubleValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.DoubleValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.DoubleValue.displayName="proto.google.protobuf.DoubleValue"),proto.google.protobuf.FloatValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.FloatValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.FloatValue.displayName="proto.google.protobuf.FloatValue"),proto.google.protobuf.Int64Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.Int64Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int64Value.displayName="proto.google.protobuf.Int64Value"),proto.google.protobuf.UInt64Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt64Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt64Value.displayName="proto.google.protobuf.UInt64Value"),proto.google.protobuf.Int32Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.Int32Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int32Value.displayName="proto.google.protobuf.Int32Value"),proto.google.protobuf.UInt32Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt32Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt32Value.displayName="proto.google.protobuf.UInt32Value"),proto.google.protobuf.BoolValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.BoolValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BoolValue.displayName="proto.google.protobuf.BoolValue"),proto.google.protobuf.StringValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.StringValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.StringValue.displayName="proto.google.protobuf.StringValue"),proto.google.protobuf.BytesValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.BytesValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BytesValue.displayName="proto.google.protobuf.BytesValue"),r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.DoubleValue.prototype.toObject=function(u){return proto.google.protobuf.DoubleValue.toObject(u,this)},proto.google.protobuf.DoubleValue.toObject=function(u,s){var g={value:r.Message.getFloatingPointFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.DoubleValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.DoubleValue;return proto.google.protobuf.DoubleValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.DoubleValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readDouble();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.DoubleValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.DoubleValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.DoubleValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeDouble(1,g)},proto.google.protobuf.DoubleValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.DoubleValue.prototype.setValue=function(u){return r.Message.setProto3FloatField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.FloatValue.prototype.toObject=function(u){return proto.google.protobuf.FloatValue.toObject(u,this)},proto.google.protobuf.FloatValue.toObject=function(u,s){var g={value:r.Message.getFloatingPointFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.FloatValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.FloatValue;return proto.google.protobuf.FloatValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.FloatValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readFloat();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.FloatValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.FloatValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.FloatValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeFloat(1,g)},proto.google.protobuf.FloatValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.FloatValue.prototype.setValue=function(u){return r.Message.setProto3FloatField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int64Value.prototype.toObject=function(u){return proto.google.protobuf.Int64Value.toObject(u,this)},proto.google.protobuf.Int64Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.Int64Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.Int64Value;return proto.google.protobuf.Int64Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.Int64Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readInt64();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.Int64Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.Int64Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.Int64Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeInt64(1,g)},proto.google.protobuf.Int64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int64Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt64Value.prototype.toObject=function(u){return proto.google.protobuf.UInt64Value.toObject(u,this)},proto.google.protobuf.UInt64Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.UInt64Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.UInt64Value;return proto.google.protobuf.UInt64Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.UInt64Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readUint64();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.UInt64Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.UInt64Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.UInt64Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeUint64(1,g)},proto.google.protobuf.UInt64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt64Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int32Value.prototype.toObject=function(u){return proto.google.protobuf.Int32Value.toObject(u,this)},proto.google.protobuf.Int32Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.Int32Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.Int32Value;return proto.google.protobuf.Int32Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.Int32Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readInt32();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.Int32Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.Int32Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.Int32Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeInt32(1,g)},proto.google.protobuf.Int32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int32Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt32Value.prototype.toObject=function(u){return proto.google.protobuf.UInt32Value.toObject(u,this)},proto.google.protobuf.UInt32Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.UInt32Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.UInt32Value;return proto.google.protobuf.UInt32Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.UInt32Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readUint32();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.UInt32Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.UInt32Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.UInt32Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeUint32(1,g)},proto.google.protobuf.UInt32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt32Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BoolValue.prototype.toObject=function(u){return proto.google.protobuf.BoolValue.toObject(u,this)},proto.google.protobuf.BoolValue.toObject=function(u,s){var g={value:r.Message.getBooleanFieldWithDefault(s,1,!1)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.BoolValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.BoolValue;return proto.google.protobuf.BoolValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.BoolValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readBool();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.BoolValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.BoolValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.BoolValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())&&s.writeBool(1,g)},proto.google.protobuf.BoolValue.prototype.getValue=function(){return r.Message.getBooleanFieldWithDefault(this,1,!1)},proto.google.protobuf.BoolValue.prototype.setValue=function(u){return r.Message.setProto3BooleanField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.StringValue.prototype.toObject=function(u){return proto.google.protobuf.StringValue.toObject(u,this)},proto.google.protobuf.StringValue.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,"")};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.StringValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.StringValue;return proto.google.protobuf.StringValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.StringValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readString();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.StringValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.StringValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.StringValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue()).length>0&&s.writeString(1,g)},proto.google.protobuf.StringValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.StringValue.prototype.setValue=function(u){return r.Message.setProto3StringField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BytesValue.prototype.toObject=function(u){return proto.google.protobuf.BytesValue.toObject(u,this)},proto.google.protobuf.BytesValue.toObject=function(u,s){var g={value:s.getValue_asB64()};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.BytesValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.BytesValue;return proto.google.protobuf.BytesValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.BytesValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readBytes();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.BytesValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.BytesValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.BytesValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue_asU8()).length>0&&s.writeBytes(1,g)},proto.google.protobuf.BytesValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.BytesValue.prototype.getValue_asB64=function(){return r.Message.bytesAsB64(this.getValue())},proto.google.protobuf.BytesValue.prototype.getValue_asU8=function(){return r.Message.bytesAsU8(this.getValue())},proto.google.protobuf.BytesValue.prototype.setValue=function(u){return r.Message.setProto3BytesField(this,1,u)},o.object.extend(t,proto.google.protobuf)},function(module,exports,__webpack_require__){(function(global,Buffer){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,o=0;o<r;o++){var l=e[o];if(t.call(n,l,o,e))return{i:o,v:l}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},$jscomp.getGlobal=function(e){return typeof window<"u"&&window===e?e:global!==void 0&&global!=null?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,n,r){if(t){for(n=$jscomp.global,e=e.split("."),r=0;r<e.length-1;r++){var o=e[r];o in n||(n[o]={}),n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&t!=null&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).i}},"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(e==null)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"endsWith");t+="",n===void 0&&(n=r.length),n=Math.max(0,Math.min(0|n,r.length));for(var o=t.length;0<o&&0<n;)if(r[--n]!=t[--o])return!1;return 0>=o}},"es6","es3"),$jscomp.polyfill("Array.prototype.find",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).v}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var o=r.length,l=t.length;n=Math.max(0,Math.min(0|n,r.length));for(var u=0;u<l&&n<o;)if(r[n++]!=t[u++])return!1;return u>=l}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(e){return e||function(t){var n=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var r="";t;)1&t&&(r+=n),(t>>>=1)&&(n+=n);return r}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return e!==void 0},goog.isString=function(e){return typeof e=="string"},goog.isBoolean=function(e){return typeof e=="boolean"},goog.isNumber=function(e){return typeof e=="number"},goog.exportPath_=function(e,t,n){e=e.split("."),n=n||goog.global,e[0]in n||n.execScript===void 0||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)!e.length&&goog.isDef(t)?n[r]=t:n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}},goog.define=function(e,t){return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||e.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&typeof e.getCurrentModulePath=="function"&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(t=t[e[n]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var n in t=t||goog.global,e)t[n]=e[n]},goog.addDependency=function(e,t,n,r){},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+`
29
47
  ;})();
30
48
  `},goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var n=e.call(void 0,{});else{if(!goog.isString(e))throw Error("Invalid module definition");goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),n=goog.loadModuleFromSource_.call(void 0,e)}var r=goog.moduleLoaderState_.moduleName;if(!goog.isString(r)||!r)throw Error('Invalid module name "'+r+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(r,n):goog.SEAL_MODULE_EXPORTS&&Object.seal&&typeof n=="object"&&n!=null&&Object.seal(n),goog.loadedModules_[r]={exports:n,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)e[t]=="."?e.splice(t,1):t&&e[t]==".."&&e[t-1]&&e[t-1]!=".."?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),t.status==0||t.status==200?t.responseText:null}catch{return null}},goog.transpile_=function(e,t,n){var r=goog.global.$jscomp;r||(goog.global.$jscomp=r={});var o=r.transpile;if(!o){var l=goog.basePath+goog.TRANSPILER,u=goog.loadFileSync_(l);if(u){if(function(){(0,eval)(u+`
31
49
  //# sourceURL=`+l)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(r=goog.global.$jscomp).transpile}}return o||(o=r.transpile=function(s,g){return goog.logToConsole_(g+" requires transpilation but no transpiler was found."),s}),o(e,t,n)},goog.typeOf=function(e){var t=typeof e;if(t=="object"){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if(n=="[object Window]")return"object";if(n=="[object Array]"||typeof e.length=="number"&&e.splice!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("splice"))return"array";if(n=="[object Function]"||e.call!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("call"))return"function"}else if(t=="function"&&e.call===void 0)return"object";return t},goog.isNull=function(e){return e===null},goog.isDefAndNotNull=function(e){return e!=null},goog.isArray=function(e){return goog.typeOf(e)=="array"},goog.isArrayLike=function(e){var t=goog.typeOf(e);return t=="array"||t=="object"&&typeof e.length=="number"},goog.isDateLike=function(e){return goog.isObject(e)&&typeof e.getFullYear=="function"},goog.isFunction=function(e){return goog.typeOf(e)=="function"},goog.isObject=function(e){var t=typeof e;return t=="object"&&e!=null||t=="function"},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){e!==null&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch{}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(typeof e.clone=="function")return e.clone();for(var n in t=t=="array"?[]:{},e)t[n]=goog.cloneObject(e[n]);return t}return e},goog.bindNative_=function(e,t,n){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,r),e.apply(t,o)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,n){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments),e.apply(this,r)}},goog.mixin=function(e,t){for(var n in t)e[n]=t[n]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(goog.global._evalTest_!==void 0){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,n=t.createElement("SCRIPT");n.type="text/javascript",n.defer=!1,n.appendChild(t.createTextNode(e)),t.head.appendChild(n),t.head.removeChild(n)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if(String(e).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var n=function(o){return goog.cssNameMapping_[o]||o},r=function(o){o=o.split("-");for(var l=[],u=0;u<o.length;u++)l.push(n(o[u]));return l.join("-")};return r=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?n:r:function(o){return o},e=t?e+"-"+r(t):r(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},goog.getMsg=function(e,t,n){return n&&n.html&&(e=e.replace(/</g,"&lt;")),t&&(e=e.replace(/\{\$([^}]+)}/g,function(r,o){return t!=null&&o in t?t[o]:r})),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,n){goog.exportPath_(e,t,n)},goog.exportProperty=function(e,t,n){e[t]=n},goog.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.base=function(r,o,l){for(var u=Array(arguments.length-2),s=2;s<arguments.length;s++)u[s-2]=arguments[s];return t.prototype[o].apply(r,u)}},goog.base=function(e,t,n){var r=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!r)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(r.superClass_!==void 0){for(var o=Array(arguments.length-1),l=1;l<arguments.length;l++)o[l-1]=arguments[l];return r.superClass_.constructor.apply(e,o)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(o=Array(arguments.length-2),l=2;l<arguments.length;l++)o[l-2]=arguments[l];l=!1;for(var u=e.constructor.prototype;u;u=Object.getPrototypeOf(u))if(u[t]===r)l=!0;else if(l)return u[t].apply(e,o);if(e[t]===r)return e.constructor.prototype[t].apply(e,o);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},goog.defineClass=function(e,t){var n=t.constructor,r=t.statics;return n&&n!=Object.prototype.constructor||(n=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),n=goog.defineClass.createSealingConstructor_(n,e),e&&goog.inherits(n,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(n.prototype,t),r!=null&&(r instanceof Function?r(n):goog.defineClass.applyProperties_(n,r)),n},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var n=!goog.defineClass.isUnsealable_(t),r=function(){var o=e.apply(this,arguments)||this;return o[goog.UID_PROPERTY_]=o[goog.UID_PROPERTY_],this.constructor===r&&n&&Object.seal instanceof Function&&Object.seal(o),o};return r},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);for(var r=0;r<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;r++)n=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[r],Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},goog.tagUnsealableClass=function(e){},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if(typeof TrustedTypes>"u"||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(n){goog.logToConsole_(n.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,n=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return n.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return n.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return n.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return n.FIXED32;default:return n.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=9223372036854776e3,jspb.BinaryConstants.TWO_TO_64=18446744073709552e3,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var n="",r=(e=e.split("%s")).length-1,o=0;o<r;o++)n+=e[o]+(o<t.length?t[o]:"%s");return n+e[r]},goog.asserts.doAssertFailure_=function(e,t,n,r){var o="Assertion failed";if(n){o+=": "+n;var l=r}else e&&(o+=": "+e,l=t);e=new goog.asserts.AssertionError(""+o,l||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&e==null&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,n,r){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],n,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||typeof e=="number"&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):e===null?"null":typeof e},goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.indexOf.call(e,t,n)}:function(e,t,n){if(n=n==null?0:0>n?Math.max(0,e.length+n):n,goog.isString(e))return goog.isString(t)&&t.length==1?e.indexOf(t,n):-1;for(;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.lastIndexOf.call(e,t,n??e.length-1)}:function(e,t,n){if(0>(n=n??e.length-1)&&(n=Math.max(0,e.length+n)),goog.isString(e))return goog.isString(t)&&t.length==1?e.lastIndexOf(t,n):-1;for(;0<=n;n--)if(n in e&&e[n]===t)return n;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,n){goog.asserts.assert(e.length!=null),Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)l in o&&t.call(n,o[l],l,e)},goog.array.forEachRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;--r)r in o&&t.call(n,o[r],r,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.filter.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=[],l=0,u=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in u){var g=u[s];t.call(n,g,s,e)&&(o[l++]=g)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.map.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=Array(r),l=goog.isString(e)?e.split(""):e,u=0;u<r;u++)u in l&&(o[u]=t.call(n,l[u],u,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,n,r){return goog.asserts.assert(e.length!=null),r&&(t=goog.bind(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEach(e,function(l,u){o=t.call(r,o,l,u,e)}),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,n,r){return goog.asserts.assert(e.length!=null),goog.asserts.assert(t!=null),r&&(t=goog.bind(t,r)),Array.prototype.reduceRight.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEachRight(e,function(l,u){o=t.call(r,o,l,u,e)}),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.some.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)if(l in o&&t.call(n,o[l],l,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.every.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)if(l in o&&!t.call(n,o[l],l,e))return!1;return!0},goog.array.count=function(e,t,n){var r=0;return goog.array.forEach(e,function(o,l,u){t.call(n,o,l,u)&&++r},n),r},goog.array.find=function(e,t,n){return 0>(t=goog.array.findIndex(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)if(l in o&&t.call(n,o[l],l,e))return l;return-1},goog.array.findRight=function(e,t,n){return 0>(t=goog.array.findIndexRight(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;r--)if(r in o&&t.call(n,o[r],r,e))return r;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return e.length==0},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,n){goog.array.splice(e,n,0,t)},goog.array.insertArrayAt=function(e,t,n){goog.partial(goog.array.splice,e,n,0).apply(null,t)},goog.array.insertBefore=function(e,t,n){var r;arguments.length==2||0>(r=goog.array.indexOf(e,n))?e.push(t):goog.array.insertAt(e,t,r)},goog.array.remove=function(e,t){var n;return(n=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),n},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(e.length!=null),Array.prototype.splice.call(e,t,1).length==1},goog.array.removeIf=function(e,t,n){return 0<=(t=goog.array.findIndex(e,t,n))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,n){var r=0;return goog.array.forEachRight(e,function(o,l){t.call(n,o,l,e)&&goog.array.removeAt(e,l)&&r++}),r},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(goog.isArrayLike(r)){var o=e.length||0,l=r.length||0;e.length=o+l;for(var u=0;u<l;u++)e[o+u]=r[u]}else e.push(r)}},goog.array.splice=function(e,t,n,r){return goog.asserts.assert(e.length!=null),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,n){return goog.asserts.assert(e.length!=null),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)},goog.array.removeDuplicates=function(e,t,n){t=t||e;var r=function(g){return goog.isObject(g)?"o"+goog.getUid(g):(typeof g).charAt(0)+g};n=n||r,r={};for(var o=0,l=0;l<e.length;){var u=e[l++],s=n(u);Object.prototype.hasOwnProperty.call(r,s)||(r[s]=!0,t[o++]=u)}t.length=o},goog.array.binarySearch=function(e,t,n){return goog.array.binarySearch_(e,n||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,n){return goog.array.binarySearch_(e,t,!0,void 0,n)},goog.array.binarySearch_=function(e,t,n,r,o){for(var l,u=0,s=e.length;u<s;){var g=u+s>>1,c=n?t.call(o,e[g],g,e):t(r,e[g]);0<c?u=g+1:(s=g,l=!c)}return l?u:~u},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]={index:r,value:e[r]};var o=t||goog.array.defaultCompare;for(goog.array.sort(n,function(l,u){return o(l.value,u.value)||l.index-u.index}),r=0;r<e.length;r++)e[r]=n[r].value},goog.array.sortByKey=function(e,t,n){var r=n||goog.array.defaultCompare;goog.array.sort(e,function(o,l){return r(t(o),t(l))})},goog.array.sortObjectsByKey=function(e,t,n){goog.array.sortByKey(e,function(r){return r[t]},n)},goog.array.isSorted=function(e,t,n){t=t||goog.array.defaultCompare;for(var r=1;r<e.length;r++){var o=t(e[r-1],e[r]);if(0<o||o==0&&n)return!1}return!0},goog.array.equals=function(e,t,n){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var r=e.length;n=n||goog.array.defaultCompareEquality;for(var o=0;o<r;o++)if(!n(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,n){n=n||goog.array.defaultCompare;for(var r=Math.min(e.length,t.length),o=0;o<r;o++){var l=n(e[o],t[o]);if(l!=0)return l}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,n){return 0>(n=goog.array.binarySearch(e,t,n))&&(goog.array.insertAt(e,t,-(n+1)),!0)},goog.array.binaryRemove=function(e,t,n){return 0<=(t=goog.array.binarySearch(e,t,n))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,n){for(var r={},o=0;o<e.length;o++){var l=e[o],u=t.call(n,l,o,e);goog.isDef(u)&&(r[u]||(r[u]=[])).push(l)}return r},goog.array.toObject=function(e,t,n){var r={};return goog.array.forEach(e,function(o,l){r[t.call(n,o,l,e)]=o}),r},goog.array.range=function(e,t,n){var r=[],o=0,l=e;if(t!==void 0&&(o=e,l=t),0>(n=n||1)*(l-o))return[];if(0<n)for(e=o;e<l;e+=n)r.push(e);else for(e=o;e>l;e+=n)r.push(e);return r},goog.array.repeat=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n},goog.array.flatten=function(e){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(goog.isArray(r))for(var o=0;o<r.length;o+=8192){var l=goog.array.slice(r,o,o+8192);l=goog.array.flatten.apply(null,l);for(var u=0;u<l.length;u++)t.push(l[u])}else t.push(r)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(e.length!=null),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,n){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=n&&n<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,n,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],n=arguments[0].length,r=1;r<arguments.length;r++)arguments[r].length<n&&(n=arguments[r].length);for(r=0;r<n;r++){for(var o=[],l=0;l<arguments.length;l++)o.push(arguments[l][r]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var n=e.length-1;0<n;n--){var r=Math.floor(t()*(n+1)),o=e[n];e[n]=e[r],e[r]=o}},goog.array.copyByIndex=function(e,t){var n=[];return goog.array.forEach(t,function(r){n.push(e[r])}),n},goog.array.concatMap=function(e,t,n){return goog.array.concat.apply([],goog.array.map(e,t,n))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);255<o&&(t[n++]=255&o,o>>=8),t[n++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",n=0;n<e.length;n+=8192){var r=goog.array.slice(e,n,n+8192);t+=String.fromCharCode.apply(null,r)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,function(n){return 1<(n=n.toString(16)).length?n:"0"+n}).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(e.length%2==0,"Key string length must be multiple of 2");for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);128>o?t[n++]=o:(2048>o?t[n++]=o>>6|192:((64512&o)==55296&&r+1<e.length&&(64512&e.charCodeAt(r+1))==56320?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),t[n++]=o>>18|240,t[n++]=o>>12&63|128):t[n++]=o>>12|224,t[n++]=o>>6&63|128),t[n++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],n=0,r=0;n<e.length;){var o=e[n++];if(128>o)t[r++]=String.fromCharCode(o);else if(191<o&&224>o){var l=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&l)}else if(239<o&&365>o){l=e[n++];var u=e[n++];o=((7&o)<<18|(63&l)<<12|(63&u)<<6|63&e[n++])-65536,t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else l=e[n++],u=e[n++],t[r++]=String.fromCharCode((15&o)<<12|(63&l)<<6|63&u)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return n},goog.string={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return e.lastIndexOf(t,0)==0},goog.string.internal.endsWith=function(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)==n},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))==0},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))==0},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test(e))return e;e.indexOf("&")!=-1&&(e=e.replace(goog.string.internal.AMP_RE_,"&amp;")),e.indexOf("<")!=-1&&(e=e.replace(goog.string.internal.LT_RE_,"&lt;")),e.indexOf(">")!=-1&&(e=e.replace(goog.string.internal.GT_RE_,"&gt;")),e.indexOf('"')!=-1&&(e=e.replace(goog.string.internal.QUOT_RE_,"&quot;")),e.indexOf("'")!=-1&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;")),e.indexOf("\0")!=-1&&(e=e.replace(goog.string.internal.NULL_RE_,"&#0;"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.internal.contains=function(e,t){return e.indexOf(t)!=-1},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var n=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var r=Math.max(e.length,t.length),o=0;n==0&&o<r;o++){var l=e[o]||"",u=t[o]||"";do{if(l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],u=/(\d*)(\D*)(.*)/.exec(u)||["","","",""],l[0].length==0&&u[0].length==0)break;n=l[1].length==0?0:parseInt(l[1],10);var s=u[1].length==0?0:parseInt(u[1],10);n=goog.string.internal.compareElements_(n,s)||goog.string.internal.compareElements_(l[2].length==0,u[2].length==0)||goog.string.internal.compareElements_(l[2],u[2]),l=l[3],u=u[3]}while(n==0)}return n},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(e!=null)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return goog.fs.url.findUrlObject_()!=null},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||(goog.LOCALE.substring(0,2).toLowerCase()=="ar"||goog.LOCALE.substring(0,2).toLowerCase()=="fa"||goog.LOCALE.substring(0,2).toLowerCase()=="he"||goog.LOCALE.substring(0,2).toLowerCase()=="iw"||goog.LOCALE.substring(0,2).toLowerCase()=="ps"||goog.LOCALE.substring(0,2).toLowerCase()=="sd"||goog.LOCALE.substring(0,2).toLowerCase()=="ug"||goog.LOCALE.substring(0,2).toLowerCase()=="ur"||goog.LOCALE.substring(0,2).toLowerCase()=="yi")&&(goog.LOCALE.length==2||goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")||3<=goog.LOCALE.length&&goog.LOCALE.substring(0,3).toLowerCase()=="ckb"&&(goog.LOCALE.length==3||goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")||7<=goog.LOCALE.length&&(goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")&&(goog.LOCALE.substring(3,7).toLowerCase()=="adlm"||goog.LOCALE.substring(3,7).toLowerCase()=="arab"||goog.LOCALE.substring(3,7).toLowerCase()=="hebr"||goog.LOCALE.substring(3,7).toLowerCase()=="nkoo"||goog.LOCALE.substring(3,7).toLowerCase()=="rohg"||goog.LOCALE.substring(3,7).toLowerCase()=="thaa")||8<=goog.LOCALE.length&&(goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")&&(goog.LOCALE.substring(4,8).toLowerCase()=="adlm"||goog.LOCALE.substring(4,8).toLowerCase()=="arab"||goog.LOCALE.substring(4,8).toLowerCase()=="hebr"||goog.LOCALE.substring(4,8).toLowerCase()=="nkoo"||goog.LOCALE.substring(4,8).toLowerCase()=="rohg"||goog.LOCALE.substring(4,8).toLowerCase()=="thaa"),goog.i18n.bidi.Format={LRE:"‪",RLE:"‫",PDF:"‬",LRM:"‎",RLM:"‏"},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return typeof e=="number"?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:e==null?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ऀ-῿‎Ⰰ-\uD801\uD804-\uD839\uD83C-\uDBFF豈-﬜︀-﹯﻽-￿",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ‏\uD802-\uD803\uD83A-\uD83Bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(t===void 0?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=rtl"):`
32
50
  <span dir=rtl>`+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=ltr"):`
33
51
  <span dir=ltr>`+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var n=0,r=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var l=e[t];goog.i18n.bidi.startsWithRtl(l)?(n++,r++):goog.i18n.bidi.isRequiredLtrRe_.test(l)?o=!0:goog.i18n.bidi.hasAnyLtr(l)?r++:goog.i18n.bidi.hasNumeralsRe_.test(l)&&(o=!0)}return r==0?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:n/r>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var n=goog.html.TrustedResourceUrl.unwrap(this),r=(n=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(n))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(n[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",n[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",r,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},goog.html.TrustedResourceUrl.format=function(e,t){var n=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(r,o){if(!Object.prototype.hasOwnProperty.call(t,o))throw Error('Found marker, "'+o+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(r=t[o])instanceof goog.string.Const?goog.string.Const.unwrap(r):encodeURIComponent(String(r))}),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,n,r){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(n,r)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",n=0;n<e.length;n++)t+=goog.string.Const.unwrap(e[n]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,n){if(n==null)return t;if(goog.isString(n))return n?e+encodeURIComponent(n):"";for(var r in n){var o=n[r];o=goog.isArray(o)?o:[o];for(var l=0;l<o.length;l++){var u=o[l];u!=null&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(r)+"="+encodeURIComponent(String(u)))}}return t},goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SAFE_MIME_TYPE_PATTERN_.test(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch{return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,n){return(e=e.exec(t))?(e=e[1],(n instanceof goog.string.Const?[goog.string.Const.unwrap(n)]:n.map(function(r){return goog.string.Const.unwrap(r)})).indexOf(e)==-1&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),`Style string must contain at least one ':', to specify a "name: value" pair: `+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyle().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,n="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var r=e[t];r!=null&&(n+=t+":"+(r=goog.isArray(r)?goog.array.map(r,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(r))+";")}return n?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(n):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,n=!0,r=0;r<e.length;r++){var o=e.charAt(r);o=="'"&&n?t=!t:o=='"'&&t&&(n=!n)}return t&&n},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,n=/^[-_a-zA-Z0-9]$/,r=0;r<e.length;r++){var o=e.charAt(r);if(o=="]"){if(t)return!1;t=!0}else if(o=="["){if(!t)return!1;t=!1}else if(!t&&!n.test(o))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_=`[-,."'%_!# a-zA-Z0-9\\[\\]]`,goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,function(t,n,r,o){var l="";return r=r.replace(/^(['"])(.*)\1$/,function(u,s,g){return l=s,g}),t=goog.html.SafeUrl.sanitize(r).getTypedStringValue(),n+l+t+l+o})},goog.html.SafeStyle.concat=function(e){var t="",n=function(r){goog.isArray(r)?goog.array.forEach(r,n):t+=goog.html.SafeStyle.unwrap(r)};return goog.array.forEach(arguments,n),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var n=[],r=1;r<arguments.length;r++)n.push(goog.html.SafeScript.stringify_(arguments[r]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+n.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeScript().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.object={},goog.object.is=function(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,n){for(var r in e)t.call(n,e[r],r,e)},goog.object.filter=function(e,t,n){var r,o={};for(r in e)t.call(n,e[r],r,e)&&(o[r]=e[r]);return o},goog.object.map=function(e,t,n){var r,o={};for(r in e)o[r]=t.call(n,e[r],r,e);return o},goog.object.some=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return!0;return!1},goog.object.every=function(e,t,n){for(var r in e)if(!t.call(n,e[r],r,e))return!1;return!0},goog.object.getCount=function(e){var t,n=0;for(t in e)n++;return n},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n},goog.object.getKeys=function(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n},goog.object.getValueByKeys=function(e,t){var n=goog.isArrayLike(t),r=n?t:arguments;for(n=n?0:1;n<r.length;n++){if(e==null)return;e=e[r[n]]}return e},goog.object.containsKey=function(e,t){return e!==null&&t in e},goog.object.containsValue=function(e,t){for(var n in e)if(e[n]==t)return!0;return!1},goog.object.findKey=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},goog.object.findValue=function(e,t,n){return(t=goog.object.findKey(e,t,n))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var n;return(n=t in e)&&delete e[t],n},goog.object.add=function(e,t,n){if(e!==null&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,n)},goog.object.get=function(e,t,n){return e!==null&&t in e?e[t]:n},goog.object.set=function(e,t,n){e[t]=n},goog.object.setIfUndefined=function(e,t,n){return t in e?e[t]:e[t]=n},goog.object.setWithReturnValueIfNotSet=function(e,t,n){return t in e?e[t]:(n=n(),e[t]=n)},goog.object.equals=function(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0},goog.object.clone=function(e){var t,n={};for(t in e)n[t]=e[t];return n},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(goog.isFunction(e.clone))return e.clone();for(var n in t=t=="array"?[]:{},e)t[n]=goog.object.unsafeClone(e[n]);return t}return e},goog.object.transpose=function(e){var t,n={};for(t in e)n[e[t]]=t;return n},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var n,r,o=1;o<arguments.length;o++){for(n in r=arguments[o])e[n]=r[n];for(var l=0;l<goog.object.PROTOTYPE_FIELDS_.length;l++)n=goog.object.PROTOTYPE_FIELDS_[l],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}},goog.object.create=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var n={},r=0;r<t;r+=2)n[arguments[r]]=arguments[r+1];return n},goog.object.createSet=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var n={},r=0;r<t;r++)n[arguments[r]]=!0;return n},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,n){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var r={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||n);){for(var o=Object.getOwnPropertyNames(e),l=0;l<o.length;l++)r[o[l]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(r)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var n=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(n))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(n))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},n=[],r=0;r<e.length;r++){var o=e[r];if(t[o])n.push(t[o]);else if(goog.object.contains(t,o)&&n.pop()!=o)return!1}return n.length==0},goog.html.SafeStyleSheet.concat=function(e){var t="",n=function(r){goog.isArray(r)?goog.array.forEach(r,n):t+=goog.html.SafeStyleSheet.unwrap(r)};return goog.array.forEach(arguments,n),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyleSheet().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return goog.dom.tags.VOID_TAGS_[e]===!0},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,n=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,r=[];t=n.exec(e);)r.push([t[1],t[2],t[3]||void 0]);return r},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(o){return o=goog.array.find(o,r),n[o]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var n={};goog.array.forEach(t,function(o){n[o[0]]=o[1]});var r=goog.partial(goog.object.containsKey,n);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var n=/MSIE +([\d\.]+)/.exec(e);if(n&&n[1])if(e=/Trident\/(\d.\d)/.exec(e),n[1]=="7.0")if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=n[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t=typeof e=="object",n=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(n=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),n)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,n){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,n)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,n,r){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(o,{sandbox:""},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.createSandboxIframe=function(e,t,n,r){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=goog.html.SafeHtml.combineAttributes(o,{},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var n in t){var r=n.toLowerCase();if(r=="language"||r=="src"||r=="text"||r=="type")throw Error('Cannot set "'+r+'" attribute')}for(n="",e=goog.array.concat(e),r=0;r<e.length;r++)n+=goog.html.SafeScript.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var n="";e=goog.array.concat(e);for(var r=0;r<e.length;r++)n+=goog.html.SafeStyleSheet.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,n){if(n instanceof goog.string.Const)n=goog.string.Const.unwrap(n);else if(t.toLowerCase()=="style")n=goog.html.SafeHtml.getStyleValue_(n);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+n+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(n instanceof goog.html.TrustedResourceUrl)n=goog.html.TrustedResourceUrl.unwrap(n);else if(n instanceof goog.html.SafeUrl)n=goog.html.SafeUrl.unwrap(n);else{if(!goog.isString(n))throw Error('Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+n+'" given.');n=goog.html.SafeUrl.sanitize(n).getTypedStringValue()}}return n.implementsGoogStringTypedString&&(n=n.getTypedStringValue()),goog.asserts.assert(goog.isString(n)||goog.isNumber(n),"String or number value expected, got "+typeof n+" with value: "+n),t+'="'+goog.string.internal.htmlEscape(String(n))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e);return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,n,r){return(t=goog.html.SafeHtml.create(t,n,r)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var n=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),r=[],o=function(l){goog.isArray(l)?goog.array.forEach(l,o):(l=goog.html.SafeHtml.htmlEscape(l),r.push(goog.html.SafeHtml.unwrap(l)),l=l.getDirection(),n==goog.i18n.bidi.Dir.NEUTRAL?n=l:l!=goog.i18n.bidi.Dir.NEUTRAL&&n!=l&&(n=null))};return goog.array.forEach(t,o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r.join(goog.html.SafeHtml.unwrap(e)),n)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var n=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return n.dir_=e,n},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return new goog.html.SafeHtml().initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,n){var r=null,o="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(n)?goog.isArray(n)||(n=[n]):n=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!n.length,"Void tag <"+e+"> does not allow content."),o+=">"):(r=goog.html.SafeHtml.concat(n),o+=">"+goog.html.SafeHtml.unwrap(r)+"</"+e+">",r=r.getDirection()),(e=t&&t.dir)&&(r=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,r)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var n="";if(t)for(var r in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(r))throw Error('Invalid attribute name "'+r+'".');var o=t[r];goog.isDefAndNotNull(o)&&(n+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,r,o))}return n},goog.html.SafeHtml.combineAttributes=function(e,t,n){var r,o={};for(r in e)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=e[r];for(r in t)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=t[r];for(r in n){var l=r.toLowerCase();if(l in e)throw Error('Cannot override "'+l+'" attribute, got "'+r+'" with value "'+n[r]+'"');l in t&&delete o[l],o[r]=n[r]}return o},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,n){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,n||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=goog.dom.asserts.getWindow_(e);n&&n[t]!==void 0&&(e&&(e instanceof n[t]||!(e instanceof n.Location||e instanceof n.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return e===void 0?"undefined":e===null?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch{return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,n=t&&(t.defaultView||t.parentWindow);if((n=n||goog.global).Element&&n.Location)return n}catch{}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var r=Array.prototype.slice.call(arguments);return r.push.apply(r,n),e.apply(this,r)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(n){return t?e==n:e===n}},goog.functions.compose=function(e,t){var n=arguments,r=n.length;return function(){var o;r&&(o=n[r-1].apply(this,arguments));for(var l=r-2;0<=l;l--)o=n[l].call(this,o);return o}},goog.functions.sequence=function(e){var t=arguments,n=t.length;return function(){for(var r,o=0;o<n;o++)r=t[o].apply(this,arguments);return r}},goog.functions.and=function(e){var t=arguments,n=t.length;return function(){for(var r=0;r<n;r++)if(!t[r].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,n=t.length;return function(){for(var r=0;r<n;r++)if(t[r].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var n=function(){};return n.prototype=e.prototype,n=new n,e.apply(n,Array.prototype.slice.call(arguments,1)),n},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,n=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(n||(t=e(),n=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var n=t;t=null,n()}}},goog.functions.debounce=function(e,t,n){var r=0;return function(o){goog.global.clearTimeout(r);var l=arguments;r=goog.global.setTimeout(function(){e.apply(n,l)},t)}},goog.functions.throttle=function(e,t,n){var r=0,o=!1,l=[],u=function(){r=0,o&&(o=!1,s())},s=function(){r=goog.global.setTimeout(u,t),e.apply(n,l)};return function(g){l=arguments,r?o=!0:s()}},goog.functions.rateLimit=function(e,t,n){var r=0,o=function(){r=0};return function(l){r||(r=goog.global.setTimeout(o,t),e.apply(n,arguments))}},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,n){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(n))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&typeof document>"u")return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild)&&(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)}),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[n])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,n){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=n,goog.string.internal.caseInsensitiveContains(n,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,n,r,o){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),n?goog.string.Const.unwrap(n):"",r,o)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,n){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),n)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var n=e.split("%s"),r="",o=Array.prototype.slice.call(arguments,1);o.length&&1<n.length;)r+=n.shift()+o.shift();return r+n.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return e.length==0},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return e==" "},goog.string.isUnicodeChar=function(e){return e.length==1&&" "<=e&&"~">=e||"€"<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,`
34
- `)},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),o=t.toLowerCase().match(n),l=Math.min(r.length,o.length),u=0;u<l;u++){n=r[u];var s=o[u];if(n!=s)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:n<s?-1:1}return r.length!=o.length?r.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"&#101;")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(o,l){var u=n[o];return u||(l.charAt(0)=="#"&&(l=+("0"+l.substr(1)),isNaN(l)||(u=String.fromCharCode(l))),u||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),o+" ")),u=r.firstChild.nodeValue.slice(0,-1)),n[o]=u)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(t,n){switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return n.charAt(0)!="#"||(n=+("0"+n.substr(1)),isNaN(n))?t:String.fromCharCode(n)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var o=n==1?t:t.charAt(r);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var o=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(o)}else e.length>t&&(r=Math.floor(t/2),o=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(o));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<o&&127>o?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))==-1&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return e==null?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return t==0&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(t,n){return n.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(n,r,o){return r+o.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;typeof t=="string"&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(t[r]!=""){var o=e.lastIndexOf(t[r]);o>n&&(n=o)}return n==-1?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)n[o]=o;for(o=0;o<e.length;o++){r[0]=o+1;for(var l=0;l<t.length;l++)r[l+1]=Math.min(r[l]+1,n[l+1]+1,n[l]+ +(e[o]!=t[l]));for(l=0;l<n.length;l++)n[l]=r[l]}return r[t.length]},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch{}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return n[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if(n[0]=="Edge")return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,function(n){return t==n[0]}))&&e[1]||""},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_())!=null&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function",goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function",goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var o=e[r],l=r+1<e.length,u=l?e[r+1]:0,s=r+2<e.length,g=s?e[r+2]:0,c=o>>2;o=(3&o)<<4|u>>4,u=(15&u)<<2|g>>6,g&=63,s||(g=64,l||(u=64)),n.push(t[c],t[o],t[u]||"",t[g]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,function(r){n+=String.fromCharCode(r)}),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,function(r){n.push(r)}),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return goog.crypt.base64.decodeStringInternal_(e,function(l){r[o++]=l}),r.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(g){for(;r<e.length;){var c=e.charAt(r++),f=goog.crypt.base64.charToByteMap_[c];if(f!=null)return f;if(!goog.string.isEmptyOrWhitespace(c))throw Error("Unknown base64 encoding at char: "+c)}return g}goog.crypt.base64.init_();for(var r=0;;){var o=n(-1),l=n(0),u=n(64),s=n(64);if(s===64&&o===-1)break;t(o<<2|l>>4),u!=64&&(t(l<<4&240|u>>2),s!=64&&t(u<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var o=0;o<r.length;o++){var l=r[o],u=goog.crypt.base64.charToByteMap_[l];u===void 0?goog.crypt.base64.charToByteMap_[l]=o:goog.asserts.assert(u===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(e==0?n==0?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),l=e.charCodeAt(4),u=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(o<<24)>>>0,jspb.utils.split64High=l+(u<<8)+(s<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,n==255?e?NaN:1/0*t:n==0?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,r==2047?e?NaN:1/0*n:r==0?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(o,l){return o=o?String(o):"",l?"0000000".slice(o.length)+o:o}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+e);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+((e=1+~e>>>0)==0?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(l,u){for(var s=0;8>s&&(l!==1||0<u);s++)u=l*r[s]+u,r[s]=255&u,u>>>=8}goog.asserts.assert(0<e.length);var n=!1;e[0]==="-"&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var l=0;8>l;l++)r[l]=255&~r[l]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(e.length==18),goog.asserts.assert(e[0]=="0"),goog.asserts.assert(e[1]=="x");for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,o=t;o<n;o++)r+=e[o]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var o=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(o++;;){var l=e[t++];if(!(128&l))break}else for(;t<n;){for(l=r;128<l;){if(e[t]!=(127&l|128))return o;t++,l>>=7}if(e[t++]!=l)break;for(o++;128&(l=e[t++]););}return o},jspb.utils.countFixedFields_=function(e,t,n,r,o){var l=0;if(128>r)for(;t<n&&e[t++]==r;)l++,t+=o;else for(;t<n;){for(var u=r;128<u;){if(e[t++]!=(127&u|128))return l;u>>=7}if(e[t++]!=u)break;l++,t+=o}return l},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var o=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var l=r;128<l;){if(e[t++]!=(127&l|128))return o;l>>=7}if(e[t++]!=l)break;o++;for(var u=0,s=1;u+=(127&(l=e[t++]))*s,s*=128,(128&l)!=0;);t+=u}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return typeof e=="string"?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||Buffer!==void 0&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=t!==void 0?t:0,this.end_=n!==void 0?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,o=0;4>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,o=0,l=n+7;l>=n;l--)r=r<<8|t[l],o=o<<8|t[l+4];return e(r,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],o="";n<e;){var l=t[n++];if(128>l)r.push(l);else{if(192>l)continue;if(224>l){var u=t[n++];r.push((31&l)<<6|63&u)}else if(240>l){u=t[n++];var s=t[n++];r.push((15&l)<<12|(63&u)<<6|63&s)}else 248>l&&(l=(7&l)<<18|(63&(u=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++],l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))}8192<=r.length&&(o+=String.fromCharCode.apply(null,r),r.length=0)}return o+=goog.crypt.byteArrayToString(r),this.cursor_=n,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],o=e[t+2],l=e[t+3],u=e[t+4],s=e[t+5],g=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,o,l,u,s,g,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(this.readCallbacks_!==null),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],o=0;o<n.length;o++){var l=this.map_[n[o][0].toString()];this.wrapEntry_(l);var u=l.valueWrapper;u?(goog.asserts.assert(t),r.push([l.key,t(e,u)])):r.push([l.key,l.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var o=e[r][0],l=n(e[r][1]);t.set(o,l)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var o=this.map_[n[r]];e.call(t,this.wrapEntry_(o),o.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,o){var l=this.stringKeys_();l.sort();for(var u=0;u<l.length;u++){var s=this.map_[l[u]];t.beginSubMessage(e),n.call(t,1,s.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(s),o):r.call(t,2,s.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,o,l,u){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();s==1?l=n.call(t):s==2&&(e.valueCtor_?(goog.asserts.assert(o),u||(u=new e.valueCtor_),r.call(t,u,o)):u=r.call(t))}goog.asserts.assert(l!=null),goog.asserts.assert(u!=null),e.set(l,u)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,o){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,o,l){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=o,this.isPacked=l},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function",jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,o,l){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=n===0?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(n=o[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(l&&l.length)for(t=0;t<l.length;t++)jspb.Message.computeOneofCase(e,l[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(e===null||typeof e!="object"||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],o=0;o<e.length;o++)r[o]=t.call(e[o],n,e[o]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,o){for(var l in n){var u=n[l],s=r.call(e,u);if(s!=null){for(var g in u.fieldName)if(u.fieldName.hasOwnProperty(g))break;t[g]=u.toObjectFn?u.isRepeated?jspb.Message.toObjectList(s,u.toObjectFn,o):u.toObjectFn(o,s):s}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var o in n){var l=n[o],u=l.fieldInfo;if(!l.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var s=r.call(e,u);if(s!=null)if(u.isMessageType()){if(!l.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");l.binaryWriterFn.call(t,u.fieldIndex,s,l.binaryMessageSerializeFn)}else l.binaryWriterFn.call(t,u.fieldIndex,s)}},jspb.Message.readBinaryExtension=function(e,t,n,r,o){var l=n[t.getFieldNumber()];if(l){if(n=l.fieldInfo,!l.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var u=new n.ctor;l.binaryReaderFn.call(t,u,l.binaryMessageDeserializeFn)}else u=l.binaryReaderFn.call(t);n.isRepeated&&!l.isPacked?(t=r.call(e,n))?t.push(u):o.call(e,n,[u]):o.call(e,n,u)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:+e},jspb.Message.getBooleanField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return e==null||typeof e=="string"?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return e==null||e instanceof Uint8Array?e:typeof e=="string"?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&typeof e[0]!="string"?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,function(n){goog.typeOf(n)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(n)+" expected "+t)})}},jspb.Message.getFieldWithDefault=function(e,t,n){return(e=jspb.Message.getField(e,t))==null?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return(e=jspb.Message.getBooleanField(e,t))==null?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return(e=jspb.Message.getOptionalFloatingPointField(e,t))==null?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(n)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),r!=null?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&r!==void 0&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,o=0;o<t.length;o++){var l=t[o],u=jspb.Message.getField(e,l);u!=null&&(n=l,r=u,jspb.Message.setField(e,l,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var o=jspb.Message.getField(e,n);(r||o)&&(e.wrappers_[n]=new t(o))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),o=[],l=0;l<r.length;l++)o[l]=new t(r[l]);e.wrappers_[n]=o}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n&&n.toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=r&&r.toArray();return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,o)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],o=0;o<n.length;o++)r[o]=n[o].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,o){jspb.Message.wrapRepeatedField_(e,r,t);var l=e.wrappers_[t];return l||(l=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),o!=null?(l.splice(o,0,n),e.splice(o,0,n.toArray())):(l.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var o={},l=0;l<e.length;l++)o[t.call(e[l])]=n?n.call(e[l],r,e[l]):e[l];return o},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(n){return new e.ctor(n)})),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,function(r){return r.toArray()})):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t&&t.toArray()):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],o=0,l=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),o=1);o<l;o++)jspb.Message.compareFields(n[o],t[o])||(r[o]=t[o]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!(typeof e=="number"&&isNaN(e)||typeof t=="number"&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,o=void 0,l=Math.max(e.length,t.length);for(n=0;n<l;n++){var u=e[n],s=t[n];if(u&&u.constructor==Object&&(goog.asserts.assert(r===void 0),goog.asserts.assert(n===e.length-1),r=u,u=void 0),s&&s.constructor==Object&&(goog.asserts.assert(o===void 0),goog.asserts.assert(n===t.length-1),o=s,s=void 0),!jspb.Message.compareFields(u,s))return!1}return!r&&!o||(r=r||{},o=o||{},jspb.Message.compareExtensions(r,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),o=n.length=0;o<r.length;o++)n[o]=r[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];r!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)(r=e[n])!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,o=t>>>16;for(t=n*r+65536*(n*o&65535)+65536*((e>>>=16)*r&65535),n=e*o+(n*o>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(e==0)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return e==""&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var o=parseInt(e[r],10);n.lo=o,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=(2147483648&this.hi)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&e[0]=="-";return t&&(e=e.substring(1)),(e=jspb.arith.UInt64.fromString(e))===null?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(n,r){t.writeSplitVarint64(n>>>0,r>>>0)})},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(typeof e=="boolean"||typeof e=="number"),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var o=e.charCodeAt(n+1);56320<=o&&57343>=o&&(r=1024*(r-55296)+o-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){e!=null&&t!=null&&n!=null&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,o=0;o<n;o++){var l=t[o];e.set(l,r),r+=l.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){t!=null&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){t!=null&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){t!=null&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){t!=null&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,function(o,l){r.writeSplitVarint64(o>>>0,l>>>0)})},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++){var o=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(o)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=this.encoder_,l=0;l<t.length;l++)jspb.utils.toZigzag64(n(t[l]),r(t[l]),function(u,s){o.writeSplitVarint64(u>>>0,s>>>0)});this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf}).call(this,__webpack_require__(6),__webpack_require__(5).Buffer)},function(e,t){var n=function(r){function o(){this.fetch=!1,this.DOMException=r.DOMException}return o.prototype=r,new o}(typeof self<"u"?self:this);(function(r){(function(o){var l="URLSearchParams"in r,u="Symbol"in r&&"iterator"in Symbol,s="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch{return!1}}(),g="FormData"in r,c="ArrayBuffer"in r;if(c)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],T=ArrayBuffer.isView||function(C){return C&&f.indexOf(Object.prototype.toString.call(C))>-1};function v(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function p(C){return typeof C!="string"&&(C=String(C)),C}function d(C){var w={next:function(){var x=C.shift();return{done:x===void 0,value:x}}};return u&&(w[Symbol.iterator]=function(){return w}),w}function h(C){this.map={},C instanceof h?C.forEach(function(w,x){this.append(x,w)},this):Array.isArray(C)?C.forEach(function(w){this.append(w[0],w[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(w){this.append(w,C[w])},this)}function S(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function I(C){return new Promise(function(w,x){C.onload=function(){w(C.result)},C.onerror=function(){x(C.error)}})}function L(C){var w=new FileReader,x=I(w);return w.readAsArrayBuffer(C),x}function O(C){if(C.slice)return C.slice(0);var w=new Uint8Array(C.byteLength);return w.set(new Uint8Array(C)),w.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(C){var w;this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:s&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:g&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:l&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():c&&s&&(w=C)&&DataView.prototype.isPrototypeOf(w)?(this._bodyArrayBuffer=O(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(C)||T(C))?this._bodyArrayBuffer=O(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var C=S(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?S(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(L)}),this.text=function(){var C,w,x,H=S(this);if(H)return H;if(this._bodyBlob)return C=this._bodyBlob,w=new FileReader,x=I(w),w.readAsText(C),x;if(this._bodyArrayBuffer)return Promise.resolve(function(U){for(var N=new Uint8Array(U),k=new Array(N.length),F=0;F<N.length;F++)k[F]=String.fromCharCode(N[F]);return k.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(C,w){C=v(C),w=p(w);var x=this.map[C];this.map[C]=x?x+", "+w:w},h.prototype.delete=function(C){delete this.map[v(C)]},h.prototype.get=function(C){return C=v(C),this.has(C)?this.map[C]:null},h.prototype.has=function(C){return this.map.hasOwnProperty(v(C))},h.prototype.set=function(C,w){this.map[v(C)]=p(w)},h.prototype.forEach=function(C,w){for(var x in this.map)this.map.hasOwnProperty(x)&&C.call(w,this.map[x],x,this)},h.prototype.keys=function(){var C=[];return this.forEach(function(w,x){C.push(x)}),d(C)},h.prototype.values=function(){var C=[];return this.forEach(function(w){C.push(w)}),d(C)},h.prototype.entries=function(){var C=[];return this.forEach(function(w,x){C.push([x,w])}),d(C)},u&&(h.prototype[Symbol.iterator]=h.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function M(C,w){var x,H,U=(w=w||{}).body;if(C instanceof M){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,w.headers||(this.headers=new h(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,U||C._bodyInit==null||(U=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=w.credentials||this.credentials||"same-origin",!w.headers&&this.headers||(this.headers=new h(w.headers)),this.method=(x=w.method||this.method||"GET",H=x.toUpperCase(),m.indexOf(H)>-1?H:x),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(U)}function G(C){var w=new FormData;return C.trim().split("&").forEach(function(x){if(x){var H=x.split("="),U=H.shift().replace(/\+/g," "),N=H.join("=").replace(/\+/g," ");w.append(decodeURIComponent(U),decodeURIComponent(N))}}),w}function Z(C,w){w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in w?w.statusText:"OK",this.headers=new h(w.headers),this.url=w.url||"",this._initBody(C)}M.prototype.clone=function(){return new M(this,{body:this._bodyInit})},R.call(M.prototype),R.call(Z.prototype),Z.prototype.clone=function(){return new Z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},Z.error=function(){var C=new Z(null,{status:0,statusText:""});return C.type="error",C};var _=[301,302,303,307,308];Z.redirect=function(C,w){if(_.indexOf(w)===-1)throw new RangeError("Invalid status code");return new Z(null,{status:w,headers:{location:C}})},o.DOMException=r.DOMException;try{new o.DOMException}catch{o.DOMException=function(w,x){this.message=w,this.name=x;var H=Error(w);this.stack=H.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function y(C,w){return new Promise(function(x,H){var U=new M(C,w);if(U.signal&&U.signal.aborted)return H(new o.DOMException("Aborted","AbortError"));var N=new XMLHttpRequest;function k(){N.abort()}N.onload=function(){var F,A,b={status:N.status,statusText:N.statusText,headers:(F=N.getAllResponseHeaders()||"",A=new h,F.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(W){var Q=W.split(":"),ee=Q.shift().trim();if(ee){var ne=Q.join(":").trim();A.append(ee,ne)}}),A)};b.url="responseURL"in N?N.responseURL:b.headers.get("X-Request-URL");var B="response"in N?N.response:N.responseText;x(new Z(B,b))},N.onerror=function(){H(new TypeError("Network request failed"))},N.ontimeout=function(){H(new TypeError("Network request failed"))},N.onabort=function(){H(new o.DOMException("Aborted","AbortError"))},N.open(U.method,U.url,!0),U.credentials==="include"?N.withCredentials=!0:U.credentials==="omit"&&(N.withCredentials=!1),"responseType"in N&&s&&(N.responseType="blob"),U.headers.forEach(function(F,A){N.setRequestHeader(A,F)}),U.signal&&(U.signal.addEventListener("abort",k),N.onreadystatechange=function(){N.readyState===4&&U.signal.removeEventListener("abort",k)}),N.send(U._bodyInit===void 0?null:U._bodyInit)})}y.polyfill=!0,r.fetch||(r.fetch=y,r.Headers=h,r.Request=M,r.Response=Z),o.Headers=h,o.Request=M,o.Response=Z,o.fetch=y})({})})(n),delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},function(e,t,n){(function(r){const o=n(210),l=n(52),u=(s,g,c)=>({from:u,EnvVarError:n(52),get:function(f){if(!f)return s;if(arguments.length>1)throw new l("It looks like you passed more than one argument to env.get(). Since env-var@6.0.0 this is no longer supported. To set a default value use env.get(TARGET).default(DEFAULT)");return o(s,f,g||{},c||function(){})},accessors:n(94),logger:n(224)(console.log,s.NODE_ENV)});e.exports=u(r.env)}).call(this,n(2))},function(e,t,n){var r=n(13),o=n(73),l=n(3).LEVEL,u=e.exports=function(){var s=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.call(this,{objectMode:!0,highWaterMark:g.highWaterMark}),this.format=g.format,this.level=g.level,this.handleExceptions=g.handleExceptions,this.silent=g.silent,g.log&&(this.log=g.log),g.logv&&(this.logv=g.logv),g.close&&(this.close=g.close),this.once("pipe",function(c){s.levels=c.levels,s.parent=c}),this.once("unpipe",function(c){c===s.parent&&(s.parent=null,s.close&&s.close())})};r.inherits(u,o),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);var f=this.level||this.parent&&this.parent.level;if(!f||this.levels[f]>=this.levels[s[l]]){if(s&&!this.format)return this.log(s,c);var T=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s),this.format.options)}catch(p){T=p}if(T||!v){if(c(),T)throw T;return}return this.log(v,c)}return c(null)},u.prototype._writev=function(s,g){if(this.logv){var c=s.filter(this._accept,this);return c.length?this.logv(c,g):g(null)}for(var f=0;f<s.length;f++)if(this._accept(s[f]))if(!s[f].chunk||this.format){var T=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s[f].chunk),this.format.options)}catch(p){T=p}if(T||!v){if(s[f].callback(),T)throw g(null),T}else this.log(v,s[f].callback)}else this.log(s[f].chunk,s[f].callback);return g(null)},u.prototype._accept=function(s){var g=s.chunk;if(this.silent)return!1;var c=this.level||this.parent&&this.parent.level;return!(g.exception!==!0&&c&&!(this.levels[c]>=this.levels[g[l]])||!this.handleExceptions&&g.exception===!0)},u.prototype._nop=function(){}},function(e,t,n){(function(r){const o=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,l=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(){this.signal.dispatchEvent("abort")}},u=typeof AbortSignal=="function",s=typeof l.AbortSignal=="function",g=u?AbortSignal:s?l.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(R){if(R==="abort"){this.aborted=!0;const m={type:R,target:this};this.onabort(m),this._listeners.forEach(M=>M(m),this)}}onabort(){}addEventListener(R,m){R==="abort"&&this._listeners.push(m)}removeEventListener(R,m){R==="abort"&&(this._listeners=this._listeners.filter(M=>M!==m))}},c=new Set,f=(R,m)=>{const M=`LRU_CACHE_OPTION_${R}`;p(M)&&d(M,`${R} option`,`options.${m}`,O)},T=(R,m)=>{const M=`LRU_CACHE_METHOD_${R}`;if(p(M)){const{prototype:G}=O,{get:Z}=Object.getOwnPropertyDescriptor(G,R);d(M,`${R} method`,`cache.${m}()`,Z)}},v=(...R)=>{typeof r=="object"&&r&&typeof r.emitWarning=="function"?r.emitWarning(...R):console.error(...R)},p=R=>!c.has(R),d=(R,m,M,G)=>{c.add(R),v(`The ${m} is deprecated. Please use ${M} instead.`,"DeprecationWarning",R,G)},h=R=>R&&R===Math.floor(R)&&R>0&&isFinite(R),S=R=>h(R)?R<=Math.pow(2,8)?Uint8Array:R<=Math.pow(2,16)?Uint16Array:R<=Math.pow(2,32)?Uint32Array:R<=Number.MAX_SAFE_INTEGER?I:null:null;class I extends Array{constructor(m){super(m),this.fill(0)}}class L{constructor(m){if(m===0)return[];const M=S(m);this.heap=new M(m),this.length=0}push(m){this.heap[this.length++]=m}pop(){return this.heap[--this.length]}}class O{constructor(m={}){const{max:M=0,ttl:G,ttlResolution:Z=1,ttlAutopurge:_,updateAgeOnGet:y,updateAgeOnHas:C,allowStale:w,dispose:x,disposeAfter:H,noDisposeOnSet:U,noUpdateTTL:N,maxSize:k=0,maxEntrySize:F=0,sizeCalculation:A,fetchMethod:b,fetchContext:B,noDeleteOnFetchRejection:W,noDeleteOnStaleGet:Q}=m,{length:ee,maxAge:ne,stale:X}=m instanceof O?{}:m;if(M!==0&&!h(M))throw new TypeError("max option must be a nonnegative integer");const $=M?S(M):Array;if(!$)throw new Error("invalid max value: "+M);if(this.max=M,this.maxSize=k,this.maxEntrySize=F||this.maxSize,this.sizeCalculation=A||ee,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=b||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=B,!this.fetchMethod&&B!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(M).fill(null),this.valList=new Array(M).fill(null),this.next=new $(M),this.prev=new $(M),this.head=0,this.tail=0,this.free=new L(M),this.initialFill=1,this.size=0,typeof x=="function"&&(this.dispose=x),typeof H=="function"?(this.disposeAfter=H,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!U,this.noUpdateTTL=!!N,this.noDeleteOnFetchRejection=!!W,this.maxEntrySize!==0){if(this.maxSize!==0&&!h(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!h(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!w||!!X,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!y,this.updateAgeOnHas=!!C,this.ttlResolution=h(Z)||Z===0?Z:1,this.ttlAutopurge=!!_,this.ttl=G||ne||0,this.ttl){if(!h(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const E="LRU_CACHE_UNBOUNDED";p(E)&&(c.add(E),v("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,O))}X&&f("stale","allowStale"),ne&&f("maxAge","ttl"),ee&&f("length","sizeCalculation")}getRemainingTTL(m){return this.has(m,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new I(this.max),this.starts=new I(this.max),this.setItemTTL=(G,Z,_=o.now())=>{if(this.starts[G]=Z!==0?_:0,this.ttls[G]=Z,Z!==0&&this.ttlAutopurge){const y=setTimeout(()=>{this.isStale(G)&&this.delete(this.keyList[G])},Z+1);y.unref&&y.unref()}},this.updateItemAge=G=>{this.starts[G]=this.ttls[G]!==0?o.now():0};let m=0;const M=()=>{const G=o.now();if(this.ttlResolution>0){m=G;const Z=setTimeout(()=>m=0,this.ttlResolution);Z.unref&&Z.unref()}return G};this.getRemainingTTL=G=>{const Z=this.keyMap.get(G);return Z===void 0?0:this.ttls[Z]===0||this.starts[Z]===0?1/0:this.starts[Z]+this.ttls[Z]-(m||M())},this.isStale=G=>this.ttls[G]!==0&&this.starts[G]!==0&&(m||M())-this.starts[G]>this.ttls[G]}updateItemAge(m){}setItemTTL(m,M,G){}isStale(m){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new I(this.max),this.removeItemSize=m=>{this.calculatedSize-=this.sizes[m],this.sizes[m]=0},this.requireSize=(m,M,G,Z)=>{if(!h(G)){if(!Z)throw new TypeError("invalid size value (must be positive integer)");if(typeof Z!="function")throw new TypeError("sizeCalculation must be a function");if(G=Z(M,m),!h(G))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return G},this.addItemSize=(m,M)=>{this.sizes[m]=M;const G=this.maxSize-this.sizes[m];for(;this.calculatedSize>G;)this.evict(!0);this.calculatedSize+=this.sizes[m]}}removeItemSize(m){}addItemSize(m,M){}requireSize(m,M,G,Z){if(G||Z)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:m=this.allowStale}={}){if(this.size)for(let M=this.tail;this.isValidIndex(M)&&(!m&&this.isStale(M)||(yield M),M!==this.head);)M=this.prev[M]}*rindexes({allowStale:m=this.allowStale}={}){if(this.size)for(let M=this.head;this.isValidIndex(M)&&(!m&&this.isStale(M)||(yield M),M!==this.tail);)M=this.next[M]}isValidIndex(m){return this.keyMap.get(this.keyList[m])===m}*entries(){for(const m of this.indexes())yield[this.keyList[m],this.valList[m]]}*rentries(){for(const m of this.rindexes())yield[this.keyList[m],this.valList[m]]}*keys(){for(const m of this.indexes())yield this.keyList[m]}*rkeys(){for(const m of this.rindexes())yield this.keyList[m]}*values(){for(const m of this.indexes())yield this.valList[m]}*rvalues(){for(const m of this.rindexes())yield this.valList[m]}[Symbol.iterator](){return this.entries()}find(m,M={}){for(const G of this.indexes())if(m(this.valList[G],this.keyList[G],this))return this.get(this.keyList[G],M)}forEach(m,M=this){for(const G of this.indexes())m.call(M,this.valList[G],this.keyList[G],this)}rforEach(m,M=this){for(const G of this.rindexes())m.call(M,this.valList[G],this.keyList[G],this)}get prune(){return T("prune","purgeStale"),this.purgeStale}purgeStale(){let m=!1;for(const M of this.rindexes({allowStale:!0}))this.isStale(M)&&(this.delete(this.keyList[M]),m=!0);return m}dump(){const m=[];for(const M of this.indexes({allowStale:!0})){const G=this.keyList[M],Z=this.valList[M],_={value:this.isBackgroundFetch(Z)?Z.__staleWhileFetching:Z};if(this.ttls){_.ttl=this.ttls[M];const y=o.now()-this.starts[M];_.start=Math.floor(Date.now()-y)}this.sizes&&(_.size=this.sizes[M]),m.unshift([G,_])}return m}load(m){this.clear();for(const[M,G]of m){if(G.start){const Z=Date.now()-G.start;G.start=o.now()-Z}this.set(M,G.value,G)}}dispose(m,M,G){}set(m,M,{ttl:G=this.ttl,start:Z,noDisposeOnSet:_=this.noDisposeOnSet,size:y=0,sizeCalculation:C=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL}={}){if(y=this.requireSize(m,M,y,C),this.maxEntrySize&&y>this.maxEntrySize)return this;let x=this.size===0?void 0:this.keyMap.get(m);if(x===void 0)x=this.newIndex(),this.keyList[x]=m,this.valList[x]=M,this.keyMap.set(m,x),this.next[this.tail]=x,this.prev[x]=this.tail,this.tail=x,this.size++,this.addItemSize(x,y),w=!1;else{const H=this.valList[x];M!==H&&(this.isBackgroundFetch(H)?H.__abortController.abort():_||(this.dispose(H,m,"set"),this.disposeAfter&&this.disposed.push([H,m,"set"])),this.removeItemSize(x),this.valList[x]=M,this.addItemSize(x,y)),this.moveToTail(x)}if(G===0||this.ttl!==0||this.ttls||this.initializeTTLTracking(),w||this.setItemTTL(x,G,Z),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const m=this.valList[this.head];return this.evict(!0),m}}evict(m){const M=this.head,G=this.keyList[M],Z=this.valList[M];return this.isBackgroundFetch(Z)?Z.__abortController.abort():(this.dispose(Z,G,"evict"),this.disposeAfter&&this.disposed.push([Z,G,"evict"])),this.removeItemSize(M),m&&(this.keyList[M]=null,this.valList[M]=null,this.free.push(M)),this.head=this.next[M],this.keyMap.delete(G),this.size--,M}has(m,{updateAgeOnHas:M=this.updateAgeOnHas}={}){const G=this.keyMap.get(m);return G!==void 0&&!this.isStale(G)&&(M&&this.updateItemAge(G),!0)}peek(m,{allowStale:M=this.allowStale}={}){const G=this.keyMap.get(m);if(G!==void 0&&(M||!this.isStale(G))){const Z=this.valList[G];return this.isBackgroundFetch(Z)?Z.__staleWhileFetching:Z}}backgroundFetch(m,M,G,Z){const _=M===void 0?void 0:this.valList[M];if(this.isBackgroundFetch(_))return _;const y=new l,C={signal:y.signal,options:G,context:Z},w=new Promise(x=>x(this.fetchMethod(m,_,C))).then(x=>(y.signal.aborted||this.set(m,x,C.options),x),x=>{if(this.valList[M]===w&&(!G.noDeleteOnFetchRejection||w.__staleWhileFetching===void 0?this.delete(m):this.valList[M]=w.__staleWhileFetching),w.__returned===w)throw x});return w.__abortController=y,w.__staleWhileFetching=_,w.__returned=null,M===void 0?(this.set(m,w,C.options),M=this.keyMap.get(m)):this.valList[M]=w,w}isBackgroundFetch(m){return m&&typeof m=="object"&&typeof m.then=="function"&&Object.prototype.hasOwnProperty.call(m,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(m,"__returned")&&(m.__returned===m||m.__returned===null)}async fetch(m,{allowStale:M=this.allowStale,updateAgeOnGet:G=this.updateAgeOnGet,noDeleteOnStaleGet:Z=this.noDeleteOnStaleGet,ttl:_=this.ttl,noDisposeOnSet:y=this.noDisposeOnSet,size:C=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:H=this.noDeleteOnFetchRejection,fetchContext:U=this.fetchContext,forceRefresh:N=!1}={}){if(!this.fetchMethod)return this.get(m,{allowStale:M,updateAgeOnGet:G,noDeleteOnStaleGet:Z});const k={allowStale:M,updateAgeOnGet:G,noDeleteOnStaleGet:Z,ttl:_,noDisposeOnSet:y,size:C,sizeCalculation:w,noUpdateTTL:x,noDeleteOnFetchRejection:H};let F=this.keyMap.get(m);if(F===void 0){const A=this.backgroundFetch(m,F,k,U);return A.__returned=A}{const A=this.valList[F];if(this.isBackgroundFetch(A))return M&&A.__staleWhileFetching!==void 0?A.__staleWhileFetching:A.__returned=A;if(!N&&!this.isStale(F))return this.moveToTail(F),G&&this.updateItemAge(F),A;const b=this.backgroundFetch(m,F,k,U);return M&&b.__staleWhileFetching!==void 0?b.__staleWhileFetching:b.__returned=b}}get(m,{allowStale:M=this.allowStale,updateAgeOnGet:G=this.updateAgeOnGet,noDeleteOnStaleGet:Z=this.noDeleteOnStaleGet}={}){const _=this.keyMap.get(m);if(_!==void 0){const y=this.valList[_],C=this.isBackgroundFetch(y);return this.isStale(_)?C?M?y.__staleWhileFetching:void 0:(Z||this.delete(m),M?y:void 0):C?void 0:(this.moveToTail(_),G&&this.updateItemAge(_),y)}}connect(m,M){this.prev[M]=m,this.next[m]=M}moveToTail(m){m!==this.tail&&(m===this.head?this.head=this.next[m]:this.connect(this.prev[m],this.next[m]),this.connect(this.tail,m),this.tail=m)}get del(){return T("del","delete"),this.delete}delete(m){let M=!1;if(this.size!==0){const G=this.keyMap.get(m);if(G!==void 0)if(M=!0,this.size===1)this.clear();else{this.removeItemSize(G);const Z=this.valList[G];this.isBackgroundFetch(Z)?Z.__abortController.abort():(this.dispose(Z,m,"delete"),this.disposeAfter&&this.disposed.push([Z,m,"delete"])),this.keyMap.delete(m),this.keyList[G]=null,this.valList[G]=null,G===this.tail?this.tail=this.prev[G]:G===this.head?this.head=this.next[G]:(this.next[this.prev[G]]=this.next[G],this.prev[this.next[G]]=this.prev[G]),this.size--,this.free.push(G)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return M}clear(){for(const m of this.rindexes({allowStale:!0})){const M=this.valList[m];if(this.isBackgroundFetch(M))M.__abortController.abort();else{const G=this.keyList[m];this.dispose(M,G,"delete"),this.disposeAfter&&this.disposed.push([M,G,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return T("reset","clear"),this.clear}get length(){return((m,M)=>{const G=`LRU_CACHE_PROPERTY_${m}`;if(p(G)){const{prototype:Z}=O,{get:_}=Object.getOwnPropertyDescriptor(Z,m);d(G,`${m} property`,`cache.${M}`,_)}})("length","size"),this.size}static get AbortController(){return l}static get AbortSignal(){return g}}e.exports=O}).call(this,n(2))},function(e,t,n){var r=n(41).Colorizer;e.exports=function(o){return r.addColors(o.colors||o),o}},function(e,t,n){var r={};e.exports=r,r.themes={};var o=n(13),l=r.styles=n(108),u=Object.defineProperties,s=new RegExp(/[\r\n]+/g);r.supportsColor=n(109).supportsColor,r.enabled===void 0&&(r.enabled=r.supportsColor()!==!1),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(S){return(""+S).replace(/\x1B\[\d+m/g,"")},r.stylize=function(S,I){return r.enabled?l[I].open+S+l[I].close:S+""};var g=/[|\\{}()[\]^$+*?.]/g;function c(S){var I=function L(){return p.apply(L,arguments)};return I._styles=S,I.__proto__=v,I}var f,T=(f={},l.grey=l.gray,Object.keys(l).forEach(function(S){l[S].closeRe=new RegExp(function(I){if(typeof I!="string")throw new TypeError("Expected a string");return I.replace(g,"\\$&")}(l[S].close),"g"),f[S]={get:function(){return c(this._styles.concat(S))}}}),f),v=u(function(){},T);function p(){var S=Array.prototype.slice.call(arguments),I=S.map(function(M){return M!==void 0&&M.constructor===String?M:o.inspect(M)}).join(" ");if(!r.enabled||!I)return I;for(var L=I.indexOf(`
35
- `)!=-1,O=this._styles,R=O.length;R--;){var m=l[O[R]];I=m.open+I.replace(m.closeRe,m.open)+m.close,L&&(I=I.replace(s,function(M){return m.close+M+m.open}))}return I}r.setTheme=function(S){if(typeof S!="string")for(var I in S)(function(L){r[L]=function(O){if(typeof S[L]=="object"){var R=O;for(var m in S[L])R=r[S[L][m]](R);return R}return r[S[L]](O)}})(I);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var d=function(S,I){var L=I.split("");return(L=L.map(S)).join("")};for(var h in r.trap=n(111),r.zalgo=n(112),r.maps={},r.maps.america=n(113)(r),r.maps.zebra=n(114)(r),r.maps.rainbow=n(115)(r),r.maps.random=n(116)(r),r.maps)(function(S){r[S]=function(I){return d(r.maps[S],I)}})(h);u(r,function(){var S={};return Object.keys(T).forEach(function(I){S[I]={get:function(){return c([I])}}}),S}())},function(e,t){e.exports=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"}},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(n,r){n.super_=r;var o=function(){};o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n}},function(e,t){var n={};e.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(o){var l=r[o],u=n[o]=[];u.open="\x1B["+l[0]+"m",u.close="\x1B["+l[1]+"m"})},function(e,t,n){(function(r){var o=n(18),l=n(110),u=r.env,s=void 0;function g(c){return function(f){return f!==0&&{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}(function(f){if(s===!1)return 0;if(l("color=16m")||l("color=full")||l("color=truecolor"))return 3;if(l("color=256"))return 2;if(f&&!f.isTTY&&s!==!0)return 0;var T=s?1:0;if(r.platform==="win32"){var v=o.release().split(".");return Number(r.versions.node.split(".")[0])>=8&&Number(v[0])>=10&&Number(v[2])>=10586?Number(v[2])>=14931?3:2:1}return"CI"in u?["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(p){return p in u})||u.CI_NAME==="codeship"?1:T:"TEAMCITY_VERSION"in u?/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0:"TERM_PROGRAM"in u?parseInt("3.4.19".split(".")[0],10)>=3?3:2:/-256(color)?$/i.test("xterm-256color")?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test("xterm-256color")||"COLORTERM"in u?1:T}(c))}l("no-color")||l("no-colors")||l("color=false")?s=!1:(l("color")||l("colors")||l("color=true")||l("color=always"))&&(s=!0),"FORCE_COLOR"in u&&(s=u.FORCE_COLOR.length===0||parseInt(u.FORCE_COLOR,10)!==0),e.exports={supportsColor:g,stdout:g(r.stdout),stderr:g(r.stderr)}}).call(this,n(2))},function(e,t,n){(function(r){e.exports=function(o,l){var u=(l=l||r.argv).indexOf("--"),s=/^-{1,2}/.test(o)?"":"--",g=l.indexOf(s+o);return g!==-1&&(u===-1||g<u)}}).call(this,n(2))},function(e,t){e.exports=function(n,r){var o="";n=(n=n||"Run the trap, drop the bass").split("");var l={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return n.forEach(function(u){u=u.toLowerCase();var s=l[u]||[" "],g=Math.floor(Math.random()*s.length);o+=l[u]!==void 0?l[u][g]:u}),o}},function(e,t){e.exports=function(n,r){n=n||" he is here ";var o={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},l=[].concat(o.up,o.down,o.mid);function u(g){return Math.floor(Math.random()*g)}function s(g){var c=!1;return l.filter(function(f){c=f===g}),c}return function(g,c){var f,T,v="";for(T in(c=c||{}).up=c.up===void 0||c.up,c.mid=c.mid===void 0||c.mid,c.down=c.down===void 0||c.down,c.size=c.size!==void 0?c.size:"maxi",g=g.split(""))if(!s(T)){switch(v+=g[T],f={up:0,down:0,mid:0},c.size){case"mini":f.up=u(8),f.mid=u(2),f.down=u(8);break;case"maxi":f.up=u(16)+3,f.mid=u(4)+1,f.down=u(64)+3;break;default:f.up=u(8)+1,f.mid=u(6)/2,f.down=u(8)+1}var p=["up","mid","down"];for(var d in p)for(var h=p[d],S=0;S<=f[h];S++)c[h]&&(v+=o[h][u(o[h].length)])}return v}(n,r)}},function(e,t){e.exports=function(n){return function(r,o,l){if(r===" ")return r;switch(o%3){case 0:return n.red(r);case 1:return n.white(r);case 2:return n.blue(r)}}}},function(e,t){e.exports=function(n){return function(r,o,l){return o%2==0?r:n.inverse(r)}}},function(e,t){e.exports=function(n){var r=["red","yellow","green","blue","magenta"];return function(o,l,u){return o===" "?o:n[r[l++%r.length]](o)}}},function(e,t){e.exports=function(n){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta"];return function(o,l,u){return o===" "?o:n[r[Math.round(Math.random()*(r.length-2))]](o)}}},function(e,t,n){Object.defineProperty(t,"cli",{value:n(118)}),Object.defineProperty(t,"npm",{value:n(119)}),Object.defineProperty(t,"syslog",{value:n(120)})},function(e,t,n){t.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},t.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}},function(e,t,n){t.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},t.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}},function(e,t,n){t.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},t.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}},function(e,t,n){var r=n(12);e.exports=r(function(o){return o.message=" ".concat(o.message),o})},function(e,t,n){function r(T,v){if(!(T instanceof v))throw new TypeError("Cannot call a class as a function")}function o(T,v){for(var p=0;p<v.length;p++){var d=v[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}var l=n(41).Colorizer,u=n(60).Padder,s=n(3),g=s.configs,c=s.MESSAGE,f=function(){function T(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,T),d.levels||(d.levels=g.npm.levels),this.colorizer=new l(d),this.padder=new u(d),this.options=d}var v,p;return v=T,(p=[{key:"transform",value:function(d,h){return this.colorizer.transform(this.padder.transform(d,h),h),d[c]="".concat(d.level,":").concat(d.message),d}}])&&o(v.prototype,p),T}();e.exports=function(T){return new f(T)},e.exports.Format=f},function(e,t,n){var r=n(12);function o(u){if(u.every(l))return function(s){for(var g=s,c=0;c<u.length;c++)if(!(g=u[c].transform(g,u[c].options)))return!1;return g}}function l(u){if(typeof u.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
36
- `));return!0}e.exports=function(){for(var u=arguments.length,s=new Array(u),g=0;g<u;g++)s[g]=arguments[g];var c=r(o(s)),f=c();return f.Format=c.Format,f},e.exports.cascade=o},function(e,t,n){(function(r){var o=n(12),l=n(3).MESSAGE,u=n(35);function s(g,c){return c instanceof r?c.toString("base64"):typeof c=="bigint"?c.toString():c}e.exports=o(function(g){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g[l]=(c.stable?u.stableStringify:u)(g,c.replacer||s,c.space),g})}).call(this,n(5).Buffer)},function(e,t,n){t.byteLength=function(T){var v=c(T),p=v[0],d=v[1];return 3*(p+d)/4-d},t.toByteArray=function(T){for(var v,p=c(T),d=p[0],h=p[1],S=new l(function(R,m,M){return 3*(m+M)/4-M}(0,d,h)),I=0,L=h>0?d-4:d,O=0;O<L;O+=4)v=o[T.charCodeAt(O)]<<18|o[T.charCodeAt(O+1)]<<12|o[T.charCodeAt(O+2)]<<6|o[T.charCodeAt(O+3)],S[I++]=v>>16&255,S[I++]=v>>8&255,S[I++]=255&v;return h===2&&(v=o[T.charCodeAt(O)]<<2|o[T.charCodeAt(O+1)]>>4,S[I++]=255&v),h===1&&(v=o[T.charCodeAt(O)]<<10|o[T.charCodeAt(O+1)]<<4|o[T.charCodeAt(O+2)]>>2,S[I++]=v>>8&255,S[I++]=255&v),S},t.fromByteArray=function(T){for(var v,p=T.length,d=p%3,h=[],S=0,I=p-d;S<I;S+=16383)h.push(f(T,S,S+16383>I?I:S+16383));return d===1?(v=T[p-1],h.push(r[v>>2]+r[v<<4&63]+"==")):d===2&&(v=(T[p-2]<<8)+T[p-1],h.push(r[v>>10]+r[v>>4&63]+r[v<<2&63]+"=")),h.join("")};for(var r=[],o=[],l=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,g=u.length;s<g;++s)r[s]=u[s],o[u.charCodeAt(s)]=s;function c(T){var v=T.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=T.indexOf("=");return p===-1&&(p=v),[p,p===v?0:4-p%4]}function f(T,v,p){for(var d,h,S=[],I=v;I<p;I+=3)d=(T[I]<<16&16711680)+(T[I+1]<<8&65280)+(255&T[I+2]),S.push(r[(h=d)>>18&63]+r[h>>12&63]+r[h>>6&63]+r[63&h]);return S.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(n,r,o,l,u){var s,g,c=8*u-l-1,f=(1<<c)-1,T=f>>1,v=-7,p=o?u-1:0,d=o?-1:1,h=n[r+p];for(p+=d,s=h&(1<<-v)-1,h>>=-v,v+=c;v>0;s=256*s+n[r+p],p+=d,v-=8);for(g=s&(1<<-v)-1,s>>=-v,v+=l;v>0;g=256*g+n[r+p],p+=d,v-=8);if(s===0)s=1-T;else{if(s===f)return g?NaN:1/0*(h?-1:1);g+=Math.pow(2,l),s-=T}return(h?-1:1)*g*Math.pow(2,s-l)},t.write=function(n,r,o,l,u,s){var g,c,f,T=8*s-u-1,v=(1<<T)-1,p=v>>1,d=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=l?0:s-1,S=l?1:-1,I=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,g=v):(g=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-g))<1&&(g--,f*=2),(r+=g+p>=1?d/f:d*Math.pow(2,1-p))*f>=2&&(g++,f/=2),g+p>=v?(c=0,g=v):g+p>=1?(c=(r*f-1)*Math.pow(2,u),g+=p):(c=r*Math.pow(2,p-1)*Math.pow(2,u),g=0));u>=8;n[o+h]=255&c,h+=S,c/=256,u-=8);for(g=g<<u|c,T+=u;T>0;n[o+h]=255&g,h+=S,g/=256,T-=8);n[o+h-S]|=128*I}},function(e,t,n){var r=n(12);e.exports=r(function(o,l){return l.message?(o.message="[".concat(l.label,"] ").concat(o.message),o):(o.label=l.label,o)})},function(e,t,n){var r=n(12),o=n(3).MESSAGE,l=n(35);e.exports=r(function(u){var s={};return u.message&&(s["@message"]=u.message,delete u.message),u.timestamp&&(s["@timestamp"]=u.timestamp,delete u.timestamp),s["@fields"]=u,u[o]=l(s),u})},function(e,t,n){var r=n(12);function o(u,s,g){var c,f,T,v=s.reduce(function(d,h){return d[h]=u[h],delete u[h],d},{}),p=Object.keys(u).reduce(function(d,h){return d[h]=u[h],delete u[h],d},{});return Object.assign(u,v,(T=p,(f=g)in(c={})?Object.defineProperty(c,f,{value:T,enumerable:!0,configurable:!0,writable:!0}):c[f]=T,c)),u}function l(u,s,g){return u[g]=s.reduce(function(c,f){return c[f]=u[f],delete u[f],c},{}),u}e.exports=r(function(u){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g="metadata";s.key&&(g=s.key);var c=[];return s.fillExcept||s.fillWith||(c.push("level"),c.push("message")),s.fillExcept&&(c=s.fillExcept),c.length>0?o(u,c,g):s.fillWith?l(u,s.fillWith,g):u})},function(e,t,n){var r=n(13).inspect,o=n(12),l=n(3),u=l.LEVEL,s=l.MESSAGE,g=l.SPLAT;e.exports=o(function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=Object.assign({},c);return delete T[u],delete T[s],delete T[g],c[s]=r(T,!1,f.depth||null,f.colorize),c})},function(e,t,n){function r(u,s){for(var g=0;g<s.length;g++){var c=s[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}var o=n(3).MESSAGE,l=function(){function u(c){(function(f,T){if(!(f instanceof T))throw new TypeError("Cannot call a class as a function")})(this,u),this.template=c}var s,g;return s=u,(g=[{key:"transform",value:function(c){return c[o]=this.template(c),c}}])&&r(s.prototype,g),u}();e.exports=function(u){return new l(u)},e.exports.Printf=e.exports.Format=l},function(e,t,n){var r=n(12),o=n(3).MESSAGE,l=n(35);e.exports=r(function(u){var s=l(Object.assign({},u,{level:void 0,message:void 0,splat:void 0})),g=u.padding&&u.padding[u.level]||"";return u[o]=s!=="{}"?"".concat(u.level,":").concat(g," ").concat(u.message," ").concat(s):"".concat(u.level,":").concat(g," ").concat(u.message),u})},function(e,t,n){function r(T){return function(v){if(Array.isArray(v))return o(v)}(T)||function(v){if(typeof Symbol<"u"&&Symbol.iterator in Object(v))return Array.from(v)}(T)||function(v,p){if(v){if(typeof v=="string")return o(v,p);var d=Object.prototype.toString.call(v).slice(8,-1);if(d==="Object"&&v.constructor&&(d=v.constructor.name),d==="Map"||d==="Set")return Array.from(v);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return o(v,p)}}(T)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
37
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(T,v){(v==null||v>T.length)&&(v=T.length);for(var p=0,d=new Array(v);p<v;p++)d[p]=T[p];return d}function l(T,v){for(var p=0;p<v.length;p++){var d=v[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}var u=n(13),s=n(3).SPLAT,g=/%[scdjifoO%]/g,c=/%%/g,f=function(){function T(d){(function(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")})(this,T),this.options=d}var v,p;return v=T,(p=[{key:"_splat",value:function(d,h){var S=d.message,I=d[s]||d.splat||[],L=S.match(c),O=L&&L.length||0,R=h.length-O-I.length,m=R<0?I.splice(R,-1*R):[],M=m.length;if(M)for(var G=0;G<M;G++)Object.assign(d,m[G]);return d.message=u.format.apply(u,[S].concat(r(I))),d}},{key:"transform",value:function(d){var h=d.message,S=d[s]||d.splat;if(!S||!S.length)return d;var I=h&&h.match&&h.match(g);if(!I&&(S||S.length)){var L=S.length>1?S.splice(0):S,O=L.length;if(O)for(var R=0;R<O;R++)Object.assign(d,L[R]);return d}return I?this._splat(d,I):d}}])&&l(v.prototype,p),T}();e.exports=function(T){return new f(T)}},function(e,t,n){var r=n(135),o=n(12);e.exports=o(function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return u.format&&(l.timestamp=typeof u.format=="function"?u.format():r.format(new Date,u.format)),l.timestamp||(l.timestamp=new Date().toISOString()),u.alias&&(l[u.alias]=l.timestamp),l})},function(e,t,n){n.r(t),n.d(t,"assign",function(){return g}),n.d(t,"format",function(){return y}),n.d(t,"parse",function(){return C}),n.d(t,"defaultI18n",function(){return v}),n.d(t,"setGlobalDateI18n",function(){return d}),n.d(t,"setGlobalDateMasks",function(){return _});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o="[^\\s]+",l=/\[([^]*?)\]/gm;function u(x,H){for(var U=[],N=0,k=x.length;N<k;N++)U.push(x[N].substr(0,H));return U}var s=function(x){return function(H,U){var N=U[x].map(function(k){return k.toLowerCase()}).indexOf(H.toLowerCase());return N>-1?N:null}};function g(x){for(var H=[],U=1;U<arguments.length;U++)H[U-1]=arguments[U];for(var N=0,k=H;N<k.length;N++){var F=k[N];for(var A in F)x[A]=F[A]}return x}var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],T=u(f,3),v={dayNamesShort:u(c,3),dayNames:c,monthNamesShort:T,monthNames:f,amPm:["am","pm"],DoFn:function(x){return x+["th","st","nd","rd"][x%10>3?0:(x-x%10!=10?1:0)*x%10]}},p=g({},v),d=function(x){return p=g(p,x)},h=function(x){return x.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},S=function(x,H){for(H===void 0&&(H=2),x=String(x);x.length<H;)x="0"+x;return x},I={D:function(x){return String(x.getDate())},DD:function(x){return S(x.getDate())},Do:function(x,H){return H.DoFn(x.getDate())},d:function(x){return String(x.getDay())},dd:function(x){return S(x.getDay())},ddd:function(x,H){return H.dayNamesShort[x.getDay()]},dddd:function(x,H){return H.dayNames[x.getDay()]},M:function(x){return String(x.getMonth()+1)},MM:function(x){return S(x.getMonth()+1)},MMM:function(x,H){return H.monthNamesShort[x.getMonth()]},MMMM:function(x,H){return H.monthNames[x.getMonth()]},YY:function(x){return S(String(x.getFullYear()),4).substr(2)},YYYY:function(x){return S(x.getFullYear(),4)},h:function(x){return String(x.getHours()%12||12)},hh:function(x){return S(x.getHours()%12||12)},H:function(x){return String(x.getHours())},HH:function(x){return S(x.getHours())},m:function(x){return String(x.getMinutes())},mm:function(x){return S(x.getMinutes())},s:function(x){return String(x.getSeconds())},ss:function(x){return S(x.getSeconds())},S:function(x){return String(Math.round(x.getMilliseconds()/100))},SS:function(x){return S(Math.round(x.getMilliseconds()/10),2)},SSS:function(x){return S(x.getMilliseconds(),3)},a:function(x,H){return x.getHours()<12?H.amPm[0]:H.amPm[1]},A:function(x,H){return x.getHours()<12?H.amPm[0].toUpperCase():H.amPm[1].toUpperCase()},ZZ:function(x){var H=x.getTimezoneOffset();return(H>0?"-":"+")+S(100*Math.floor(Math.abs(H)/60)+Math.abs(H)%60,4)},Z:function(x){var H=x.getTimezoneOffset();return(H>0?"-":"+")+S(Math.floor(Math.abs(H)/60),2)+":"+S(Math.abs(H)%60,2)}},L=function(x){return+x-1},O=[null,"[1-9]\\d?"],R=[null,o],m=["isPm",o,function(x,H){var U=x.toLowerCase();return U===H.amPm[0]?0:U===H.amPm[1]?1:null}],M=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(x){var H=(x+"").match(/([+-]|\d\d)/gi);if(H){var U=60*+H[1]+parseInt(H[2],10);return H[0]==="+"?U:-U}return 0}],G={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+o,function(x){return parseInt(x,10)}],M:["month","[1-9]\\d?",L],MM:["month","\\d\\d",L],YY:["year","\\d\\d",function(x){var H=+(""+new Date().getFullYear()).substr(0,2);return+(""+(+x>68?H-1:H)+x)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(x){return 100*+x}],SS:["millisecond","\\d\\d",function(x){return 10*+x}],SSS:["millisecond","\\d{3}"],d:O,dd:O,ddd:R,dddd:R,MMM:["month",o,s("monthNamesShort")],MMMM:["month",o,s("monthNames")],a:m,A:m,ZZ:M,Z:M},Z={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},_=function(x){return g(Z,x)},y=function(x,H,U){if(H===void 0&&(H=Z.default),U===void 0&&(U={}),typeof x=="number"&&(x=new Date(x)),Object.prototype.toString.call(x)!=="[object Date]"||isNaN(x.getTime()))throw new Error("Invalid Date pass to format");var N=[];H=(H=Z[H]||H).replace(l,function(F,A){return N.push(A),"@@@"});var k=g(g({},p),U);return(H=H.replace(r,function(F){return I[F](x,k)})).replace(/@@@/g,function(){return N.shift()})};function C(x,H,U){if(U===void 0&&(U={}),typeof H!="string")throw new Error("Invalid format in fecha parse");if(H=Z[H]||H,x.length>1e3)return null;var N={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},k=[],F=[],A=H.replace(l,function(Y,re){return F.push(h(re)),"@@@"}),b={},B={};A=h(A).replace(r,function(Y){var re=G[Y],oe=re[0],ue=re[1],ve=re[3];if(b[oe])throw new Error("Invalid format. "+oe+" specified twice in format");return b[oe]=!0,ve&&(B[ve]=!0),k.push(re),"("+ue+")"}),Object.keys(B).forEach(function(Y){if(!b[Y])throw new Error("Invalid format. "+Y+" is required in specified format")}),A=A.replace(/@@@/g,function(){return F.shift()});var W=x.match(new RegExp(A,"i"));if(!W)return null;for(var Q=g(g({},p),U),ee=1;ee<W.length;ee++){var ne=k[ee-1],X=ne[0],$=ne[2],E=$?$(W[ee],Q):+W[ee];if(E==null)return null;N[X]=E}N.isPm===1&&N.hour!=null&&+N.hour!=12?N.hour=+N.hour+12:N.isPm===0&&+N.hour==12&&(N.hour=0);for(var j=new Date(N.year,N.month,N.day,N.hour,N.minute,N.second,N.millisecond),V=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],K=(ee=0,V.length);ee<K;ee++)if(b[V[ee][0]]&&N[V[ee][0]]!==j[V[ee][1]]())return null;return N.timezoneOffset==null?j:new Date(Date.UTC(N.year,N.month,N.day,N.hour,N.minute-N.timezoneOffset,N.second,N.millisecond))}var w={format:y,parse:C,defaultI18n:v,setGlobalDateI18n:d,setGlobalDateMasks:_};t.default=w},function(e,t,n){var r=n(59),o=n(12),l=n(3).MESSAGE;e.exports=o(function(u,s){return s.level!==!1&&(u.level=r.strip(u.level)),s.message!==!1&&(u.message=r.strip(u.message)),s.raw!==!1&&u[l]&&(u[l]=r.strip(u[l])),u})},function(e){e.exports=JSON.parse('{"name":"winston","description":"A logger for just about everything.","version":"3.3.3","author":"Charlie Robbins <charlie.robbins@gmail.com>","maintainers":["Jarrett Cruger <jcrugzz@gmail.com>","Chris Alderson <chrisalderson@protonmail.com>","David Hyde <dabh@stanford.edu>"],"repository":{"type":"git","url":"https://github.com/winstonjs/winston.git"},"keywords":["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],"dependencies":{"async":"^3.1.0","@dabh/diagnostics":"^2.0.2","is-stream":"^2.0.0","logform":"^2.2.0","one-time":"^1.0.0","readable-stream":"^3.4.0","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.4.0"},"devDependencies":{"@babel/cli":"^7.10.3","@babel/core":"^7.10.3","@babel/preset-env":"^7.10.3","@types/node":"^14.0.13","abstract-winston-transport":"^0.5.1","assume":"^2.2.0","colors":"^1.4.0","cross-spawn-async":"^2.2.5","eslint-config-populist":"^4.2.0","hock":"^1.4.1","mocha":"^8.0.1","nyc":"^15.1.0","rimraf":"^3.0.2","split2":"^3.1.1","std-mocks":"^1.0.1","through2":"^3.0.1","winston-compat":"^0.1.5"},"main":"./lib/winston","browser":"./dist/winston","types":"./index.d.ts","scripts":{"lint":"populist lib/*.js lib/winston/*.js lib/winston/**/*.js","pretest":"npm run lint","test":"nyc --reporter=text --reporter lcov npm run test:mocha","test:mocha":"mocha test/*.test.js test/**/*.test.js --exit","build":"./node_modules/.bin/rimraf dist && babel lib -d dist","prepublishOnly":"npm run build"},"engines":{"node":">= 6.4.0"},"license":"MIT"}')},function(e,t,n){Object.defineProperty(t,"Console",{configurable:!0,enumerable:!0,get:function(){return n(139)}}),Object.defineProperty(t,"File",{configurable:!0,enumerable:!0,get:function(){return n(148)}}),Object.defineProperty(t,"Http",{configurable:!0,enumerable:!0,get:function(){return n(188)}}),Object.defineProperty(t,"Stream",{configurable:!0,enumerable:!0,get:function(){return n(200)}})},function(e,t,n){(function(r){function o(S){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I})(S)}function l(S,I){if(!(S instanceof I))throw new TypeError("Cannot call a class as a function")}function u(S,I){for(var L=0;L<I.length;L++){var O=I[L];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}function s(S,I){return(s=Object.setPrototypeOf||function(L,O){return L.__proto__=O,L})(S,I)}function g(S){var I=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var L,O=f(S);if(I){var R=f(this).constructor;L=Reflect.construct(O,arguments,R)}else L=O.apply(this,arguments);return c(this,L)}}function c(S,I){return!I||o(I)!=="object"&&typeof I!="function"?function(L){if(L===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L}(S):I}function f(S){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)})(S)}var T=n(18),v=n(3),p=v.LEVEL,d=v.MESSAGE,h=n(20);e.exports=function(S){(function(m,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(M&&M.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),M&&s(m,M)})(R,S);var I,L,O=g(R);function R(){var m,M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return l(this,R),(m=O.call(this,M)).name=M.name||"console",m.stderrLevels=m._stringArrayToSet(M.stderrLevels),m.consoleWarnLevels=m._stringArrayToSet(M.consoleWarnLevels),m.eol=M.eol||T.EOL,m.setMaxListeners(30),m}return I=R,(L=[{key:"log",value:function(m,M){var G=this;return r(function(){return G.emit("logged",m)}),this.stderrLevels[m[p]]?(console._stderr?console._stderr.write("".concat(m[d]).concat(this.eol)):console.error(m[d]),void(M&&M())):this.consoleWarnLevels[m[p]]?(console._stderr?console._stderr.write("".concat(m[d]).concat(this.eol)):console.warn(m[d]),void(M&&M())):(console._stdout?console._stdout.write("".concat(m[d]).concat(this.eol)):console.log(m[d]),void(M&&M()))}},{key:"_stringArrayToSet",value:function(m,M){if(!m)return{};if(M=M||"Cannot make set from type other than Array of string elements",!Array.isArray(m))throw new Error(M);return m.reduce(function(G,Z){if(typeof Z!="string")throw new Error(M);return G[Z]=!0,G},{})}}])&&u(I.prototype,L),R}(h)}).call(this,n(15).setImmediate)},function(e,t,n){(function(r,o){(function(l,u){if(!l.setImmediate){var s,g,c,f,T,v=1,p={},d=!1,h=l.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(l);S=S&&S.setTimeout?S:l,{}.toString.call(l.process)==="[object process]"?s=function(O){o.nextTick(function(){L(O)})}:function(){if(l.postMessage&&!l.importScripts){var O=!0,R=l.onmessage;return l.onmessage=function(){O=!1},l.postMessage("","*"),l.onmessage=R,O}}()?(f="setImmediate$"+Math.random()+"$",T=function(O){O.source===l&&typeof O.data=="string"&&O.data.indexOf(f)===0&&L(+O.data.slice(f.length))},l.addEventListener?l.addEventListener("message",T,!1):l.attachEvent("onmessage",T),s=function(O){l.postMessage(f+O,"*")}):l.MessageChannel?((c=new MessageChannel).port1.onmessage=function(O){L(O.data)},s=function(O){c.port2.postMessage(O)}):h&&"onreadystatechange"in h.createElement("script")?(g=h.documentElement,s=function(O){var R=h.createElement("script");R.onreadystatechange=function(){L(O),R.onreadystatechange=null,g.removeChild(R),R=null},g.appendChild(R)}):s=function(O){setTimeout(L,0,O)},S.setImmediate=function(O){typeof O!="function"&&(O=new Function(""+O));for(var R=new Array(arguments.length-1),m=0;m<R.length;m++)R[m]=arguments[m+1];var M={callback:O,args:R};return p[v]=M,s(v),v++},S.clearImmediate=I}function I(O){delete p[O]}function L(O){if(d)setTimeout(L,0,O);else{var R=p[O];if(R){d=!0;try{(function(m){var M=m.callback,G=m.args;switch(G.length){case 0:M();break;case 1:M(G[0]);break;case 2:M(G[0],G[1]);break;case 3:M(G[0],G[1],G[2]);break;default:M.apply(void 0,G)}})(R)}finally{I(O),d=!1}}}}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(62)},function(e,t,n){(function(r,o){var l=n(16);e.exports=R;var u,s=n(42);R.ReadableState=O,n(21).EventEmitter;var g=function(A,b){return A.listeners(b).length},c=n(63),f=n(44).Buffer,T=r.Uint8Array||function(){},v=Object.create(n(17));v.inherits=n(7);var p=n(143),d=void 0;d=p&&p.debuglog?p.debuglog("stream"):function(){};var h,S=n(144),I=n(64);v.inherits(R,c);var L=["error","close","destroy","pause","resume"];function O(A,b){A=A||{};var B=b instanceof(u=u||n(36));this.objectMode=!!A.objectMode,B&&(this.objectMode=this.objectMode||!!A.readableObjectMode);var W=A.highWaterMark,Q=A.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=W||W===0?W:B&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new S,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=A.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,A.encoding&&(h||(h=n(22).StringDecoder),this.decoder=new h(A.encoding),this.encoding=A.encoding)}function R(A){if(u=u||n(36),!(this instanceof R))return new R(A);this._readableState=new O(A,this),this.readable=!0,A&&(typeof A.read=="function"&&(this._read=A.read),typeof A.destroy=="function"&&(this._destroy=A.destroy)),c.call(this)}function m(A,b,B,W,Q){var ee,ne=A._readableState;return b===null?(ne.reading=!1,function(X,$){if(!$.ended){if($.decoder){var E=$.decoder.end();E&&E.length&&($.buffer.push(E),$.length+=$.objectMode?1:E.length)}$.ended=!0,Z(X)}}(A,ne)):(Q||(ee=function(X,$){var E;j=$,f.isBuffer(j)||j instanceof T||typeof $=="string"||$===void 0||X.objectMode||(E=new TypeError("Invalid non-string/buffer chunk"));var j;return E}(ne,b)),ee?A.emit("error",ee):ne.objectMode||b&&b.length>0?(typeof b=="string"||ne.objectMode||Object.getPrototypeOf(b)===f.prototype||(b=function(X){return f.from(X)}(b)),W?ne.endEmitted?A.emit("error",new Error("stream.unshift() after end event")):M(A,ne,b,!0):ne.ended?A.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!B?(b=ne.decoder.write(b),ne.objectMode||b.length!==0?M(A,ne,b,!1):y(A,ne)):M(A,ne,b,!1))):W||(ne.reading=!1)),function(X){return!X.ended&&(X.needReadable||X.length<X.highWaterMark||X.length===0)}(ne)}function M(A,b,B,W){b.flowing&&b.length===0&&!b.sync?(A.emit("data",B),A.read(0)):(b.length+=b.objectMode?1:B.length,W?b.buffer.unshift(B):b.buffer.push(B),b.needReadable&&Z(A)),y(A,b)}Object.defineProperty(R.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(A){this._readableState&&(this._readableState.destroyed=A)}}),R.prototype.destroy=I.destroy,R.prototype._undestroy=I.undestroy,R.prototype._destroy=function(A,b){this.push(null),b(A)},R.prototype.push=function(A,b){var B,W=this._readableState;return W.objectMode?B=!0:typeof A=="string"&&((b=b||W.defaultEncoding)!==W.encoding&&(A=f.from(A,b),b=""),B=!0),m(this,A,b,!1,B)},R.prototype.unshift=function(A){return m(this,A,null,!0,!1)},R.prototype.isPaused=function(){return this._readableState.flowing===!1},R.prototype.setEncoding=function(A){return h||(h=n(22).StringDecoder),this._readableState.decoder=new h(A),this._readableState.encoding=A,this};function G(A,b){return A<=0||b.length===0&&b.ended?0:b.objectMode?1:A!=A?b.flowing&&b.length?b.buffer.head.data.length:b.length:(A>b.highWaterMark&&(b.highWaterMark=function(B){return B>=8388608?B=8388608:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}(A)),A<=b.length?A:b.ended?b.length:(b.needReadable=!0,0))}function Z(A){var b=A._readableState;b.needReadable=!1,b.emittedReadable||(d("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?l.nextTick(_,A):_(A))}function _(A){d("emit readable"),A.emit("readable"),H(A)}function y(A,b){b.readingMore||(b.readingMore=!0,l.nextTick(C,A,b))}function C(A,b){for(var B=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length<b.highWaterMark&&(d("maybeReadMore read 0"),A.read(0),B!==b.length);)B=b.length;b.readingMore=!1}function w(A){d("readable nexttick read 0"),A.read(0)}function x(A,b){b.reading||(d("resume read 0"),A.read(0)),b.resumeScheduled=!1,b.awaitDrain=0,A.emit("resume"),H(A),b.flowing&&!b.reading&&A.read(0)}function H(A){var b=A._readableState;for(d("flow",b.flowing);b.flowing&&A.read()!==null;);}function U(A,b){return b.length===0?null:(b.objectMode?B=b.buffer.shift():!A||A>=b.length?(B=b.decoder?b.buffer.join(""):b.buffer.length===1?b.buffer.head.data:b.buffer.concat(b.length),b.buffer.clear()):B=function(W,Q,ee){var ne;return W<Q.head.data.length?(ne=Q.head.data.slice(0,W),Q.head.data=Q.head.data.slice(W)):ne=W===Q.head.data.length?Q.shift():ee?function(X,$){var E=$.head,j=1,V=E.data;for(X-=V.length;E=E.next;){var K=E.data,Y=X>K.length?K.length:X;if(Y===K.length?V+=K:V+=K.slice(0,X),(X-=Y)===0){Y===K.length?(++j,E.next?$.head=E.next:$.head=$.tail=null):($.head=E,E.data=K.slice(Y));break}++j}return $.length-=j,V}(W,Q):function(X,$){var E=f.allocUnsafe(X),j=$.head,V=1;for(j.data.copy(E),X-=j.data.length;j=j.next;){var K=j.data,Y=X>K.length?K.length:X;if(K.copy(E,E.length-X,0,Y),(X-=Y)===0){Y===K.length?(++V,j.next?$.head=j.next:$.head=$.tail=null):($.head=j,j.data=K.slice(Y));break}++V}return $.length-=V,E}(W,Q),ne}(A,b.buffer,b.decoder),B);var B}function N(A){var b=A._readableState;if(b.length>0)throw new Error('"endReadable()" called on non-empty stream');b.endEmitted||(b.ended=!0,l.nextTick(k,b,A))}function k(A,b){A.endEmitted||A.length!==0||(A.endEmitted=!0,b.readable=!1,b.emit("end"))}function F(A,b){for(var B=0,W=A.length;B<W;B++)if(A[B]===b)return B;return-1}R.prototype.read=function(A){d("read",A),A=parseInt(A,10);var b=this._readableState,B=A;if(A!==0&&(b.emittedReadable=!1),A===0&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return d("read: emitReadable",b.length,b.ended),b.length===0&&b.ended?N(this):Z(this),null;if((A=G(A,b))===0&&b.ended)return b.length===0&&N(this),null;var W,Q=b.needReadable;return d("need readable",Q),(b.length===0||b.length-A<b.highWaterMark)&&d("length less than watermark",Q=!0),b.ended||b.reading?d("reading or ended",Q=!1):Q&&(d("do read"),b.reading=!0,b.sync=!0,b.length===0&&(b.needReadable=!0),this._read(b.highWaterMark),b.sync=!1,b.reading||(A=G(B,b))),(W=A>0?U(A,b):null)===null?(b.needReadable=!0,A=0):b.length-=A,b.length===0&&(b.ended||(b.needReadable=!0),B!==A&&b.ended&&N(this)),W!==null&&this.emit("data",W),W},R.prototype._read=function(A){this.emit("error",new Error("_read() is not implemented"))},R.prototype.pipe=function(A,b){var B=this,W=this._readableState;switch(W.pipesCount){case 0:W.pipes=A;break;case 1:W.pipes=[W.pipes,A];break;default:W.pipes.push(A)}W.pipesCount+=1,d("pipe count=%d opts=%j",W.pipesCount,b);var Q=(!b||b.end!==!1)&&A!==o.stdout&&A!==o.stderr?ne:re;function ee(oe,ue){d("onunpipe"),oe===B&&ue&&ue.hasUnpiped===!1&&(ue.hasUnpiped=!0,d("cleanup"),A.removeListener("close",K),A.removeListener("finish",Y),A.removeListener("drain",X),A.removeListener("error",V),A.removeListener("unpipe",ee),B.removeListener("end",ne),B.removeListener("end",re),B.removeListener("data",j),$=!0,!W.awaitDrain||A._writableState&&!A._writableState.needDrain||X())}function ne(){d("onend"),A.end()}W.endEmitted?l.nextTick(Q):B.once("end",Q),A.on("unpipe",ee);var X=function(oe){return function(){var ue=oe._readableState;d("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&g(oe,"data")&&(ue.flowing=!0,H(oe))}}(B);A.on("drain",X);var $=!1,E=!1;function j(oe){d("ondata"),E=!1,A.write(oe)!==!1||E||((W.pipesCount===1&&W.pipes===A||W.pipesCount>1&&F(W.pipes,A)!==-1)&&!$&&(d("false write response, pause",B._readableState.awaitDrain),B._readableState.awaitDrain++,E=!0),B.pause())}function V(oe){d("onerror",oe),re(),A.removeListener("error",V),g(A,"error")===0&&A.emit("error",oe)}function K(){A.removeListener("finish",Y),re()}function Y(){d("onfinish"),A.removeListener("close",K),re()}function re(){d("unpipe"),B.unpipe(A)}return B.on("data",j),function(oe,ue,ve){if(typeof oe.prependListener=="function")return oe.prependListener(ue,ve);oe._events&&oe._events[ue]?s(oe._events[ue])?oe._events[ue].unshift(ve):oe._events[ue]=[ve,oe._events[ue]]:oe.on(ue,ve)}(A,"error",V),A.once("close",K),A.once("finish",Y),A.emit("pipe",B),W.flowing||(d("pipe resume"),B.resume()),A},R.prototype.unpipe=function(A){var b=this._readableState,B={hasUnpiped:!1};if(b.pipesCount===0)return this;if(b.pipesCount===1)return A&&A!==b.pipes||(A||(A=b.pipes),b.pipes=null,b.pipesCount=0,b.flowing=!1,A&&A.emit("unpipe",this,B)),this;if(!A){var W=b.pipes,Q=b.pipesCount;b.pipes=null,b.pipesCount=0,b.flowing=!1;for(var ee=0;ee<Q;ee++)W[ee].emit("unpipe",this,B);return this}var ne=F(b.pipes,A);return ne===-1||(b.pipes.splice(ne,1),b.pipesCount-=1,b.pipesCount===1&&(b.pipes=b.pipes[0]),A.emit("unpipe",this,B)),this},R.prototype.on=function(A,b){var B=c.prototype.on.call(this,A,b);if(A==="data")this._readableState.flowing!==!1&&this.resume();else if(A==="readable"){var W=this._readableState;W.endEmitted||W.readableListening||(W.readableListening=W.needReadable=!0,W.emittedReadable=!1,W.reading?W.length&&Z(this):l.nextTick(w,this))}return B},R.prototype.addListener=R.prototype.on,R.prototype.resume=function(){var A=this._readableState;return A.flowing||(d("resume"),A.flowing=!0,function(b,B){B.resumeScheduled||(B.resumeScheduled=!0,l.nextTick(x,b,B))}(this,A)),this},R.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},R.prototype.wrap=function(A){var b=this,B=this._readableState,W=!1;for(var Q in A.on("end",function(){if(d("wrapped end"),B.decoder&&!B.ended){var ne=B.decoder.end();ne&&ne.length&&b.push(ne)}b.push(null)}),A.on("data",function(ne){d("wrapped data"),B.decoder&&(ne=B.decoder.write(ne)),B.objectMode&&ne==null||(B.objectMode||ne&&ne.length)&&(b.push(ne)||(W=!0,A.pause()))}),A)this[Q]===void 0&&typeof A[Q]=="function"&&(this[Q]=function(ne){return function(){return A[ne].apply(A,arguments)}}(Q));for(var ee=0;ee<L.length;ee++)A.on(L[ee],this.emit.bind(this,L[ee]));return this._read=function(ne){d("wrapped _read",ne),W&&(W=!1,A.resume())},this},Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),R._fromList=U}).call(this,n(6),n(2))},function(e,t){},function(e,t,n){var r=n(44).Buffer,o=n(145);e.exports=function(){function l(){(function(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")})(this,l),this.head=null,this.tail=null,this.length=0}return l.prototype.push=function(u){var s={data:u,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},l.prototype.unshift=function(u){var s={data:u,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},l.prototype.shift=function(){if(this.length!==0){var u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}},l.prototype.clear=function(){this.head=this.tail=null,this.length=0},l.prototype.join=function(u){if(this.length===0)return"";for(var s=this.head,g=""+s.data;s=s.next;)g+=u+s.data;return g},l.prototype.concat=function(u){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var s,g,c,f=r.allocUnsafe(u>>>0),T=this.head,v=0;T;)s=T.data,g=f,c=v,s.copy(g,c),v+=T.data.length,T=T.next;return f},l}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var l=o.inspect({length:this.length});return this.constructor.name+" "+l})},function(e,t){},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=o(s);return g!==void 0?typeof c=="string"?f.fill(g,c):f.fill(g):f.fill(0),f},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){var r=n(13),o=n(3).LEVEL,l=n(20),u=e.exports=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(l.call(this,s),!s.transport||typeof s.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");function g(c){this.emit("error",c,this.transport)}this.transport=s.transport,this.level=this.level||s.transport.level,this.handleExceptions=this.handleExceptions||s.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=g.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(u,l),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);(!this.level||this.levels[this.level]>=this.levels[s[o]])&&this.transport.log(s[o],s.message,s,this._nop),c(null)},u.prototype._writev=function(s,g){for(var c=0;c<s.length;c++)this._accept(s[c])&&(this.transport.log(s[c].chunk[o],s[c].chunk.message,s[c].chunk,this._nop),s[c].callback());return g(null)},u.prototype._deprecated=function(){console.error([this.transport.name+" is a legacy winston transport. Consider upgrading: ","- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
38
- `))},u.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){(function(r,o){function l(_){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y})(_)}function u(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function s(_,y){for(var C=0;C<y.length;C++){var w=y[C];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(_,w.key,w)}}function g(_,y){return(g=Object.setPrototypeOf||function(C,w){return C.__proto__=w,C})(_,y)}function c(_){var y=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var C,w=v(_);if(y){var x=v(this).constructor;C=Reflect.construct(w,arguments,x)}else C=w.apply(this,arguments);return f(this,C)}}function f(_,y){return!y||l(y)!=="object"&&typeof y!="function"?T(_):y}function T(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function v(_){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)})(_)}var p=n(65),d=n(56),h=n(149),S=n(159),I=n(3).MESSAGE,L=n(33),O=L.Stream,R=L.PassThrough,m=n(20),M=n(38)("winston:file"),G=n(18),Z=n(187);e.exports=function(_){(function(H,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(U&&U.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),U&&g(H,U)})(x,_);var y,C,w=c(x);function x(){var H,U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function N(k){for(var F=arguments.length,A=new Array(F>1?F-1:0),b=1;b<F;b++)A[b-1]=arguments[b];A.slice(1).forEach(function(B){if(U[B])throw new Error("Cannot set ".concat(B," and ").concat(k," together"))})}if(u(this,x),(H=w.call(this,U)).name=U.name||"file",H._stream=new R,H._stream.setMaxListeners(30),H._onError=H._onError.bind(T(H)),U.filename||U.dirname)N("filename or dirname","stream"),H._basename=H.filename=U.filename?d.basename(U.filename):"winston.log",H.dirname=U.dirname||d.dirname(U.filename),H.options=U.options||{flags:"a"};else{if(!U.stream)throw new Error("Cannot log to file without filename or stream.");console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),N("stream","filename","maxsize"),H._dest=H._stream.pipe(H._setupStream(U.stream)),H.dirname=d.dirname(H._dest.path)}return H.maxsize=U.maxsize||null,H.rotationFormat=U.rotationFormat||!1,H.zippedArchive=U.zippedArchive||!1,H.maxFiles=U.maxFiles||null,H.eol=U.eol||G.EOL,H.tailable=U.tailable||!1,H._size=0,H._pendingSize=0,H._created=0,H._drain=!1,H._opening=!1,H._ending=!1,H.dirname&&H._createLogDirIfNotExist(H.dirname),H.open(),H}return y=x,(C=[{key:"finishIfEnding",value:function(){var H=this;this._ending&&(this._opening?this.once("open",function(){H._stream.once("finish",function(){return H.emit("finish")}),r(function(){return H._stream.end()})}):(this._stream.once("finish",function(){return H.emit("finish")}),r(function(){return H._stream.end()})))}},{key:"log",value:function(H){var U=this,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return N(),!0;if(this._drain)this._stream.once("drain",function(){U._drain=!1,U.log(H,N)});else{if(!this._rotate){var k="".concat(H[I]).concat(this.eol),F=o.byteLength(k);this._pendingSize+=F,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var A=this._stream.write(k,b.bind(this));return A?N():(this._drain=!0,this._stream.once("drain",function(){U._drain=!1,N()})),M("written",A,this._drain),this.finishIfEnding(),A}this._stream.once("rotate",function(){U._rotate=!1,U.log(H,N)})}function b(){var B=this;this._size+=F,this._pendingSize-=F,M("logged %s %s",this._size,k),this.emit("logged",H),this._opening||this._needsNewFile()&&(this._rotate=!0,this._endStream(function(){return B._rotateFile()}))}}},{key:"query",value:function(H,U){typeof H=="function"&&(U=H,H={}),H=function(W){return(W=W||{}).rows=W.rows||W.limit||10,W.start=W.start||0,W.until=W.until||new Date,l(W.until)!=="object"&&(W.until=new Date(W.until)),W.from=W.from||W.until-864e5,l(W.from)!=="object"&&(W.from=new Date(W.from)),W.order=W.order||"desc",W}(H);var N=d.join(this.dirname,this.filename),k="",F=[],A=0,b=p.createReadStream(N,{encoding:"utf8"});function B(W,Q){try{var ee=JSON.parse(W);(function(ne){if(ne&&l(ne)==="object"){var X=new Date(ne.timestamp);if(!(H.from&&X<H.from||H.until&&X>H.until||H.level&&H.level!==ne.level))return!0}})(ee)&&function(ne){H.rows&&F.length>=H.rows&&H.order!=="desc"?b.readable&&b.destroy():(H.fields&&(ne=H.fields.reduce(function(X,$){return X[$]=ne[$],X},{})),H.order==="desc"&&F.length>=H.rows&&F.shift(),F.push(ne))}(ee)}catch(ne){Q||b.emit("error",ne)}}b.on("error",function(W){if(b.readable&&b.destroy(),U)return W.code!=="ENOENT"?U(W):U(null,F)}),b.on("data",function(W){for(var Q=(W=(k+W).split(/\n+/)).length-1,ee=0;ee<Q;ee++)(!H.start||A>=H.start)&&B(W[ee]),A++;k=W[Q]}),b.on("close",function(){k&&B(k,!0),H.order==="desc"&&(F=F.reverse()),U&&U(null,F)})}},{key:"stream",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=d.join(this.dirname,this.filename),N=new O,k={file:U,start:H.start};return N.destroy=Z(k,function(F,A){if(F)return N.emit("error",F);try{N.emit("data",A),A=JSON.parse(A),N.emit("log",A)}catch(b){N.emit("error",b)}}),N}},{key:"open",value:function(){var H=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(U,N){if(U)return H.emit("error",U);M("stat done: %s { size: %s }",H.filename,N),H._size=N,H._dest=H._createStream(H._stream),H._opening=!1,H.once("open",function(){H._stream.eventNames().includes("rotate")?H._stream.emit("rotate"):H._rotate=!1})})))}},{key:"stat",value:function(H){var U=this,N=this._getFile(),k=d.join(this.dirname,N);p.stat(k,function(F,A){return F&&F.code==="ENOENT"?(M("ENOENT ok",k),U.filename=N,H(null,0)):F?(M("err ".concat(F.code," ").concat(k)),H(F)):!A||U._needsNewFile(A.size)?U._incFile(function(){return U.stat(H)}):(U.filename=N,void H(null,A.size))})}},{key:"close",value:function(H){var U=this;this._stream&&this._stream.end(function(){H&&H(),U.emit("flush"),U.emit("closed")})}},{key:"_needsNewFile",value:function(H){return H=H||this._size,this.maxsize&&H>=this.maxsize}},{key:"_onError",value:function(H){this.emit("error",H)}},{key:"_setupStream",value:function(H){return H.on("error",this._onError),H}},{key:"_cleanupStream",value:function(H){return H.removeListener("error",this._onError),H}},{key:"_rotateFile",value:function(){var H=this;this._incFile(function(){return H.open()})}},{key:"_endStream",value:function(){var H=this,U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){H._cleanupStream(H._dest),U()})):U()}},{key:"_createStream",value:function(H){var U=this,N=d.join(this.dirname,this.filename);M("create stream start",N,this.options);var k=p.createWriteStream(N,this.options).on("error",function(A){return M(A)}).on("close",function(){return M("close",k.path,k.bytesWritten)}).on("open",function(){M("file open ok",N),U.emit("open",N),H.pipe(k),U.rotatedWhileOpening&&(U._stream=new R,U._stream.setMaxListeners(30),U._rotateFile(),U.rotatedWhileOpening=!1,U._cleanupStream(k),H.end())});if(M("create stream ok",N),this.zippedArchive){var F=S.createGzip();return F.pipe(k),F}return k}},{key:"_incFile",value:function(H){M("_incFile",this.filename);var U=d.extname(this._basename),N=d.basename(this._basename,U);this.tailable?this._checkMaxFilesTailable(U,N,H):(this._created+=1,this._checkMaxFilesIncrementing(U,N,H))}},{key:"_getFile",value:function(){var H=d.extname(this._basename),U=d.basename(this._basename,H),N=this.rotationFormat?this.rotationFormat():this._created,k=!this.tailable&&this._created?"".concat(U).concat(N).concat(H):"".concat(U).concat(H);return this.zippedArchive&&!this.tailable?"".concat(k,".gz"):k}},{key:"_checkMaxFilesIncrementing",value:function(H,U,N){if(!this.maxFiles||this._created<this.maxFiles)return r(N);var k=this._created-this.maxFiles,F=k!==0?k:"",A=this.zippedArchive?".gz":"",b="".concat(U).concat(F).concat(H).concat(A),B=d.join(this.dirname,b);p.unlink(B,N)}},{key:"_checkMaxFilesTailable",value:function(H,U,N){var k=this,F=[];if(this.maxFiles){for(var A=this.zippedArchive?".gz":"",b=this.maxFiles-1;b>1;b--)F.push(function(B,W){var Q=this,ee="".concat(U).concat(B-1).concat(H).concat(A),ne=d.join(this.dirname,ee);p.exists(ne,function(X){if(!X)return W(null);ee="".concat(U).concat(B).concat(H).concat(A),p.rename(ne,d.join(Q.dirname,ee),W)})}.bind(this,b));h(F,function(){p.rename(d.join(k.dirname,"".concat(U).concat(H)),d.join(k.dirname,"".concat(U,"1").concat(H).concat(A)),N)})}}},{key:"_createLogDirIfNotExist",value:function(H){p.existsSync(H)||p.mkdirSync(H,{recursive:!0})}}])&&s(y.prototype,C),x}(m)}).call(this,n(15).setImmediate,n(5).Buffer)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u,s){return(0,r.default)(o.default,u,s)};var r=l(n(150)),o=l(n(154));function l(u){return u&&u.__esModule?u:{default:u}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(45)),o=u(n(25)),l=u(n(31));function u(s){return s&&s.__esModule?s:{default:s}}t.default=(0,l.default)((s,g,c)=>{var f=(0,r.default)(g)?[]:{};s(g,(T,v,p)=>{(0,o.default)(T)((d,...h)=>{h.length<2&&([h]=h),f[v]=h,p(d)})},T=>c(T,f))},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(c){return(0,l.isAsync)(c)?function(...f){const T=f.pop();return s(c.apply(this,f),T)}:(0,r.default)(function(f,T){var v;try{v=c.apply(this,f)}catch(p){return T(p)}if(v&&typeof v.then=="function")return s(v,T);T(null,v)})};var r=u(n(152)),o=u(n(153)),l=n(25);function u(c){return c&&c.__esModule?c:{default:c}}function s(c,f){return c.then(T=>{g(f,null,T)},T=>{g(f,T&&T.message?T:new Error(T))})}function g(c,f,T){try{c(f,T)}catch(v){(0,o.default)(p=>{throw p},v)}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...o){var l=o.pop();return r.call(this,o,l)}},e.exports=t.default},function(e,t,n){(function(r,o){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=c,t.wrap=f;var l,u=t.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,s=t.hasSetImmediate=typeof r=="function"&&r,g=t.hasNextTick=typeof o=="object"&&typeof o.nextTick=="function";function c(T){setTimeout(T,0)}function f(T){return(v,...p)=>T(()=>v(...p))}l=u?queueMicrotask:s?r:g?o.nextTick:c,t.default=f(l)}).call(this,n(15).setImmediate,n(2))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(66)),o=l(n(31));function l(u){return u&&u.__esModule?u:{default:u}}t.default=(0,o.default)(function(u,s,g){return(0,r.default)(u,1,s,g)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(67)),o=c(n(156)),l=c(n(68)),u=n(25),s=c(n(158)),g=c(n(46));function c(f){return f&&f.__esModule?f:{default:f}}t.default=f=>(T,v,p)=>{if(p=(0,r.default)(p),f<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!T)return p(null);if((0,u.isAsyncGenerator)(T))return(0,s.default)(T,f,v,p);if((0,u.isAsyncIterable)(T))return(0,s.default)(T[Symbol.asyncIterator](),f,v,p);var d=(0,o.default)(T),h=!1,S=!1,I=0,L=!1;function O(m,M){if(!S)if(I-=1,m)h=!0,p(m);else if(m===!1)h=!0,S=!0;else{if(M===g.default||h&&I<=0)return h=!0,p(null);L||R()}}function R(){for(L=!0;I<f&&!h;){var m=d();if(m===null)return h=!0,void(I<=0&&p(null));I+=1,v(m.value,m.key,(0,l.default)(O))}L=!1}R()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u){if((0,r.default)(u))return function(v){var p=-1,d=v.length;return function(){return++p<d?{value:v[p],key:p}:null}}(u);var s=(0,o.default)(u);return s?function(v){var p=-1;return function(){var d=v.next();return d.done?null:(p++,{value:d.value,key:p})}}(s):(g=u,c=g?Object.keys(g):[],f=-1,T=c.length,function v(){var p=c[++f];return p==="__proto__"?v():f<T?{value:g[p],key:p}:null});var g,c,f,T};var r=l(n(45)),o=l(n(157));function l(u){return u&&u.__esModule?u:{default:u}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u,s,g,c){let f=!1,T=!1,v=!1,p=0,d=0;function h(){p>=s||v||f||(v=!0,u.next().then(({value:L,done:O})=>{if(!T&&!f){if(v=!1,O)return f=!0,void(p<=0&&c(null));p++,g(L,d,S),d++,h()}}).catch(I))}function S(L,O){if(p-=1,!T)return L?I(L):L===!1?(f=!0,void(T=!0)):O===l.default||f&&p<=0?(f=!0,c(null)):void h()}function I(L){T||(v=!1,f=!0,c(L))}h()};var r,o=n(46),l=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){(function(r){var o=n(5).Buffer,l=n(160).Transform,u=n(168),s=n(13),g=n(74).ok,c=n(5).kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";u.Z_MIN_WINDOWBITS=8,u.Z_MAX_WINDOWBITS=15,u.Z_DEFAULT_WINDOWBITS=15,u.Z_MIN_CHUNK=64,u.Z_MAX_CHUNK=1/0,u.Z_DEFAULT_CHUNK=16384,u.Z_MIN_MEMLEVEL=1,u.Z_MAX_MEMLEVEL=9,u.Z_DEFAULT_MEMLEVEL=8,u.Z_MIN_LEVEL=-1,u.Z_MAX_LEVEL=9,u.Z_DEFAULT_LEVEL=u.Z_DEFAULT_COMPRESSION;for(var T=Object.keys(u),v=0;v<T.length;v++){var p=T[v];p.match(/^Z/)&&Object.defineProperty(t,p,{enumerable:!0,value:u[p],writable:!1})}for(var d={Z_OK:u.Z_OK,Z_STREAM_END:u.Z_STREAM_END,Z_NEED_DICT:u.Z_NEED_DICT,Z_ERRNO:u.Z_ERRNO,Z_STREAM_ERROR:u.Z_STREAM_ERROR,Z_DATA_ERROR:u.Z_DATA_ERROR,Z_MEM_ERROR:u.Z_MEM_ERROR,Z_BUF_ERROR:u.Z_BUF_ERROR,Z_VERSION_ERROR:u.Z_VERSION_ERROR},h=Object.keys(d),S=0;S<h.length;S++){var I=h[S];d[d[I]]=I}function L(U,N,k){var F=[],A=0;function b(){for(var W;(W=U.read())!==null;)F.push(W),A+=W.length;U.once("readable",b)}function B(){var W,Q=null;A>=c?Q=new RangeError(f):W=o.concat(F,A),F=[],U.close(),k(Q,W)}U.on("error",function(W){U.removeListener("end",B),U.removeListener("readable",b),k(W)}),U.on("end",B),U.end(N),b()}function O(U,N){if(typeof N=="string"&&(N=o.from(N)),!o.isBuffer(N))throw new TypeError("Not a string or buffer");var k=U._finishFlushFlag;return U._processChunk(N,k)}function R(U){if(!(this instanceof R))return new R(U);w.call(this,U,u.DEFLATE)}function m(U){if(!(this instanceof m))return new m(U);w.call(this,U,u.INFLATE)}function M(U){if(!(this instanceof M))return new M(U);w.call(this,U,u.GZIP)}function G(U){if(!(this instanceof G))return new G(U);w.call(this,U,u.GUNZIP)}function Z(U){if(!(this instanceof Z))return new Z(U);w.call(this,U,u.DEFLATERAW)}function _(U){if(!(this instanceof _))return new _(U);w.call(this,U,u.INFLATERAW)}function y(U){if(!(this instanceof y))return new y(U);w.call(this,U,u.UNZIP)}function C(U){return U===u.Z_NO_FLUSH||U===u.Z_PARTIAL_FLUSH||U===u.Z_SYNC_FLUSH||U===u.Z_FULL_FLUSH||U===u.Z_FINISH||U===u.Z_BLOCK}function w(U,N){var k=this;if(this._opts=U=U||{},this._chunkSize=U.chunkSize||t.Z_DEFAULT_CHUNK,l.call(this,U),U.flush&&!C(U.flush))throw new Error("Invalid flush flag: "+U.flush);if(U.finishFlush&&!C(U.finishFlush))throw new Error("Invalid flush flag: "+U.finishFlush);if(this._flushFlag=U.flush||u.Z_NO_FLUSH,this._finishFlushFlag=U.finishFlush!==void 0?U.finishFlush:u.Z_FINISH,U.chunkSize&&(U.chunkSize<t.Z_MIN_CHUNK||U.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+U.chunkSize);if(U.windowBits&&(U.windowBits<t.Z_MIN_WINDOWBITS||U.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+U.windowBits);if(U.level&&(U.level<t.Z_MIN_LEVEL||U.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+U.level);if(U.memLevel&&(U.memLevel<t.Z_MIN_MEMLEVEL||U.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+U.memLevel);if(U.strategy&&U.strategy!=t.Z_FILTERED&&U.strategy!=t.Z_HUFFMAN_ONLY&&U.strategy!=t.Z_RLE&&U.strategy!=t.Z_FIXED&&U.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+U.strategy);if(U.dictionary&&!o.isBuffer(U.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new u.Zlib(N);var F=this;this._hadError=!1,this._handle.onerror=function(B,W){x(F),F._hadError=!0;var Q=new Error(B);Q.errno=W,Q.code=t.codes[W],F.emit("error",Q)};var A=t.Z_DEFAULT_COMPRESSION;typeof U.level=="number"&&(A=U.level);var b=t.Z_DEFAULT_STRATEGY;typeof U.strategy=="number"&&(b=U.strategy),this._handle.init(U.windowBits||t.Z_DEFAULT_WINDOWBITS,A,U.memLevel||t.Z_DEFAULT_MEMLEVEL,b,U.dictionary),this._buffer=o.allocUnsafe(this._chunkSize),this._offset=0,this._level=A,this._strategy=b,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!k._handle},configurable:!0,enumerable:!0})}function x(U,N){N&&r.nextTick(N),U._handle&&(U._handle.close(),U._handle=null)}function H(U){U.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=R,t.Inflate=m,t.Gzip=M,t.Gunzip=G,t.DeflateRaw=Z,t.InflateRaw=_,t.Unzip=y,t.createDeflate=function(U){return new R(U)},t.createInflate=function(U){return new m(U)},t.createDeflateRaw=function(U){return new Z(U)},t.createInflateRaw=function(U){return new _(U)},t.createGzip=function(U){return new M(U)},t.createGunzip=function(U){return new G(U)},t.createUnzip=function(U){return new y(U)},t.deflate=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new R(N),U,k)},t.deflateSync=function(U,N){return O(new R(N),U)},t.gzip=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new M(N),U,k)},t.gzipSync=function(U,N){return O(new M(N),U)},t.deflateRaw=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new Z(N),U,k)},t.deflateRawSync=function(U,N){return O(new Z(N),U)},t.unzip=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new y(N),U,k)},t.unzipSync=function(U,N){return O(new y(N),U)},t.inflate=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new m(N),U,k)},t.inflateSync=function(U,N){return O(new m(N),U)},t.gunzip=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new G(N),U,k)},t.gunzipSync=function(U,N){return O(new G(N),U)},t.inflateRaw=function(U,N,k){return typeof N=="function"&&(k=N,N={}),L(new _(N),U,k)},t.inflateRawSync=function(U,N){return O(new _(N),U)},s.inherits(w,l),w.prototype.params=function(U,N,k){if(U<t.Z_MIN_LEVEL||U>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+U);if(N!=t.Z_FILTERED&&N!=t.Z_HUFFMAN_ONLY&&N!=t.Z_RLE&&N!=t.Z_FIXED&&N!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+N);if(this._level!==U||this._strategy!==N){var F=this;this.flush(u.Z_SYNC_FLUSH,function(){g(F._handle,"zlib binding closed"),F._handle.params(U,N),F._hadError||(F._level=U,F._strategy=N,k&&k())})}else r.nextTick(k)},w.prototype.reset=function(){return g(this._handle,"zlib binding closed"),this._handle.reset()},w.prototype._flush=function(U){this._transform(o.alloc(0),"",U)},w.prototype.flush=function(U,N){var k=this,F=this._writableState;(typeof U=="function"||U===void 0&&!N)&&(N=U,U=u.Z_FULL_FLUSH),F.ended?N&&r.nextTick(N):F.ending?N&&this.once("end",N):F.needDrain?N&&this.once("drain",function(){return k.flush(U,N)}):(this._flushFlag=U,this.write(o.alloc(0),"",N))},w.prototype.close=function(U){x(this,U),r.nextTick(H,this)},w.prototype._transform=function(U,N,k){var F,A=this._writableState,b=(A.ending||A.ended)&&(!U||A.length===U.length);return U===null||o.isBuffer(U)?this._handle?(b?F=this._finishFlushFlag:(F=this._flushFlag,U.length>=A.length&&(this._flushFlag=this._opts.flush||u.Z_NO_FLUSH)),void this._processChunk(U,F,k)):k(new Error("zlib binding closed")):k(new Error("invalid input"))},w.prototype._processChunk=function(U,N,k){var F=U&&U.length,A=this._chunkSize-this._offset,b=0,B=this,W=typeof k=="function";if(!W){var Q,ee=[],ne=0;this.on("error",function(V){Q=V}),g(this._handle,"zlib binding closed");do var X=this._handle.writeSync(N,U,b,F,this._buffer,this._offset,A);while(!this._hadError&&j(X[0],X[1]));if(this._hadError)throw Q;if(ne>=c)throw x(this),new RangeError(f);var $=o.concat(ee,ne);return x(this),$}g(this._handle,"zlib binding closed");var E=this._handle.write(N,U,b,F,this._buffer,this._offset,A);function j(V,K){if(this&&(this.buffer=null,this.callback=null),!B._hadError){var Y=A-K;if(g(Y>=0,"have should not go down"),Y>0){var re=B._buffer.slice(B._offset,B._offset+Y);B._offset+=Y,W?B.push(re):(ee.push(re),ne+=re.length)}if((K===0||B._offset>=B._chunkSize)&&(A=B._chunkSize,B._offset=0,B._buffer=o.allocUnsafe(B._chunkSize)),K===0){if(b+=F-V,F=V,!W)return!0;var oe=B._handle.write(N,U,b,F,B._buffer,B._offset,B._chunkSize);return oe.callback=j,void(oe.buffer=U)}if(!W)return!1;k()}}E.buffer=U,E.callback=j},s.inherits(R,w),s.inherits(m,w),s.inherits(M,w),s.inherits(G,w),s.inherits(Z,w),s.inherits(_,w),s.inherits(y,w)}).call(this,n(2))},function(e,t,n){e.exports=o;var r=n(21).EventEmitter;function o(){r.call(this)}n(7)(o,r),o.Readable=n(32),o.Writable=n(73),o.Duplex=n(165),o.Transform=n(166),o.PassThrough=n(167),o.Stream=o,o.prototype.pipe=function(l,u){var s=this;function g(h){l.writable&&l.write(h)===!1&&s.pause&&s.pause()}function c(){s.readable&&s.resume&&s.resume()}s.on("data",g),l.on("drain",c),l._isStdio||u&&u.end===!1||(s.on("end",T),s.on("close",v));var f=!1;function T(){f||(f=!0,l.end())}function v(){f||(f=!0,typeof l.destroy=="function"&&l.destroy())}function p(h){if(d(),r.listenerCount(this,"error")===0)throw h}function d(){s.removeListener("data",g),l.removeListener("drain",c),s.removeListener("end",T),s.removeListener("close",v),s.removeListener("error",p),l.removeListener("error",p),s.removeListener("end",d),s.removeListener("close",d),l.removeListener("close",d)}return s.on("error",p),l.on("error",p),s.on("end",d),s.on("close",d),l.on("close",d),l.emit("pipe",s),l}},function(e,t){},function(e,t,n){var r=n(47).Buffer,o=n(163);e.exports=function(){function l(){(function(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")})(this,l),this.head=null,this.tail=null,this.length=0}return l.prototype.push=function(u){var s={data:u,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},l.prototype.unshift=function(u){var s={data:u,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},l.prototype.shift=function(){if(this.length!==0){var u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}},l.prototype.clear=function(){this.head=this.tail=null,this.length=0},l.prototype.join=function(u){if(this.length===0)return"";for(var s=this.head,g=""+s.data;s=s.next;)g+=u+s.data;return g},l.prototype.concat=function(u){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var s,g,c,f=r.allocUnsafe(u>>>0),T=this.head,v=0;T;)s=T.data,g=f,c=v,s.copy(g,c),v+=T.data.length,T=T.next;return f},l}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var l=o.inspect({length:this.length});return this.constructor.name+" "+l})},function(e,t){},function(e,t,n){e.exports=l;var r=n(72),o=n(17);function l(u){if(!(this instanceof l))return new l(u);r.call(this,u)}o.inherits=n(7),o.inherits(l,r),l.prototype._transform=function(u,s,g){g(null,u)}},function(e,t,n){e.exports=n(23)},function(e,t,n){e.exports=n(32).Transform},function(e,t,n){e.exports=n(32).PassThrough},function(e,t,n){(function(r,o){var l=n(74),u=n(170),s=n(171),g=n(174),c=n(177);for(var f in c)t[f]=c[f];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function T(v){if(typeof v!="number"||v<t.DEFLATE||v>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=v,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}T.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,l(this.init_done,"close before init"),l(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||g.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},T.prototype.write=function(v,p,d,h,S,I,L){return this._write(!0,v,p,d,h,S,I,L)},T.prototype.writeSync=function(v,p,d,h,S,I,L){return this._write(!1,v,p,d,h,S,I,L)},T.prototype._write=function(v,p,d,h,S,I,L,O){if(l.equal(arguments.length,8),l(this.init_done,"write before init"),l(this.mode!==t.NONE,"already finalized"),l.equal(!1,this.write_in_progress,"write already in progress"),l.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,l.equal(!1,p===void 0,"must provide flush value"),this.write_in_progress=!0,p!==t.Z_NO_FLUSH&&p!==t.Z_PARTIAL_FLUSH&&p!==t.Z_SYNC_FLUSH&&p!==t.Z_FULL_FLUSH&&p!==t.Z_FINISH&&p!==t.Z_BLOCK)throw new Error("Invalid flush value");if(d==null&&(d=r.alloc(0),S=0,h=0),this.strm.avail_in=S,this.strm.input=d,this.strm.next_in=h,this.strm.avail_out=O,this.strm.output=I,this.strm.next_out=L,this.flush=p,!v)return this._process(),this._checkError()?this._afterSync():void 0;var R=this;return o.nextTick(function(){R._process(),R._after()}),this},T.prototype._afterSync=function(){var v=this.strm.avail_out,p=this.strm.avail_in;return this.write_in_progress=!1,[p,v]},T.prototype._process=function(){var v=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(v=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(v===null)break;if(this.strm.input[v]!==31){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,v++,this.strm.avail_in===1)break;case 1:if(v===null)break;this.strm.input[v]===139?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=g.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=g.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=g.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=g.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},T.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},T.prototype._after=function(){if(this._checkError()){var v=this.strm.avail_out,p=this.strm.avail_in;this.write_in_progress=!1,this.callback(p,v),this.pending_close&&this.close()}},T.prototype._error=function(v){this.strm.msg&&(v=this.strm.msg),this.onerror(v,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},T.prototype.init=function(v,p,d,h,S){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),l(v>=8&&v<=15,"invalid windowBits"),l(p>=-1&&p<=9,"invalid compression level"),l(d>=1&&d<=9,"invalid memlevel"),l(h===t.Z_FILTERED||h===t.Z_HUFFMAN_ONLY||h===t.Z_RLE||h===t.Z_FIXED||h===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(p,v,d,h,S),this._setDictionary()},T.prototype.params=function(){throw new Error("deflateParams Not supported")},T.prototype.reset=function(){this._reset(),this._setDictionary()},T.prototype._init=function(v,p,d,h,S){switch(this.level=v,this.windowBits=p,this.memLevel=d,this.strategy=h,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new u,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=g.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=S,this.write_in_progress=!1,this.init_done=!0},T.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},T.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=g.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=T}).call(this,n(5).Buffer,n(2))},function(e,t,n){var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;function u(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}e.exports=function(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var g={},c=0;c<10;c++)g["_"+String.fromCharCode(c)]=c;if(Object.getOwnPropertyNames(g).map(function(T){return g[T]}).join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(T){f[T]=T}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(s,g){for(var c,f,T=u(s),v=1;v<arguments.length;v++){for(var p in c=Object(arguments[v]))o.call(c,p)&&(T[p]=c[p]);if(r){f=r(c);for(var d=0;d<f.length;d++)l.call(c,f[d])&&(T[f[d]]=c[f[d]])}}return T}},function(e,t,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){var r,o=n(37),l=n(172),u=n(75),s=n(76),g=n(173);function c(_,y){return _.msg=g[y],y}function f(_){return(_<<1)-(_>4?9:0)}function T(_){for(var y=_.length;--y>=0;)_[y]=0}function v(_){var y=_.state,C=y.pending;C>_.avail_out&&(C=_.avail_out),C!==0&&(o.arraySet(_.output,y.pending_buf,y.pending_out,C,_.next_out),_.next_out+=C,y.pending_out+=C,_.total_out+=C,_.avail_out-=C,y.pending-=C,y.pending===0&&(y.pending_out=0))}function p(_,y){l._tr_flush_block(_,_.block_start>=0?_.block_start:-1,_.strstart-_.block_start,y),_.block_start=_.strstart,v(_.strm)}function d(_,y){_.pending_buf[_.pending++]=y}function h(_,y){_.pending_buf[_.pending++]=y>>>8&255,_.pending_buf[_.pending++]=255&y}function S(_,y){var C,w,x=_.max_chain_length,H=_.strstart,U=_.prev_length,N=_.nice_match,k=_.strstart>_.w_size-262?_.strstart-(_.w_size-262):0,F=_.window,A=_.w_mask,b=_.prev,B=_.strstart+258,W=F[H+U-1],Q=F[H+U];_.prev_length>=_.good_match&&(x>>=2),N>_.lookahead&&(N=_.lookahead);do if(F[(C=y)+U]===Q&&F[C+U-1]===W&&F[C]===F[H]&&F[++C]===F[H+1]){H+=2,C++;do;while(F[++H]===F[++C]&&F[++H]===F[++C]&&F[++H]===F[++C]&&F[++H]===F[++C]&&F[++H]===F[++C]&&F[++H]===F[++C]&&F[++H]===F[++C]&&F[++H]===F[++C]&&H<B);if(w=258-(B-H),H=B-258,w>U){if(_.match_start=y,U=w,w>=N)break;W=F[H+U-1],Q=F[H+U]}}while((y=b[y&A])>k&&--x!=0);return U<=_.lookahead?U:_.lookahead}function I(_){var y,C,w,x,H,U,N,k,F,A,b=_.w_size;do{if(x=_.window_size-_.lookahead-_.strstart,_.strstart>=b+(b-262)){o.arraySet(_.window,_.window,b,b,0),_.match_start-=b,_.strstart-=b,_.block_start-=b,y=C=_.hash_size;do w=_.head[--y],_.head[y]=w>=b?w-b:0;while(--C);y=C=b;do w=_.prev[--y],_.prev[y]=w>=b?w-b:0;while(--C);x+=b}if(_.strm.avail_in===0)break;if(U=_.strm,N=_.window,k=_.strstart+_.lookahead,F=x,A=void 0,(A=U.avail_in)>F&&(A=F),C=A===0?0:(U.avail_in-=A,o.arraySet(N,U.input,U.next_in,A,k),U.state.wrap===1?U.adler=u(U.adler,N,A,k):U.state.wrap===2&&(U.adler=s(U.adler,N,A,k)),U.next_in+=A,U.total_in+=A,A),_.lookahead+=C,_.lookahead+_.insert>=3)for(H=_.strstart-_.insert,_.ins_h=_.window[H],_.ins_h=(_.ins_h<<_.hash_shift^_.window[H+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[H+3-1])&_.hash_mask,_.prev[H&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=H,H++,_.insert--,!(_.lookahead+_.insert<3)););}while(_.lookahead<262&&_.strm.avail_in!==0)}function L(_,y){for(var C,w;;){if(_.lookahead<262){if(I(_),_.lookahead<262&&y===0)return 1;if(_.lookahead===0)break}if(C=0,_.lookahead>=3&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,C=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),C!==0&&_.strstart-C<=_.w_size-262&&(_.match_length=S(_,C)),_.match_length>=3)if(w=l._tr_tally(_,_.strstart-_.match_start,_.match_length-3),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=3){_.match_length--;do _.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,C=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart;while(--_.match_length!=0);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else w=l._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(w&&(p(_,!1),_.strm.avail_out===0))return 1}return _.insert=_.strstart<2?_.strstart:2,y===4?(p(_,!0),_.strm.avail_out===0?3:4):_.last_lit&&(p(_,!1),_.strm.avail_out===0)?1:2}function O(_,y){for(var C,w,x;;){if(_.lookahead<262){if(I(_),_.lookahead<262&&y===0)return 1;if(_.lookahead===0)break}if(C=0,_.lookahead>=3&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,C=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=2,C!==0&&_.prev_length<_.max_lazy_match&&_.strstart-C<=_.w_size-262&&(_.match_length=S(_,C),_.match_length<=5&&(_.strategy===1||_.match_length===3&&_.strstart-_.match_start>4096)&&(_.match_length=2)),_.prev_length>=3&&_.match_length<=_.prev_length){x=_.strstart+_.lookahead-3,w=l._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-3),_.lookahead-=_.prev_length-1,_.prev_length-=2;do++_.strstart<=x&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+3-1])&_.hash_mask,C=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart);while(--_.prev_length!=0);if(_.match_available=0,_.match_length=2,_.strstart++,w&&(p(_,!1),_.strm.avail_out===0))return 1}else if(_.match_available){if((w=l._tr_tally(_,0,_.window[_.strstart-1]))&&p(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return 1}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(w=l._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<2?_.strstart:2,y===4?(p(_,!0),_.strm.avail_out===0?3:4):_.last_lit&&(p(_,!1),_.strm.avail_out===0)?1:2}function R(_,y,C,w,x){this.good_length=_,this.max_lazy=y,this.nice_length=C,this.max_chain=w,this.func=x}function m(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(1146),this.dyn_dtree=new o.Buf16(122),this.bl_tree=new o.Buf16(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(16),this.heap=new o.Buf16(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(573),T(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function M(_){var y;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=2,(y=_.state).pending=0,y.pending_out=0,y.wrap<0&&(y.wrap=-y.wrap),y.status=y.wrap?42:113,_.adler=y.wrap===2?0:1,y.last_flush=0,l._tr_init(y),0):c(_,-2)}function G(_){var y,C=M(_);return C===0&&((y=_.state).window_size=2*y.w_size,T(y.head),y.max_lazy_match=r[y.level].max_lazy,y.good_match=r[y.level].good_length,y.nice_match=r[y.level].nice_length,y.max_chain_length=r[y.level].max_chain,y.strstart=0,y.block_start=0,y.lookahead=0,y.insert=0,y.match_length=y.prev_length=2,y.match_available=0,y.ins_h=0),C}function Z(_,y,C,w,x,H){if(!_)return-2;var U=1;if(y===-1&&(y=6),w<0?(U=0,w=-w):w>15&&(U=2,w-=16),x<1||x>9||C!==8||w<8||w>15||y<0||y>9||H<0||H>4)return c(_,-2);w===8&&(w=9);var N=new m;return _.state=N,N.strm=_,N.wrap=U,N.gzhead=null,N.w_bits=w,N.w_size=1<<N.w_bits,N.w_mask=N.w_size-1,N.hash_bits=x+7,N.hash_size=1<<N.hash_bits,N.hash_mask=N.hash_size-1,N.hash_shift=~~((N.hash_bits+3-1)/3),N.window=new o.Buf8(2*N.w_size),N.head=new o.Buf16(N.hash_size),N.prev=new o.Buf16(N.w_size),N.lit_bufsize=1<<x+6,N.pending_buf_size=4*N.lit_bufsize,N.pending_buf=new o.Buf8(N.pending_buf_size),N.d_buf=1*N.lit_bufsize,N.l_buf=3*N.lit_bufsize,N.level=y,N.strategy=H,N.method=C,G(_)}r=[new R(0,0,0,0,function(_,y){var C=65535;for(C>_.pending_buf_size-5&&(C=_.pending_buf_size-5);;){if(_.lookahead<=1){if(I(_),_.lookahead===0&&y===0)return 1;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var w=_.block_start+C;if((_.strstart===0||_.strstart>=w)&&(_.lookahead=_.strstart-w,_.strstart=w,p(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-262&&(p(_,!1),_.strm.avail_out===0))return 1}return _.insert=0,y===4?(p(_,!0),_.strm.avail_out===0?3:4):(_.strstart>_.block_start&&(p(_,!1),_.strm.avail_out),1)}),new R(4,4,8,4,L),new R(4,5,16,8,L),new R(4,6,32,32,L),new R(4,4,16,16,O),new R(8,16,32,32,O),new R(8,16,128,128,O),new R(8,32,128,256,O),new R(32,128,258,1024,O),new R(32,258,258,4096,O)],t.deflateInit=function(_,y){return Z(_,y,8,15,8,0)},t.deflateInit2=Z,t.deflateReset=G,t.deflateResetKeep=M,t.deflateSetHeader=function(_,y){return _&&_.state?_.state.wrap!==2?-2:(_.state.gzhead=y,0):-2},t.deflate=function(_,y){var C,w,x,H;if(!_||!_.state||y>5||y<0)return _?c(_,-2):-2;if(w=_.state,!_.output||!_.input&&_.avail_in!==0||w.status===666&&y!==4)return c(_,_.avail_out===0?-5:-2);if(w.strm=_,C=w.last_flush,w.last_flush=y,w.status===42)if(w.wrap===2)_.adler=0,d(w,31),d(w,139),d(w,8),w.gzhead?(d(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),d(w,255&w.gzhead.time),d(w,w.gzhead.time>>8&255),d(w,w.gzhead.time>>16&255),d(w,w.gzhead.time>>24&255),d(w,w.level===9?2:w.strategy>=2||w.level<2?4:0),d(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(d(w,255&w.gzhead.extra.length),d(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(_.adler=s(_.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(d(w,0),d(w,0),d(w,0),d(w,0),d(w,0),d(w,w.level===9?2:w.strategy>=2||w.level<2?4:0),d(w,3),w.status=113);else{var U=8+(w.w_bits-8<<4)<<8;U|=(w.strategy>=2||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(U|=32),U+=31-U%31,w.status=113,h(w,U),w.strstart!==0&&(h(w,_.adler>>>16),h(w,65535&_.adler)),_.adler=1}if(w.status===69)if(w.gzhead.extra){for(x=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>x&&(_.adler=s(_.adler,w.pending_buf,w.pending-x,x)),v(_),x=w.pending,w.pending!==w.pending_buf_size));)d(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>x&&(_.adler=s(_.adler,w.pending_buf,w.pending-x,x)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){x=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>x&&(_.adler=s(_.adler,w.pending_buf,w.pending-x,x)),v(_),x=w.pending,w.pending===w.pending_buf_size)){H=1;break}H=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,d(w,H)}while(H!==0);w.gzhead.hcrc&&w.pending>x&&(_.adler=s(_.adler,w.pending_buf,w.pending-x,x)),H===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){x=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>x&&(_.adler=s(_.adler,w.pending_buf,w.pending-x,x)),v(_),x=w.pending,w.pending===w.pending_buf_size)){H=1;break}H=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,d(w,H)}while(H!==0);w.gzhead.hcrc&&w.pending>x&&(_.adler=s(_.adler,w.pending_buf,w.pending-x,x)),H===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&v(_),w.pending+2<=w.pending_buf_size&&(d(w,255&_.adler),d(w,_.adler>>8&255),_.adler=0,w.status=113)):w.status=113),w.pending!==0){if(v(_),_.avail_out===0)return w.last_flush=-1,0}else if(_.avail_in===0&&f(y)<=f(C)&&y!==4)return c(_,-5);if(w.status===666&&_.avail_in!==0)return c(_,-5);if(_.avail_in!==0||w.lookahead!==0||y!==0&&w.status!==666){var N=w.strategy===2?function(k,F){for(var A;;){if(k.lookahead===0&&(I(k),k.lookahead===0)){if(F===0)return 1;break}if(k.match_length=0,A=l._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++,A&&(p(k,!1),k.strm.avail_out===0))return 1}return k.insert=0,F===4?(p(k,!0),k.strm.avail_out===0?3:4):k.last_lit&&(p(k,!1),k.strm.avail_out===0)?1:2}(w,y):w.strategy===3?function(k,F){for(var A,b,B,W,Q=k.window;;){if(k.lookahead<=258){if(I(k),k.lookahead<=258&&F===0)return 1;if(k.lookahead===0)break}if(k.match_length=0,k.lookahead>=3&&k.strstart>0&&(b=Q[B=k.strstart-1])===Q[++B]&&b===Q[++B]&&b===Q[++B]){W=k.strstart+258;do;while(b===Q[++B]&&b===Q[++B]&&b===Q[++B]&&b===Q[++B]&&b===Q[++B]&&b===Q[++B]&&b===Q[++B]&&b===Q[++B]&&B<W);k.match_length=258-(W-B),k.match_length>k.lookahead&&(k.match_length=k.lookahead)}if(k.match_length>=3?(A=l._tr_tally(k,1,k.match_length-3),k.lookahead-=k.match_length,k.strstart+=k.match_length,k.match_length=0):(A=l._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++),A&&(p(k,!1),k.strm.avail_out===0))return 1}return k.insert=0,F===4?(p(k,!0),k.strm.avail_out===0?3:4):k.last_lit&&(p(k,!1),k.strm.avail_out===0)?1:2}(w,y):r[w.level].func(w,y);if(N!==3&&N!==4||(w.status=666),N===1||N===3)return _.avail_out===0&&(w.last_flush=-1),0;if(N===2&&(y===1?l._tr_align(w):y!==5&&(l._tr_stored_block(w,0,0,!1),y===3&&(T(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),v(_),_.avail_out===0))return w.last_flush=-1,0}return y!==4?0:w.wrap<=0?1:(w.wrap===2?(d(w,255&_.adler),d(w,_.adler>>8&255),d(w,_.adler>>16&255),d(w,_.adler>>24&255),d(w,255&_.total_in),d(w,_.total_in>>8&255),d(w,_.total_in>>16&255),d(w,_.total_in>>24&255)):(h(w,_.adler>>>16),h(w,65535&_.adler)),v(_),w.wrap>0&&(w.wrap=-w.wrap),w.pending!==0?0:1)},t.deflateEnd=function(_){var y;return _&&_.state?(y=_.state.status)!==42&&y!==69&&y!==73&&y!==91&&y!==103&&y!==113&&y!==666?c(_,-2):(_.state=null,y===113?c(_,-3):0):-2},t.deflateSetDictionary=function(_,y){var C,w,x,H,U,N,k,F,A=y.length;if(!_||!_.state||(H=(C=_.state).wrap)===2||H===1&&C.status!==42||C.lookahead)return-2;for(H===1&&(_.adler=u(_.adler,y,A,0)),C.wrap=0,A>=C.w_size&&(H===0&&(T(C.head),C.strstart=0,C.block_start=0,C.insert=0),F=new o.Buf8(C.w_size),o.arraySet(F,y,A-C.w_size,C.w_size,0),y=F,A=C.w_size),U=_.avail_in,N=_.next_in,k=_.input,_.avail_in=A,_.next_in=0,_.input=y,I(C);C.lookahead>=3;){w=C.strstart,x=C.lookahead-2;do C.ins_h=(C.ins_h<<C.hash_shift^C.window[w+3-1])&C.hash_mask,C.prev[w&C.w_mask]=C.head[C.ins_h],C.head[C.ins_h]=w,w++;while(--x);C.strstart=w,C.lookahead=2,I(C)}return C.strstart+=C.lookahead,C.block_start=C.strstart,C.insert=C.lookahead,C.lookahead=0,C.match_length=C.prev_length=2,C.match_available=0,_.next_in=N,_.input=k,_.avail_in=U,C.wrap=H,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){var r=n(37);function o(b){for(var B=b.length;--B>=0;)b[B]=0}var l=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],u=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],g=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);o(c);var f=new Array(60);o(f);var T=new Array(512);o(T);var v=new Array(256);o(v);var p=new Array(29);o(p);var d,h,S,I=new Array(30);function L(b,B,W,Q,ee){this.static_tree=b,this.extra_bits=B,this.extra_base=W,this.elems=Q,this.max_length=ee,this.has_stree=b&&b.length}function O(b,B){this.dyn_tree=b,this.max_code=0,this.stat_desc=B}function R(b){return b<256?T[b]:T[256+(b>>>7)]}function m(b,B){b.pending_buf[b.pending++]=255&B,b.pending_buf[b.pending++]=B>>>8&255}function M(b,B,W){b.bi_valid>16-W?(b.bi_buf|=B<<b.bi_valid&65535,m(b,b.bi_buf),b.bi_buf=B>>16-b.bi_valid,b.bi_valid+=W-16):(b.bi_buf|=B<<b.bi_valid&65535,b.bi_valid+=W)}function G(b,B,W){M(b,W[2*B],W[2*B+1])}function Z(b,B){var W=0;do W|=1&b,b>>>=1,W<<=1;while(--B>0);return W>>>1}function _(b,B,W){var Q,ee,ne=new Array(16),X=0;for(Q=1;Q<=15;Q++)ne[Q]=X=X+W[Q-1]<<1;for(ee=0;ee<=B;ee++){var $=b[2*ee+1];$!==0&&(b[2*ee]=Z(ne[$]++,$))}}function y(b){var B;for(B=0;B<286;B++)b.dyn_ltree[2*B]=0;for(B=0;B<30;B++)b.dyn_dtree[2*B]=0;for(B=0;B<19;B++)b.bl_tree[2*B]=0;b.dyn_ltree[512]=1,b.opt_len=b.static_len=0,b.last_lit=b.matches=0}function C(b){b.bi_valid>8?m(b,b.bi_buf):b.bi_valid>0&&(b.pending_buf[b.pending++]=b.bi_buf),b.bi_buf=0,b.bi_valid=0}function w(b,B,W,Q){var ee=2*B,ne=2*W;return b[ee]<b[ne]||b[ee]===b[ne]&&Q[B]<=Q[W]}function x(b,B,W){for(var Q=b.heap[W],ee=W<<1;ee<=b.heap_len&&(ee<b.heap_len&&w(B,b.heap[ee+1],b.heap[ee],b.depth)&&ee++,!w(B,Q,b.heap[ee],b.depth));)b.heap[W]=b.heap[ee],W=ee,ee<<=1;b.heap[W]=Q}function H(b,B,W){var Q,ee,ne,X,$=0;if(b.last_lit!==0)do Q=b.pending_buf[b.d_buf+2*$]<<8|b.pending_buf[b.d_buf+2*$+1],ee=b.pending_buf[b.l_buf+$],$++,Q===0?G(b,ee,B):(G(b,(ne=v[ee])+256+1,B),(X=l[ne])!==0&&M(b,ee-=p[ne],X),G(b,ne=R(--Q),W),(X=u[ne])!==0&&M(b,Q-=I[ne],X));while($<b.last_lit);G(b,256,B)}function U(b,B){var W,Q,ee,ne=B.dyn_tree,X=B.stat_desc.static_tree,$=B.stat_desc.has_stree,E=B.stat_desc.elems,j=-1;for(b.heap_len=0,b.heap_max=573,W=0;W<E;W++)ne[2*W]!==0?(b.heap[++b.heap_len]=j=W,b.depth[W]=0):ne[2*W+1]=0;for(;b.heap_len<2;)ne[2*(ee=b.heap[++b.heap_len]=j<2?++j:0)]=1,b.depth[ee]=0,b.opt_len--,$&&(b.static_len-=X[2*ee+1]);for(B.max_code=j,W=b.heap_len>>1;W>=1;W--)x(b,ne,W);ee=E;do W=b.heap[1],b.heap[1]=b.heap[b.heap_len--],x(b,ne,1),Q=b.heap[1],b.heap[--b.heap_max]=W,b.heap[--b.heap_max]=Q,ne[2*ee]=ne[2*W]+ne[2*Q],b.depth[ee]=(b.depth[W]>=b.depth[Q]?b.depth[W]:b.depth[Q])+1,ne[2*W+1]=ne[2*Q+1]=ee,b.heap[1]=ee++,x(b,ne,1);while(b.heap_len>=2);b.heap[--b.heap_max]=b.heap[1],function(V,K){var Y,re,oe,ue,ve,Re,Te=K.dyn_tree,Ne=K.max_code,Oe=K.stat_desc.static_tree,Ce=K.stat_desc.has_stree,Me=K.stat_desc.extra_bits,Fe=K.stat_desc.extra_base,$e=K.stat_desc.max_length,nt=0;for(ue=0;ue<=15;ue++)V.bl_count[ue]=0;for(Te[2*V.heap[V.heap_max]+1]=0,Y=V.heap_max+1;Y<573;Y++)(ue=Te[2*Te[2*(re=V.heap[Y])+1]+1]+1)>$e&&(ue=$e,nt++),Te[2*re+1]=ue,re>Ne||(V.bl_count[ue]++,ve=0,re>=Fe&&(ve=Me[re-Fe]),Re=Te[2*re],V.opt_len+=Re*(ue+ve),Ce&&(V.static_len+=Re*(Oe[2*re+1]+ve)));if(nt!==0){do{for(ue=$e-1;V.bl_count[ue]===0;)ue--;V.bl_count[ue]--,V.bl_count[ue+1]+=2,V.bl_count[$e]--,nt-=2}while(nt>0);for(ue=$e;ue!==0;ue--)for(re=V.bl_count[ue];re!==0;)(oe=V.heap[--Y])>Ne||(Te[2*oe+1]!==ue&&(V.opt_len+=(ue-Te[2*oe+1])*Te[2*oe],Te[2*oe+1]=ue),re--)}}(b,B),_(ne,j,b.bl_count)}function N(b,B,W){var Q,ee,ne=-1,X=B[1],$=0,E=7,j=4;for(X===0&&(E=138,j=3),B[2*(W+1)+1]=65535,Q=0;Q<=W;Q++)ee=X,X=B[2*(Q+1)+1],++$<E&&ee===X||($<j?b.bl_tree[2*ee]+=$:ee!==0?(ee!==ne&&b.bl_tree[2*ee]++,b.bl_tree[32]++):$<=10?b.bl_tree[34]++:b.bl_tree[36]++,$=0,ne=ee,X===0?(E=138,j=3):ee===X?(E=6,j=3):(E=7,j=4))}function k(b,B,W){var Q,ee,ne=-1,X=B[1],$=0,E=7,j=4;for(X===0&&(E=138,j=3),Q=0;Q<=W;Q++)if(ee=X,X=B[2*(Q+1)+1],!(++$<E&&ee===X)){if($<j)do G(b,ee,b.bl_tree);while(--$!=0);else ee!==0?(ee!==ne&&(G(b,ee,b.bl_tree),$--),G(b,16,b.bl_tree),M(b,$-3,2)):$<=10?(G(b,17,b.bl_tree),M(b,$-3,3)):(G(b,18,b.bl_tree),M(b,$-11,7));$=0,ne=ee,X===0?(E=138,j=3):ee===X?(E=6,j=3):(E=7,j=4)}}o(I);var F=!1;function A(b,B,W,Q){M(b,0+(Q?1:0),3),function(ee,ne,X,$){C(ee),$&&(m(ee,X),m(ee,~X)),r.arraySet(ee.pending_buf,ee.window,ne,X,ee.pending),ee.pending+=X}(b,B,W,!0)}t._tr_init=function(b){F||(function(){var B,W,Q,ee,ne,X=new Array(16);for(Q=0,ee=0;ee<28;ee++)for(p[ee]=Q,B=0;B<1<<l[ee];B++)v[Q++]=ee;for(v[Q-1]=ee,ne=0,ee=0;ee<16;ee++)for(I[ee]=ne,B=0;B<1<<u[ee];B++)T[ne++]=ee;for(ne>>=7;ee<30;ee++)for(I[ee]=ne<<7,B=0;B<1<<u[ee]-7;B++)T[256+ne++]=ee;for(W=0;W<=15;W++)X[W]=0;for(B=0;B<=143;)c[2*B+1]=8,B++,X[8]++;for(;B<=255;)c[2*B+1]=9,B++,X[9]++;for(;B<=279;)c[2*B+1]=7,B++,X[7]++;for(;B<=287;)c[2*B+1]=8,B++,X[8]++;for(_(c,287,X),B=0;B<30;B++)f[2*B+1]=5,f[2*B]=Z(B,5);d=new L(c,l,257,286,15),h=new L(f,u,0,30,15),S=new L(new Array(0),s,0,19,7)}(),F=!0),b.l_desc=new O(b.dyn_ltree,d),b.d_desc=new O(b.dyn_dtree,h),b.bl_desc=new O(b.bl_tree,S),b.bi_buf=0,b.bi_valid=0,y(b)},t._tr_stored_block=A,t._tr_flush_block=function(b,B,W,Q){var ee,ne,X=0;b.level>0?(b.strm.data_type===2&&(b.strm.data_type=function($){var E,j=4093624447;for(E=0;E<=31;E++,j>>>=1)if(1&j&&$.dyn_ltree[2*E]!==0)return 0;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return 1;for(E=32;E<256;E++)if($.dyn_ltree[2*E]!==0)return 1;return 0}(b)),U(b,b.l_desc),U(b,b.d_desc),X=function($){var E;for(N($,$.dyn_ltree,$.l_desc.max_code),N($,$.dyn_dtree,$.d_desc.max_code),U($,$.bl_desc),E=18;E>=3&&$.bl_tree[2*g[E]+1]===0;E--);return $.opt_len+=3*(E+1)+5+5+4,E}(b),ee=b.opt_len+3+7>>>3,(ne=b.static_len+3+7>>>3)<=ee&&(ee=ne)):ee=ne=W+5,W+4<=ee&&B!==-1?A(b,B,W,Q):b.strategy===4||ne===ee?(M(b,2+(Q?1:0),3),H(b,c,f)):(M(b,4+(Q?1:0),3),function($,E,j,V){var K;for(M($,E-257,5),M($,j-1,5),M($,V-4,4),K=0;K<V;K++)M($,$.bl_tree[2*g[K]+1],3);k($,$.dyn_ltree,E-1),k($,$.dyn_dtree,j-1)}(b,b.l_desc.max_code+1,b.d_desc.max_code+1,X+1),H(b,b.dyn_ltree,b.dyn_dtree)),y(b),Q&&C(b)},t._tr_tally=function(b,B,W){return b.pending_buf[b.d_buf+2*b.last_lit]=B>>>8&255,b.pending_buf[b.d_buf+2*b.last_lit+1]=255&B,b.pending_buf[b.l_buf+b.last_lit]=255&W,b.last_lit++,B===0?b.dyn_ltree[2*W]++:(b.matches++,B--,b.dyn_ltree[2*(v[W]+256+1)]++,b.dyn_dtree[2*R(B)]++),b.last_lit===b.lit_bufsize-1},t._tr_align=function(b){M(b,2,3),G(b,256,c),function(B){B.bi_valid===16?(m(B,B.bi_buf),B.bi_buf=0,B.bi_valid=0):B.bi_valid>=8&&(B.pending_buf[B.pending++]=255&B.bi_buf,B.bi_buf>>=8,B.bi_valid-=8)}(b)}},function(e,t,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){var r=n(37),o=n(75),l=n(76),u=n(175),s=n(176);function g(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(O){var R;return O&&O.state?(R=O.state,O.total_in=O.total_out=R.total=0,O.msg="",R.wrap&&(O.adler=1&R.wrap),R.mode=1,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new r.Buf32(852),R.distcode=R.distdyn=new r.Buf32(592),R.sane=1,R.back=-1,0):-2}function T(O){var R;return O&&O.state?((R=O.state).wsize=0,R.whave=0,R.wnext=0,f(O)):-2}function v(O,R){var m,M;return O&&O.state?(M=O.state,R<0?(m=0,R=-R):(m=1+(R>>4),R<48&&(R&=15)),R&&(R<8||R>15)?-2:(M.window!==null&&M.wbits!==R&&(M.window=null),M.wrap=m,M.wbits=R,T(O))):-2}function p(O,R){var m,M;return O?(M=new c,O.state=M,M.window=null,(m=v(O,R))!==0&&(O.state=null),m):-2}var d,h,S=!0;function I(O){if(S){var R;for(d=new r.Buf32(512),h=new r.Buf32(32),R=0;R<144;)O.lens[R++]=8;for(;R<256;)O.lens[R++]=9;for(;R<280;)O.lens[R++]=7;for(;R<288;)O.lens[R++]=8;for(s(1,O.lens,0,288,d,0,O.work,{bits:9}),R=0;R<32;)O.lens[R++]=5;s(2,O.lens,0,32,h,0,O.work,{bits:5}),S=!1}O.lencode=d,O.lenbits=9,O.distcode=h,O.distbits=5}function L(O,R,m,M){var G,Z=O.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new r.Buf8(Z.wsize)),M>=Z.wsize?(r.arraySet(Z.window,R,m-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):((G=Z.wsize-Z.wnext)>M&&(G=M),r.arraySet(Z.window,R,m-M,G,Z.wnext),(M-=G)?(r.arraySet(Z.window,R,m-M,M,0),Z.wnext=M,Z.whave=Z.wsize):(Z.wnext+=G,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=G))),0}t.inflateReset=T,t.inflateReset2=v,t.inflateResetKeep=f,t.inflateInit=function(O){return p(O,15)},t.inflateInit2=p,t.inflate=function(O,R){var m,M,G,Z,_,y,C,w,x,H,U,N,k,F,A,b,B,W,Q,ee,ne,X,$,E,j=0,V=new r.Buf8(4),K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return-2;(m=O.state).mode===12&&(m.mode=13),_=O.next_out,G=O.output,C=O.avail_out,Z=O.next_in,M=O.input,y=O.avail_in,w=m.hold,x=m.bits,H=y,U=C,X=0;e:for(;;)switch(m.mode){case 1:if(m.wrap===0){m.mode=13;break}for(;x<16;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(2&m.wrap&&w===35615){m.check=0,V[0]=255&w,V[1]=w>>>8&255,m.check=l(m.check,V,2,0),w=0,x=0,m.mode=2;break}if(m.flags=0,m.head&&(m.head.done=!1),!(1&m.wrap)||(((255&w)<<8)+(w>>8))%31){O.msg="incorrect header check",m.mode=30;break}if((15&w)!=8){O.msg="unknown compression method",m.mode=30;break}if(x-=4,ne=8+(15&(w>>>=4)),m.wbits===0)m.wbits=ne;else if(ne>m.wbits){O.msg="invalid window size",m.mode=30;break}m.dmax=1<<ne,O.adler=m.check=1,m.mode=512&w?10:12,w=0,x=0;break;case 2:for(;x<16;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(m.flags=w,(255&m.flags)!=8){O.msg="unknown compression method",m.mode=30;break}if(57344&m.flags){O.msg="unknown header flags set",m.mode=30;break}m.head&&(m.head.text=w>>8&1),512&m.flags&&(V[0]=255&w,V[1]=w>>>8&255,m.check=l(m.check,V,2,0)),w=0,x=0,m.mode=3;case 3:for(;x<32;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}m.head&&(m.head.time=w),512&m.flags&&(V[0]=255&w,V[1]=w>>>8&255,V[2]=w>>>16&255,V[3]=w>>>24&255,m.check=l(m.check,V,4,0)),w=0,x=0,m.mode=4;case 4:for(;x<16;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}m.head&&(m.head.xflags=255&w,m.head.os=w>>8),512&m.flags&&(V[0]=255&w,V[1]=w>>>8&255,m.check=l(m.check,V,2,0)),w=0,x=0,m.mode=5;case 5:if(1024&m.flags){for(;x<16;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}m.length=w,m.head&&(m.head.extra_len=w),512&m.flags&&(V[0]=255&w,V[1]=w>>>8&255,m.check=l(m.check,V,2,0)),w=0,x=0}else m.head&&(m.head.extra=null);m.mode=6;case 6:if(1024&m.flags&&((N=m.length)>y&&(N=y),N&&(m.head&&(ne=m.head.extra_len-m.length,m.head.extra||(m.head.extra=new Array(m.head.extra_len)),r.arraySet(m.head.extra,M,Z,N,ne)),512&m.flags&&(m.check=l(m.check,M,N,Z)),y-=N,Z+=N,m.length-=N),m.length))break e;m.length=0,m.mode=7;case 7:if(2048&m.flags){if(y===0)break e;N=0;do ne=M[Z+N++],m.head&&ne&&m.length<65536&&(m.head.name+=String.fromCharCode(ne));while(ne&&N<y);if(512&m.flags&&(m.check=l(m.check,M,N,Z)),y-=N,Z+=N,ne)break e}else m.head&&(m.head.name=null);m.length=0,m.mode=8;case 8:if(4096&m.flags){if(y===0)break e;N=0;do ne=M[Z+N++],m.head&&ne&&m.length<65536&&(m.head.comment+=String.fromCharCode(ne));while(ne&&N<y);if(512&m.flags&&(m.check=l(m.check,M,N,Z)),y-=N,Z+=N,ne)break e}else m.head&&(m.head.comment=null);m.mode=9;case 9:if(512&m.flags){for(;x<16;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(w!==(65535&m.check)){O.msg="header crc mismatch",m.mode=30;break}w=0,x=0}m.head&&(m.head.hcrc=m.flags>>9&1,m.head.done=!0),O.adler=m.check=0,m.mode=12;break;case 10:for(;x<32;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}O.adler=m.check=g(w),w=0,x=0,m.mode=11;case 11:if(m.havedict===0)return O.next_out=_,O.avail_out=C,O.next_in=Z,O.avail_in=y,m.hold=w,m.bits=x,2;O.adler=m.check=1,m.mode=12;case 12:if(R===5||R===6)break e;case 13:if(m.last){w>>>=7&x,x-=7&x,m.mode=27;break}for(;x<3;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}switch(m.last=1&w,x-=1,3&(w>>>=1)){case 0:m.mode=14;break;case 1:if(I(m),m.mode=20,R===6){w>>>=2,x-=2;break e}break;case 2:m.mode=17;break;case 3:O.msg="invalid block type",m.mode=30}w>>>=2,x-=2;break;case 14:for(w>>>=7&x,x-=7&x;x<32;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if((65535&w)!=(w>>>16^65535)){O.msg="invalid stored block lengths",m.mode=30;break}if(m.length=65535&w,w=0,x=0,m.mode=15,R===6)break e;case 15:m.mode=16;case 16:if(N=m.length){if(N>y&&(N=y),N>C&&(N=C),N===0)break e;r.arraySet(G,M,Z,N,_),y-=N,Z+=N,C-=N,_+=N,m.length-=N;break}m.mode=12;break;case 17:for(;x<14;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(m.nlen=257+(31&w),w>>>=5,x-=5,m.ndist=1+(31&w),w>>>=5,x-=5,m.ncode=4+(15&w),w>>>=4,x-=4,m.nlen>286||m.ndist>30){O.msg="too many length or distance symbols",m.mode=30;break}m.have=0,m.mode=18;case 18:for(;m.have<m.ncode;){for(;x<3;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}m.lens[K[m.have++]]=7&w,w>>>=3,x-=3}for(;m.have<19;)m.lens[K[m.have++]]=0;if(m.lencode=m.lendyn,m.lenbits=7,$={bits:m.lenbits},X=s(0,m.lens,0,19,m.lencode,0,m.work,$),m.lenbits=$.bits,X){O.msg="invalid code lengths set",m.mode=30;break}m.have=0,m.mode=19;case 19:for(;m.have<m.nlen+m.ndist;){for(;b=(j=m.lencode[w&(1<<m.lenbits)-1])>>>16&255,B=65535&j,!((A=j>>>24)<=x);){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(B<16)w>>>=A,x-=A,m.lens[m.have++]=B;else{if(B===16){for(E=A+2;x<E;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(w>>>=A,x-=A,m.have===0){O.msg="invalid bit length repeat",m.mode=30;break}ne=m.lens[m.have-1],N=3+(3&w),w>>>=2,x-=2}else if(B===17){for(E=A+3;x<E;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}x-=A,ne=0,N=3+(7&(w>>>=A)),w>>>=3,x-=3}else{for(E=A+7;x<E;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}x-=A,ne=0,N=11+(127&(w>>>=A)),w>>>=7,x-=7}if(m.have+N>m.nlen+m.ndist){O.msg="invalid bit length repeat",m.mode=30;break}for(;N--;)m.lens[m.have++]=ne}}if(m.mode===30)break;if(m.lens[256]===0){O.msg="invalid code -- missing end-of-block",m.mode=30;break}if(m.lenbits=9,$={bits:m.lenbits},X=s(1,m.lens,0,m.nlen,m.lencode,0,m.work,$),m.lenbits=$.bits,X){O.msg="invalid literal/lengths set",m.mode=30;break}if(m.distbits=6,m.distcode=m.distdyn,$={bits:m.distbits},X=s(2,m.lens,m.nlen,m.ndist,m.distcode,0,m.work,$),m.distbits=$.bits,X){O.msg="invalid distances set",m.mode=30;break}if(m.mode=20,R===6)break e;case 20:m.mode=21;case 21:if(y>=6&&C>=258){O.next_out=_,O.avail_out=C,O.next_in=Z,O.avail_in=y,m.hold=w,m.bits=x,u(O,U),_=O.next_out,G=O.output,C=O.avail_out,Z=O.next_in,M=O.input,y=O.avail_in,w=m.hold,x=m.bits,m.mode===12&&(m.back=-1);break}for(m.back=0;b=(j=m.lencode[w&(1<<m.lenbits)-1])>>>16&255,B=65535&j,!((A=j>>>24)<=x);){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(b&&!(240&b)){for(W=A,Q=b,ee=B;b=(j=m.lencode[ee+((w&(1<<W+Q)-1)>>W)])>>>16&255,B=65535&j,!(W+(A=j>>>24)<=x);){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}w>>>=W,x-=W,m.back+=W}if(w>>>=A,x-=A,m.back+=A,m.length=B,b===0){m.mode=26;break}if(32&b){m.back=-1,m.mode=12;break}if(64&b){O.msg="invalid literal/length code",m.mode=30;break}m.extra=15&b,m.mode=22;case 22:if(m.extra){for(E=m.extra;x<E;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}m.length+=w&(1<<m.extra)-1,w>>>=m.extra,x-=m.extra,m.back+=m.extra}m.was=m.length,m.mode=23;case 23:for(;b=(j=m.distcode[w&(1<<m.distbits)-1])>>>16&255,B=65535&j,!((A=j>>>24)<=x);){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(!(240&b)){for(W=A,Q=b,ee=B;b=(j=m.distcode[ee+((w&(1<<W+Q)-1)>>W)])>>>16&255,B=65535&j,!(W+(A=j>>>24)<=x);){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}w>>>=W,x-=W,m.back+=W}if(w>>>=A,x-=A,m.back+=A,64&b){O.msg="invalid distance code",m.mode=30;break}m.offset=B,m.extra=15&b,m.mode=24;case 24:if(m.extra){for(E=m.extra;x<E;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}m.offset+=w&(1<<m.extra)-1,w>>>=m.extra,x-=m.extra,m.back+=m.extra}if(m.offset>m.dmax){O.msg="invalid distance too far back",m.mode=30;break}m.mode=25;case 25:if(C===0)break e;if(N=U-C,m.offset>N){if((N=m.offset-N)>m.whave&&m.sane){O.msg="invalid distance too far back",m.mode=30;break}N>m.wnext?(N-=m.wnext,k=m.wsize-N):k=m.wnext-N,N>m.length&&(N=m.length),F=m.window}else F=G,k=_-m.offset,N=m.length;N>C&&(N=C),C-=N,m.length-=N;do G[_++]=F[k++];while(--N);m.length===0&&(m.mode=21);break;case 26:if(C===0)break e;G[_++]=m.length,C--,m.mode=21;break;case 27:if(m.wrap){for(;x<32;){if(y===0)break e;y--,w|=M[Z++]<<x,x+=8}if(U-=C,O.total_out+=U,m.total+=U,U&&(O.adler=m.check=m.flags?l(m.check,G,U,_-U):o(m.check,G,U,_-U)),U=C,(m.flags?w:g(w))!==m.check){O.msg="incorrect data check",m.mode=30;break}w=0,x=0}m.mode=28;case 28:if(m.wrap&&m.flags){for(;x<32;){if(y===0)break e;y--,w+=M[Z++]<<x,x+=8}if(w!==(4294967295&m.total)){O.msg="incorrect length check",m.mode=30;break}w=0,x=0}m.mode=29;case 29:X=1;break e;case 30:X=-3;break e;case 31:return-4;case 32:default:return-2}return O.next_out=_,O.avail_out=C,O.next_in=Z,O.avail_in=y,m.hold=w,m.bits=x,(m.wsize||U!==O.avail_out&&m.mode<30&&(m.mode<27||R!==4))&&L(O,O.output,O.next_out,U-O.avail_out)?(m.mode=31,-4):(H-=O.avail_in,U-=O.avail_out,O.total_in+=H,O.total_out+=U,m.total+=U,m.wrap&&U&&(O.adler=m.check=m.flags?l(m.check,G,U,O.next_out-U):o(m.check,G,U,O.next_out-U)),O.data_type=m.bits+(m.last?64:0)+(m.mode===12?128:0)+(m.mode===20||m.mode===15?256:0),(H===0&&U===0||R===4)&&X===0&&(X=-5),X)},t.inflateEnd=function(O){if(!O||!O.state)return-2;var R=O.state;return R.window&&(R.window=null),O.state=null,0},t.inflateGetHeader=function(O,R){var m;return O&&O.state&&2&(m=O.state).wrap?(m.head=R,R.done=!1,0):-2},t.inflateSetDictionary=function(O,R){var m,M=R.length;return O&&O.state?(m=O.state).wrap!==0&&m.mode!==11?-2:m.mode===11&&o(1,R,M,0)!==m.check?-3:L(O,R,M,M)?(m.mode=31,-4):(m.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){e.exports=function(r,o){var l,u,s,g,c,f,T,v,p,d,h,S,I,L,O,R,m,M,G,Z,_,y,C,w,x;l=r.state,u=r.next_in,w=r.input,s=u+(r.avail_in-5),g=r.next_out,x=r.output,c=g-(o-r.avail_out),f=g+(r.avail_out-257),T=l.dmax,v=l.wsize,p=l.whave,d=l.wnext,h=l.window,S=l.hold,I=l.bits,L=l.lencode,O=l.distcode,R=(1<<l.lenbits)-1,m=(1<<l.distbits)-1;e:do{I<15&&(S+=w[u++]<<I,I+=8,S+=w[u++]<<I,I+=8),M=L[S&R];t:for(;;){if(S>>>=G=M>>>24,I-=G,(G=M>>>16&255)===0)x[g++]=65535&M;else{if(!(16&G)){if(!(64&G)){M=L[(65535&M)+(S&(1<<G)-1)];continue t}if(32&G){l.mode=12;break e}r.msg="invalid literal/length code",l.mode=30;break e}Z=65535&M,(G&=15)&&(I<G&&(S+=w[u++]<<I,I+=8),Z+=S&(1<<G)-1,S>>>=G,I-=G),I<15&&(S+=w[u++]<<I,I+=8,S+=w[u++]<<I,I+=8),M=O[S&m];n:for(;;){if(S>>>=G=M>>>24,I-=G,!(16&(G=M>>>16&255))){if(!(64&G)){M=O[(65535&M)+(S&(1<<G)-1)];continue n}r.msg="invalid distance code",l.mode=30;break e}if(_=65535&M,I<(G&=15)&&(S+=w[u++]<<I,(I+=8)<G&&(S+=w[u++]<<I,I+=8)),(_+=S&(1<<G)-1)>T){r.msg="invalid distance too far back",l.mode=30;break e}if(S>>>=G,I-=G,_>(G=g-c)){if((G=_-G)>p&&l.sane){r.msg="invalid distance too far back",l.mode=30;break e}if(y=0,C=h,d===0){if(y+=v-G,G<Z){Z-=G;do x[g++]=h[y++];while(--G);y=g-_,C=x}}else if(d<G){if(y+=v+d-G,(G-=d)<Z){Z-=G;do x[g++]=h[y++];while(--G);if(y=0,d<Z){Z-=G=d;do x[g++]=h[y++];while(--G);y=g-_,C=x}}}else if(y+=d-G,G<Z){Z-=G;do x[g++]=h[y++];while(--G);y=g-_,C=x}for(;Z>2;)x[g++]=C[y++],x[g++]=C[y++],x[g++]=C[y++],Z-=3;Z&&(x[g++]=C[y++],Z>1&&(x[g++]=C[y++]))}else{y=g-_;do x[g++]=x[y++],x[g++]=x[y++],x[g++]=x[y++],Z-=3;while(Z>2);Z&&(x[g++]=x[y++],Z>1&&(x[g++]=x[y++]))}break}}break}}while(u<s&&g<f);u-=Z=I>>3,S&=(1<<(I-=Z<<3))-1,r.next_in=u,r.next_out=g,r.avail_in=u<s?s-u+5:5-(u-s),r.avail_out=g<f?f-g+257:257-(g-f),l.hold=S,l.bits=I}},function(e,t,n){var r=n(37),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(g,c,f,T,v,p,d,h){var S,I,L,O,R,m,M,G,Z,_=h.bits,y=0,C=0,w=0,x=0,H=0,U=0,N=0,k=0,F=0,A=0,b=null,B=0,W=new r.Buf16(16),Q=new r.Buf16(16),ee=null,ne=0;for(y=0;y<=15;y++)W[y]=0;for(C=0;C<T;C++)W[c[f+C]]++;for(H=_,x=15;x>=1&&W[x]===0;x--);if(H>x&&(H=x),x===0)return v[p++]=20971520,v[p++]=20971520,h.bits=1,0;for(w=1;w<x&&W[w]===0;w++);for(H<w&&(H=w),k=1,y=1;y<=15;y++)if(k<<=1,(k-=W[y])<0)return-1;if(k>0&&(g===0||x!==1))return-1;for(Q[1]=0,y=1;y<15;y++)Q[y+1]=Q[y]+W[y];for(C=0;C<T;C++)c[f+C]!==0&&(d[Q[c[f+C]]++]=C);if(g===0?(b=ee=d,m=19):g===1?(b=o,B-=257,ee=l,ne-=257,m=256):(b=u,ee=s,m=-1),A=0,C=0,y=w,R=p,U=H,N=0,L=-1,O=(F=1<<H)-1,g===1&&F>852||g===2&&F>592)return 1;for(;;){M=y-N,d[C]<m?(G=0,Z=d[C]):d[C]>m?(G=ee[ne+d[C]],Z=b[B+d[C]]):(G=96,Z=0),S=1<<y-N,w=I=1<<U;do v[R+(A>>N)+(I-=S)]=M<<24|G<<16|Z|0;while(I!==0);for(S=1<<y-1;A&S;)S>>=1;if(S!==0?(A&=S-1,A+=S):A=0,C++,--W[y]==0){if(y===x)break;y=c[f+d[C]]}if(y>H&&(A&O)!==L){for(N===0&&(N=H),R+=w,k=1<<(U=y-N);U+N<x&&!((k-=W[U+N])<=0);)U++,k<<=1;if(F+=1<<U,g===1&&F>852||g===2&&F>592)return 1;v[L=A&O]=H<<24|U<<16|R-p|0}}return A!==0&&(v[R+A]=y-N<<24|64<<16|0),h.bits=H,0}},function(e,t,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t){},function(e,t,n){function r(c,f){var T=Object.keys(c);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(c);f&&(v=v.filter(function(p){return Object.getOwnPropertyDescriptor(c,p).enumerable})),T.push.apply(T,v)}return T}function o(c,f,T){return f in c?Object.defineProperty(c,f,{value:T,enumerable:!0,configurable:!0,writable:!0}):c[f]=T,c}function l(c,f){for(var T=0;T<f.length;T++){var v=f[T];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}var u=n(5).Buffer,s=n(180).inspect,g=s&&s.custom||"inspect";e.exports=function(){function c(){(function(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")})(this,c),this.head=null,this.tail=null,this.length=0}var f,T;return f=c,(T=[{key:"push",value:function(v){var p={data:v,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(v){var p={data:v,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var p=this.head,d=""+p.data;p=p.next;)d+=v+p.data;return d}},{key:"concat",value:function(v){if(this.length===0)return u.alloc(0);for(var p,d,h,S=u.allocUnsafe(v>>>0),I=this.head,L=0;I;)p=I.data,d=S,h=L,u.prototype.copy.call(p,d,h),L+=I.data.length,I=I.next;return S}},{key:"consume",value:function(v,p){var d;return v<this.head.data.length?(d=this.head.data.slice(0,v),this.head.data=this.head.data.slice(v)):d=v===this.head.data.length?this.shift():p?this._getString(v):this._getBuffer(v),d}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(v){var p=this.head,d=1,h=p.data;for(v-=h.length;p=p.next;){var S=p.data,I=v>S.length?S.length:v;if(I===S.length?h+=S:h+=S.slice(0,v),(v-=I)==0){I===S.length?(++d,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=S.slice(I));break}++d}return this.length-=d,h}},{key:"_getBuffer",value:function(v){var p=u.allocUnsafe(v),d=this.head,h=1;for(d.data.copy(p),v-=d.data.length;d=d.next;){var S=d.data,I=v>S.length?S.length:v;if(S.copy(p,p.length-v,0,I),(v-=I)==0){I===S.length?(++h,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=S.slice(I));break}++h}return this.length-=h,p}},{key:g,value:function(v,p){return s(this,function(d){for(var h=1;h<arguments.length;h++){var S=arguments[h]!=null?arguments[h]:{};h%2?r(Object(S),!0).forEach(function(I){o(d,I,S[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(S)):r(Object(S)).forEach(function(I){Object.defineProperty(d,I,Object.getOwnPropertyDescriptor(S,I))})}return d}({},p,{depth:0,customInspect:!1}))}}])&&l(f.prototype,T),c}()},function(e,t){},function(e,t,n){(function(r){var o;function l(O,R,m){return R in O?Object.defineProperty(O,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[R]=m,O}var u=n(49),s=Symbol("lastResolve"),g=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),T=Symbol("lastPromise"),v=Symbol("handlePromise"),p=Symbol("stream");function d(O,R){return{value:O,done:R}}function h(O){var R=O[s];if(R!==null){var m=O[p].read();m!==null&&(O[T]=null,O[s]=null,O[g]=null,R(d(m,!1)))}}function S(O){r.nextTick(h,O)}var I=Object.getPrototypeOf(function(){}),L=Object.setPrototypeOf((l(o={get stream(){return this[p]},next:function(){var O=this,R=this[c];if(R!==null)return Promise.reject(R);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(Z,_){r.nextTick(function(){O[c]?_(O[c]):Z(d(void 0,!0))})});var m,M=this[T];if(M)m=new Promise(function(Z,_){return function(y,C){Z.then(function(){_[f]?y(d(void 0,!0)):_[v](y,C)},C)}}(M,this));else{var G=this[p].read();if(G!==null)return Promise.resolve(d(G,!1));m=new Promise(this[v])}return this[T]=m,m}},Symbol.asyncIterator,function(){return this}),l(o,"return",function(){var O=this;return new Promise(function(R,m){O[p].destroy(null,function(M){M?m(M):R(d(void 0,!0))})})}),o),I);e.exports=function(O){var R,m=Object.create(L,(l(R={},p,{value:O,writable:!0}),l(R,s,{value:null,writable:!0}),l(R,g,{value:null,writable:!0}),l(R,c,{value:null,writable:!0}),l(R,f,{value:O._readableState.endEmitted,writable:!0}),l(R,v,{value:function(M,G){var Z=m[p].read();Z?(m[T]=null,m[s]=null,m[g]=null,M(d(Z,!1))):(m[s]=M,m[g]=G)},writable:!0}),R));return m[T]=null,u(O,function(M){if(M&&M.code!=="ERR_STREAM_PREMATURE_CLOSE"){var G=m[g];return G!==null&&(m[T]=null,m[s]=null,m[g]=null,G(M)),void(m[c]=M)}var Z=m[s];Z!==null&&(m[T]=null,m[s]=null,m[g]=null,Z(d(void 0,!0))),m[f]=!0}),O.on("readable",S.bind(null,m)),m}}).call(this,n(2))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){e.exports=o;var r=n(82);function o(l){if(!(this instanceof o))return new o(l);r.call(this,l)}n(7)(o,r),o.prototype._transform=function(l,u,s){s(null,l)}},function(e,t,n){var r,o=n(26).codes,l=o.ERR_MISSING_ARGS,u=o.ERR_STREAM_DESTROYED;function s(v){if(v)throw v}function g(v,p,d,h){h=function(L){var O=!1;return function(){O||(O=!0,L.apply(void 0,arguments))}}(h);var S=!1;v.on("close",function(){S=!0}),r===void 0&&(r=n(49)),r(v,{readable:p,writable:d},function(L){if(L)return h(L);S=!0,h()});var I=!1;return function(L){if(!S&&!I)return I=!0,function(O){return O.setHeader&&typeof O.abort=="function"}(v)?v.abort():typeof v.destroy=="function"?v.destroy():void h(L||new u("pipe"))}}function c(v){v()}function f(v,p){return v.pipe(p)}function T(v){return v.length?typeof v[v.length-1]!="function"?s:v.pop():s}e.exports=function(){for(var v=arguments.length,p=new Array(v),d=0;d<v;d++)p[d]=arguments[d];var h,S=T(p);if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new l("streams");var I=p.map(function(L,O){var R=O<p.length-1;return g(L,R,O>0,function(m){h||(h=m),m&&I.forEach(c),R||(I.forEach(c),S(h))})});return p.reduce(f)}},function(e,t,n){var r=n(186)(function o(l,u){return(u=u||{}).namespace=l,u.prod=!0,u.dev=!1,u.force||o.force?o.yep(u):o.nope(u)});e.exports=r},function(e,t){var n=[],r=[],o=function(){};function l(d){return!~n.indexOf(d)&&(n.push(d),!0)}function u(d){o=d}function s(d){for(var h=[],S=0;S<n.length;S++)if(n[S].async)h.push(n[S]);else if(n[S](d))return!0;return!!h.length&&new Promise(function(I){Promise.all(h.map(function(L){return L(d)})).then(function(L){I(L.some(Boolean))})})}function g(d){return!~r.indexOf(d)&&(r.push(d),!0)}function c(){o.apply(o,arguments)}function f(d){for(var h=0;h<r.length;h++)d=r[h].apply(r[h],arguments);return d}function T(d,h){var S=Object.prototype.hasOwnProperty;for(var I in h)S.call(h,I)&&(d[I]=h[I]);return d}function v(d){return d.enabled=!1,d.modify=g,d.set=u,d.use=l,T(function(){return!1},d)}function p(d){return d.enabled=!0,d.modify=g,d.set=u,d.use=l,T(function(){var h=Array.prototype.slice.call(arguments,0);return c.call(c,d,f(h,d)),!0},d)}e.exports=function(d){return d.introduce=T,d.enabled=s,d.process=f,d.modify=g,d.write=c,d.nope=v,d.yep=p,d.set=u,d.use=l,d}},function(e,t,n){(function(r){var o=n(65),l=n(22).StringDecoder,u=n(33).Stream;function s(){}e.exports=function(g,c){var f=r.alloc(65536),T=new l("utf8"),v=new u,p="",d=0,h=0;return g.start===-1&&delete g.start,v.readable=!0,v.destroy=function(){v.destroyed=!0,v.emit("end"),v.emit("close")},o.open(g.file,"a+","0644",function(S,I){if(S)return c?c(S):v.emit("error",S),void v.destroy();(function L(){if(!v.destroyed)return o.read(I,f,0,f.length,d,function(O,R){if(O)return c?c(O):v.emit("error",O),void v.destroy();if(!R)return p&&((g.start==null||h>g.start)&&(c?c(null,p):v.emit("line",p)),h++,p=""),setTimeout(L,1e3);var m=T.write(f.slice(0,R));c||v.emit("data",m);for(var M=(m=(p+m).split(/\n+/)).length-1,G=0;G<M;G++)(g.start==null||h>g.start)&&(c?c(null,m[G]):v.emit("line",m[G])),h++;return p=m[M],d+=R,L()});o.close(I,s)})()}),c?v.destroy:v}}).call(this,n(5).Buffer)},function(e,t,n){(function(r,o){function l(O){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(O)}function u(O,R){var m=Object.keys(O);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(O);R&&(M=M.filter(function(G){return Object.getOwnPropertyDescriptor(O,G).enumerable})),m.push.apply(m,M)}return m}function s(O){for(var R=1;R<arguments.length;R++){var m=arguments[R]!=null?arguments[R]:{};R%2?u(Object(m),!0).forEach(function(M){g(O,M,m[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(m)):u(Object(m)).forEach(function(M){Object.defineProperty(O,M,Object.getOwnPropertyDescriptor(m,M))})}return O}function g(O,R,m){return R in O?Object.defineProperty(O,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[R]=m,O}function c(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function f(O,R){for(var m=0;m<R.length;m++){var M=R[m];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}function T(O,R){return(T=Object.setPrototypeOf||function(m,M){return m.__proto__=M,m})(O,R)}function v(O){var R=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var m,M=d(O);if(R){var G=d(this).constructor;m=Reflect.construct(M,arguments,G)}else m=M.apply(this,arguments);return p(this,m)}}function p(O,R){return!R||l(R)!=="object"&&typeof R!="function"?function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}(O):R}function d(O){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(O)}var h=n(83),S=n(199),I=n(33).Stream,L=n(20);e.exports=function(O){(function(Z,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");Z.prototype=Object.create(_&&_.prototype,{constructor:{value:Z,writable:!0,configurable:!0}}),_&&T(Z,_)})(G,O);var R,m,M=v(G);function G(){var Z,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return c(this,G),(Z=M.call(this,_)).options=_,Z.name=_.name||"http",Z.ssl=!!_.ssl,Z.host=_.host||"localhost",Z.port=_.port,Z.auth=_.auth,Z.path=_.path||"",Z.agent=_.agent,Z.headers=_.headers||{},Z.headers["content-type"]="application/json",Z.port||(Z.port=Z.ssl?443:80),Z}return R=G,(m=[{key:"log",value:function(Z,_){var y=this;this._request(Z,function(C,w){w&&w.statusCode!==200&&(C=new Error("Invalid HTTP Status Code: ".concat(w.statusCode))),C?y.emit("warn",C):y.emit("logged",Z)}),_&&r(_)}},{key:"query",value:function(Z,_){typeof Z=="function"&&(_=Z,Z={}),(Z={method:"query",params:this.normalizeQuery(Z)}).params.path&&(Z.path=Z.params.path,delete Z.params.path),Z.params.auth&&(Z.auth=Z.params.auth,delete Z.params.auth),this._request(Z,function(y,C,w){if(C&&C.statusCode!==200&&(y=new Error("Invalid HTTP Status Code: ".concat(C.statusCode))),y)return _(y);if(typeof w=="string")try{w=JSON.parse(w)}catch(x){return _(x)}_(null,w)})}},{key:"stream",value:function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=new I;(Z={method:"stream",params:Z}).params.path&&(Z.path=Z.params.path,delete Z.params.path),Z.params.auth&&(Z.auth=Z.params.auth,delete Z.params.auth);var y="",C=this._request(Z);return _.destroy=function(){return C.destroy()},C.on("data",function(w){for(var x=(w=(y+w).split(/\n+/)).length-1,H=0;H<x;H++)try{_.emit("log",JSON.parse(w[H]))}catch(U){_.emit("error",U)}y=w[x]}),C.on("error",function(w){return _.emit("error",w)}),_}},{key:"_request",value:function(Z,_){var y=(Z=Z||{}).auth||this.auth,C=Z.path||this.path||"";delete Z.auth,delete Z.path;var w=Object.assign({},this.headers);y&&y.bearer&&(w.Authorization="Bearer ".concat(y.bearer));var x=(this.ssl?S:h).request(s(s({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(C.replace(/^\//,"")),headers:w,auth:y&&y.username&&y.password?"".concat(y.username,":").concat(y.password):"",agent:this.agent}));x.on("error",_),x.on("response",function(H){return H.on("end",function(){return _(null,H)}).resume()}),x.end(o.from(JSON.stringify(Z),"utf8"))}}])&&f(R.prototype,m),G}(L)}).call(this,n(15).setImmediate,n(5).Buffer)},function(e,t,n){(function(r,o,l){var u=n(84),s=n(7),g=n(85),c=n(32),f=n(190),T=g.IncomingMessage,v=g.readyStates,p=e.exports=function(h){var S,I=this;c.Writable.call(I),I._opts=h,I._body=[],I._headers={},h.auth&&I.setHeader("Authorization","Basic "+new r(h.auth).toString("base64")),Object.keys(h.headers).forEach(function(O){I.setHeader(O,h.headers[O])});var L=!0;if(h.mode==="disable-fetch"||"requestTimeout"in h&&!u.abortController)L=!1,S=!0;else if(h.mode==="prefer-streaming")S=!1;else if(h.mode==="allow-wrong-content-type")S=!u.overrideMimeType;else{if(h.mode&&h.mode!=="default"&&h.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");S=!0}I._mode=function(O,R){return u.fetch&&R?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&O?"arraybuffer":u.vbArray&&O?"text:vbarray":"text"}(S,L),I._fetchTimer=null,I.on("finish",function(){I._onFinish()})};s(p,c.Writable),p.prototype.setHeader=function(h,S){var I=h.toLowerCase();d.indexOf(I)===-1&&(this._headers[I]={name:h,value:S})},p.prototype.getHeader=function(h){var S=this._headers[h.toLowerCase()];return S?S.value:null},p.prototype.removeHeader=function(h){delete this._headers[h.toLowerCase()]},p.prototype._onFinish=function(){var h=this;if(!h._destroyed){var S=h._opts,I=h._headers,L=null;S.method!=="GET"&&S.method!=="HEAD"&&(L=u.arraybuffer?f(r.concat(h._body)):u.blobConstructor?new o.Blob(h._body.map(function(G){return f(G)}),{type:(I["content-type"]||{}).value||""}):r.concat(h._body).toString());var O=[];if(Object.keys(I).forEach(function(G){var Z=I[G].name,_=I[G].value;Array.isArray(_)?_.forEach(function(y){O.push([Z,y])}):O.push([Z,_])}),h._mode==="fetch"){var R=null;if(u.abortController){var m=new AbortController;R=m.signal,h._fetchAbortController=m,"requestTimeout"in S&&S.requestTimeout!==0&&(h._fetchTimer=o.setTimeout(function(){h.emit("requestTimeout"),h._fetchAbortController&&h._fetchAbortController.abort()},S.requestTimeout))}o.fetch(h._opts.url,{method:h._opts.method,headers:O,body:L||void 0,mode:"cors",credentials:S.withCredentials?"include":"same-origin",signal:R}).then(function(G){h._fetchResponse=G,h._connect()},function(G){o.clearTimeout(h._fetchTimer),h._destroyed||h.emit("error",G)})}else{var M=h._xhr=new o.XMLHttpRequest;try{M.open(h._opts.method,h._opts.url,!0)}catch(G){return void l.nextTick(function(){h.emit("error",G)})}"responseType"in M&&(M.responseType=h._mode.split(":")[0]),"withCredentials"in M&&(M.withCredentials=!!S.withCredentials),h._mode==="text"&&"overrideMimeType"in M&&M.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in S&&(M.timeout=S.requestTimeout,M.ontimeout=function(){h.emit("requestTimeout")}),O.forEach(function(G){M.setRequestHeader(G[0],G[1])}),h._response=null,M.onreadystatechange=function(){switch(M.readyState){case v.LOADING:case v.DONE:h._onXHRProgress()}},h._mode==="moz-chunked-arraybuffer"&&(M.onprogress=function(){h._onXHRProgress()}),M.onerror=function(){h._destroyed||h.emit("error",new Error("XHR error"))};try{M.send(L)}catch(G){return void l.nextTick(function(){h.emit("error",G)})}}}},p.prototype._onXHRProgress=function(){(function(h){try{var S=h.status;return S!==null&&S!==0}catch{return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},p.prototype._connect=function(){var h=this;h._destroyed||(h._response=new T(h._xhr,h._fetchResponse,h._mode,h._fetchTimer),h._response.on("error",function(S){h.emit("error",S)}),h.emit("response",h._response))},p.prototype._write=function(h,S,I){this._body.push(h),I()},p.prototype.abort=p.prototype.destroy=function(){this._destroyed=!0,o.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},p.prototype.end=function(h,S,I){typeof h=="function"&&(I=h,h=void 0),c.Writable.prototype.end.call(this,h,S,I)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(5).Buffer,n(6),n(2))},function(e,t,n){var r=n(5).Buffer;e.exports=function(o){if(o instanceof Uint8Array){if(o.byteOffset===0&&o.byteLength===o.buffer.byteLength)return o.buffer;if(typeof o.buffer.slice=="function")return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}if(r.isBuffer(o)){for(var l=new Uint8Array(o.length),u=o.length,s=0;s<u;s++)l[s]=o[s];return l.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var r={},o=0;o<arguments.length;o++){var l=arguments[o];for(var u in l)n.call(l,u)&&(r[u]=l[u])}return r};var n=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){(function(r,o){var l;(function(u){t&&t.nodeType,r&&r.nodeType;var s=typeof o=="object"&&o;s.global!==s&&s.window!==s&&s.self;var g,c=2147483647,f=/^xn--/,T=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,h=String.fromCharCode;function S(_){throw new RangeError(p[_])}function I(_,y){for(var C=_.length,w=[];C--;)w[C]=y(_[C]);return w}function L(_,y){var C=_.split("@"),w="";return C.length>1&&(w=C[0]+"@",_=C[1]),w+I((_=_.replace(v,".")).split("."),y).join(".")}function O(_){for(var y,C,w=[],x=0,H=_.length;x<H;)(y=_.charCodeAt(x++))>=55296&&y<=56319&&x<H?(64512&(C=_.charCodeAt(x++)))==56320?w.push(((1023&y)<<10)+(1023&C)+65536):(w.push(y),x--):w.push(y);return w}function R(_){return I(_,function(y){var C="";return y>65535&&(C+=h((y-=65536)>>>10&1023|55296),y=56320|1023&y),C+=h(y)}).join("")}function m(_,y){return _+22+75*(_<26)-((y!=0)<<5)}function M(_,y,C){var w=0;for(_=C?d(_/700):_>>1,_+=d(_/y);_>455;w+=36)_=d(_/35);return d(w+36*_/(_+38))}function G(_){var y,C,w,x,H,U,N,k,F,A,b,B=[],W=_.length,Q=0,ee=128,ne=72;for((C=_.lastIndexOf("-"))<0&&(C=0),w=0;w<C;++w)_.charCodeAt(w)>=128&&S("not-basic"),B.push(_.charCodeAt(w));for(x=C>0?C+1:0;x<W;){for(H=Q,U=1,N=36;x>=W&&S("invalid-input"),((k=(b=_.charCodeAt(x++))-48<10?b-22:b-65<26?b-65:b-97<26?b-97:36)>=36||k>d((c-Q)/U))&&S("overflow"),Q+=k*U,!(k<(F=N<=ne?1:N>=ne+26?26:N-ne));N+=36)U>d(c/(A=36-F))&&S("overflow"),U*=A;ne=M(Q-H,y=B.length+1,H==0),d(Q/y)>c-ee&&S("overflow"),ee+=d(Q/y),Q%=y,B.splice(Q++,0,ee)}return R(B)}function Z(_){var y,C,w,x,H,U,N,k,F,A,b,B,W,Q,ee,ne=[];for(B=(_=O(_)).length,y=128,C=0,H=72,U=0;U<B;++U)(b=_[U])<128&&ne.push(h(b));for(w=x=ne.length,x&&ne.push("-");w<B;){for(N=c,U=0;U<B;++U)(b=_[U])>=y&&b<N&&(N=b);for(N-y>d((c-C)/(W=w+1))&&S("overflow"),C+=(N-y)*W,y=N,U=0;U<B;++U)if((b=_[U])<y&&++C>c&&S("overflow"),b==y){for(k=C,F=36;!(k<(A=F<=H?1:F>=H+26?26:F-H));F+=36)ee=k-A,Q=36-A,ne.push(h(m(A+ee%Q,0))),k=d(ee/Q);ne.push(h(m(k,0))),H=M(C,W,w==x),C=0,++w}++C,++y}return ne.join("")}g={version:"1.4.1",ucs2:{decode:O,encode:R},decode:G,encode:Z,toASCII:function(_){return L(_,function(y){return T.test(y)?"xn--"+Z(y):y})},toUnicode:function(_){return L(_,function(y){return f.test(y)?G(y.slice(4).toLowerCase()):y})}},(l=function(){return g}.call(t,n,t,r))===void 0||(r.exports=l)})()}).call(this,n(194)(e),n(6))},function(e,t){e.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(e,t,n){e.exports={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}}},function(e,t,n){t.decode=t.parse=n(197),t.encode=t.stringify=n(198)},function(e,t,n){function r(l,u){return Object.prototype.hasOwnProperty.call(l,u)}e.exports=function(l,u,s,g){u=u||"&",s=s||"=";var c={};if(typeof l!="string"||l.length===0)return c;var f=/\+/g;l=l.split(u);var T=1e3;g&&typeof g.maxKeys=="number"&&(T=g.maxKeys);var v=l.length;T>0&&v>T&&(v=T);for(var p=0;p<v;++p){var d,h,S,I,L=l[p].replace(f,"%20"),O=L.indexOf(s);O>=0?(d=L.substr(0,O),h=L.substr(O+1)):(d=L,h=""),S=decodeURIComponent(d),I=decodeURIComponent(h),r(c,S)?o(c[S])?c[S].push(I):c[S]=[c[S],I]:c[S]=I}return c};var o=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"}},function(e,t,n){var r=function(s){switch(typeof s){case"string":return s;case"boolean":return s?"true":"false";case"number":return isFinite(s)?s:"";default:return""}};e.exports=function(s,g,c,f){return g=g||"&",c=c||"=",s===null&&(s=void 0),typeof s=="object"?l(u(s),function(T){var v=encodeURIComponent(r(T))+c;return o(s[T])?l(s[T],function(p){return v+encodeURIComponent(r(p))}).join(g):v+encodeURIComponent(r(s[T]))}).join(g):f?encodeURIComponent(r(f))+c+encodeURIComponent(r(s)):""};var o=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function l(s,g){if(s.map)return s.map(g);for(var c=[],f=0;f<s.length;f++)c.push(g(s[f],f));return c}var u=Object.keys||function(s){var g=[];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&g.push(c);return g}},function(e,t,n){var r=n(83),o=n(86),l=e.exports;for(var u in r)r.hasOwnProperty(u)&&(l[u]=r[u]);function s(g){if(typeof g=="string"&&(g=o.parse(g)),g.protocol||(g.protocol="https:"),g.protocol!=="https:")throw new Error('Protocol "'+g.protocol+'" not supported. Expected "https:"');return g}l.request=function(g,c){return g=s(g),r.request.call(this,g,c)},l.get=function(g,c){return g=s(g),r.get.call(this,g,c)}},function(e,t,n){(function(r){function o(h){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S})(h)}function l(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function u(h,S){for(var I=0;I<S.length;I++){var L=S[I];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(h,L.key,L)}}function s(h,S){return(s=Object.setPrototypeOf||function(I,L){return I.__proto__=L,I})(h,S)}function g(h){var S=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var I,L=f(h);if(S){var O=f(this).constructor;I=Reflect.construct(L,arguments,O)}else I=L.apply(this,arguments);return c(this,I)}}function c(h,S){return!S||o(S)!=="object"&&typeof S!="function"?function(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}(h):S}function f(h){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)})(h)}var T=n(87),v=n(3).MESSAGE,p=n(18),d=n(20);e.exports=function(h){(function(R,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");R.prototype=Object.create(m&&m.prototype,{constructor:{value:R,writable:!0,configurable:!0}}),m&&s(R,m)})(O,h);var S,I,L=g(O);function O(){var R,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(l(this,O),R=L.call(this,m),!m.stream||!T(m.stream))throw new Error("options.stream is required.");return R._stream=m.stream,R._stream.setMaxListeners(1/0),R.isObjectMode=m.stream._writableState.objectMode,R.eol=m.eol||p.EOL,R}return S=O,(I=[{key:"log",value:function(R,m){var M=this;if(r(function(){return M.emit("logged",R)}),this.isObjectMode)return this._stream.write(R),void(m&&m());this._stream.write("".concat(R[v]).concat(this.eol)),m&&m()}}])&&u(S.prototype,I),O}(d)}).call(this,n(15).setImmediate)},function(e,t,n){(function(r){function o(w,x,H){return x in w?Object.defineProperty(w,x,{value:H,enumerable:!0,configurable:!0,writable:!0}):w[x]=H,w}function l(w){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x})(w)}function u(w,x){for(var H=0;H<x.length;H++){var U=x[H];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(w,U.key,U)}}function s(w,x){return(s=Object.setPrototypeOf||function(H,U){return H.__proto__=U,H})(w,x)}function g(w){var x=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var H,U=f(w);if(x){var N=f(this).constructor;H=Reflect.construct(U,arguments,N)}else H=U.apply(this,arguments);return c(this,H)}}function c(w,x){return!x||l(x)!=="object"&&typeof x!="function"?function(H){if(H===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H}(w):x}function f(w){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)})(w)}var T=n(33),v=T.Stream,p=T.Transform,d=n(51),h=n(3),S=h.LEVEL,I=h.SPLAT,L=n(87),O=n(89),R=n(93),m=n(205),M=n(206),G=n(61).warn,Z=n(50),_=/%[scdjifoO%]/g,y=function(w){(function(k,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(F&&F.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),F&&s(k,F)})(N,w);var x,H,U=g(N);function N(k){var F;return function(A,b){if(!(A instanceof b))throw new TypeError("Cannot call a class as a function")}(this,N),(F=U.call(this,{objectMode:!0})).configure(k),F}return x=N,(H=[{key:"child",value:function(k){var F=this;return Object.create(F,{write:{value:function(A){var b=Object.assign({},k,A);A instanceof Error&&(b.stack=A.stack,b.message=A.message),F.write(b)}}})}},{key:"configure",value:function(){var k=this,F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},A=F.silent,b=F.format,B=F.defaultMeta,W=F.levels,Q=F.level,ee=Q===void 0?"info":Q,ne=F.exitOnError,X=ne===void 0||ne,$=F.transports,E=F.colors,j=F.emitErrs,V=F.formatters,K=F.padLevels,Y=F.rewriters,re=F.stripColors,oe=F.exceptionHandlers,ue=F.rejectionHandlers;if(this.transports.length&&this.clear(),this.silent=A,this.format=b||this.format||n(207)(),this.defaultMeta=B||null,this.levels=W||this.levels||Z.npm.levels,this.level=ee,this.exceptions=new O(this),this.rejections=new R(this),this.profilers={},this.exitOnError=X,$&&($=Array.isArray($)?$:[$]).forEach(function(ve){return k.add(ve)}),E||j||V||K||Y||re)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
39
- `));oe&&this.exceptions.handle(oe),ue&&this.rejections.handle(ue)}},{key:"isLevelEnabled",value:function(k){var F=this,A=C(this.levels,k);if(A===null)return!1;var b=C(this.levels,this.level);return b!==null&&(this.transports&&this.transports.length!==0?this.transports.findIndex(function(B){var W=C(F.levels,B.level);return W===null&&(W=b),W>=A})!==-1:b>=A)}},{key:"log",value:function(k,F){for(var A,b,B=arguments.length,W=new Array(B>2?B-2:0),Q=2;Q<B;Q++)W[Q-2]=arguments[Q];if(arguments.length===1)return k[S]=k.level,this._addDefaultMeta(k),this.write(k),this;if(arguments.length===2)return F&&l(F)==="object"?(F[S]=F.level=k,this._addDefaultMeta(F),this.write(F),this):(this.write((o(b={},S,k),o(b,"level",k),o(b,"message",F),b)),this);var ee=W[0];if(l(ee)==="object"&&ee!==null){var ne=F&&F.match&&F.match(_);if(!ne){var X,$=Object.assign({},this.defaultMeta,ee,(o(X={},S,k),o(X,I,W),o(X,"level",k),o(X,"message",F),X));return ee.message&&($.message="".concat($.message," ").concat(ee.message)),ee.stack&&($.stack=ee.stack),this.write($),this}}return this.write(Object.assign({},this.defaultMeta,(o(A={},S,k),o(A,I,W),o(A,"level",k),o(A,"message",F),A))),this}},{key:"_transform",value:function(k,F,A){if(this.silent)return A();k[S]||(k[S]=k.level),this.levels[k[S]]||this.levels[k[S]]===0||console.error("[winston] Unknown logger level: %s",k[S]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports %j",k);try{this.push(this.format.transform(k,this.format.options))}catch(b){throw b}finally{A()}}},{key:"_final",value:function(k){var F=this.transports.slice();d(F,function(A,b){if(!A||A.finished)return r(b);A.once("finish",b),A.end()},k)}},{key:"add",value:function(k){var F=!L(k)||k.log.length>2?new m({transport:k}):k;if(!F._writableState||!F._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",F),this._onEvent("warn",F),this.pipe(F),k.handleExceptions&&this.exceptions.handle(),k.handleRejections&&this.rejections.handle(),this}},{key:"remove",value:function(k){if(!k)return this;var F=k;return(!L(k)||k.log.length>2)&&(F=this.transports.filter(function(A){return A.transport===k})[0]),F&&this.unpipe(F),this}},{key:"clear",value:function(){return this.unpipe(),this}},{key:"close",value:function(){return this.clear(),this.emit("close"),this}},{key:"setLevels",value:function(){G.deprecated("setLevels")}},{key:"query",value:function(k,F){typeof k=="function"&&(F=k,k={}),k=k||{};var A={},b=Object.assign({},k.query||{});d(this.transports.filter(function(B){return!!B.query}),function(B,W){(function(Q,ee){k.query&&typeof Q.formatQuery=="function"&&(k.query=Q.formatQuery(b)),Q.query(k,function(ne,X){if(ne)return ee(ne);typeof Q.formatResults=="function"&&(X=Q.formatResults(X,k.format)),ee(null,X)})})(B,function(Q,ee){W&&((ee=Q||ee)&&(A[B.name]=ee),W()),W=null})},function(){return F(null,A)})}},{key:"stream",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=new v,A=[];return F._streams=A,F.destroy=function(){for(var b=A.length;b--;)A[b].destroy()},this.transports.filter(function(b){return!!b.stream}).forEach(function(b){var B=b.stream(k);B&&(A.push(B),B.on("log",function(W){W.transport=W.transport||[],W.transport.push(b.name),F.emit("log",W)}),B.on("error",function(W){W.transport=W.transport||[],W.transport.push(b.name),F.emit("error",W)}))}),F}},{key:"startTimer",value:function(){return new M(this)}},{key:"profile",value:function(k){var F=Date.now();if(this.profilers[k]){var A=this.profilers[k];delete this.profilers[k];for(var b=arguments.length,B=new Array(b>1?b-1:0),W=1;W<b;W++)B[W-1]=arguments[W];typeof B[B.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),B.pop());var Q=l(B[B.length-1])==="object"?B.pop():{};return Q.level=Q.level||"info",Q.durationMs=F-A,Q.message=Q.message||k,this.write(Q)}return this.profilers[k]=F,this}},{key:"handleExceptions",value:function(){var k;console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),(k=this.exceptions).handle.apply(k,arguments)}},{key:"unhandleExceptions",value:function(){var k;console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),(k=this.exceptions).unhandle.apply(k,arguments)}},{key:"cli",value:function(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
40
- `))}},{key:"_onEvent",value:function(k,F){F["__winston"+k]||(F["__winston"+k]=function(A){k!=="error"||this.transports.includes(F)||this.add(F),this.emit(k,A,F)}.bind(this),F.on(k,F["__winston"+k]))}},{key:"_addDefaultMeta",value:function(k){this.defaultMeta&&Object.assign(k,this.defaultMeta)}}])&&u(x.prototype,H),N}(p);function C(w,x){var H=w[x];return H||H===0?H:null}Object.defineProperty(y.prototype,"transports",{configurable:!1,enumerable:!0,get:function(){var w=this._readableState.pipes;return Array.isArray(w)?w:[w].filter(Boolean)}}),e.exports=y}).call(this,n(15).setImmediate)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(45)),o=f(n(46)),l=f(n(66)),u=f(n(67)),s=f(n(68)),g=f(n(25)),c=f(n(31));function f(p){return p&&p.__esModule?p:{default:p}}function T(p,d,h){h=(0,u.default)(h);var S=0,I=0,{length:L}=p,O=!1;function R(m,M){m===!1&&(O=!0),O!==!0&&(m?h(m):++I!==L&&M!==o.default||h(null))}for(L===0&&h(null);S<L;S++)d(p[S],S,(0,s.default)(R))}function v(p,d,h){return(0,l.default)(p,1/0,d,h)}t.default=(0,c.default)(function(p,d,h){return((0,r.default)(p)?T:v)(p,(0,g.default)(d),h)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return(o,l,u)=>r(o,u)},e.exports=t.default},function(e,t,n){var r=Object.prototype.toString;e.exports=function(o){if(typeof o.displayName=="string"&&o.constructor.name)return o.displayName;if(typeof o.name=="string"&&o.name)return o.name;if(typeof o=="object"&&o.constructor&&typeof o.constructor.name=="string")return o.constructor.name;var l=o.toString(),u=r.call(o).slice(8,-1);return(l=u==="Function"?l.substring(l.indexOf("(")+1,l.indexOf(")")):u)||"anonymous"}},function(e,t,n){const r=n(13),{LEVEL:o}=n(3),l=n(20),u=e.exports=function(s={}){if(l.call(this,s),!s.transport||typeof s.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=s.transport,this.level=this.level||s.transport.level,this.handleExceptions=this.handleExceptions||s.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=function(g){this.emit("error",g,this.transport)}.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(u,l),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);(!this.level||this.levels[this.level]>=this.levels[s[o]])&&this.transport.log(s[o],s.message,s,this._nop),c(null)},u.prototype._writev=function(s,g){for(let c=0;c<s.length;c++)this._accept(s[c])&&(this.transport.log(s[c].chunk[o],s[c].chunk.message,s[c].chunk,this._nop),s[c].callback());return g(null)},u.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
41
- `))},u.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(l)}function o(l,u){for(var s=0;s<u.length;s++){var g=u[s];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}e.exports=function(){function l(g){if(function(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}(this,l),!g)throw new Error("Logger is required for profiling.");this.logger=g,this.start=Date.now()}var u,s;return u=l,(s=[{key:"done",value:function(){for(var g=arguments.length,c=new Array(g),f=0;f<g;f++)c[f]=arguments[f];typeof c[c.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),c.pop());var T=r(c[c.length-1])==="object"?c.pop():{};return T.level=T.level||"info",T.durationMs=Date.now()-this.start,this.logger.write(T)}}])&&o(u.prototype,s),l}()},function(e,t,n){(function(r){const o=n(208),{MESSAGE:l}=n(3),u=n(35);function s(g,c){return c instanceof r?c.toString("base64"):typeof c=="bigint"?c.toString():c}e.exports=o((g,c={})=>(g[l]=(c.stable?u.stableStringify:u)(g,c.replacer||s,c.space),g))}).call(this,n(5).Buffer)},function(e,t,n){class r extends Error{constructor(l){super(`Format functions must be synchronous taking a two arguments: (info, opts)
52
+ `)},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),o=t.toLowerCase().match(n),l=Math.min(r.length,o.length),u=0;u<l;u++){n=r[u];var s=o[u];if(n!=s)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:n<s?-1:1}return r.length!=o.length?r.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"&#101;")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(o,l){var u=n[o];return u||(l.charAt(0)=="#"&&(l=+("0"+l.substr(1)),isNaN(l)||(u=String.fromCharCode(l))),u||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),o+" ")),u=r.firstChild.nodeValue.slice(0,-1)),n[o]=u)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(t,n){switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return n.charAt(0)!="#"||(n=+("0"+n.substr(1)),isNaN(n))?t:String.fromCharCode(n)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var o=n==1?t:t.charAt(r);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var o=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(o)}else e.length>t&&(r=Math.floor(t/2),o=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(o));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<o&&127>o?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))==-1&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return e==null?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return t==0&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(t,n){return n.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(n,r,o){return r+o.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;typeof t=="string"&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(t[r]!=""){var o=e.lastIndexOf(t[r]);o>n&&(n=o)}return n==-1?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)n[o]=o;for(o=0;o<e.length;o++){r[0]=o+1;for(var l=0;l<t.length;l++)r[l+1]=Math.min(r[l]+1,n[l+1]+1,n[l]+ +(e[o]!=t[l]));for(l=0;l<n.length;l++)n[l]=r[l]}return r[t.length]},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch{}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return n[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if(n[0]=="Edge")return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,function(n){return t==n[0]}))&&e[1]||""},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_())!=null&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function",goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function",goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var o=e[r],l=r+1<e.length,u=l?e[r+1]:0,s=r+2<e.length,g=s?e[r+2]:0,c=o>>2;o=(3&o)<<4|u>>4,u=(15&u)<<2|g>>6,g&=63,s||(g=64,l||(u=64)),n.push(t[c],t[o],t[u]||"",t[g]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,function(r){n+=String.fromCharCode(r)}),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,function(r){n.push(r)}),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return goog.crypt.base64.decodeStringInternal_(e,function(l){r[o++]=l}),r.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(g){for(;r<e.length;){var c=e.charAt(r++),d=goog.crypt.base64.charToByteMap_[c];if(d!=null)return d;if(!goog.string.isEmptyOrWhitespace(c))throw Error("Unknown base64 encoding at char: "+c)}return g}goog.crypt.base64.init_();for(var r=0;;){var o=n(-1),l=n(0),u=n(64),s=n(64);if(s===64&&o===-1)break;t(o<<2|l>>4),u!=64&&(t(l<<4&240|u>>2),s!=64&&t(u<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var o=0;o<r.length;o++){var l=r[o],u=goog.crypt.base64.charToByteMap_[l];u===void 0?goog.crypt.base64.charToByteMap_[l]=o:goog.asserts.assert(u===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(e==0?n==0?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),l=e.charCodeAt(4),u=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(o<<24)>>>0,jspb.utils.split64High=l+(u<<8)+(s<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,n==255?e?NaN:1/0*t:n==0?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,r==2047?e?NaN:1/0*n:r==0?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(o,l){return o=o?String(o):"",l?"0000000".slice(o.length)+o:o}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+e);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+((e=1+~e>>>0)==0?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(l,u){for(var s=0;8>s&&(l!==1||0<u);s++)u=l*r[s]+u,r[s]=255&u,u>>>=8}goog.asserts.assert(0<e.length);var n=!1;e[0]==="-"&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var l=0;8>l;l++)r[l]=255&~r[l]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(e.length==18),goog.asserts.assert(e[0]=="0"),goog.asserts.assert(e[1]=="x");for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,o=t;o<n;o++)r+=e[o]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var o=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(o++;;){var l=e[t++];if(!(128&l))break}else for(;t<n;){for(l=r;128<l;){if(e[t]!=(127&l|128))return o;t++,l>>=7}if(e[t++]!=l)break;for(o++;128&(l=e[t++]););}return o},jspb.utils.countFixedFields_=function(e,t,n,r,o){var l=0;if(128>r)for(;t<n&&e[t++]==r;)l++,t+=o;else for(;t<n;){for(var u=r;128<u;){if(e[t++]!=(127&u|128))return l;u>>=7}if(e[t++]!=u)break;l++,t+=o}return l},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var o=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var l=r;128<l;){if(e[t++]!=(127&l|128))return o;l>>=7}if(e[t++]!=l)break;o++;for(var u=0,s=1;u+=(127&(l=e[t++]))*s,s*=128,(128&l)!=0;);t+=u}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return typeof e=="string"?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||Buffer!==void 0&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=t!==void 0?t:0,this.end_=n!==void 0?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,o=0;4>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,o=0,l=n+7;l>=n;l--)r=r<<8|t[l],o=o<<8|t[l+4];return e(r,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],o="";n<e;){var l=t[n++];if(128>l)r.push(l);else{if(192>l)continue;if(224>l){var u=t[n++];r.push((31&l)<<6|63&u)}else if(240>l){u=t[n++];var s=t[n++];r.push((15&l)<<12|(63&u)<<6|63&s)}else 248>l&&(l=(7&l)<<18|(63&(u=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++],l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))}8192<=r.length&&(o+=String.fromCharCode.apply(null,r),r.length=0)}return o+=goog.crypt.byteArrayToString(r),this.cursor_=n,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],o=e[t+2],l=e[t+3],u=e[t+4],s=e[t+5],g=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,o,l,u,s,g,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(this.readCallbacks_!==null),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],o=0;o<n.length;o++){var l=this.map_[n[o][0].toString()];this.wrapEntry_(l);var u=l.valueWrapper;u?(goog.asserts.assert(t),r.push([l.key,t(e,u)])):r.push([l.key,l.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var o=e[r][0],l=n(e[r][1]);t.set(o,l)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var o=this.map_[n[r]];e.call(t,this.wrapEntry_(o),o.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,o){var l=this.stringKeys_();l.sort();for(var u=0;u<l.length;u++){var s=this.map_[l[u]];t.beginSubMessage(e),n.call(t,1,s.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(s),o):r.call(t,2,s.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,o,l,u){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();s==1?l=n.call(t):s==2&&(e.valueCtor_?(goog.asserts.assert(o),u||(u=new e.valueCtor_),r.call(t,u,o)):u=r.call(t))}goog.asserts.assert(l!=null),goog.asserts.assert(u!=null),e.set(l,u)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,o){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,o,l){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=o,this.isPacked=l},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function",jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,o,l){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=n===0?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(n=o[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(l&&l.length)for(t=0;t<l.length;t++)jspb.Message.computeOneofCase(e,l[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(e===null||typeof e!="object"||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],o=0;o<e.length;o++)r[o]=t.call(e[o],n,e[o]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,o){for(var l in n){var u=n[l],s=r.call(e,u);if(s!=null){for(var g in u.fieldName)if(u.fieldName.hasOwnProperty(g))break;t[g]=u.toObjectFn?u.isRepeated?jspb.Message.toObjectList(s,u.toObjectFn,o):u.toObjectFn(o,s):s}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var o in n){var l=n[o],u=l.fieldInfo;if(!l.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var s=r.call(e,u);if(s!=null)if(u.isMessageType()){if(!l.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");l.binaryWriterFn.call(t,u.fieldIndex,s,l.binaryMessageSerializeFn)}else l.binaryWriterFn.call(t,u.fieldIndex,s)}},jspb.Message.readBinaryExtension=function(e,t,n,r,o){var l=n[t.getFieldNumber()];if(l){if(n=l.fieldInfo,!l.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var u=new n.ctor;l.binaryReaderFn.call(t,u,l.binaryMessageDeserializeFn)}else u=l.binaryReaderFn.call(t);n.isRepeated&&!l.isPacked?(t=r.call(e,n))?t.push(u):o.call(e,n,[u]):o.call(e,n,u)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:+e},jspb.Message.getBooleanField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return e==null||typeof e=="string"?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return e==null||e instanceof Uint8Array?e:typeof e=="string"?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&typeof e[0]!="string"?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,function(n){goog.typeOf(n)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(n)+" expected "+t)})}},jspb.Message.getFieldWithDefault=function(e,t,n){return(e=jspb.Message.getField(e,t))==null?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return(e=jspb.Message.getBooleanField(e,t))==null?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return(e=jspb.Message.getOptionalFloatingPointField(e,t))==null?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(n)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),r!=null?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&r!==void 0&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,o=0;o<t.length;o++){var l=t[o],u=jspb.Message.getField(e,l);u!=null&&(n=l,r=u,jspb.Message.setField(e,l,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var o=jspb.Message.getField(e,n);(r||o)&&(e.wrappers_[n]=new t(o))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),o=[],l=0;l<r.length;l++)o[l]=new t(r[l]);e.wrappers_[n]=o}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n&&n.toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=r&&r.toArray();return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,o)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],o=0;o<n.length;o++)r[o]=n[o].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,o){jspb.Message.wrapRepeatedField_(e,r,t);var l=e.wrappers_[t];return l||(l=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),o!=null?(l.splice(o,0,n),e.splice(o,0,n.toArray())):(l.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var o={},l=0;l<e.length;l++)o[t.call(e[l])]=n?n.call(e[l],r,e[l]):e[l];return o},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(n){return new e.ctor(n)})),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,function(r){return r.toArray()})):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t&&t.toArray()):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],o=0,l=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),o=1);o<l;o++)jspb.Message.compareFields(n[o],t[o])||(r[o]=t[o]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!(typeof e=="number"&&isNaN(e)||typeof t=="number"&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,o=void 0,l=Math.max(e.length,t.length);for(n=0;n<l;n++){var u=e[n],s=t[n];if(u&&u.constructor==Object&&(goog.asserts.assert(r===void 0),goog.asserts.assert(n===e.length-1),r=u,u=void 0),s&&s.constructor==Object&&(goog.asserts.assert(o===void 0),goog.asserts.assert(n===t.length-1),o=s,s=void 0),!jspb.Message.compareFields(u,s))return!1}return!r&&!o||(r=r||{},o=o||{},jspb.Message.compareExtensions(r,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),o=n.length=0;o<r.length;o++)n[o]=r[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];r!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)(r=e[n])!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,o=t>>>16;for(t=n*r+65536*(n*o&65535)+65536*((e>>>=16)*r&65535),n=e*o+(n*o>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(e==0)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return e==""&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var o=parseInt(e[r],10);n.lo=o,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=(2147483648&this.hi)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&e[0]=="-";return t&&(e=e.substring(1)),(e=jspb.arith.UInt64.fromString(e))===null?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(n,r){t.writeSplitVarint64(n>>>0,r>>>0)})},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(typeof e=="boolean"||typeof e=="number"),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var o=e.charCodeAt(n+1);56320<=o&&57343>=o&&(r=1024*(r-55296)+o-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){e!=null&&t!=null&&n!=null&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,o=0;o<n;o++){var l=t[o];e.set(l,r),r+=l.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){t!=null&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){t!=null&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){t!=null&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){t!=null&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,function(o,l){r.writeSplitVarint64(o>>>0,l>>>0)})},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++){var o=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(o)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=this.encoder_,l=0;l<t.length;l++)jspb.utils.toZigzag64(n(t[l]),r(t[l]),function(u,s){o.writeSplitVarint64(u>>>0,s>>>0)});this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf}).call(this,__webpack_require__(6),__webpack_require__(5).Buffer)},function(e,t){var n=typeof self<"u"?self:this,r=function(){function l(){this.fetch=!1,this.DOMException=n.DOMException}return l.prototype=n,new l}();(function(l){(function(u){var s="URLSearchParams"in l,g="Symbol"in l&&"iterator"in Symbol,c="FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),d="FormData"in l,w="ArrayBuffer"in l;if(w)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(C){return C&&v.indexOf(Object.prototype.toString.call(C))>-1};function f(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function p(C){return typeof C!="string"&&(C=String(C)),C}function S(C){var z={next:function(){var P=C.shift();return{done:P===void 0,value:P}}};return g&&(z[Symbol.iterator]=function(){return z}),z}function N(C){this.map={},C instanceof N?C.forEach(function(z,P){this.append(P,z)},this):Array.isArray(C)?C.forEach(function(z){this.append(z[0],z[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(z){this.append(z,C[z])},this)}function B(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function E(C){return new Promise(function(z,P){C.onload=function(){z(C.result)},C.onerror=function(){P(C.error)}})}function T(C){var z=new FileReader,P=E(z);return z.readAsArrayBuffer(C),P}function h(C){if(C.slice)return C.slice(0);var z=new Uint8Array(C.byteLength);return z.set(new Uint8Array(C)),z.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(C){var z;this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:c&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:d&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:s&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():w&&c&&(z=C)&&DataView.prototype.isPrototypeOf(z)?(this._bodyArrayBuffer=h(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):w&&(ArrayBuffer.prototype.isPrototypeOf(C)||y(C))?this._bodyArrayBuffer=h(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c&&(this.blob=function(){var C=B(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?B(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(T)}),this.text=function(){var C,z,P,D=B(this);if(D)return D;if(this._bodyBlob)return C=this._bodyBlob,z=new FileReader,P=E(z),z.readAsText(C),P;if(this._bodyArrayBuffer)return Promise.resolve(function(O){for(var L=new Uint8Array(O),U=new Array(L.length),A=0;A<L.length;A++)U[A]=String.fromCharCode(L[A]);return U.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}N.prototype.append=function(C,z){C=f(C),z=p(z);var P=this.map[C];this.map[C]=P?P+", "+z:z},N.prototype.delete=function(C){delete this.map[f(C)]},N.prototype.get=function(C){return C=f(C),this.has(C)?this.map[C]:null},N.prototype.has=function(C){return this.map.hasOwnProperty(f(C))},N.prototype.set=function(C,z){this.map[f(C)]=p(z)},N.prototype.forEach=function(C,z){for(var P in this.map)this.map.hasOwnProperty(P)&&C.call(z,this.map[P],P,this)},N.prototype.keys=function(){var C=[];return this.forEach(function(z,P){C.push(P)}),S(C)},N.prototype.values=function(){var C=[];return this.forEach(function(z){C.push(z)}),S(C)},N.prototype.entries=function(){var C=[];return this.forEach(function(z,P){C.push([P,z])}),S(C)},g&&(N.prototype[Symbol.iterator]=N.prototype.entries);var W=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function X(C,z){var P,D,O=(z=z||{}).body;if(C instanceof X){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,z.headers||(this.headers=new N(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,O||C._bodyInit==null||(O=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=z.credentials||this.credentials||"same-origin",!z.headers&&this.headers||(this.headers=new N(z.headers)),this.method=(P=z.method||this.method||"GET",D=P.toUpperCase(),W.indexOf(D)>-1?D:P),this.mode=z.mode||this.mode||null,this.signal=z.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(O)}function m(C){var z=new FormData;return C.trim().split("&").forEach(function(P){if(P){var D=P.split("="),O=D.shift().replace(/\+/g," "),L=D.join("=").replace(/\+/g," ");z.append(decodeURIComponent(O),decodeURIComponent(L))}}),z}function _(C,z){z||(z={}),this.type="default",this.status=z.status===void 0?200:z.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in z?z.statusText:"OK",this.headers=new N(z.headers),this.url=z.url||"",this._initBody(C)}X.prototype.clone=function(){return new X(this,{body:this._bodyInit})},R.call(X.prototype),R.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},_.error=function(){var C=new _(null,{status:0,statusText:""});return C.type="error",C};var G=[301,302,303,307,308];_.redirect=function(C,z){if(G.indexOf(z)===-1)throw new RangeError("Invalid status code");return new _(null,{status:z,headers:{location:C}})},u.DOMException=l.DOMException;try{new u.DOMException}catch{u.DOMException=function(z,P){this.message=z,this.name=P;var D=Error(z);this.stack=D.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function j(C,z){return new Promise(function(P,D){var O=new X(C,z);if(O.signal&&O.signal.aborted)return D(new u.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function U(){L.abort()}L.onload=function(){var A,V,q={status:L.status,statusText:L.statusText,headers:(A=L.getAllResponseHeaders()||"",V=new N,A.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(ee){var te=ee.split(":"),k=te.shift().trim();if(k){var x=te.join(":").trim();V.append(k,x)}}),V)};q.url="responseURL"in L?L.responseURL:q.headers.get("X-Request-URL");var Q="response"in L?L.response:L.responseText;P(new _(Q,q))},L.onerror=function(){D(new TypeError("Network request failed"))},L.ontimeout=function(){D(new TypeError("Network request failed"))},L.onabort=function(){D(new u.DOMException("Aborted","AbortError"))},L.open(O.method,O.url,!0),O.credentials==="include"?L.withCredentials=!0:O.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&c&&(L.responseType="blob"),O.headers.forEach(function(A,V){L.setRequestHeader(V,A)}),O.signal&&(O.signal.addEventListener("abort",U),L.onreadystatechange=function(){L.readyState===4&&O.signal.removeEventListener("abort",U)}),L.send(O._bodyInit===void 0?null:O._bodyInit)})}j.polyfill=!0,l.fetch||(l.fetch=j,l.Headers=N,l.Request=X,l.Response=_),u.Headers=N,u.Request=X,u.Response=_,u.fetch=j,Object.defineProperty(u,"__esModule",{value:!0})})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},function(e,t,n){(function(r){const o=n(215),l=n(51),u=(s,g,c)=>({from:u,EnvVarError:n(51),get:function(d){if(!d)return s;if(arguments.length>1)throw new l("It looks like you passed more than one argument to env.get(). Since env-var@6.0.0 this is no longer supported. To set a default value use env.get(TARGET).default(DEFAULT)");return o(s,d,g||{},c||function(){})},accessors:n(94),logger:n(229)(console.log,s.NODE_ENV)});e.exports=u(r.env)}).call(this,n(2))},function(e,t,n){(function(r){const o=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,l=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(){this.signal.dispatchEvent("abort")}},u=typeof AbortSignal=="function",s=typeof l.AbortSignal=="function",g=u?AbortSignal:s?l.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(T){if(T==="abort"){this.aborted=!0;const h={type:T,target:this};this.onabort(h),this._listeners.forEach(R=>R(h),this)}}onabort(){}addEventListener(T,h){T==="abort"&&this._listeners.push(h)}removeEventListener(T,h){T==="abort"&&(this._listeners=this._listeners.filter(R=>R!==h))}},c=new Set,d=(T,h)=>{const R=`LRU_CACHE_OPTION_${T}`;y(R)&&f(R,`${T} option`,`options.${h}`,E)},w=(T,h)=>{const R=`LRU_CACHE_METHOD_${T}`;if(y(R)){const{prototype:W}=E,{get:X}=Object.getOwnPropertyDescriptor(W,T);f(R,`${T} method`,`cache.${h}()`,X)}},v=(...T)=>{typeof r=="object"&&r&&typeof r.emitWarning=="function"?r.emitWarning(...T):console.error(...T)},y=T=>!c.has(T),f=(T,h,R,W)=>{c.add(T),v(`The ${h} is deprecated. Please use ${R} instead.`,"DeprecationWarning",T,W)},p=T=>T&&T===Math.floor(T)&&T>0&&isFinite(T),S=T=>p(T)?T<=Math.pow(2,8)?Uint8Array:T<=Math.pow(2,16)?Uint16Array:T<=Math.pow(2,32)?Uint32Array:T<=Number.MAX_SAFE_INTEGER?N:null:null;class N extends Array{constructor(h){super(h),this.fill(0)}}class B{constructor(h){if(h===0)return[];const R=S(h);this.heap=new R(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}}class E{constructor(h={}){const{max:R=0,ttl:W,ttlResolution:X=1,ttlAutopurge:m,updateAgeOnGet:_,updateAgeOnHas:G,allowStale:j,dispose:C,disposeAfter:z,noDisposeOnSet:P,noUpdateTTL:D,maxSize:O=0,maxEntrySize:L=0,sizeCalculation:U,fetchMethod:A,fetchContext:V,noDeleteOnFetchRejection:q,noDeleteOnStaleGet:Q}=h,{length:ee,maxAge:te,stale:k}=h instanceof E?{}:h;if(R!==0&&!p(R))throw new TypeError("max option must be a nonnegative integer");const x=R?S(R):Array;if(!x)throw new Error("invalid max value: "+R);if(this.max=R,this.maxSize=O,this.maxEntrySize=L||this.maxSize,this.sizeCalculation=U||ee,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=A||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=V,!this.fetchMethod&&V!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(R).fill(null),this.valList=new Array(R).fill(null),this.next=new x(R),this.prev=new x(R),this.head=0,this.tail=0,this.free=new B(R),this.initialFill=1,this.size=0,typeof C=="function"&&(this.dispose=C),typeof z=="function"?(this.disposeAfter=z,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!P,this.noUpdateTTL=!!D,this.noDeleteOnFetchRejection=!!q,this.maxEntrySize!==0){if(this.maxSize!==0&&!p(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!p(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!j||!!k,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!_,this.updateAgeOnHas=!!G,this.ttlResolution=p(X)||X===0?X:1,this.ttlAutopurge=!!m,this.ttl=W||te||0,this.ttl){if(!p(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const b="LRU_CACHE_UNBOUNDED";y(b)&&(c.add(b),v("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",b,E))}k&&d("stale","allowStale"),te&&d("maxAge","ttl"),ee&&d("length","sizeCalculation")}getRemainingTTL(h){return this.has(h,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new N(this.max),this.starts=new N(this.max),this.setItemTTL=(W,X,m=o.now())=>{if(this.starts[W]=X!==0?m:0,this.ttls[W]=X,X!==0&&this.ttlAutopurge){const _=setTimeout(()=>{this.isStale(W)&&this.delete(this.keyList[W])},X+1);_.unref&&_.unref()}},this.updateItemAge=W=>{this.starts[W]=this.ttls[W]!==0?o.now():0};let h=0;const R=()=>{const W=o.now();if(this.ttlResolution>0){h=W;const X=setTimeout(()=>h=0,this.ttlResolution);X.unref&&X.unref()}return W};this.getRemainingTTL=W=>{const X=this.keyMap.get(W);return X===void 0?0:this.ttls[X]===0||this.starts[X]===0?1/0:this.starts[X]+this.ttls[X]-(h||R())},this.isStale=W=>this.ttls[W]!==0&&this.starts[W]!==0&&(h||R())-this.starts[W]>this.ttls[W]}updateItemAge(h){}setItemTTL(h,R,W){}isStale(h){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new N(this.max),this.removeItemSize=h=>{this.calculatedSize-=this.sizes[h],this.sizes[h]=0},this.requireSize=(h,R,W,X)=>{if(!p(W)){if(!X)throw new TypeError("invalid size value (must be positive integer)");if(typeof X!="function")throw new TypeError("sizeCalculation must be a function");if(W=X(R,h),!p(W))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return W},this.addItemSize=(h,R)=>{this.sizes[h]=R;const W=this.maxSize-this.sizes[h];for(;this.calculatedSize>W;)this.evict(!0);this.calculatedSize+=this.sizes[h]}}removeItemSize(h){}addItemSize(h,R){}requireSize(h,R,W,X){if(W||X)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:h=this.allowStale}={}){if(this.size)for(let R=this.tail;this.isValidIndex(R)&&(!h&&this.isStale(R)||(yield R),R!==this.head);)R=this.prev[R]}*rindexes({allowStale:h=this.allowStale}={}){if(this.size)for(let R=this.head;this.isValidIndex(R)&&(!h&&this.isStale(R)||(yield R),R!==this.tail);)R=this.next[R]}isValidIndex(h){return this.keyMap.get(this.keyList[h])===h}*entries(){for(const h of this.indexes())yield[this.keyList[h],this.valList[h]]}*rentries(){for(const h of this.rindexes())yield[this.keyList[h],this.valList[h]]}*keys(){for(const h of this.indexes())yield this.keyList[h]}*rkeys(){for(const h of this.rindexes())yield this.keyList[h]}*values(){for(const h of this.indexes())yield this.valList[h]}*rvalues(){for(const h of this.rindexes())yield this.valList[h]}[Symbol.iterator](){return this.entries()}find(h,R={}){for(const W of this.indexes())if(h(this.valList[W],this.keyList[W],this))return this.get(this.keyList[W],R)}forEach(h,R=this){for(const W of this.indexes())h.call(R,this.valList[W],this.keyList[W],this)}rforEach(h,R=this){for(const W of this.rindexes())h.call(R,this.valList[W],this.keyList[W],this)}get prune(){return w("prune","purgeStale"),this.purgeStale}purgeStale(){let h=!1;for(const R of this.rindexes({allowStale:!0}))this.isStale(R)&&(this.delete(this.keyList[R]),h=!0);return h}dump(){const h=[];for(const R of this.indexes({allowStale:!0})){const W=this.keyList[R],X=this.valList[R],m={value:this.isBackgroundFetch(X)?X.__staleWhileFetching:X};if(this.ttls){m.ttl=this.ttls[R];const _=o.now()-this.starts[R];m.start=Math.floor(Date.now()-_)}this.sizes&&(m.size=this.sizes[R]),h.unshift([W,m])}return h}load(h){this.clear();for(const[R,W]of h){if(W.start){const X=Date.now()-W.start;W.start=o.now()-X}this.set(R,W.value,W)}}dispose(h,R,W){}set(h,R,{ttl:W=this.ttl,start:X,noDisposeOnSet:m=this.noDisposeOnSet,size:_=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:j=this.noUpdateTTL}={}){if(_=this.requireSize(h,R,_,G),this.maxEntrySize&&_>this.maxEntrySize)return this;let C=this.size===0?void 0:this.keyMap.get(h);if(C===void 0)C=this.newIndex(),this.keyList[C]=h,this.valList[C]=R,this.keyMap.set(h,C),this.next[this.tail]=C,this.prev[C]=this.tail,this.tail=C,this.size++,this.addItemSize(C,_),j=!1;else{const z=this.valList[C];R!==z&&(this.isBackgroundFetch(z)?z.__abortController.abort():m||(this.dispose(z,h,"set"),this.disposeAfter&&this.disposed.push([z,h,"set"])),this.removeItemSize(C),this.valList[C]=R,this.addItemSize(C,_)),this.moveToTail(C)}if(W===0||this.ttl!==0||this.ttls||this.initializeTTLTracking(),j||this.setItemTTL(C,W,X),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const h=this.valList[this.head];return this.evict(!0),h}}evict(h){const R=this.head,W=this.keyList[R],X=this.valList[R];return this.isBackgroundFetch(X)?X.__abortController.abort():(this.dispose(X,W,"evict"),this.disposeAfter&&this.disposed.push([X,W,"evict"])),this.removeItemSize(R),h&&(this.keyList[R]=null,this.valList[R]=null,this.free.push(R)),this.head=this.next[R],this.keyMap.delete(W),this.size--,R}has(h,{updateAgeOnHas:R=this.updateAgeOnHas}={}){const W=this.keyMap.get(h);return W!==void 0&&!this.isStale(W)&&(R&&this.updateItemAge(W),!0)}peek(h,{allowStale:R=this.allowStale}={}){const W=this.keyMap.get(h);if(W!==void 0&&(R||!this.isStale(W))){const X=this.valList[W];return this.isBackgroundFetch(X)?X.__staleWhileFetching:X}}backgroundFetch(h,R,W,X){const m=R===void 0?void 0:this.valList[R];if(this.isBackgroundFetch(m))return m;const _=new l,G={signal:_.signal,options:W,context:X},j=new Promise(C=>C(this.fetchMethod(h,m,G))).then(C=>(_.signal.aborted||this.set(h,C,G.options),C),C=>{if(this.valList[R]===j&&(!W.noDeleteOnFetchRejection||j.__staleWhileFetching===void 0?this.delete(h):this.valList[R]=j.__staleWhileFetching),j.__returned===j)throw C});return j.__abortController=_,j.__staleWhileFetching=m,j.__returned=null,R===void 0?(this.set(h,j,G.options),R=this.keyMap.get(h)):this.valList[R]=j,j}isBackgroundFetch(h){return h&&typeof h=="object"&&typeof h.then=="function"&&Object.prototype.hasOwnProperty.call(h,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(h,"__returned")&&(h.__returned===h||h.__returned===null)}async fetch(h,{allowStale:R=this.allowStale,updateAgeOnGet:W=this.updateAgeOnGet,noDeleteOnStaleGet:X=this.noDeleteOnStaleGet,ttl:m=this.ttl,noDisposeOnSet:_=this.noDisposeOnSet,size:G=0,sizeCalculation:j=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:z=this.noDeleteOnFetchRejection,fetchContext:P=this.fetchContext,forceRefresh:D=!1}={}){if(!this.fetchMethod)return this.get(h,{allowStale:R,updateAgeOnGet:W,noDeleteOnStaleGet:X});const O={allowStale:R,updateAgeOnGet:W,noDeleteOnStaleGet:X,ttl:m,noDisposeOnSet:_,size:G,sizeCalculation:j,noUpdateTTL:C,noDeleteOnFetchRejection:z};let L=this.keyMap.get(h);if(L===void 0){const U=this.backgroundFetch(h,L,O,P);return U.__returned=U}{const U=this.valList[L];if(this.isBackgroundFetch(U))return R&&U.__staleWhileFetching!==void 0?U.__staleWhileFetching:U.__returned=U;if(!D&&!this.isStale(L))return this.moveToTail(L),W&&this.updateItemAge(L),U;const A=this.backgroundFetch(h,L,O,P);return R&&A.__staleWhileFetching!==void 0?A.__staleWhileFetching:A.__returned=A}}get(h,{allowStale:R=this.allowStale,updateAgeOnGet:W=this.updateAgeOnGet,noDeleteOnStaleGet:X=this.noDeleteOnStaleGet}={}){const m=this.keyMap.get(h);if(m!==void 0){const _=this.valList[m],G=this.isBackgroundFetch(_);return this.isStale(m)?G?R?_.__staleWhileFetching:void 0:(X||this.delete(h),R?_:void 0):G?void 0:(this.moveToTail(m),W&&this.updateItemAge(m),_)}}connect(h,R){this.prev[R]=h,this.next[h]=R}moveToTail(h){h!==this.tail&&(h===this.head?this.head=this.next[h]:this.connect(this.prev[h],this.next[h]),this.connect(this.tail,h),this.tail=h)}get del(){return w("del","delete"),this.delete}delete(h){let R=!1;if(this.size!==0){const W=this.keyMap.get(h);if(W!==void 0)if(R=!0,this.size===1)this.clear();else{this.removeItemSize(W);const X=this.valList[W];this.isBackgroundFetch(X)?X.__abortController.abort():(this.dispose(X,h,"delete"),this.disposeAfter&&this.disposed.push([X,h,"delete"])),this.keyMap.delete(h),this.keyList[W]=null,this.valList[W]=null,W===this.tail?this.tail=this.prev[W]:W===this.head?this.head=this.next[W]:(this.next[this.prev[W]]=this.next[W],this.prev[this.next[W]]=this.prev[W]),this.size--,this.free.push(W)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return R}clear(){for(const h of this.rindexes({allowStale:!0})){const R=this.valList[h];if(this.isBackgroundFetch(R))R.__abortController.abort();else{const W=this.keyList[h];this.dispose(R,W,"delete"),this.disposeAfter&&this.disposed.push([R,W,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return w("reset","clear"),this.clear}get length(){return((h,R)=>{const W=`LRU_CACHE_PROPERTY_${h}`;if(y(W)){const{prototype:X}=E,{get:m}=Object.getOwnPropertyDescriptor(X,h);f(W,`${h} property`,`cache.${R}`,m)}})("length","size"),this.size}static get AbortController(){return l}static get AbortSignal(){return g}}e.exports=E}).call(this,n(2))},function(e,t,n){var r=n(42).Colorizer;e.exports=function(o){return r.addColors(o.colors||o),o}},function(e,t,n){var r={};e.exports=r,r.themes={};var o=n(13),l=r.styles=n(107),u=Object.defineProperties,s=new RegExp(/[\r\n]+/g);r.supportsColor=n(108).supportsColor,r.enabled===void 0&&(r.enabled=r.supportsColor()!==!1),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(S){return(""+S).replace(/\x1B\[\d+m/g,"")},r.stylize=function(S,N){if(!r.enabled)return S+"";var B=l[N];return!B&&N in r?r[N](S):B.open+S+B.close};var g=/[|\\{}()[\]^$+*?.]/g;function c(S){var N=function B(){return y.apply(B,arguments)};return N._styles=S,N.__proto__=v,N}var d,w=(d={},l.grey=l.gray,Object.keys(l).forEach(function(S){l[S].closeRe=new RegExp(function(N){if(typeof N!="string")throw new TypeError("Expected a string");return N.replace(g,"\\$&")}(l[S].close),"g"),d[S]={get:function(){return c(this._styles.concat(S))}}}),d),v=u(function(){},w);function y(){var S=Array.prototype.slice.call(arguments),N=S.map(function(R){return R!=null&&R.constructor===String?R:o.inspect(R)}).join(" ");if(!r.enabled||!N)return N;for(var B=N.indexOf(`
53
+ `)!=-1,E=this._styles,T=E.length;T--;){var h=l[E[T]];N=h.open+N.replace(h.closeRe,h.open)+h.close,B&&(N=N.replace(s,function(R){return h.close+R+h.open}))}return N}r.setTheme=function(S){if(typeof S!="string")for(var N in S)(function(B){r[B]=function(E){if(typeof S[B]=="object"){var T=E;for(var h in S[B])T=r[S[B][h]](T);return T}return r[S[B]](E)}})(N);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var f=function(S,N){var B=N.split("");return(B=B.map(S)).join("")};for(var p in r.trap=n(110),r.zalgo=n(111),r.maps={},r.maps.america=n(112)(r),r.maps.zebra=n(113)(r),r.maps.rainbow=n(114)(r),r.maps.random=n(115)(r),r.maps)(function(S){r[S]=function(N){return f(r.maps[S],N)}})(p);u(r,function(){var S={};return Object.keys(w).forEach(function(N){S[N]={get:function(){return c([N])}}}),S}())},function(e,t){e.exports=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"}},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(n,r){n.super_=r;var o=function(){};o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n}},function(e,t){var n={};e.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(o){var l=r[o],u=n[o]=[];u.open="\x1B["+l[0]+"m",u.close="\x1B["+l[1]+"m"})},function(e,t,n){(function(r){var o=n(16),l=n(109),u=r.env,s=void 0;function g(c){return function(d){return d!==0&&{level:d,hasBasic:!0,has256:d>=2,has16m:d>=3}}(function(d){if(s===!1)return 0;if(l("color=16m")||l("color=full")||l("color=truecolor"))return 3;if(l("color=256"))return 2;if(d&&!d.isTTY&&s!==!0)return 0;var w=s?1:0;if(r.platform==="win32"){var v=o.release().split(".");return Number(r.versions.node.split(".")[0])>=8&&Number(v[0])>=10&&Number(v[2])>=10586?Number(v[2])>=14931?3:2:1}return"CI"in u?["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(y){return y in u})||u.CI_NAME==="codeship"?1:w:"TEAMCITY_VERSION"in u?/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0:"TERM_PROGRAM"in u?parseInt("3.4.20".split(".")[0],10)>=3?3:2:/-256(color)?$/i.test("xterm-256color")?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test("xterm-256color")||"COLORTERM"in u?1:w}(c))}l("no-color")||l("no-colors")||l("color=false")?s=!1:(l("color")||l("colors")||l("color=true")||l("color=always"))&&(s=!0),"FORCE_COLOR"in u&&(s=u.FORCE_COLOR.length===0||parseInt(u.FORCE_COLOR,10)!==0),e.exports={supportsColor:g,stdout:g(r.stdout),stderr:g(r.stderr)}}).call(this,n(2))},function(e,t,n){(function(r){e.exports=function(o,l){var u=(l=l||r.argv).indexOf("--"),s=/^-{1,2}/.test(o)?"":"--",g=l.indexOf(s+o);return g!==-1&&(u===-1||g<u)}}).call(this,n(2))},function(e,t){e.exports=function(n,r){var o="";n=(n=n||"Run the trap, drop the bass").split("");var l={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return n.forEach(function(u){u=u.toLowerCase();var s=l[u]||[" "],g=Math.floor(Math.random()*s.length);o+=l[u]!==void 0?l[u][g]:u}),o}},function(e,t){e.exports=function(n,r){n=n||" he is here ";var o={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},l=[].concat(o.up,o.down,o.mid);function u(g){return Math.floor(Math.random()*g)}function s(g){var c=!1;return l.filter(function(d){c=d===g}),c}return function(g,c){var d,w,v="";for(w in(c=c||{}).up=c.up===void 0||c.up,c.mid=c.mid===void 0||c.mid,c.down=c.down===void 0||c.down,c.size=c.size!==void 0?c.size:"maxi",g=g.split(""))if(!s(w)){switch(v+=g[w],d={up:0,down:0,mid:0},c.size){case"mini":d.up=u(8),d.mid=u(2),d.down=u(8);break;case"maxi":d.up=u(16)+3,d.mid=u(4)+1,d.down=u(64)+3;break;default:d.up=u(8)+1,d.mid=u(6)/2,d.down=u(8)+1}var y=["up","mid","down"];for(var f in y)for(var p=y[f],S=0;S<=d[p];S++)c[p]&&(v+=o[p][u(o[p].length)])}return v}(n,r)}},function(e,t){e.exports=function(n){return function(r,o,l){if(r===" ")return r;switch(o%3){case 0:return n.red(r);case 1:return n.white(r);case 2:return n.blue(r)}}}},function(e,t){e.exports=function(n){return function(r,o,l){return o%2==0?r:n.inverse(r)}}},function(e,t){e.exports=function(n){var r=["red","yellow","green","blue","magenta"];return function(o,l,u){return o===" "?o:n[r[l++%r.length]](o)}}},function(e,t){e.exports=function(n){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(o,l,u){return o===" "?o:n[r[Math.round(Math.random()*(r.length-2))]](o)}}},function(e,t,n){Object.defineProperty(t,"cli",{value:n(117)}),Object.defineProperty(t,"npm",{value:n(118)}),Object.defineProperty(t,"syslog",{value:n(119)})},function(e,t,n){t.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},t.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}},function(e,t,n){t.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},t.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}},function(e,t,n){t.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},t.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}},function(e,t,n){var r=n(8);e.exports=r(function(o){return o.message=" ".concat(o.message),o})},function(e,t,n){function r(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(42).Colorizer,u=n(59).Padder,s=n(3),g=s.configs,c=s.MESSAGE,d=function(){function w(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,w),f.levels||(f.levels=g.cli.levels),this.colorizer=new l(f),this.padder=new u(f),this.options=f}var v,y;return v=w,(y=[{key:"transform",value:function(f,p){return this.colorizer.transform(this.padder.transform(f,p),p),f[c]="".concat(f.level,":").concat(f.message),f}}])&&o(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}();e.exports=function(w){return new d(w)},e.exports.Format=d},function(e,t,n){var r=n(8);function o(u){if(u.every(l))return function(s){for(var g=s,c=0;c<u.length;c++)if(!(g=u[c].transform(g,u[c].options)))return!1;return g}}function l(u){if(typeof u.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
54
+ `));return!0}e.exports=function(){for(var u=arguments.length,s=new Array(u),g=0;g<u;g++)s[g]=arguments[g];var c=r(o(s)),d=c();return d.Format=c.Format,d},e.exports.cascade=o},function(e,t,n){function r(g,c,d){return c in g?Object.defineProperty(g,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):g[c]=d,g}var o=n(8),l=n(3),u=l.LEVEL,s=l.MESSAGE;e.exports=o(function(g,c){var d=c.stack,w=c.cause;if(g instanceof Error){var v,y=Object.assign({},g,(r(v={level:g.level},u,g[u]||g.level),r(v,"message",g.message),r(v,s,g[s]||g.message),v));return d&&(y.stack=g.stack),w&&(y.cause=g.cause),y}if(!(g.message instanceof Error))return g;var f=g.message;return Object.assign(g,f),g.message=f.message,g[s]=f.message,d&&(g.stack=f.stack),w&&(g.cause=f.cause),g})},function(e,t,n){var r=n(8),o=n(3).MESSAGE,l=n(29);function u(s,g){return typeof g=="bigint"?g.toString():g}e.exports=r(function(s,g){var c=l.configure(g);return s[o]=c(s,g.replacer||u,g.space),s})},function(e,t,n){var r=n(8);e.exports=r(function(o,l){return l.message?(o.message="[".concat(l.label,"] ").concat(o.message),o):(o.label=l.label,o)})},function(e,t,n){var r=n(8),o=n(3).MESSAGE,l=n(29);e.exports=r(function(u){var s={};return u.message&&(s["@message"]=u.message,delete u.message),u.timestamp&&(s["@timestamp"]=u.timestamp,delete u.timestamp),s["@fields"]=u,u[o]=l(s),u})},function(e,t,n){var r=n(8);function o(u,s,g){var c,d,w,v=s.reduce(function(f,p){return f[p]=u[p],delete u[p],f},{}),y=Object.keys(u).reduce(function(f,p){return f[p]=u[p],delete u[p],f},{});return Object.assign(u,v,(w=y,(d=g)in(c={})?Object.defineProperty(c,d,{value:w,enumerable:!0,configurable:!0,writable:!0}):c[d]=w,c)),u}function l(u,s,g){return u[g]=s.reduce(function(c,d){return c[d]=u[d],delete u[d],c},{}),u}e.exports=r(function(u){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g="metadata";s.key&&(g=s.key);var c=[];return s.fillExcept||s.fillWith||(c.push("level"),c.push("message")),s.fillExcept&&(c=s.fillExcept),c.length>0?o(u,c,g):s.fillWith?l(u,s.fillWith,g):u})},function(e,t,n){var r=n(8),o=n(129);e.exports=r(function(l){var u=+new Date;return(void 0).diff=u-((void 0).prevTime||u),(void 0).prevTime=u,l.ms="+".concat(o((void 0).diff)),l})},function(e,t){var n=1e3,r=6e4,o=36e5,l=24*o;function u(s,g,c,d){var w=g>=1.5*c;return Math.round(s/c)+" "+d+(w?"s":"")}e.exports=function(s,g){g=g||{};var c=typeof s;if(c==="string"&&s.length>0)return function(d){if(!((d=String(d)).length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(w){var v=parseFloat(w[1]);switch((w[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*v;case"weeks":case"week":case"w":return 6048e5*v;case"days":case"day":case"d":return v*l;case"hours":case"hour":case"hrs":case"hr":case"h":return v*o;case"minutes":case"minute":case"mins":case"min":case"m":return v*r;case"seconds":case"second":case"secs":case"sec":case"s":return v*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}(s);if(c==="number"&&isFinite(s))return g.long?function(d){var w=Math.abs(d);return w>=l?u(d,w,l,"day"):w>=o?u(d,w,o,"hour"):w>=r?u(d,w,r,"minute"):w>=n?u(d,w,n,"second"):d+" ms"}(s):function(d){var w=Math.abs(d);return w>=l?Math.round(d/l)+"d":w>=o?Math.round(d/o)+"h":w>=r?Math.round(d/r)+"m":w>=n?Math.round(d/n)+"s":d+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}},function(e,t,n){var r=n(13).inspect,o=n(8),l=n(3),u=l.LEVEL,s=l.MESSAGE,g=l.SPLAT;e.exports=o(function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=Object.assign({},c);return delete w[u],delete w[s],delete w[g],c[s]=r(w,!1,d.depth||null,d.colorize),c})},function(e,t,n){function r(u,s){for(var g=0;g<s.length;g++){var c=s[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}var o=n(3).MESSAGE,l=function(){function u(c){(function(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")})(this,u),this.template=c}var s,g;return s=u,(g=[{key:"transform",value:function(c){return c[o]=this.template(c),c}}])&&r(s.prototype,g),Object.defineProperty(s,"prototype",{writable:!1}),u}();e.exports=function(u){return new l(u)},e.exports.Printf=e.exports.Format=l},function(e,t,n){var r=n(8),o=n(3).MESSAGE,l=n(29);e.exports=r(function(u){var s=l(Object.assign({},u,{level:void 0,message:void 0,splat:void 0})),g=u.padding&&u.padding[u.level]||"";return u[o]=s!=="{}"?"".concat(u.level,":").concat(g," ").concat(u.message," ").concat(s):"".concat(u.level,":").concat(g," ").concat(u.message),u})},function(e,t,n){function r(w){return function(v){if(Array.isArray(v))return o(v)}(w)||function(v){if(typeof Symbol<"u"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(w)||function(v,y){if(v){if(typeof v=="string")return o(v,y);var f=Object.prototype.toString.call(v).slice(8,-1);if(f==="Object"&&v.constructor&&(f=v.constructor.name),f==="Map"||f==="Set")return Array.from(v);if(f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return o(v,y)}}(w)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
55
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(w,v){(v==null||v>w.length)&&(v=w.length);for(var y=0,f=new Array(v);y<v;y++)f[y]=w[y];return f}function l(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var u=n(13),s=n(3).SPLAT,g=/%[scdjifoO%]/g,c=/%%/g,d=function(){function w(f){(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")})(this,w),this.options=f}var v,y;return v=w,(y=[{key:"_splat",value:function(f,p){var S=f.message,N=f[s]||f.splat||[],B=S.match(c),E=B&&B.length||0,T=p.length-E-N.length,h=T<0?N.splice(T,-1*T):[],R=h.length;if(R)for(var W=0;W<R;W++)Object.assign(f,h[W]);return f.message=u.format.apply(u,[S].concat(r(N))),f}},{key:"transform",value:function(f){var p=f.message,S=f[s]||f.splat;if(!S||!S.length)return f;var N=p&&p.match&&p.match(g);if(!N&&(S||S.length)){var B=S.length>1?S.splice(0):S,E=B.length;if(E)for(var T=0;T<E;T++)Object.assign(f,B[T]);return f}return N?this._splat(f,N):f}}])&&l(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}();e.exports=function(w){return new d(w)}},function(e,t,n){var r=n(135),o=n(8);e.exports=o(function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return u.format&&(l.timestamp=typeof u.format=="function"?u.format():r.format(new Date,u.format)),l.timestamp||(l.timestamp=new Date().toISOString()),u.alias&&(l[u.alias]=l.timestamp),l})},function(e,t,n){n.r(t),n.d(t,"assign",function(){return g}),n.d(t,"format",function(){return _}),n.d(t,"parse",function(){return G}),n.d(t,"defaultI18n",function(){return v}),n.d(t,"setGlobalDateI18n",function(){return f}),n.d(t,"setGlobalDateMasks",function(){return m});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o="[^\\s]+",l=/\[([^]*?)\]/gm;function u(C,z){for(var P=[],D=0,O=C.length;D<O;D++)P.push(C[D].substr(0,z));return P}var s=function(C){return function(z,P){var D=P[C].map(function(O){return O.toLowerCase()}).indexOf(z.toLowerCase());return D>-1?D:null}};function g(C){for(var z=[],P=1;P<arguments.length;P++)z[P-1]=arguments[P];for(var D=0,O=z;D<O.length;D++){var L=O[D];for(var U in L)C[U]=L[U]}return C}var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"],w=u(d,3),v={dayNamesShort:u(c,3),dayNames:c,monthNamesShort:w,monthNames:d,amPm:["am","pm"],DoFn:function(C){return C+["th","st","nd","rd"][C%10>3?0:(C-C%10!=10?1:0)*C%10]}},y=g({},v),f=function(C){return y=g(y,C)},p=function(C){return C.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},S=function(C,z){for(z===void 0&&(z=2),C=String(C);C.length<z;)C="0"+C;return C},N={D:function(C){return String(C.getDate())},DD:function(C){return S(C.getDate())},Do:function(C,z){return z.DoFn(C.getDate())},d:function(C){return String(C.getDay())},dd:function(C){return S(C.getDay())},ddd:function(C,z){return z.dayNamesShort[C.getDay()]},dddd:function(C,z){return z.dayNames[C.getDay()]},M:function(C){return String(C.getMonth()+1)},MM:function(C){return S(C.getMonth()+1)},MMM:function(C,z){return z.monthNamesShort[C.getMonth()]},MMMM:function(C,z){return z.monthNames[C.getMonth()]},YY:function(C){return S(String(C.getFullYear()),4).substr(2)},YYYY:function(C){return S(C.getFullYear(),4)},h:function(C){return String(C.getHours()%12||12)},hh:function(C){return S(C.getHours()%12||12)},H:function(C){return String(C.getHours())},HH:function(C){return S(C.getHours())},m:function(C){return String(C.getMinutes())},mm:function(C){return S(C.getMinutes())},s:function(C){return String(C.getSeconds())},ss:function(C){return S(C.getSeconds())},S:function(C){return String(Math.round(C.getMilliseconds()/100))},SS:function(C){return S(Math.round(C.getMilliseconds()/10),2)},SSS:function(C){return S(C.getMilliseconds(),3)},a:function(C,z){return C.getHours()<12?z.amPm[0]:z.amPm[1]},A:function(C,z){return C.getHours()<12?z.amPm[0].toUpperCase():z.amPm[1].toUpperCase()},ZZ:function(C){var z=C.getTimezoneOffset();return(z>0?"-":"+")+S(100*Math.floor(Math.abs(z)/60)+Math.abs(z)%60,4)},Z:function(C){var z=C.getTimezoneOffset();return(z>0?"-":"+")+S(Math.floor(Math.abs(z)/60),2)+":"+S(Math.abs(z)%60,2)}},B=function(C){return+C-1},E=[null,"[1-9]\\d?"],T=[null,o],h=["isPm",o,function(C,z){var P=C.toLowerCase();return P===z.amPm[0]?0:P===z.amPm[1]?1:null}],R=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(C){var z=(C+"").match(/([+-]|\d\d)/gi);if(z){var P=60*+z[1]+parseInt(z[2],10);return z[0]==="+"?P:-P}return 0}],W={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+o,function(C){return parseInt(C,10)}],M:["month","[1-9]\\d?",B],MM:["month","\\d\\d",B],YY:["year","\\d\\d",function(C){var z=+(""+new Date().getFullYear()).substr(0,2);return+(""+(+C>68?z-1:z)+C)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(C){return 100*+C}],SS:["millisecond","\\d\\d",function(C){return 10*+C}],SSS:["millisecond","\\d{3}"],d:E,dd:E,ddd:T,dddd:T,MMM:["month",o,s("monthNamesShort")],MMMM:["month",o,s("monthNames")],a:h,A:h,ZZ:R,Z:R},X={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},m=function(C){return g(X,C)},_=function(C,z,P){if(z===void 0&&(z=X.default),P===void 0&&(P={}),typeof C=="number"&&(C=new Date(C)),Object.prototype.toString.call(C)!=="[object Date]"||isNaN(C.getTime()))throw new Error("Invalid Date pass to format");var D=[];z=(z=X[z]||z).replace(l,function(L,U){return D.push(U),"@@@"});var O=g(g({},y),P);return(z=z.replace(r,function(L){return N[L](C,O)})).replace(/@@@/g,function(){return D.shift()})};function G(C,z,P){if(P===void 0&&(P={}),typeof z!="string")throw new Error("Invalid format in fecha parse");if(z=X[z]||z,C.length>1e3)return null;var D={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},O=[],L=[],U=z.replace(l,function(Y,ne){return L.push(p(ne)),"@@@"}),A={},V={};U=p(U).replace(r,function(Y){var ne=W[Y],ie=ne[0],ue=ne[1],we=ne[3];if(A[ie])throw new Error("Invalid format. "+ie+" specified twice in format");return A[ie]=!0,we&&(V[we]=!0),O.push(ne),"("+ue+")"}),Object.keys(V).forEach(function(Y){if(!A[Y])throw new Error("Invalid format. "+Y+" is required in specified format")}),U=U.replace(/@@@/g,function(){return L.shift()});var q=C.match(new RegExp(U,"i"));if(!q)return null;for(var Q=g(g({},y),P),ee=1;ee<q.length;ee++){var te=O[ee-1],k=te[0],x=te[2],b=x?x(q[ee],Q):+q[ee];if(b==null)return null;D[k]=b}D.isPm===1&&D.hour!=null&&+D.hour!=12?D.hour=+D.hour+12:D.isPm===0&&+D.hour==12&&(D.hour=0);for(var I=new Date(D.year,D.month,D.day,D.hour,D.minute,D.second,D.millisecond),$=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],K=(ee=0,$.length);ee<K;ee++)if(A[$[ee][0]]&&D[$[ee][0]]!==I[$[ee][1]]())return null;return D.timezoneOffset==null?I:new Date(Date.UTC(D.year,D.month,D.day,D.hour,D.minute-D.timezoneOffset,D.second,D.millisecond))}var j={format:_,parse:G,defaultI18n:v,setGlobalDateI18n:f,setGlobalDateMasks:m};t.default=j},function(e,t,n){var r=n(58),o=n(8),l=n(3).MESSAGE;e.exports=o(function(u,s){return s.level!==!1&&(u.level=r.strip(u.level)),s.message!==!1&&(u.message=r.strip(String(u.message))),s.raw!==!1&&u[l]&&(u[l]=r.strip(String(u[l]))),u})},function(e){e.exports=JSON.parse('{"name":"winston","description":"A logger for just about everything.","version":"3.8.2","author":"Charlie Robbins <charlie.robbins@gmail.com>","maintainers":["David Hyde <dabh@alumni.stanford.edu>"],"repository":{"type":"git","url":"https://github.com/winstonjs/winston.git"},"keywords":["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],"dependencies":{"@dabh/diagnostics":"^2.0.2","@colors/colors":"1.5.0","async":"^3.2.3","is-stream":"^2.0.0","logform":"^2.4.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.5.0"},"devDependencies":{"@babel/cli":"^7.17.0","@babel/core":"^7.17.2","@babel/preset-env":"^7.16.7","@dabh/eslint-config-populist":"^5.0.0","@types/node":"^18.0.0","abstract-winston-transport":"^0.5.1","assume":"^2.2.0","cross-spawn-async":"^2.2.5","eslint":"^8.9.0","hock":"^1.4.1","mocha":"8.1.3","nyc":"^15.1.0","rimraf":"^3.0.2","split2":"^4.1.0","std-mocks":"^1.0.1","through2":"^4.0.2","winston-compat":"^0.1.5"},"main":"./lib/winston.js","browser":"./dist/winston","types":"./index.d.ts","scripts":{"lint":"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","test":"mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration","build":"rimraf dist && babel lib -d dist","prepublishOnly":"npm run build"},"engines":{"node":">= 12.0.0"},"license":"MIT"}')},function(e,t,n){Object.defineProperty(t,"Console",{configurable:!0,enumerable:!0,get:function(){return n(139)}}),Object.defineProperty(t,"File",{configurable:!0,enumerable:!0,get:function(){return n(152)}}),Object.defineProperty(t,"Http",{configurable:!0,enumerable:!0,get:function(){return n(193)}}),Object.defineProperty(t,"Stream",{configurable:!0,enumerable:!0,get:function(){return n(205)}})},function(e,t,n){(function(r){function o(S){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N})(S)}function l(S,N){if(!(S instanceof N))throw new TypeError("Cannot call a class as a function")}function u(S,N){for(var B=0;B<N.length;B++){var E=N[B];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function s(S,N){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,E){return B.__proto__=E,B})(S,N)}function g(S){var N=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var B,E=d(S);if(N){var T=d(this).constructor;B=Reflect.construct(E,arguments,T)}else B=E.apply(this,arguments);return c(this,B)}}function c(S,N){if(N&&(o(N)==="object"||typeof N=="function"))return N;if(N!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}(S)}function d(S){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(N){return N.__proto__||Object.getPrototypeOf(N)})(S)}var w=n(16),v=n(3),y=v.LEVEL,f=v.MESSAGE,p=n(14);e.exports=function(S){(function(h,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(R&&R.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),Object.defineProperty(h,"prototype",{writable:!1}),R&&s(h,R)})(T,S);var N,B,E=g(T);function T(){var h,R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return l(this,T),(h=E.call(this,R)).name=R.name||"console",h.stderrLevels=h._stringArrayToSet(R.stderrLevels),h.consoleWarnLevels=h._stringArrayToSet(R.consoleWarnLevels),h.eol=typeof R.eol=="string"?R.eol:w.EOL,h.setMaxListeners(30),h}return N=T,(B=[{key:"log",value:function(h,R){var W=this;return r(function(){return W.emit("logged",h)}),this.stderrLevels[h[y]]?(console._stderr?console._stderr.write("".concat(h[f]).concat(this.eol)):console.error(h[f]),void(R&&R())):this.consoleWarnLevels[h[y]]?(console._stderr?console._stderr.write("".concat(h[f]).concat(this.eol)):console.warn(h[f]),void(R&&R())):(console._stdout?console._stdout.write("".concat(h[f]).concat(this.eol)):console.log(h[f]),void(R&&R()))}},{key:"_stringArrayToSet",value:function(h,R){if(!h)return{};if(R=R||"Cannot make set from type other than Array of string elements",!Array.isArray(h))throw new Error(R);return h.reduce(function(W,X){if(typeof X!="string")throw new Error(R);return W[X]=!0,W},{})}}])&&u(N.prototype,B),Object.defineProperty(N,"prototype",{writable:!1}),T}(p)}).call(this,n(19).setImmediate)},function(e,t,n){(function(r,o){(function(l,u){if(!l.setImmediate){var s,g,c,d,w,v=1,y={},f=!1,p=l.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(l);S=S&&S.setTimeout?S:l,{}.toString.call(l.process)==="[object process]"?s=function(E){o.nextTick(function(){B(E)})}:function(){if(l.postMessage&&!l.importScripts){var E=!0,T=l.onmessage;return l.onmessage=function(){E=!1},l.postMessage("","*"),l.onmessage=T,E}}()?(d="setImmediate$"+Math.random()+"$",w=function(E){E.source===l&&typeof E.data=="string"&&E.data.indexOf(d)===0&&B(+E.data.slice(d.length))},l.addEventListener?l.addEventListener("message",w,!1):l.attachEvent("onmessage",w),s=function(E){l.postMessage(d+E,"*")}):l.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){B(E.data)},s=function(E){c.port2.postMessage(E)}):p&&"onreadystatechange"in p.createElement("script")?(g=p.documentElement,s=function(E){var T=p.createElement("script");T.onreadystatechange=function(){B(E),T.onreadystatechange=null,g.removeChild(T),T=null},g.appendChild(T)}):s=function(E){setTimeout(B,0,E)},S.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var T=new Array(arguments.length-1),h=0;h<T.length;h++)T[h]=arguments[h+1];var R={callback:E,args:T};return y[v]=R,s(v),v++},S.clearImmediate=N}function N(E){delete y[E]}function B(E){if(f)setTimeout(B,0,E);else{var T=y[E];if(T){f=!0;try{(function(h){var R=h.callback,W=h.args;switch(W.length){case 0:R();break;case 1:R(W[0]);break;case 2:R(W[0],W[1]);break;case 3:R(W[0],W[1],W[2]);break;default:R.apply(void 0,W)}})(T)}finally{N(E),f=!1}}}}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,n(6),n(2))},function(e,t,n){t.byteLength=function(w){var v=c(w),y=v[0],f=v[1];return 3*(y+f)/4-f},t.toByteArray=function(w){for(var v,y=c(w),f=y[0],p=y[1],S=new l(function(T,h,R){return 3*(h+R)/4-R}(0,f,p)),N=0,B=p>0?f-4:f,E=0;E<B;E+=4)v=o[w.charCodeAt(E)]<<18|o[w.charCodeAt(E+1)]<<12|o[w.charCodeAt(E+2)]<<6|o[w.charCodeAt(E+3)],S[N++]=v>>16&255,S[N++]=v>>8&255,S[N++]=255&v;return p===2&&(v=o[w.charCodeAt(E)]<<2|o[w.charCodeAt(E+1)]>>4,S[N++]=255&v),p===1&&(v=o[w.charCodeAt(E)]<<10|o[w.charCodeAt(E+1)]<<4|o[w.charCodeAt(E+2)]>>2,S[N++]=v>>8&255,S[N++]=255&v),S},t.fromByteArray=function(w){for(var v,y=w.length,f=y%3,p=[],S=0,N=y-f;S<N;S+=16383)p.push(d(w,S,S+16383>N?N:S+16383));return f===1?(v=w[y-1],p.push(r[v>>2]+r[v<<4&63]+"==")):f===2&&(v=(w[y-2]<<8)+w[y-1],p.push(r[v>>10]+r[v>>4&63]+r[v<<2&63]+"=")),p.join("")};for(var r=[],o=[],l=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,g=u.length;s<g;++s)r[s]=u[s],o[u.charCodeAt(s)]=s;function c(w){var v=w.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=w.indexOf("=");return y===-1&&(y=v),[y,y===v?0:4-y%4]}function d(w,v,y){for(var f,p,S=[],N=v;N<y;N+=3)f=(w[N]<<16&16711680)+(w[N+1]<<8&65280)+(255&w[N+2]),S.push(r[(p=f)>>18&63]+r[p>>12&63]+r[p>>6&63]+r[63&p]);return S.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(n,r,o,l,u){var s,g,c=8*u-l-1,d=(1<<c)-1,w=d>>1,v=-7,y=o?u-1:0,f=o?-1:1,p=n[r+y];for(y+=f,s=p&(1<<-v)-1,p>>=-v,v+=c;v>0;s=256*s+n[r+y],y+=f,v-=8);for(g=s&(1<<-v)-1,s>>=-v,v+=l;v>0;g=256*g+n[r+y],y+=f,v-=8);if(s===0)s=1-w;else{if(s===d)return g?NaN:1/0*(p?-1:1);g+=Math.pow(2,l),s-=w}return(p?-1:1)*g*Math.pow(2,s-l)},t.write=function(n,r,o,l,u,s){var g,c,d,w=8*s-u-1,v=(1<<w)-1,y=v>>1,f=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=l?0:s-1,S=l?1:-1,N=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,g=v):(g=Math.floor(Math.log(r)/Math.LN2),r*(d=Math.pow(2,-g))<1&&(g--,d*=2),(r+=g+y>=1?f/d:f*Math.pow(2,1-y))*d>=2&&(g++,d/=2),g+y>=v?(c=0,g=v):g+y>=1?(c=(r*d-1)*Math.pow(2,u),g+=y):(c=r*Math.pow(2,y-1)*Math.pow(2,u),g=0));u>=8;n[o+p]=255&c,p+=S,c/=256,u-=8);for(g=g<<u|c,w+=u;w>0;n[o+p]=255&g,p+=S,g/=256,w-=8);n[o+p-S]|=128*N}},function(e,t,n){(function(r,o){var l;e.exports=_,_.ReadableState=m,n(20).EventEmitter;var u=function(k,x){return k.listeners(x).length},s=n(62),g=n(5).Buffer,c=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},d,w=n(144);d=w&&w.debuglog?w.debuglog("stream"):function(){};var v,y,f,p=n(145),S=n(64),N=n(65).getHighWaterMark,B=n(35).codes,E=B.ERR_INVALID_ARG_TYPE,T=B.ERR_STREAM_PUSH_AFTER_EOF,h=B.ERR_METHOD_NOT_IMPLEMENTED,R=B.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(_,s);var W=S.errorOrDestroy,X=["error","close","destroy","pause","resume"];function m(k,x,b){l=l||n(36),k=k||{},typeof b!="boolean"&&(b=x instanceof l),this.objectMode=!!k.objectMode,b&&(this.objectMode=this.objectMode||!!k.readableObjectMode),this.highWaterMark=N(this,k,"readableHighWaterMark",b),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.destroyed=!1,this.defaultEncoding=k.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,k.encoding&&(v||(v=n(21).StringDecoder),this.decoder=new v(k.encoding),this.encoding=k.encoding)}function _(k){if(l=l||n(36),!(this instanceof _))return new _(k);var x=this instanceof l;this._readableState=new m(k,this,x),this.readable=!0,k&&(typeof k.read=="function"&&(this._read=k.read),typeof k.destroy=="function"&&(this._destroy=k.destroy)),s.call(this)}function G(k,x,b,I,$){d("readableAddChunk",x);var K,Y=k._readableState;if(x===null)Y.reading=!1,function(ne,ie){if(d("onEofChunk"),!ie.ended){if(ie.decoder){var ue=ie.decoder.end();ue&&ue.length&&(ie.buffer.push(ue),ie.length+=ie.objectMode?1:ue.length)}ie.ended=!0,ie.sync?z(ne):(ie.needReadable=!1,ie.emittedReadable||(ie.emittedReadable=!0,P(ne)))}}(k,Y);else if($||(K=function(ne,ie){var ue;we=ie,g.isBuffer(we)||we instanceof c||typeof ie=="string"||ie===void 0||ne.objectMode||(ue=new E("chunk",["string","Buffer","Uint8Array"],ie));var we;return ue}(Y,x)),K)W(k,K);else if(Y.objectMode||x&&x.length>0)if(typeof x=="string"||Y.objectMode||Object.getPrototypeOf(x)===g.prototype||(x=function(ne){return g.from(ne)}(x)),I)Y.endEmitted?W(k,new R):j(k,Y,x,!0);else if(Y.ended)W(k,new T);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!b?(x=Y.decoder.write(x),Y.objectMode||x.length!==0?j(k,Y,x,!1):D(k,Y)):j(k,Y,x,!1)}else I||(Y.reading=!1,D(k,Y));return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function j(k,x,b,I){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,k.emit("data",b)):(x.length+=x.objectMode?1:b.length,I?x.buffer.unshift(b):x.buffer.push(b),x.needReadable&&z(k)),D(k,x)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(k){this._readableState&&(this._readableState.destroyed=k)}}),_.prototype.destroy=S.destroy,_.prototype._undestroy=S.undestroy,_.prototype._destroy=function(k,x){x(k)},_.prototype.push=function(k,x){var b,I=this._readableState;return I.objectMode?b=!0:typeof k=="string"&&((x=x||I.defaultEncoding)!==I.encoding&&(k=g.from(k,x),x=""),b=!0),G(this,k,x,!1,b)},_.prototype.unshift=function(k){return G(this,k,null,!0,!1)},_.prototype.isPaused=function(){return this._readableState.flowing===!1},_.prototype.setEncoding=function(k){v||(v=n(21).StringDecoder);var x=new v(k);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var b=this._readableState.buffer.head,I="";b!==null;)I+=x.write(b.data),b=b.next;return this._readableState.buffer.clear(),I!==""&&this._readableState.buffer.push(I),this._readableState.length=I.length,this};function C(k,x){return k<=0||x.length===0&&x.ended?0:x.objectMode?1:k!=k?x.flowing&&x.length?x.buffer.head.data.length:x.length:(k>x.highWaterMark&&(x.highWaterMark=function(b){return b>=1073741824?b=1073741824:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}(k)),k<=x.length?k:x.ended?x.length:(x.needReadable=!0,0))}function z(k){var x=k._readableState;d("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(d("emitReadable",x.flowing),x.emittedReadable=!0,o.nextTick(P,k))}function P(k){var x=k._readableState;d("emitReadable_",x.destroyed,x.length,x.ended),x.destroyed||!x.length&&!x.ended||(k.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,V(k)}function D(k,x){x.readingMore||(x.readingMore=!0,o.nextTick(O,k,x))}function O(k,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var b=x.length;if(d("maybeReadMore read 0"),k.read(0),b===x.length)break}x.readingMore=!1}function L(k){var x=k._readableState;x.readableListening=k.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:k.listenerCount("data")>0&&k.resume()}function U(k){d("readable nexttick read 0"),k.read(0)}function A(k,x){d("resume",x.reading),x.reading||k.read(0),x.resumeScheduled=!1,k.emit("resume"),V(k),x.flowing&&!x.reading&&k.read(0)}function V(k){var x=k._readableState;for(d("flow",x.flowing);x.flowing&&k.read()!==null;);}function q(k,x){return x.length===0?null:(x.objectMode?b=x.buffer.shift():!k||k>=x.length?(b=x.decoder?x.buffer.join(""):x.buffer.length===1?x.buffer.first():x.buffer.concat(x.length),x.buffer.clear()):b=x.buffer.consume(k,x.decoder),b);var b}function Q(k){var x=k._readableState;d("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,o.nextTick(ee,x,k))}function ee(k,x){if(d("endReadableNT",k.endEmitted,k.length),!k.endEmitted&&k.length===0&&(k.endEmitted=!0,x.readable=!1,x.emit("end"),k.autoDestroy)){var b=x._writableState;(!b||b.autoDestroy&&b.finished)&&x.destroy()}}function te(k,x){for(var b=0,I=k.length;b<I;b++)if(k[b]===x)return b;return-1}_.prototype.read=function(k){d("read",k),k=parseInt(k,10);var x=this._readableState,b=k;if(k!==0&&(x.emittedReadable=!1),k===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return d("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Q(this):z(this),null;if((k=C(k,x))===0&&x.ended)return x.length===0&&Q(this),null;var I,$=x.needReadable;return d("need readable",$),(x.length===0||x.length-k<x.highWaterMark)&&d("length less than watermark",$=!0),x.ended||x.reading?d("reading or ended",$=!1):$&&(d("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(k=C(b,x))),(I=k>0?q(k,x):null)===null?(x.needReadable=x.length<=x.highWaterMark,k=0):(x.length-=k,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),b!==k&&x.ended&&Q(this)),I!==null&&this.emit("data",I),I},_.prototype._read=function(k){W(this,new h("_read()"))},_.prototype.pipe=function(k,x){var b=this,I=this._readableState;switch(I.pipesCount){case 0:I.pipes=k;break;case 1:I.pipes=[I.pipes,k];break;default:I.pipes.push(k)}I.pipesCount+=1,d("pipe count=%d opts=%j",I.pipesCount,x);var $=(!x||x.end!==!1)&&k!==o.stdout&&k!==o.stderr?Y:Ne;function K(Te,Ae){d("onunpipe"),Te===b&&Ae&&Ae.hasUnpiped===!1&&(Ae.hasUnpiped=!0,d("cleanup"),k.removeListener("close",Oe),k.removeListener("finish",Ee),k.removeListener("drain",ne),k.removeListener("error",we),k.removeListener("unpipe",K),b.removeListener("end",Y),b.removeListener("end",Ne),b.removeListener("data",ue),ie=!0,!I.awaitDrain||k._writableState&&!k._writableState.needDrain||ne())}function Y(){d("onend"),k.end()}I.endEmitted?o.nextTick($):b.once("end",$),k.on("unpipe",K);var ne=function(Te){return function(){var Ae=Te._readableState;d("pipeOnDrain",Ae.awaitDrain),Ae.awaitDrain&&Ae.awaitDrain--,Ae.awaitDrain===0&&u(Te,"data")&&(Ae.flowing=!0,V(Te))}}(b);k.on("drain",ne);var ie=!1;function ue(Te){d("ondata");var Ae=k.write(Te);d("dest.write",Ae),Ae===!1&&((I.pipesCount===1&&I.pipes===k||I.pipesCount>1&&te(I.pipes,k)!==-1)&&!ie&&(d("false write response, pause",I.awaitDrain),I.awaitDrain++),b.pause())}function we(Te){d("onerror",Te),Ne(),k.removeListener("error",we),u(k,"error")===0&&W(k,Te)}function Oe(){k.removeListener("finish",Ee),Ne()}function Ee(){d("onfinish"),k.removeListener("close",Oe),Ne()}function Ne(){d("unpipe"),b.unpipe(k)}return b.on("data",ue),function(Te,Ae,Ie){if(typeof Te.prependListener=="function")return Te.prependListener(Ae,Ie);Te._events&&Te._events[Ae]?Array.isArray(Te._events[Ae])?Te._events[Ae].unshift(Ie):Te._events[Ae]=[Ie,Te._events[Ae]]:Te.on(Ae,Ie)}(k,"error",we),k.once("close",Oe),k.once("finish",Ee),k.emit("pipe",b),I.flowing||(d("pipe resume"),b.resume()),k},_.prototype.unpipe=function(k){var x=this._readableState,b={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return k&&k!==x.pipes||(k||(k=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,k&&k.emit("unpipe",this,b)),this;if(!k){var I=x.pipes,$=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var K=0;K<$;K++)I[K].emit("unpipe",this,{hasUnpiped:!1});return this}var Y=te(x.pipes,k);return Y===-1||(x.pipes.splice(Y,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),k.emit("unpipe",this,b)),this},_.prototype.on=function(k,x){var b=s.prototype.on.call(this,k,x),I=this._readableState;return k==="data"?(I.readableListening=this.listenerCount("readable")>0,I.flowing!==!1&&this.resume()):k==="readable"&&(I.endEmitted||I.readableListening||(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,d("on readable",I.length,I.reading),I.length?z(this):I.reading||o.nextTick(U,this))),b},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(k,x){var b=s.prototype.removeListener.call(this,k,x);return k==="readable"&&o.nextTick(L,this),b},_.prototype.removeAllListeners=function(k){var x=s.prototype.removeAllListeners.apply(this,arguments);return k!=="readable"&&k!==void 0||o.nextTick(L,this),x},_.prototype.resume=function(){var k=this._readableState;return k.flowing||(d("resume"),k.flowing=!k.readableListening,function(x,b){b.resumeScheduled||(b.resumeScheduled=!0,o.nextTick(A,x,b))}(this,k)),k.paused=!1,this},_.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(k){var x=this,b=this._readableState,I=!1;for(var $ in k.on("end",function(){if(d("wrapped end"),b.decoder&&!b.ended){var Y=b.decoder.end();Y&&Y.length&&x.push(Y)}x.push(null)}),k.on("data",function(Y){d("wrapped data"),b.decoder&&(Y=b.decoder.write(Y)),b.objectMode&&Y==null||(b.objectMode||Y&&Y.length)&&(x.push(Y)||(I=!0,k.pause()))}),k)this[$]===void 0&&typeof k[$]=="function"&&(this[$]=function(Y){return function(){return k[Y].apply(k,arguments)}}($));for(var K=0;K<X.length;K++)k.on(X[K],this.emit.bind(this,X[K]));return this._read=function(Y){d("wrapped _read",Y),I&&(I=!1,k.resume())},this},typeof Symbol=="function"&&(_.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=n(148)),y(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(k){this._readableState&&(this._readableState.flowing=k)}}),_._fromList=q,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(_.from=function(k,x){return f===void 0&&(f=n(150)),f(_,k,x)})}).call(this,n(6),n(2))},function(e,t){},function(e,t,n){function r(w,v){var y=Object.keys(w);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(w);v&&(f=f.filter(function(p){return Object.getOwnPropertyDescriptor(w,p).enumerable})),y.push.apply(y,f)}return y}function o(w){for(var v=1;v<arguments.length;v++){var y=arguments[v]!=null?arguments[v]:{};v%2?r(Object(y),!0).forEach(function(f){l(w,f,y[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(f){Object.defineProperty(w,f,Object.getOwnPropertyDescriptor(y,f))})}return w}function l(w,v,y){return(v=s(v))in w?Object.defineProperty(w,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):w[v]=y,w}function u(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,s(f.key),f)}}function s(w){var v=function(y,f){if(typeof y!="object"||y===null)return y;var p=y[Symbol.toPrimitive];if(p!==void 0){var S=p.call(y,f||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}(w,"string");return typeof v=="symbol"?v:String(v)}var g=n(5).Buffer,c=n(146).inspect,d=c&&c.custom||"inspect";e.exports=function(){function w(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,w),this.head=null,this.tail=null,this.length=0}var v,y;return v=w,(y=[{key:"push",value:function(f){var p={data:f,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(f){var p={data:f,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var p=this.head,S=""+p.data;p=p.next;)S+=f+p.data;return S}},{key:"concat",value:function(f){if(this.length===0)return g.alloc(0);for(var p,S,N,B=g.allocUnsafe(f>>>0),E=this.head,T=0;E;)p=E.data,S=B,N=T,g.prototype.copy.call(p,S,N),T+=E.data.length,E=E.next;return B}},{key:"consume",value:function(f,p){var S;return f<this.head.data.length?(S=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):S=f===this.head.data.length?this.shift():p?this._getString(f):this._getBuffer(f),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var p=this.head,S=1,N=p.data;for(f-=N.length;p=p.next;){var B=p.data,E=f>B.length?B.length:f;if(E===B.length?N+=B:N+=B.slice(0,f),(f-=E)==0){E===B.length?(++S,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=B.slice(E));break}++S}return this.length-=S,N}},{key:"_getBuffer",value:function(f){var p=g.allocUnsafe(f),S=this.head,N=1;for(S.data.copy(p),f-=S.data.length;S=S.next;){var B=S.data,E=f>B.length?B.length:f;if(B.copy(p,p.length-f,0,E),(f-=E)==0){E===B.length?(++N,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=B.slice(E));break}++N}return this.length-=N,p}},{key:d,value:function(f,p){return c(this,o(o({},p),{},{depth:0,customInspect:!1}))}}])&&u(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()},function(e,t){},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var d=o(s);return g!==void 0?typeof c=="string"?d.fill(g,c):d.fill(g):d.fill(0),d},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){(function(r){var o;function l(E,T,h){return(T=function(R){var W=function(X,m){if(typeof X!="object"||X===null)return X;var _=X[Symbol.toPrimitive];if(_!==void 0){var G=_.call(X,m||"default");if(typeof G!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(X)}(R,"string");return typeof W=="symbol"?W:String(W)}(T))in E?Object.defineProperty(E,T,{value:h,enumerable:!0,configurable:!0,writable:!0}):E[T]=h,E}var u=n(149),s=Symbol("lastResolve"),g=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),w=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function f(E,T){return{value:E,done:T}}function p(E){var T=E[s];if(T!==null){var h=E[y].read();h!==null&&(E[w]=null,E[s]=null,E[g]=null,T(f(h,!1)))}}function S(E){r.nextTick(p,E)}var N=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((l(o={get stream(){return this[y]},next:function(){var E=this,T=this[c];if(T!==null)return Promise.reject(T);if(this[d])return Promise.resolve(f(void 0,!0));if(this[y].destroyed)return new Promise(function(X,m){r.nextTick(function(){E[c]?m(E[c]):X(f(void 0,!0))})});var h,R=this[w];if(R)h=new Promise(function(X,m){return function(_,G){X.then(function(){m[d]?_(f(void 0,!0)):m[v](_,G)},G)}}(R,this));else{var W=this[y].read();if(W!==null)return Promise.resolve(f(W,!1));h=new Promise(this[v])}return this[w]=h,h}},Symbol.asyncIterator,function(){return this}),l(o,"return",function(){var E=this;return new Promise(function(T,h){E[y].destroy(null,function(R){R?h(R):T(f(void 0,!0))})})}),o),N);e.exports=function(E){var T,h=Object.create(B,(l(T={},y,{value:E,writable:!0}),l(T,s,{value:null,writable:!0}),l(T,g,{value:null,writable:!0}),l(T,c,{value:null,writable:!0}),l(T,d,{value:E._readableState.endEmitted,writable:!0}),l(T,v,{value:function(R,W){var X=h[y].read();X?(h[w]=null,h[s]=null,h[g]=null,R(f(X,!1))):(h[s]=R,h[g]=W)},writable:!0}),T));return h[w]=null,u(E,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var W=h[g];return W!==null&&(h[w]=null,h[s]=null,h[g]=null,W(R)),void(h[c]=R)}var X=h[s];X!==null&&(h[w]=null,h[s]=null,h[g]=null,X(f(void 0,!0))),h[d]=!0}),E.on("readable",S.bind(null,h)),h}}).call(this,n(2))},function(e,t,n){var r=n(35).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function l(u,s,g){if(typeof s=="function")return l(u,null,s);s||(s={}),g=function(E){var T=!1;return function(){if(!T){T=!0;for(var h=arguments.length,R=new Array(h),W=0;W<h;W++)R[W]=arguments[W];E.apply(this,R)}}}(g||o);var c=s.readable||s.readable!==!1&&u.readable,d=s.writable||s.writable!==!1&&u.writable,w=function(){u.writable||y()},v=u._writableState&&u._writableState.finished,y=function(){d=!1,v=!0,c||g.call(u)},f=u._readableState&&u._readableState.endEmitted,p=function(){c=!1,f=!0,d||g.call(u)},S=function(E){g.call(u,E)},N=function(){var E;return c&&!f?(u._readableState&&u._readableState.ended||(E=new r),g.call(u,E)):d&&!v?(u._writableState&&u._writableState.ended||(E=new r),g.call(u,E)):void 0},B=function(){u.req.on("finish",y)};return function(E){return E.setHeader&&typeof E.abort=="function"}(u)?(u.on("complete",y),u.on("abort",N),u.req?B():u.on("request",B)):d&&!u._writableState&&(u.on("end",w),u.on("close",w)),u.on("end",p),u.on("finish",y),s.error!==!1&&u.on("error",S),u.on("close",N),function(){u.removeListener("complete",y),u.removeListener("abort",N),u.removeListener("request",B),u.req&&u.req.removeListener("finish",y),u.removeListener("end",w),u.removeListener("close",w),u.removeListener("finish",y),u.removeListener("end",p),u.removeListener("error",S),u.removeListener("close",N)}}},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){var r=n(13),o=n(3).LEVEL,l=n(14),u=e.exports=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(l.call(this,s),!s.transport||typeof s.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");function g(c){this.emit("error",c,this.transport)}this.transport=s.transport,this.level=this.level||s.transport.level,this.handleExceptions=this.handleExceptions||s.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=g.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(u,l),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);(!this.level||this.levels[this.level]>=this.levels[s[o]])&&this.transport.log(s[o],s.message,s,this._nop),c(null)},u.prototype._writev=function(s,g){for(var c=0;c<s.length;c++)this._accept(s[c])&&(this.transport.log(s[c].chunk[o],s[c].chunk.message,s[c].chunk,this._nop),s[c].callback());return g(null)},u.prototype._deprecated=function(){console.error([this.transport.name+" is a legacy winston transport. Consider upgrading: ","- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
56
+ `))},u.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){(function(r,o){function l(m){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _})(m)}function u(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function s(m,_){for(var G=0;G<_.length;G++){var j=_[G];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(m,j.key,j)}}function g(m,_){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(G,j){return G.__proto__=j,G})(m,_)}function c(m){var _=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var G,j=v(m);if(_){var C=v(this).constructor;G=Reflect.construct(j,arguments,C)}else G=j.apply(this,arguments);return d(this,G)}}function d(m,_){if(_&&(l(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(m)}function w(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function v(m){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(_){return _.__proto__||Object.getPrototypeOf(_)})(m)}var y=n(66),f=n(55),p=n(153),S=n(163),N=n(3).MESSAGE,B=n(33),E=B.Stream,T=B.PassThrough,h=n(14),R=n(39)("winston:file"),W=n(16),X=n(192);e.exports=function(m){(function(z,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");z.prototype=Object.create(P&&P.prototype,{constructor:{value:z,writable:!0,configurable:!0}}),Object.defineProperty(z,"prototype",{writable:!1}),P&&g(z,P)})(C,m);var _,G,j=c(C);function C(){var z,P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function D(O){for(var L=arguments.length,U=new Array(L>1?L-1:0),A=1;A<L;A++)U[A-1]=arguments[A];U.slice(1).forEach(function(V){if(P[V])throw new Error("Cannot set ".concat(V," and ").concat(O," together"))})}if(u(this,C),(z=j.call(this,P)).name=P.name||"file",z._stream=new T,z._stream.setMaxListeners(30),z._onError=z._onError.bind(w(z)),P.filename||P.dirname)D("filename or dirname","stream"),z._basename=z.filename=P.filename?f.basename(P.filename):"winston.log",z.dirname=P.dirname||f.dirname(P.filename),z.options=P.options||{flags:"a"};else{if(!P.stream)throw new Error("Cannot log to file without filename or stream.");console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),D("stream","filename","maxsize"),z._dest=z._stream.pipe(z._setupStream(P.stream)),z.dirname=f.dirname(z._dest.path)}return z.maxsize=P.maxsize||null,z.rotationFormat=P.rotationFormat||!1,z.zippedArchive=P.zippedArchive||!1,z.maxFiles=P.maxFiles||null,z.eol=typeof P.eol=="string"?P.eol:W.EOL,z.tailable=P.tailable||!1,z._size=0,z._pendingSize=0,z._created=0,z._drain=!1,z._opening=!1,z._ending=!1,z.dirname&&z._createLogDirIfNotExist(z.dirname),z.open(),z}return _=C,(G=[{key:"finishIfEnding",value:function(){var z=this;this._ending&&(this._opening?this.once("open",function(){z._stream.once("finish",function(){return z.emit("finish")}),r(function(){return z._stream.end()})}):(this._stream.once("finish",function(){return z.emit("finish")}),r(function(){return z._stream.end()})))}},{key:"log",value:function(z){var P=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return D(),!0;if(this._drain)this._stream.once("drain",function(){P._drain=!1,P.log(z,D)});else{if(!this._rotate){var O="".concat(z[N]).concat(this.eol),L=o.byteLength(O);this._pendingSize+=L,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var U=this._stream.write(O,A.bind(this));return U?D():(this._drain=!0,this._stream.once("drain",function(){P._drain=!1,D()})),R("written",U,this._drain),this.finishIfEnding(),U}this._stream.once("rotate",function(){P._rotate=!1,P.log(z,D)})}function A(){var V=this;this._size+=L,this._pendingSize-=L,R("logged %s %s",this._size,O),this.emit("logged",z),this._opening||this._needsNewFile()&&(this._rotate=!0,this._endStream(function(){return V._rotateFile()}))}}},{key:"query",value:function(z,P){typeof z=="function"&&(P=z,z={}),z=function(q){return(q=q||{}).rows=q.rows||q.limit||10,q.start=q.start||0,q.until=q.until||new Date,l(q.until)!=="object"&&(q.until=new Date(q.until)),q.from=q.from||q.until-864e5,l(q.from)!=="object"&&(q.from=new Date(q.from)),q.order=q.order||"desc",q}(z);var D=f.join(this.dirname,this.filename),O="",L=[],U=0,A=y.createReadStream(D,{encoding:"utf8"});function V(q,Q){try{var ee=JSON.parse(q);(function(te){if(te&&l(te)==="object"){var k=new Date(te.timestamp);if(!(z.from&&k<z.from||z.until&&k>z.until||z.level&&z.level!==te.level))return!0}})(ee)&&function(te){z.rows&&L.length>=z.rows&&z.order!=="desc"?A.readable&&A.destroy():(z.fields&&(te=z.fields.reduce(function(k,x){return k[x]=te[x],k},{})),z.order==="desc"&&L.length>=z.rows&&L.shift(),L.push(te))}(ee)}catch(te){Q||A.emit("error",te)}}A.on("error",function(q){if(A.readable&&A.destroy(),P)return q.code!=="ENOENT"?P(q):P(null,L)}),A.on("data",function(q){for(var Q=(q=(O+q).split(/\n+/)).length-1,ee=0;ee<Q;ee++)(!z.start||U>=z.start)&&V(q[ee]),U++;O=q[Q]}),A.on("close",function(){O&&V(O,!0),z.order==="desc"&&(L=L.reverse()),P&&P(null,L)})}},{key:"stream",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},P=f.join(this.dirname,this.filename),D=new E,O={file:P,start:z.start};return D.destroy=X(O,function(L,U){if(L)return D.emit("error",L);try{D.emit("data",U),U=JSON.parse(U),D.emit("log",U)}catch(A){D.emit("error",A)}}),D}},{key:"open",value:function(){var z=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(P,D){if(P)return z.emit("error",P);R("stat done: %s { size: %s }",z.filename,D),z._size=D,z._dest=z._createStream(z._stream),z._opening=!1,z.once("open",function(){z._stream.eventNames().includes("rotate")?z._stream.emit("rotate"):z._rotate=!1})})))}},{key:"stat",value:function(z){var P=this,D=this._getFile(),O=f.join(this.dirname,D);y.stat(O,function(L,U){return L&&L.code==="ENOENT"?(R("ENOENT ok",O),P.filename=D,z(null,0)):L?(R("err ".concat(L.code," ").concat(O)),z(L)):!U||P._needsNewFile(U.size)?P._incFile(function(){return P.stat(z)}):(P.filename=D,void z(null,U.size))})}},{key:"close",value:function(z){var P=this;this._stream&&this._stream.end(function(){z&&z(),P.emit("flush"),P.emit("closed")})}},{key:"_needsNewFile",value:function(z){return z=z||this._size,this.maxsize&&z>=this.maxsize}},{key:"_onError",value:function(z){this.emit("error",z)}},{key:"_setupStream",value:function(z){return z.on("error",this._onError),z}},{key:"_cleanupStream",value:function(z){return z.removeListener("error",this._onError),z}},{key:"_rotateFile",value:function(){var z=this;this._incFile(function(){return z.open()})}},{key:"_endStream",value:function(){var z=this,P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){z._cleanupStream(z._dest),P()})):P()}},{key:"_createStream",value:function(z){var P=this,D=f.join(this.dirname,this.filename);R("create stream start",D,this.options);var O=y.createWriteStream(D,this.options).on("error",function(U){return R(U)}).on("close",function(){return R("close",O.path,O.bytesWritten)}).on("open",function(){R("file open ok",D),P.emit("open",D),z.pipe(O),P.rotatedWhileOpening&&(P._stream=new T,P._stream.setMaxListeners(30),P._rotateFile(),P.rotatedWhileOpening=!1,P._cleanupStream(O),z.end())});if(R("create stream ok",D),this.zippedArchive){var L=S.createGzip();return L.pipe(O),L}return O}},{key:"_incFile",value:function(z){R("_incFile",this.filename);var P=f.extname(this._basename),D=f.basename(this._basename,P);this.tailable?this._checkMaxFilesTailable(P,D,z):(this._created+=1,this._checkMaxFilesIncrementing(P,D,z))}},{key:"_getFile",value:function(){var z=f.extname(this._basename),P=f.basename(this._basename,z),D=this.rotationFormat?this.rotationFormat():this._created,O=!this.tailable&&this._created?"".concat(P).concat(D).concat(z):"".concat(P).concat(z);return this.zippedArchive&&!this.tailable?"".concat(O,".gz"):O}},{key:"_checkMaxFilesIncrementing",value:function(z,P,D){if(!this.maxFiles||this._created<this.maxFiles)return r(D);var O=this._created-this.maxFiles,L=O!==0?O:"",U=this.zippedArchive?".gz":"",A="".concat(P).concat(L).concat(z).concat(U),V=f.join(this.dirname,A);y.unlink(V,D)}},{key:"_checkMaxFilesTailable",value:function(z,P,D){var O=this,L=[];if(this.maxFiles){for(var U=this.zippedArchive?".gz":"",A=this.maxFiles-1;A>1;A--)L.push(function(V,q){var Q=this,ee="".concat(P).concat(V-1).concat(z).concat(U),te=f.join(this.dirname,ee);y.exists(te,function(k){if(!k)return q(null);ee="".concat(P).concat(V).concat(z).concat(U),y.rename(te,f.join(Q.dirname,ee),q)})}.bind(this,A));p(L,function(){y.rename(f.join(O.dirname,"".concat(P).concat(z)),f.join(O.dirname,"".concat(P,"1").concat(z).concat(U)),D)})}}},{key:"_createLogDirIfNotExist",value:function(z){y.existsSync(z)||y.mkdirSync(z,{recursive:!0})}}])&&s(_.prototype,G),Object.defineProperty(_,"prototype",{writable:!1}),C}(h)}).call(this,n(19).setImmediate,n(5).Buffer)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u,s){return(0,r.default)(o.default,u,s)};var r=l(n(154)),o=l(n(158));function l(u){return u&&u.__esModule?u:{default:u}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(44)),o=u(n(23)),l=u(n(30));function u(s){return s&&s.__esModule?s:{default:s}}t.default=(0,l.default)((s,g,c)=>{var d=(0,r.default)(g)?[]:{};s(g,(w,v,y)=>{(0,o.default)(w)((f,...p)=>{p.length<2&&([p]=p),d[v]=p,y(f)})},w=>c(w,d))},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(c){return(0,l.isAsync)(c)?function(...d){const w=d.pop();return s(c.apply(this,d),w)}:(0,r.default)(function(d,w){var v;try{v=c.apply(this,d)}catch(y){return w(y)}if(v&&typeof v.then=="function")return s(v,w);w(null,v)})};var r=u(n(156)),o=u(n(157)),l=n(23);function u(c){return c&&c.__esModule?c:{default:c}}function s(c,d){return c.then(w=>{g(d,null,w)},w=>{g(d,w&&w.message?w:new Error(w))})}function g(c,d,w){try{c(d,w)}catch(v){(0,o.default)(y=>{throw y},v)}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...o){var l=o.pop();return r.call(this,o,l)}},e.exports=t.default},function(e,t,n){(function(r,o){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=c,t.wrap=d;var l,u=t.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,s=t.hasSetImmediate=typeof r=="function"&&r,g=t.hasNextTick=typeof o=="object"&&typeof o.nextTick=="function";function c(w){setTimeout(w,0)}function d(w){return(v,...y)=>w(()=>v(...y))}l=u?queueMicrotask:s?r:g?o.nextTick:c,t.default=d(l)}).call(this,n(19).setImmediate,n(2))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(67)),o=l(n(30));function l(u){return u&&u.__esModule?u:{default:u}}t.default=(0,o.default)(function(u,s,g){return(0,r.default)(u,1,s,g)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(68)),o=c(n(160)),l=c(n(69)),u=n(23),s=c(n(162)),g=c(n(45));function c(d){return d&&d.__esModule?d:{default:d}}t.default=d=>(w,v,y)=>{if(y=(0,r.default)(y),d<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!w)return y(null);if((0,u.isAsyncGenerator)(w))return(0,s.default)(w,d,v,y);if((0,u.isAsyncIterable)(w))return(0,s.default)(w[Symbol.asyncIterator](),d,v,y);var f=(0,o.default)(w),p=!1,S=!1,N=0,B=!1;function E(h,R){if(!S)if(N-=1,h)p=!0,y(h);else if(h===!1)p=!0,S=!0;else{if(R===g.default||p&&N<=0)return p=!0,y(null);B||T()}}function T(){for(B=!0;N<d&&!p;){var h=f();if(h===null)return p=!0,void(N<=0&&y(null));N+=1,v(h.value,h.key,(0,l.default)(E))}B=!1}T()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u){if((0,r.default)(u))return function(v){var y=-1,f=v.length;return function(){return++y<f?{value:v[y],key:y}:null}}(u);var s=(0,o.default)(u);return s?function(v){var y=-1;return function(){var f=v.next();return f.done?null:(y++,{value:f.value,key:y})}}(s):(g=u,c=g?Object.keys(g):[],d=-1,w=c.length,function v(){var y=c[++d];return y==="__proto__"?v():d<w?{value:g[y],key:y}:null});var g,c,d,w};var r=l(n(44)),o=l(n(161));function l(u){return u&&u.__esModule?u:{default:u}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u,s,g,c){let d=!1,w=!1,v=!1,y=0,f=0;function p(){y>=s||v||d||(v=!0,u.next().then(({value:B,done:E})=>{if(!w&&!d){if(v=!1,E)return d=!0,void(y<=0&&c(null));y++,g(B,f,S),f++,p()}}).catch(N))}function S(B,E){if(y-=1,!w)return B?N(B):B===!1?(d=!0,void(w=!0)):E===l.default||d&&y<=0?(d=!0,c(null)):void p()}function N(B){w||(v=!1,d=!0,c(B))}p()};var r,o=n(45),l=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){(function(r){var o=n(5).Buffer,l=n(164).Transform,u=n(173),s=n(13),g=n(74).ok,c=n(5).kMaxLength,d="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";u.Z_MIN_WINDOWBITS=8,u.Z_MAX_WINDOWBITS=15,u.Z_DEFAULT_WINDOWBITS=15,u.Z_MIN_CHUNK=64,u.Z_MAX_CHUNK=1/0,u.Z_DEFAULT_CHUNK=16384,u.Z_MIN_MEMLEVEL=1,u.Z_MAX_MEMLEVEL=9,u.Z_DEFAULT_MEMLEVEL=8,u.Z_MIN_LEVEL=-1,u.Z_MAX_LEVEL=9,u.Z_DEFAULT_LEVEL=u.Z_DEFAULT_COMPRESSION;for(var w=Object.keys(u),v=0;v<w.length;v++){var y=w[v];y.match(/^Z/)&&Object.defineProperty(t,y,{enumerable:!0,value:u[y],writable:!1})}for(var f={Z_OK:u.Z_OK,Z_STREAM_END:u.Z_STREAM_END,Z_NEED_DICT:u.Z_NEED_DICT,Z_ERRNO:u.Z_ERRNO,Z_STREAM_ERROR:u.Z_STREAM_ERROR,Z_DATA_ERROR:u.Z_DATA_ERROR,Z_MEM_ERROR:u.Z_MEM_ERROR,Z_BUF_ERROR:u.Z_BUF_ERROR,Z_VERSION_ERROR:u.Z_VERSION_ERROR},p=Object.keys(f),S=0;S<p.length;S++){var N=p[S];f[f[N]]=N}function B(P,D,O){var L=[],U=0;function A(){for(var q;(q=P.read())!==null;)L.push(q),U+=q.length;P.once("readable",A)}function V(){var q,Q=null;U>=c?Q=new RangeError(d):q=o.concat(L,U),L=[],P.close(),O(Q,q)}P.on("error",function(q){P.removeListener("end",V),P.removeListener("readable",A),O(q)}),P.on("end",V),P.end(D),A()}function E(P,D){if(typeof D=="string"&&(D=o.from(D)),!o.isBuffer(D))throw new TypeError("Not a string or buffer");var O=P._finishFlushFlag;return P._processChunk(D,O)}function T(P){if(!(this instanceof T))return new T(P);j.call(this,P,u.DEFLATE)}function h(P){if(!(this instanceof h))return new h(P);j.call(this,P,u.INFLATE)}function R(P){if(!(this instanceof R))return new R(P);j.call(this,P,u.GZIP)}function W(P){if(!(this instanceof W))return new W(P);j.call(this,P,u.GUNZIP)}function X(P){if(!(this instanceof X))return new X(P);j.call(this,P,u.DEFLATERAW)}function m(P){if(!(this instanceof m))return new m(P);j.call(this,P,u.INFLATERAW)}function _(P){if(!(this instanceof _))return new _(P);j.call(this,P,u.UNZIP)}function G(P){return P===u.Z_NO_FLUSH||P===u.Z_PARTIAL_FLUSH||P===u.Z_SYNC_FLUSH||P===u.Z_FULL_FLUSH||P===u.Z_FINISH||P===u.Z_BLOCK}function j(P,D){var O=this;if(this._opts=P=P||{},this._chunkSize=P.chunkSize||t.Z_DEFAULT_CHUNK,l.call(this,P),P.flush&&!G(P.flush))throw new Error("Invalid flush flag: "+P.flush);if(P.finishFlush&&!G(P.finishFlush))throw new Error("Invalid flush flag: "+P.finishFlush);if(this._flushFlag=P.flush||u.Z_NO_FLUSH,this._finishFlushFlag=P.finishFlush!==void 0?P.finishFlush:u.Z_FINISH,P.chunkSize&&(P.chunkSize<t.Z_MIN_CHUNK||P.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+P.chunkSize);if(P.windowBits&&(P.windowBits<t.Z_MIN_WINDOWBITS||P.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+P.windowBits);if(P.level&&(P.level<t.Z_MIN_LEVEL||P.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+P.level);if(P.memLevel&&(P.memLevel<t.Z_MIN_MEMLEVEL||P.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+P.memLevel);if(P.strategy&&P.strategy!=t.Z_FILTERED&&P.strategy!=t.Z_HUFFMAN_ONLY&&P.strategy!=t.Z_RLE&&P.strategy!=t.Z_FIXED&&P.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+P.strategy);if(P.dictionary&&!o.isBuffer(P.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new u.Zlib(D);var L=this;this._hadError=!1,this._handle.onerror=function(V,q){C(L),L._hadError=!0;var Q=new Error(V);Q.errno=q,Q.code=t.codes[q],L.emit("error",Q)};var U=t.Z_DEFAULT_COMPRESSION;typeof P.level=="number"&&(U=P.level);var A=t.Z_DEFAULT_STRATEGY;typeof P.strategy=="number"&&(A=P.strategy),this._handle.init(P.windowBits||t.Z_DEFAULT_WINDOWBITS,U,P.memLevel||t.Z_DEFAULT_MEMLEVEL,A,P.dictionary),this._buffer=o.allocUnsafe(this._chunkSize),this._offset=0,this._level=U,this._strategy=A,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!O._handle},configurable:!0,enumerable:!0})}function C(P,D){D&&r.nextTick(D),P._handle&&(P._handle.close(),P._handle=null)}function z(P){P.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),t.Deflate=T,t.Inflate=h,t.Gzip=R,t.Gunzip=W,t.DeflateRaw=X,t.InflateRaw=m,t.Unzip=_,t.createDeflate=function(P){return new T(P)},t.createInflate=function(P){return new h(P)},t.createDeflateRaw=function(P){return new X(P)},t.createInflateRaw=function(P){return new m(P)},t.createGzip=function(P){return new R(P)},t.createGunzip=function(P){return new W(P)},t.createUnzip=function(P){return new _(P)},t.deflate=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new T(D),P,O)},t.deflateSync=function(P,D){return E(new T(D),P)},t.gzip=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new R(D),P,O)},t.gzipSync=function(P,D){return E(new R(D),P)},t.deflateRaw=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new X(D),P,O)},t.deflateRawSync=function(P,D){return E(new X(D),P)},t.unzip=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new _(D),P,O)},t.unzipSync=function(P,D){return E(new _(D),P)},t.inflate=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new h(D),P,O)},t.inflateSync=function(P,D){return E(new h(D),P)},t.gunzip=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new W(D),P,O)},t.gunzipSync=function(P,D){return E(new W(D),P)},t.inflateRaw=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new m(D),P,O)},t.inflateRawSync=function(P,D){return E(new m(D),P)},s.inherits(j,l),j.prototype.params=function(P,D,O){if(P<t.Z_MIN_LEVEL||P>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+P);if(D!=t.Z_FILTERED&&D!=t.Z_HUFFMAN_ONLY&&D!=t.Z_RLE&&D!=t.Z_FIXED&&D!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+D);if(this._level!==P||this._strategy!==D){var L=this;this.flush(u.Z_SYNC_FLUSH,function(){g(L._handle,"zlib binding closed"),L._handle.params(P,D),L._hadError||(L._level=P,L._strategy=D,O&&O())})}else r.nextTick(O)},j.prototype.reset=function(){return g(this._handle,"zlib binding closed"),this._handle.reset()},j.prototype._flush=function(P){this._transform(o.alloc(0),"",P)},j.prototype.flush=function(P,D){var O=this,L=this._writableState;(typeof P=="function"||P===void 0&&!D)&&(D=P,P=u.Z_FULL_FLUSH),L.ended?D&&r.nextTick(D):L.ending?D&&this.once("end",D):L.needDrain?D&&this.once("drain",function(){return O.flush(P,D)}):(this._flushFlag=P,this.write(o.alloc(0),"",D))},j.prototype.close=function(P){C(this,P),r.nextTick(z,this)},j.prototype._transform=function(P,D,O){var L,U=this._writableState,A=(U.ending||U.ended)&&(!P||U.length===P.length);return P===null||o.isBuffer(P)?this._handle?(A?L=this._finishFlushFlag:(L=this._flushFlag,P.length>=U.length&&(this._flushFlag=this._opts.flush||u.Z_NO_FLUSH)),void this._processChunk(P,L,O)):O(new Error("zlib binding closed")):O(new Error("invalid input"))},j.prototype._processChunk=function(P,D,O){var L=P&&P.length,U=this._chunkSize-this._offset,A=0,V=this,q=typeof O=="function";if(!q){var Q,ee=[],te=0;this.on("error",function($){Q=$}),g(this._handle,"zlib binding closed");do var k=this._handle.writeSync(D,P,A,L,this._buffer,this._offset,U);while(!this._hadError&&I(k[0],k[1]));if(this._hadError)throw Q;if(te>=c)throw C(this),new RangeError(d);var x=o.concat(ee,te);return C(this),x}g(this._handle,"zlib binding closed");var b=this._handle.write(D,P,A,L,this._buffer,this._offset,U);function I($,K){if(this&&(this.buffer=null,this.callback=null),!V._hadError){var Y=U-K;if(g(Y>=0,"have should not go down"),Y>0){var ne=V._buffer.slice(V._offset,V._offset+Y);V._offset+=Y,q?V.push(ne):(ee.push(ne),te+=ne.length)}if((K===0||V._offset>=V._chunkSize)&&(U=V._chunkSize,V._offset=0,V._buffer=o.allocUnsafe(V._chunkSize)),K===0){if(A+=L-$,L=$,!q)return!0;var ie=V._handle.write(D,P,A,L,V._buffer,V._offset,V._chunkSize);return ie.callback=I,void(ie.buffer=P)}if(!q)return!1;O()}}b.buffer=P,b.callback=I},s.inherits(T,j),s.inherits(h,j),s.inherits(R,j),s.inherits(W,j),s.inherits(X,j),s.inherits(m,j),s.inherits(_,j)}).call(this,n(2))},function(e,t,n){e.exports=o;var r=n(20).EventEmitter;function o(){r.call(this)}n(7)(o,r),o.Readable=n(31),o.Writable=n(169),o.Duplex=n(170),o.Transform=n(171),o.PassThrough=n(172),o.Stream=o,o.prototype.pipe=function(l,u){var s=this;function g(p){l.writable&&l.write(p)===!1&&s.pause&&s.pause()}function c(){s.readable&&s.resume&&s.resume()}s.on("data",g),l.on("drain",c),l._isStdio||u&&u.end===!1||(s.on("end",w),s.on("close",v));var d=!1;function w(){d||(d=!0,l.end())}function v(){d||(d=!0,typeof l.destroy=="function"&&l.destroy())}function y(p){if(f(),r.listenerCount(this,"error")===0)throw p}function f(){s.removeListener("data",g),l.removeListener("drain",c),s.removeListener("end",w),s.removeListener("close",v),s.removeListener("error",y),l.removeListener("error",y),s.removeListener("end",f),s.removeListener("close",f),l.removeListener("close",f)}return s.on("error",y),l.on("error",y),s.on("end",f),s.on("close",f),l.on("close",f),l.emit("pipe",s),l}},function(e,t){},function(e,t,n){var r=n(46).Buffer,o=n(167);e.exports=function(){function l(){(function(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")})(this,l),this.head=null,this.tail=null,this.length=0}return l.prototype.push=function(u){var s={data:u,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},l.prototype.unshift=function(u){var s={data:u,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},l.prototype.shift=function(){if(this.length!==0){var u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}},l.prototype.clear=function(){this.head=this.tail=null,this.length=0},l.prototype.join=function(u){if(this.length===0)return"";for(var s=this.head,g=""+s.data;s=s.next;)g+=u+s.data;return g},l.prototype.concat=function(u){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var s,g,c,d=r.allocUnsafe(u>>>0),w=this.head,v=0;w;)s=w.data,g=d,c=v,s.copy(g,c),v+=w.data.length,w=w.next;return d},l}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var l=o.inspect({length:this.length});return this.constructor.name+" "+l})},function(e,t){},function(e,t,n){e.exports=l;var r=n(73),o=Object.create(n(32));function l(u){if(!(this instanceof l))return new l(u);r.call(this,u)}o.inherits=n(7),o.inherits(l,r),l.prototype._transform=function(u,s,g){g(null,u)}},function(e,t,n){e.exports=n(47)},function(e,t,n){e.exports=n(22)},function(e,t,n){e.exports=n(31).Transform},function(e,t,n){e.exports=n(31).PassThrough},function(e,t,n){(function(r,o){var l=n(74),u=n(175),s=n(176),g=n(179),c=n(182);for(var d in c)t[d]=c[d];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function w(v){if(typeof v!="number"||v<t.DEFLATE||v>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=v,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}w.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,l(this.init_done,"close before init"),l(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||g.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},w.prototype.write=function(v,y,f,p,S,N,B){return this._write(!0,v,y,f,p,S,N,B)},w.prototype.writeSync=function(v,y,f,p,S,N,B){return this._write(!1,v,y,f,p,S,N,B)},w.prototype._write=function(v,y,f,p,S,N,B,E){if(l.equal(arguments.length,8),l(this.init_done,"write before init"),l(this.mode!==t.NONE,"already finalized"),l.equal(!1,this.write_in_progress,"write already in progress"),l.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,l.equal(!1,y===void 0,"must provide flush value"),this.write_in_progress=!0,y!==t.Z_NO_FLUSH&&y!==t.Z_PARTIAL_FLUSH&&y!==t.Z_SYNC_FLUSH&&y!==t.Z_FULL_FLUSH&&y!==t.Z_FINISH&&y!==t.Z_BLOCK)throw new Error("Invalid flush value");if(f==null&&(f=r.alloc(0),S=0,p=0),this.strm.avail_in=S,this.strm.input=f,this.strm.next_in=p,this.strm.avail_out=E,this.strm.output=N,this.strm.next_out=B,this.flush=y,!v)return this._process(),this._checkError()?this._afterSync():void 0;var T=this;return o.nextTick(function(){T._process(),T._after()}),this},w.prototype._afterSync=function(){var v=this.strm.avail_out,y=this.strm.avail_in;return this.write_in_progress=!1,[y,v]},w.prototype._process=function(){var v=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(v=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(v===null)break;if(this.strm.input[v]!==31){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,v++,this.strm.avail_in===1)break;case 1:if(v===null)break;this.strm.input[v]===139?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=g.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=g.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=g.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=g.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},w.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},w.prototype._after=function(){if(this._checkError()){var v=this.strm.avail_out,y=this.strm.avail_in;this.write_in_progress=!1,this.callback(y,v),this.pending_close&&this.close()}},w.prototype._error=function(v){this.strm.msg&&(v=this.strm.msg),this.onerror(v,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},w.prototype.init=function(v,y,f,p,S){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),l(v>=8&&v<=15,"invalid windowBits"),l(y>=-1&&y<=9,"invalid compression level"),l(f>=1&&f<=9,"invalid memlevel"),l(p===t.Z_FILTERED||p===t.Z_HUFFMAN_ONLY||p===t.Z_RLE||p===t.Z_FIXED||p===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(y,v,f,p,S),this._setDictionary()},w.prototype.params=function(){throw new Error("deflateParams Not supported")},w.prototype.reset=function(){this._reset(),this._setDictionary()},w.prototype._init=function(v,y,f,p,S){switch(this.level=v,this.windowBits=y,this.memLevel=f,this.strategy=p,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new u,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=g.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=S,this.write_in_progress=!1,this.init_done=!0},w.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},w.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=g.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=w}).call(this,n(5).Buffer,n(2))},function(e,t,n){var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;function u(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}e.exports=function(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var g={},c=0;c<10;c++)g["_"+String.fromCharCode(c)]=c;if(Object.getOwnPropertyNames(g).map(function(w){return g[w]}).join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(w){d[w]=w}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(s,g){for(var c,d,w=u(s),v=1;v<arguments.length;v++){for(var y in c=Object(arguments[v]))o.call(c,y)&&(w[y]=c[y]);if(r){d=r(c);for(var f=0;f<d.length;f++)l.call(c,d[f])&&(w[d[f]]=c[d[f]])}}return w}},function(e,t,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){var r,o=n(38),l=n(177),u=n(75),s=n(76),g=n(178);function c(m,_){return m.msg=g[_],_}function d(m){return(m<<1)-(m>4?9:0)}function w(m){for(var _=m.length;--_>=0;)m[_]=0}function v(m){var _=m.state,G=_.pending;G>m.avail_out&&(G=m.avail_out),G!==0&&(o.arraySet(m.output,_.pending_buf,_.pending_out,G,m.next_out),m.next_out+=G,_.pending_out+=G,m.total_out+=G,m.avail_out-=G,_.pending-=G,_.pending===0&&(_.pending_out=0))}function y(m,_){l._tr_flush_block(m,m.block_start>=0?m.block_start:-1,m.strstart-m.block_start,_),m.block_start=m.strstart,v(m.strm)}function f(m,_){m.pending_buf[m.pending++]=_}function p(m,_){m.pending_buf[m.pending++]=_>>>8&255,m.pending_buf[m.pending++]=255&_}function S(m,_){var G,j,C=m.max_chain_length,z=m.strstart,P=m.prev_length,D=m.nice_match,O=m.strstart>m.w_size-262?m.strstart-(m.w_size-262):0,L=m.window,U=m.w_mask,A=m.prev,V=m.strstart+258,q=L[z+P-1],Q=L[z+P];m.prev_length>=m.good_match&&(C>>=2),D>m.lookahead&&(D=m.lookahead);do if(L[(G=_)+P]===Q&&L[G+P-1]===q&&L[G]===L[z]&&L[++G]===L[z+1]){z+=2,G++;do;while(L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&z<V);if(j=258-(V-z),z=V-258,j>P){if(m.match_start=_,P=j,j>=D)break;q=L[z+P-1],Q=L[z+P]}}while((_=A[_&U])>O&&--C!=0);return P<=m.lookahead?P:m.lookahead}function N(m){var _,G,j,C,z,P,D,O,L,U,A=m.w_size;do{if(C=m.window_size-m.lookahead-m.strstart,m.strstart>=A+(A-262)){o.arraySet(m.window,m.window,A,A,0),m.match_start-=A,m.strstart-=A,m.block_start-=A,_=G=m.hash_size;do j=m.head[--_],m.head[_]=j>=A?j-A:0;while(--G);_=G=A;do j=m.prev[--_],m.prev[_]=j>=A?j-A:0;while(--G);C+=A}if(m.strm.avail_in===0)break;if(P=m.strm,D=m.window,O=m.strstart+m.lookahead,L=C,U=void 0,(U=P.avail_in)>L&&(U=L),G=U===0?0:(P.avail_in-=U,o.arraySet(D,P.input,P.next_in,U,O),P.state.wrap===1?P.adler=u(P.adler,D,U,O):P.state.wrap===2&&(P.adler=s(P.adler,D,U,O)),P.next_in+=U,P.total_in+=U,U),m.lookahead+=G,m.lookahead+m.insert>=3)for(z=m.strstart-m.insert,m.ins_h=m.window[z],m.ins_h=(m.ins_h<<m.hash_shift^m.window[z+1])&m.hash_mask;m.insert&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[z+3-1])&m.hash_mask,m.prev[z&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=z,z++,m.insert--,!(m.lookahead+m.insert<3)););}while(m.lookahead<262&&m.strm.avail_in!==0)}function B(m,_){for(var G,j;;){if(m.lookahead<262){if(N(m),m.lookahead<262&&_===0)return 1;if(m.lookahead===0)break}if(G=0,m.lookahead>=3&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),G!==0&&m.strstart-G<=m.w_size-262&&(m.match_length=S(m,G)),m.match_length>=3)if(j=l._tr_tally(m,m.strstart-m.match_start,m.match_length-3),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=3){m.match_length--;do m.strstart++,m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart;while(--m.match_length!=0);m.strstart++}else m.strstart+=m.match_length,m.match_length=0,m.ins_h=m.window[m.strstart],m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+1])&m.hash_mask;else j=l._tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++;if(j&&(y(m,!1),m.strm.avail_out===0))return 1}return m.insert=m.strstart<2?m.strstart:2,_===4?(y(m,!0),m.strm.avail_out===0?3:4):m.last_lit&&(y(m,!1),m.strm.avail_out===0)?1:2}function E(m,_){for(var G,j,C;;){if(m.lookahead<262){if(N(m),m.lookahead<262&&_===0)return 1;if(m.lookahead===0)break}if(G=0,m.lookahead>=3&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),m.prev_length=m.match_length,m.prev_match=m.match_start,m.match_length=2,G!==0&&m.prev_length<m.max_lazy_match&&m.strstart-G<=m.w_size-262&&(m.match_length=S(m,G),m.match_length<=5&&(m.strategy===1||m.match_length===3&&m.strstart-m.match_start>4096)&&(m.match_length=2)),m.prev_length>=3&&m.match_length<=m.prev_length){C=m.strstart+m.lookahead-3,j=l._tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-3),m.lookahead-=m.prev_length-1,m.prev_length-=2;do++m.strstart<=C&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart);while(--m.prev_length!=0);if(m.match_available=0,m.match_length=2,m.strstart++,j&&(y(m,!1),m.strm.avail_out===0))return 1}else if(m.match_available){if((j=l._tr_tally(m,0,m.window[m.strstart-1]))&&y(m,!1),m.strstart++,m.lookahead--,m.strm.avail_out===0)return 1}else m.match_available=1,m.strstart++,m.lookahead--}return m.match_available&&(j=l._tr_tally(m,0,m.window[m.strstart-1]),m.match_available=0),m.insert=m.strstart<2?m.strstart:2,_===4?(y(m,!0),m.strm.avail_out===0?3:4):m.last_lit&&(y(m,!1),m.strm.avail_out===0)?1:2}function T(m,_,G,j,C){this.good_length=m,this.max_lazy=_,this.nice_length=G,this.max_chain=j,this.func=C}function h(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(1146),this.dyn_dtree=new o.Buf16(122),this.bl_tree=new o.Buf16(78),w(this.dyn_ltree),w(this.dyn_dtree),w(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(16),this.heap=new o.Buf16(573),w(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(573),w(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function R(m){var _;return m&&m.state?(m.total_in=m.total_out=0,m.data_type=2,(_=m.state).pending=0,_.pending_out=0,_.wrap<0&&(_.wrap=-_.wrap),_.status=_.wrap?42:113,m.adler=_.wrap===2?0:1,_.last_flush=0,l._tr_init(_),0):c(m,-2)}function W(m){var _,G=R(m);return G===0&&((_=m.state).window_size=2*_.w_size,w(_.head),_.max_lazy_match=r[_.level].max_lazy,_.good_match=r[_.level].good_length,_.nice_match=r[_.level].nice_length,_.max_chain_length=r[_.level].max_chain,_.strstart=0,_.block_start=0,_.lookahead=0,_.insert=0,_.match_length=_.prev_length=2,_.match_available=0,_.ins_h=0),G}function X(m,_,G,j,C,z){if(!m)return-2;var P=1;if(_===-1&&(_=6),j<0?(P=0,j=-j):j>15&&(P=2,j-=16),C<1||C>9||G!==8||j<8||j>15||_<0||_>9||z<0||z>4)return c(m,-2);j===8&&(j=9);var D=new h;return m.state=D,D.strm=m,D.wrap=P,D.gzhead=null,D.w_bits=j,D.w_size=1<<D.w_bits,D.w_mask=D.w_size-1,D.hash_bits=C+7,D.hash_size=1<<D.hash_bits,D.hash_mask=D.hash_size-1,D.hash_shift=~~((D.hash_bits+3-1)/3),D.window=new o.Buf8(2*D.w_size),D.head=new o.Buf16(D.hash_size),D.prev=new o.Buf16(D.w_size),D.lit_bufsize=1<<C+6,D.pending_buf_size=4*D.lit_bufsize,D.pending_buf=new o.Buf8(D.pending_buf_size),D.d_buf=1*D.lit_bufsize,D.l_buf=3*D.lit_bufsize,D.level=_,D.strategy=z,D.method=G,W(m)}r=[new T(0,0,0,0,function(m,_){var G=65535;for(G>m.pending_buf_size-5&&(G=m.pending_buf_size-5);;){if(m.lookahead<=1){if(N(m),m.lookahead===0&&_===0)return 1;if(m.lookahead===0)break}m.strstart+=m.lookahead,m.lookahead=0;var j=m.block_start+G;if((m.strstart===0||m.strstart>=j)&&(m.lookahead=m.strstart-j,m.strstart=j,y(m,!1),m.strm.avail_out===0)||m.strstart-m.block_start>=m.w_size-262&&(y(m,!1),m.strm.avail_out===0))return 1}return m.insert=0,_===4?(y(m,!0),m.strm.avail_out===0?3:4):(m.strstart>m.block_start&&(y(m,!1),m.strm.avail_out),1)}),new T(4,4,8,4,B),new T(4,5,16,8,B),new T(4,6,32,32,B),new T(4,4,16,16,E),new T(8,16,32,32,E),new T(8,16,128,128,E),new T(8,32,128,256,E),new T(32,128,258,1024,E),new T(32,258,258,4096,E)],t.deflateInit=function(m,_){return X(m,_,8,15,8,0)},t.deflateInit2=X,t.deflateReset=W,t.deflateResetKeep=R,t.deflateSetHeader=function(m,_){return m&&m.state?m.state.wrap!==2?-2:(m.state.gzhead=_,0):-2},t.deflate=function(m,_){var G,j,C,z;if(!m||!m.state||_>5||_<0)return m?c(m,-2):-2;if(j=m.state,!m.output||!m.input&&m.avail_in!==0||j.status===666&&_!==4)return c(m,m.avail_out===0?-5:-2);if(j.strm=m,G=j.last_flush,j.last_flush=_,j.status===42)if(j.wrap===2)m.adler=0,f(j,31),f(j,139),f(j,8),j.gzhead?(f(j,(j.gzhead.text?1:0)+(j.gzhead.hcrc?2:0)+(j.gzhead.extra?4:0)+(j.gzhead.name?8:0)+(j.gzhead.comment?16:0)),f(j,255&j.gzhead.time),f(j,j.gzhead.time>>8&255),f(j,j.gzhead.time>>16&255),f(j,j.gzhead.time>>24&255),f(j,j.level===9?2:j.strategy>=2||j.level<2?4:0),f(j,255&j.gzhead.os),j.gzhead.extra&&j.gzhead.extra.length&&(f(j,255&j.gzhead.extra.length),f(j,j.gzhead.extra.length>>8&255)),j.gzhead.hcrc&&(m.adler=s(m.adler,j.pending_buf,j.pending,0)),j.gzindex=0,j.status=69):(f(j,0),f(j,0),f(j,0),f(j,0),f(j,0),f(j,j.level===9?2:j.strategy>=2||j.level<2?4:0),f(j,3),j.status=113);else{var P=8+(j.w_bits-8<<4)<<8;P|=(j.strategy>=2||j.level<2?0:j.level<6?1:j.level===6?2:3)<<6,j.strstart!==0&&(P|=32),P+=31-P%31,j.status=113,p(j,P),j.strstart!==0&&(p(j,m.adler>>>16),p(j,65535&m.adler)),m.adler=1}if(j.status===69)if(j.gzhead.extra){for(C=j.pending;j.gzindex<(65535&j.gzhead.extra.length)&&(j.pending!==j.pending_buf_size||(j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),v(m),C=j.pending,j.pending!==j.pending_buf_size));)f(j,255&j.gzhead.extra[j.gzindex]),j.gzindex++;j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),j.gzindex===j.gzhead.extra.length&&(j.gzindex=0,j.status=73)}else j.status=73;if(j.status===73)if(j.gzhead.name){C=j.pending;do{if(j.pending===j.pending_buf_size&&(j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),v(m),C=j.pending,j.pending===j.pending_buf_size)){z=1;break}z=j.gzindex<j.gzhead.name.length?255&j.gzhead.name.charCodeAt(j.gzindex++):0,f(j,z)}while(z!==0);j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),z===0&&(j.gzindex=0,j.status=91)}else j.status=91;if(j.status===91)if(j.gzhead.comment){C=j.pending;do{if(j.pending===j.pending_buf_size&&(j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),v(m),C=j.pending,j.pending===j.pending_buf_size)){z=1;break}z=j.gzindex<j.gzhead.comment.length?255&j.gzhead.comment.charCodeAt(j.gzindex++):0,f(j,z)}while(z!==0);j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),z===0&&(j.status=103)}else j.status=103;if(j.status===103&&(j.gzhead.hcrc?(j.pending+2>j.pending_buf_size&&v(m),j.pending+2<=j.pending_buf_size&&(f(j,255&m.adler),f(j,m.adler>>8&255),m.adler=0,j.status=113)):j.status=113),j.pending!==0){if(v(m),m.avail_out===0)return j.last_flush=-1,0}else if(m.avail_in===0&&d(_)<=d(G)&&_!==4)return c(m,-5);if(j.status===666&&m.avail_in!==0)return c(m,-5);if(m.avail_in!==0||j.lookahead!==0||_!==0&&j.status!==666){var D=j.strategy===2?function(O,L){for(var U;;){if(O.lookahead===0&&(N(O),O.lookahead===0)){if(L===0)return 1;break}if(O.match_length=0,U=l._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,U&&(y(O,!1),O.strm.avail_out===0))return 1}return O.insert=0,L===4?(y(O,!0),O.strm.avail_out===0?3:4):O.last_lit&&(y(O,!1),O.strm.avail_out===0)?1:2}(j,_):j.strategy===3?function(O,L){for(var U,A,V,q,Q=O.window;;){if(O.lookahead<=258){if(N(O),O.lookahead<=258&&L===0)return 1;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=3&&O.strstart>0&&(A=Q[V=O.strstart-1])===Q[++V]&&A===Q[++V]&&A===Q[++V]){q=O.strstart+258;do;while(A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&V<q);O.match_length=258-(q-V),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=3?(U=l._tr_tally(O,1,O.match_length-3),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(U=l._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),U&&(y(O,!1),O.strm.avail_out===0))return 1}return O.insert=0,L===4?(y(O,!0),O.strm.avail_out===0?3:4):O.last_lit&&(y(O,!1),O.strm.avail_out===0)?1:2}(j,_):r[j.level].func(j,_);if(D!==3&&D!==4||(j.status=666),D===1||D===3)return m.avail_out===0&&(j.last_flush=-1),0;if(D===2&&(_===1?l._tr_align(j):_!==5&&(l._tr_stored_block(j,0,0,!1),_===3&&(w(j.head),j.lookahead===0&&(j.strstart=0,j.block_start=0,j.insert=0))),v(m),m.avail_out===0))return j.last_flush=-1,0}return _!==4?0:j.wrap<=0?1:(j.wrap===2?(f(j,255&m.adler),f(j,m.adler>>8&255),f(j,m.adler>>16&255),f(j,m.adler>>24&255),f(j,255&m.total_in),f(j,m.total_in>>8&255),f(j,m.total_in>>16&255),f(j,m.total_in>>24&255)):(p(j,m.adler>>>16),p(j,65535&m.adler)),v(m),j.wrap>0&&(j.wrap=-j.wrap),j.pending!==0?0:1)},t.deflateEnd=function(m){var _;return m&&m.state?(_=m.state.status)!==42&&_!==69&&_!==73&&_!==91&&_!==103&&_!==113&&_!==666?c(m,-2):(m.state=null,_===113?c(m,-3):0):-2},t.deflateSetDictionary=function(m,_){var G,j,C,z,P,D,O,L,U=_.length;if(!m||!m.state||(z=(G=m.state).wrap)===2||z===1&&G.status!==42||G.lookahead)return-2;for(z===1&&(m.adler=u(m.adler,_,U,0)),G.wrap=0,U>=G.w_size&&(z===0&&(w(G.head),G.strstart=0,G.block_start=0,G.insert=0),L=new o.Buf8(G.w_size),o.arraySet(L,_,U-G.w_size,G.w_size,0),_=L,U=G.w_size),P=m.avail_in,D=m.next_in,O=m.input,m.avail_in=U,m.next_in=0,m.input=_,N(G);G.lookahead>=3;){j=G.strstart,C=G.lookahead-2;do G.ins_h=(G.ins_h<<G.hash_shift^G.window[j+3-1])&G.hash_mask,G.prev[j&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=j,j++;while(--C);G.strstart=j,G.lookahead=2,N(G)}return G.strstart+=G.lookahead,G.block_start=G.strstart,G.insert=G.lookahead,G.lookahead=0,G.match_length=G.prev_length=2,G.match_available=0,m.next_in=D,m.input=O,m.avail_in=P,G.wrap=z,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){var r=n(38);function o(A){for(var V=A.length;--V>=0;)A[V]=0}var l=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],u=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],g=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);o(c);var d=new Array(60);o(d);var w=new Array(512);o(w);var v=new Array(256);o(v);var y=new Array(29);o(y);var f,p,S,N=new Array(30);function B(A,V,q,Q,ee){this.static_tree=A,this.extra_bits=V,this.extra_base=q,this.elems=Q,this.max_length=ee,this.has_stree=A&&A.length}function E(A,V){this.dyn_tree=A,this.max_code=0,this.stat_desc=V}function T(A){return A<256?w[A]:w[256+(A>>>7)]}function h(A,V){A.pending_buf[A.pending++]=255&V,A.pending_buf[A.pending++]=V>>>8&255}function R(A,V,q){A.bi_valid>16-q?(A.bi_buf|=V<<A.bi_valid&65535,h(A,A.bi_buf),A.bi_buf=V>>16-A.bi_valid,A.bi_valid+=q-16):(A.bi_buf|=V<<A.bi_valid&65535,A.bi_valid+=q)}function W(A,V,q){R(A,q[2*V],q[2*V+1])}function X(A,V){var q=0;do q|=1&A,A>>>=1,q<<=1;while(--V>0);return q>>>1}function m(A,V,q){var Q,ee,te=new Array(16),k=0;for(Q=1;Q<=15;Q++)te[Q]=k=k+q[Q-1]<<1;for(ee=0;ee<=V;ee++){var x=A[2*ee+1];x!==0&&(A[2*ee]=X(te[x]++,x))}}function _(A){var V;for(V=0;V<286;V++)A.dyn_ltree[2*V]=0;for(V=0;V<30;V++)A.dyn_dtree[2*V]=0;for(V=0;V<19;V++)A.bl_tree[2*V]=0;A.dyn_ltree[512]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function G(A){A.bi_valid>8?h(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function j(A,V,q,Q){var ee=2*V,te=2*q;return A[ee]<A[te]||A[ee]===A[te]&&Q[V]<=Q[q]}function C(A,V,q){for(var Q=A.heap[q],ee=q<<1;ee<=A.heap_len&&(ee<A.heap_len&&j(V,A.heap[ee+1],A.heap[ee],A.depth)&&ee++,!j(V,Q,A.heap[ee],A.depth));)A.heap[q]=A.heap[ee],q=ee,ee<<=1;A.heap[q]=Q}function z(A,V,q){var Q,ee,te,k,x=0;if(A.last_lit!==0)do Q=A.pending_buf[A.d_buf+2*x]<<8|A.pending_buf[A.d_buf+2*x+1],ee=A.pending_buf[A.l_buf+x],x++,Q===0?W(A,ee,V):(W(A,(te=v[ee])+256+1,V),(k=l[te])!==0&&R(A,ee-=y[te],k),W(A,te=T(--Q),q),(k=u[te])!==0&&R(A,Q-=N[te],k));while(x<A.last_lit);W(A,256,V)}function P(A,V){var q,Q,ee,te=V.dyn_tree,k=V.stat_desc.static_tree,x=V.stat_desc.has_stree,b=V.stat_desc.elems,I=-1;for(A.heap_len=0,A.heap_max=573,q=0;q<b;q++)te[2*q]!==0?(A.heap[++A.heap_len]=I=q,A.depth[q]=0):te[2*q+1]=0;for(;A.heap_len<2;)te[2*(ee=A.heap[++A.heap_len]=I<2?++I:0)]=1,A.depth[ee]=0,A.opt_len--,x&&(A.static_len-=k[2*ee+1]);for(V.max_code=I,q=A.heap_len>>1;q>=1;q--)C(A,te,q);ee=b;do q=A.heap[1],A.heap[1]=A.heap[A.heap_len--],C(A,te,1),Q=A.heap[1],A.heap[--A.heap_max]=q,A.heap[--A.heap_max]=Q,te[2*ee]=te[2*q]+te[2*Q],A.depth[ee]=(A.depth[q]>=A.depth[Q]?A.depth[q]:A.depth[Q])+1,te[2*q+1]=te[2*Q+1]=ee,A.heap[1]=ee++,C(A,te,1);while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],function($,K){var Y,ne,ie,ue,we,Oe,Ee=K.dyn_tree,Ne=K.max_code,Te=K.stat_desc.static_tree,Ae=K.stat_desc.has_stree,Ie=K.stat_desc.extra_bits,Fe=K.stat_desc.extra_base,Ve=K.stat_desc.max_length,rt=0;for(ue=0;ue<=15;ue++)$.bl_count[ue]=0;for(Ee[2*$.heap[$.heap_max]+1]=0,Y=$.heap_max+1;Y<573;Y++)(ue=Ee[2*Ee[2*(ne=$.heap[Y])+1]+1]+1)>Ve&&(ue=Ve,rt++),Ee[2*ne+1]=ue,ne>Ne||($.bl_count[ue]++,we=0,ne>=Fe&&(we=Ie[ne-Fe]),Oe=Ee[2*ne],$.opt_len+=Oe*(ue+we),Ae&&($.static_len+=Oe*(Te[2*ne+1]+we)));if(rt!==0){do{for(ue=Ve-1;$.bl_count[ue]===0;)ue--;$.bl_count[ue]--,$.bl_count[ue+1]+=2,$.bl_count[Ve]--,rt-=2}while(rt>0);for(ue=Ve;ue!==0;ue--)for(ne=$.bl_count[ue];ne!==0;)(ie=$.heap[--Y])>Ne||(Ee[2*ie+1]!==ue&&($.opt_len+=(ue-Ee[2*ie+1])*Ee[2*ie],Ee[2*ie+1]=ue),ne--)}}(A,V),m(te,I,A.bl_count)}function D(A,V,q){var Q,ee,te=-1,k=V[1],x=0,b=7,I=4;for(k===0&&(b=138,I=3),V[2*(q+1)+1]=65535,Q=0;Q<=q;Q++)ee=k,k=V[2*(Q+1)+1],++x<b&&ee===k||(x<I?A.bl_tree[2*ee]+=x:ee!==0?(ee!==te&&A.bl_tree[2*ee]++,A.bl_tree[32]++):x<=10?A.bl_tree[34]++:A.bl_tree[36]++,x=0,te=ee,k===0?(b=138,I=3):ee===k?(b=6,I=3):(b=7,I=4))}function O(A,V,q){var Q,ee,te=-1,k=V[1],x=0,b=7,I=4;for(k===0&&(b=138,I=3),Q=0;Q<=q;Q++)if(ee=k,k=V[2*(Q+1)+1],!(++x<b&&ee===k)){if(x<I)do W(A,ee,A.bl_tree);while(--x!=0);else ee!==0?(ee!==te&&(W(A,ee,A.bl_tree),x--),W(A,16,A.bl_tree),R(A,x-3,2)):x<=10?(W(A,17,A.bl_tree),R(A,x-3,3)):(W(A,18,A.bl_tree),R(A,x-11,7));x=0,te=ee,k===0?(b=138,I=3):ee===k?(b=6,I=3):(b=7,I=4)}}o(N);var L=!1;function U(A,V,q,Q){R(A,0+(Q?1:0),3),function(ee,te,k,x){G(ee),x&&(h(ee,k),h(ee,~k)),r.arraySet(ee.pending_buf,ee.window,te,k,ee.pending),ee.pending+=k}(A,V,q,!0)}t._tr_init=function(A){L||(function(){var V,q,Q,ee,te,k=new Array(16);for(Q=0,ee=0;ee<28;ee++)for(y[ee]=Q,V=0;V<1<<l[ee];V++)v[Q++]=ee;for(v[Q-1]=ee,te=0,ee=0;ee<16;ee++)for(N[ee]=te,V=0;V<1<<u[ee];V++)w[te++]=ee;for(te>>=7;ee<30;ee++)for(N[ee]=te<<7,V=0;V<1<<u[ee]-7;V++)w[256+te++]=ee;for(q=0;q<=15;q++)k[q]=0;for(V=0;V<=143;)c[2*V+1]=8,V++,k[8]++;for(;V<=255;)c[2*V+1]=9,V++,k[9]++;for(;V<=279;)c[2*V+1]=7,V++,k[7]++;for(;V<=287;)c[2*V+1]=8,V++,k[8]++;for(m(c,287,k),V=0;V<30;V++)d[2*V+1]=5,d[2*V]=X(V,5);f=new B(c,l,257,286,15),p=new B(d,u,0,30,15),S=new B(new Array(0),s,0,19,7)}(),L=!0),A.l_desc=new E(A.dyn_ltree,f),A.d_desc=new E(A.dyn_dtree,p),A.bl_desc=new E(A.bl_tree,S),A.bi_buf=0,A.bi_valid=0,_(A)},t._tr_stored_block=U,t._tr_flush_block=function(A,V,q,Q){var ee,te,k=0;A.level>0?(A.strm.data_type===2&&(A.strm.data_type=function(x){var b,I=4093624447;for(b=0;b<=31;b++,I>>>=1)if(1&I&&x.dyn_ltree[2*b]!==0)return 0;if(x.dyn_ltree[18]!==0||x.dyn_ltree[20]!==0||x.dyn_ltree[26]!==0)return 1;for(b=32;b<256;b++)if(x.dyn_ltree[2*b]!==0)return 1;return 0}(A)),P(A,A.l_desc),P(A,A.d_desc),k=function(x){var b;for(D(x,x.dyn_ltree,x.l_desc.max_code),D(x,x.dyn_dtree,x.d_desc.max_code),P(x,x.bl_desc),b=18;b>=3&&x.bl_tree[2*g[b]+1]===0;b--);return x.opt_len+=3*(b+1)+5+5+4,b}(A),ee=A.opt_len+3+7>>>3,(te=A.static_len+3+7>>>3)<=ee&&(ee=te)):ee=te=q+5,q+4<=ee&&V!==-1?U(A,V,q,Q):A.strategy===4||te===ee?(R(A,2+(Q?1:0),3),z(A,c,d)):(R(A,4+(Q?1:0),3),function(x,b,I,$){var K;for(R(x,b-257,5),R(x,I-1,5),R(x,$-4,4),K=0;K<$;K++)R(x,x.bl_tree[2*g[K]+1],3);O(x,x.dyn_ltree,b-1),O(x,x.dyn_dtree,I-1)}(A,A.l_desc.max_code+1,A.d_desc.max_code+1,k+1),z(A,A.dyn_ltree,A.dyn_dtree)),_(A),Q&&G(A)},t._tr_tally=function(A,V,q){return A.pending_buf[A.d_buf+2*A.last_lit]=V>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&V,A.pending_buf[A.l_buf+A.last_lit]=255&q,A.last_lit++,V===0?A.dyn_ltree[2*q]++:(A.matches++,V--,A.dyn_ltree[2*(v[q]+256+1)]++,A.dyn_dtree[2*T(V)]++),A.last_lit===A.lit_bufsize-1},t._tr_align=function(A){R(A,2,3),W(A,256,c),function(V){V.bi_valid===16?(h(V,V.bi_buf),V.bi_buf=0,V.bi_valid=0):V.bi_valid>=8&&(V.pending_buf[V.pending++]=255&V.bi_buf,V.bi_buf>>=8,V.bi_valid-=8)}(A)}},function(e,t,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){var r=n(38),o=n(75),l=n(76),u=n(180),s=n(181);function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(E){var T;return E&&E.state?(T=E.state,E.total_in=E.total_out=T.total=0,E.msg="",T.wrap&&(E.adler=1&T.wrap),T.mode=1,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new r.Buf32(852),T.distcode=T.distdyn=new r.Buf32(592),T.sane=1,T.back=-1,0):-2}function w(E){var T;return E&&E.state?((T=E.state).wsize=0,T.whave=0,T.wnext=0,d(E)):-2}function v(E,T){var h,R;return E&&E.state?(R=E.state,T<0?(h=0,T=-T):(h=1+(T>>4),T<48&&(T&=15)),T&&(T<8||T>15)?-2:(R.window!==null&&R.wbits!==T&&(R.window=null),R.wrap=h,R.wbits=T,w(E))):-2}function y(E,T){var h,R;return E?(R=new c,E.state=R,R.window=null,(h=v(E,T))!==0&&(E.state=null),h):-2}var f,p,S=!0;function N(E){if(S){var T;for(f=new r.Buf32(512),p=new r.Buf32(32),T=0;T<144;)E.lens[T++]=8;for(;T<256;)E.lens[T++]=9;for(;T<280;)E.lens[T++]=7;for(;T<288;)E.lens[T++]=8;for(s(1,E.lens,0,288,f,0,E.work,{bits:9}),T=0;T<32;)E.lens[T++]=5;s(2,E.lens,0,32,p,0,E.work,{bits:5}),S=!1}E.lencode=f,E.lenbits=9,E.distcode=p,E.distbits=5}function B(E,T,h,R){var W,X=E.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new r.Buf8(X.wsize)),R>=X.wsize?(r.arraySet(X.window,T,h-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):((W=X.wsize-X.wnext)>R&&(W=R),r.arraySet(X.window,T,h-R,W,X.wnext),(R-=W)?(r.arraySet(X.window,T,h-R,R,0),X.wnext=R,X.whave=X.wsize):(X.wnext+=W,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=W))),0}t.inflateReset=w,t.inflateReset2=v,t.inflateResetKeep=d,t.inflateInit=function(E){return y(E,15)},t.inflateInit2=y,t.inflate=function(E,T){var h,R,W,X,m,_,G,j,C,z,P,D,O,L,U,A,V,q,Q,ee,te,k,x,b,I=0,$=new r.Buf8(4),K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return-2;(h=E.state).mode===12&&(h.mode=13),m=E.next_out,W=E.output,G=E.avail_out,X=E.next_in,R=E.input,_=E.avail_in,j=h.hold,C=h.bits,z=_,P=G,k=0;e:for(;;)switch(h.mode){case 1:if(h.wrap===0){h.mode=13;break}for(;C<16;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(2&h.wrap&&j===35615){h.check=0,$[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0),j=0,C=0,h.mode=2;break}if(h.flags=0,h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&j)<<8)+(j>>8))%31){E.msg="incorrect header check",h.mode=30;break}if((15&j)!=8){E.msg="unknown compression method",h.mode=30;break}if(C-=4,te=8+(15&(j>>>=4)),h.wbits===0)h.wbits=te;else if(te>h.wbits){E.msg="invalid window size",h.mode=30;break}h.dmax=1<<te,E.adler=h.check=1,h.mode=512&j?10:12,j=0,C=0;break;case 2:for(;C<16;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(h.flags=j,(255&h.flags)!=8){E.msg="unknown compression method",h.mode=30;break}if(57344&h.flags){E.msg="unknown header flags set",h.mode=30;break}h.head&&(h.head.text=j>>8&1),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0)),j=0,C=0,h.mode=3;case 3:for(;C<32;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}h.head&&(h.head.time=j),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,$[2]=j>>>16&255,$[3]=j>>>24&255,h.check=l(h.check,$,4,0)),j=0,C=0,h.mode=4;case 4:for(;C<16;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}h.head&&(h.head.xflags=255&j,h.head.os=j>>8),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0)),j=0,C=0,h.mode=5;case 5:if(1024&h.flags){for(;C<16;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}h.length=j,h.head&&(h.head.extra_len=j),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0)),j=0,C=0}else h.head&&(h.head.extra=null);h.mode=6;case 6:if(1024&h.flags&&((D=h.length)>_&&(D=_),D&&(h.head&&(te=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Array(h.head.extra_len)),r.arraySet(h.head.extra,R,X,D,te)),512&h.flags&&(h.check=l(h.check,R,D,X)),_-=D,X+=D,h.length-=D),h.length))break e;h.length=0,h.mode=7;case 7:if(2048&h.flags){if(_===0)break e;D=0;do te=R[X+D++],h.head&&te&&h.length<65536&&(h.head.name+=String.fromCharCode(te));while(te&&D<_);if(512&h.flags&&(h.check=l(h.check,R,D,X)),_-=D,X+=D,te)break e}else h.head&&(h.head.name=null);h.length=0,h.mode=8;case 8:if(4096&h.flags){if(_===0)break e;D=0;do te=R[X+D++],h.head&&te&&h.length<65536&&(h.head.comment+=String.fromCharCode(te));while(te&&D<_);if(512&h.flags&&(h.check=l(h.check,R,D,X)),_-=D,X+=D,te)break e}else h.head&&(h.head.comment=null);h.mode=9;case 9:if(512&h.flags){for(;C<16;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(j!==(65535&h.check)){E.msg="header crc mismatch",h.mode=30;break}j=0,C=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),E.adler=h.check=0,h.mode=12;break;case 10:for(;C<32;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}E.adler=h.check=g(j),j=0,C=0,h.mode=11;case 11:if(h.havedict===0)return E.next_out=m,E.avail_out=G,E.next_in=X,E.avail_in=_,h.hold=j,h.bits=C,2;E.adler=h.check=1,h.mode=12;case 12:if(T===5||T===6)break e;case 13:if(h.last){j>>>=7&C,C-=7&C,h.mode=27;break}for(;C<3;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}switch(h.last=1&j,C-=1,3&(j>>>=1)){case 0:h.mode=14;break;case 1:if(N(h),h.mode=20,T===6){j>>>=2,C-=2;break e}break;case 2:h.mode=17;break;case 3:E.msg="invalid block type",h.mode=30}j>>>=2,C-=2;break;case 14:for(j>>>=7&C,C-=7&C;C<32;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if((65535&j)!=(j>>>16^65535)){E.msg="invalid stored block lengths",h.mode=30;break}if(h.length=65535&j,j=0,C=0,h.mode=15,T===6)break e;case 15:h.mode=16;case 16:if(D=h.length){if(D>_&&(D=_),D>G&&(D=G),D===0)break e;r.arraySet(W,R,X,D,m),_-=D,X+=D,G-=D,m+=D,h.length-=D;break}h.mode=12;break;case 17:for(;C<14;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(h.nlen=257+(31&j),j>>>=5,C-=5,h.ndist=1+(31&j),j>>>=5,C-=5,h.ncode=4+(15&j),j>>>=4,C-=4,h.nlen>286||h.ndist>30){E.msg="too many length or distance symbols",h.mode=30;break}h.have=0,h.mode=18;case 18:for(;h.have<h.ncode;){for(;C<3;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}h.lens[K[h.have++]]=7&j,j>>>=3,C-=3}for(;h.have<19;)h.lens[K[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,x={bits:h.lenbits},k=s(0,h.lens,0,19,h.lencode,0,h.work,x),h.lenbits=x.bits,k){E.msg="invalid code lengths set",h.mode=30;break}h.have=0,h.mode=19;case 19:for(;h.have<h.nlen+h.ndist;){for(;A=(I=h.lencode[j&(1<<h.lenbits)-1])>>>16&255,V=65535&I,!((U=I>>>24)<=C);){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(V<16)j>>>=U,C-=U,h.lens[h.have++]=V;else{if(V===16){for(b=U+2;C<b;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(j>>>=U,C-=U,h.have===0){E.msg="invalid bit length repeat",h.mode=30;break}te=h.lens[h.have-1],D=3+(3&j),j>>>=2,C-=2}else if(V===17){for(b=U+3;C<b;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}C-=U,te=0,D=3+(7&(j>>>=U)),j>>>=3,C-=3}else{for(b=U+7;C<b;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}C-=U,te=0,D=11+(127&(j>>>=U)),j>>>=7,C-=7}if(h.have+D>h.nlen+h.ndist){E.msg="invalid bit length repeat",h.mode=30;break}for(;D--;)h.lens[h.have++]=te}}if(h.mode===30)break;if(h.lens[256]===0){E.msg="invalid code -- missing end-of-block",h.mode=30;break}if(h.lenbits=9,x={bits:h.lenbits},k=s(1,h.lens,0,h.nlen,h.lencode,0,h.work,x),h.lenbits=x.bits,k){E.msg="invalid literal/lengths set",h.mode=30;break}if(h.distbits=6,h.distcode=h.distdyn,x={bits:h.distbits},k=s(2,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,x),h.distbits=x.bits,k){E.msg="invalid distances set",h.mode=30;break}if(h.mode=20,T===6)break e;case 20:h.mode=21;case 21:if(_>=6&&G>=258){E.next_out=m,E.avail_out=G,E.next_in=X,E.avail_in=_,h.hold=j,h.bits=C,u(E,P),m=E.next_out,W=E.output,G=E.avail_out,X=E.next_in,R=E.input,_=E.avail_in,j=h.hold,C=h.bits,h.mode===12&&(h.back=-1);break}for(h.back=0;A=(I=h.lencode[j&(1<<h.lenbits)-1])>>>16&255,V=65535&I,!((U=I>>>24)<=C);){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(A&&!(240&A)){for(q=U,Q=A,ee=V;A=(I=h.lencode[ee+((j&(1<<q+Q)-1)>>q)])>>>16&255,V=65535&I,!(q+(U=I>>>24)<=C);){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}j>>>=q,C-=q,h.back+=q}if(j>>>=U,C-=U,h.back+=U,h.length=V,A===0){h.mode=26;break}if(32&A){h.back=-1,h.mode=12;break}if(64&A){E.msg="invalid literal/length code",h.mode=30;break}h.extra=15&A,h.mode=22;case 22:if(h.extra){for(b=h.extra;C<b;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}h.length+=j&(1<<h.extra)-1,j>>>=h.extra,C-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=23;case 23:for(;A=(I=h.distcode[j&(1<<h.distbits)-1])>>>16&255,V=65535&I,!((U=I>>>24)<=C);){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(!(240&A)){for(q=U,Q=A,ee=V;A=(I=h.distcode[ee+((j&(1<<q+Q)-1)>>q)])>>>16&255,V=65535&I,!(q+(U=I>>>24)<=C);){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}j>>>=q,C-=q,h.back+=q}if(j>>>=U,C-=U,h.back+=U,64&A){E.msg="invalid distance code",h.mode=30;break}h.offset=V,h.extra=15&A,h.mode=24;case 24:if(h.extra){for(b=h.extra;C<b;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}h.offset+=j&(1<<h.extra)-1,j>>>=h.extra,C-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){E.msg="invalid distance too far back",h.mode=30;break}h.mode=25;case 25:if(G===0)break e;if(D=P-G,h.offset>D){if((D=h.offset-D)>h.whave&&h.sane){E.msg="invalid distance too far back",h.mode=30;break}D>h.wnext?(D-=h.wnext,O=h.wsize-D):O=h.wnext-D,D>h.length&&(D=h.length),L=h.window}else L=W,O=m-h.offset,D=h.length;D>G&&(D=G),G-=D,h.length-=D;do W[m++]=L[O++];while(--D);h.length===0&&(h.mode=21);break;case 26:if(G===0)break e;W[m++]=h.length,G--,h.mode=21;break;case 27:if(h.wrap){for(;C<32;){if(_===0)break e;_--,j|=R[X++]<<C,C+=8}if(P-=G,E.total_out+=P,h.total+=P,P&&(E.adler=h.check=h.flags?l(h.check,W,P,m-P):o(h.check,W,P,m-P)),P=G,(h.flags?j:g(j))!==h.check){E.msg="incorrect data check",h.mode=30;break}j=0,C=0}h.mode=28;case 28:if(h.wrap&&h.flags){for(;C<32;){if(_===0)break e;_--,j+=R[X++]<<C,C+=8}if(j!==(4294967295&h.total)){E.msg="incorrect length check",h.mode=30;break}j=0,C=0}h.mode=29;case 29:k=1;break e;case 30:k=-3;break e;case 31:return-4;case 32:default:return-2}return E.next_out=m,E.avail_out=G,E.next_in=X,E.avail_in=_,h.hold=j,h.bits=C,(h.wsize||P!==E.avail_out&&h.mode<30&&(h.mode<27||T!==4))&&B(E,E.output,E.next_out,P-E.avail_out)?(h.mode=31,-4):(z-=E.avail_in,P-=E.avail_out,E.total_in+=z,E.total_out+=P,h.total+=P,h.wrap&&P&&(E.adler=h.check=h.flags?l(h.check,W,P,E.next_out-P):o(h.check,W,P,E.next_out-P)),E.data_type=h.bits+(h.last?64:0)+(h.mode===12?128:0)+(h.mode===20||h.mode===15?256:0),(z===0&&P===0||T===4)&&k===0&&(k=-5),k)},t.inflateEnd=function(E){if(!E||!E.state)return-2;var T=E.state;return T.window&&(T.window=null),E.state=null,0},t.inflateGetHeader=function(E,T){var h;return E&&E.state&&2&(h=E.state).wrap?(h.head=T,T.done=!1,0):-2},t.inflateSetDictionary=function(E,T){var h,R=T.length;return E&&E.state?(h=E.state).wrap!==0&&h.mode!==11?-2:h.mode===11&&o(1,T,R,0)!==h.check?-3:B(E,T,R,R)?(h.mode=31,-4):(h.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){e.exports=function(r,o){var l,u,s,g,c,d,w,v,y,f,p,S,N,B,E,T,h,R,W,X,m,_,G,j,C;l=r.state,u=r.next_in,j=r.input,s=u+(r.avail_in-5),g=r.next_out,C=r.output,c=g-(o-r.avail_out),d=g+(r.avail_out-257),w=l.dmax,v=l.wsize,y=l.whave,f=l.wnext,p=l.window,S=l.hold,N=l.bits,B=l.lencode,E=l.distcode,T=(1<<l.lenbits)-1,h=(1<<l.distbits)-1;e:do{N<15&&(S+=j[u++]<<N,N+=8,S+=j[u++]<<N,N+=8),R=B[S&T];t:for(;;){if(S>>>=W=R>>>24,N-=W,(W=R>>>16&255)===0)C[g++]=65535&R;else{if(!(16&W)){if(!(64&W)){R=B[(65535&R)+(S&(1<<W)-1)];continue t}if(32&W){l.mode=12;break e}r.msg="invalid literal/length code",l.mode=30;break e}X=65535&R,(W&=15)&&(N<W&&(S+=j[u++]<<N,N+=8),X+=S&(1<<W)-1,S>>>=W,N-=W),N<15&&(S+=j[u++]<<N,N+=8,S+=j[u++]<<N,N+=8),R=E[S&h];n:for(;;){if(S>>>=W=R>>>24,N-=W,!(16&(W=R>>>16&255))){if(!(64&W)){R=E[(65535&R)+(S&(1<<W)-1)];continue n}r.msg="invalid distance code",l.mode=30;break e}if(m=65535&R,N<(W&=15)&&(S+=j[u++]<<N,(N+=8)<W&&(S+=j[u++]<<N,N+=8)),(m+=S&(1<<W)-1)>w){r.msg="invalid distance too far back",l.mode=30;break e}if(S>>>=W,N-=W,m>(W=g-c)){if((W=m-W)>y&&l.sane){r.msg="invalid distance too far back",l.mode=30;break e}if(_=0,G=p,f===0){if(_+=v-W,W<X){X-=W;do C[g++]=p[_++];while(--W);_=g-m,G=C}}else if(f<W){if(_+=v+f-W,(W-=f)<X){X-=W;do C[g++]=p[_++];while(--W);if(_=0,f<X){X-=W=f;do C[g++]=p[_++];while(--W);_=g-m,G=C}}}else if(_+=f-W,W<X){X-=W;do C[g++]=p[_++];while(--W);_=g-m,G=C}for(;X>2;)C[g++]=G[_++],C[g++]=G[_++],C[g++]=G[_++],X-=3;X&&(C[g++]=G[_++],X>1&&(C[g++]=G[_++]))}else{_=g-m;do C[g++]=C[_++],C[g++]=C[_++],C[g++]=C[_++],X-=3;while(X>2);X&&(C[g++]=C[_++],X>1&&(C[g++]=C[_++]))}break}}break}}while(u<s&&g<d);u-=X=N>>3,S&=(1<<(N-=X<<3))-1,r.next_in=u,r.next_out=g,r.avail_in=u<s?s-u+5:5-(u-s),r.avail_out=g<d?d-g+257:257-(g-d),l.hold=S,l.bits=N}},function(e,t,n){var r=n(38),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(g,c,d,w,v,y,f,p){var S,N,B,E,T,h,R,W,X,m=p.bits,_=0,G=0,j=0,C=0,z=0,P=0,D=0,O=0,L=0,U=0,A=null,V=0,q=new r.Buf16(16),Q=new r.Buf16(16),ee=null,te=0;for(_=0;_<=15;_++)q[_]=0;for(G=0;G<w;G++)q[c[d+G]]++;for(z=m,C=15;C>=1&&q[C]===0;C--);if(z>C&&(z=C),C===0)return v[y++]=20971520,v[y++]=20971520,p.bits=1,0;for(j=1;j<C&&q[j]===0;j++);for(z<j&&(z=j),O=1,_=1;_<=15;_++)if(O<<=1,(O-=q[_])<0)return-1;if(O>0&&(g===0||C!==1))return-1;for(Q[1]=0,_=1;_<15;_++)Q[_+1]=Q[_]+q[_];for(G=0;G<w;G++)c[d+G]!==0&&(f[Q[c[d+G]]++]=G);if(g===0?(A=ee=f,h=19):g===1?(A=o,V-=257,ee=l,te-=257,h=256):(A=u,ee=s,h=-1),U=0,G=0,_=j,T=y,P=z,D=0,B=-1,E=(L=1<<z)-1,g===1&&L>852||g===2&&L>592)return 1;for(;;){R=_-D,f[G]<h?(W=0,X=f[G]):f[G]>h?(W=ee[te+f[G]],X=A[V+f[G]]):(W=96,X=0),S=1<<_-D,j=N=1<<P;do v[T+(U>>D)+(N-=S)]=R<<24|W<<16|X|0;while(N!==0);for(S=1<<_-1;U&S;)S>>=1;if(S!==0?(U&=S-1,U+=S):U=0,G++,--q[_]==0){if(_===C)break;_=c[d+f[G]]}if(_>z&&(U&E)!==B){for(D===0&&(D=z),T+=j,O=1<<(P=_-D);P+D<C&&!((O-=q[P+D])<=0);)P++,O<<=1;if(L+=1<<P,g===1&&L>852||g===2&&L>592)return 1;v[B=U&E]=z<<24|P<<16|T-y|0}}return U!==0&&(v[T+U]=_-D<<24|64<<16|0),p.bits=z,0}},function(e,t,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t){},function(e,t,n){function r(w,v){var y=Object.keys(w);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(w);v&&(f=f.filter(function(p){return Object.getOwnPropertyDescriptor(w,p).enumerable})),y.push.apply(y,f)}return y}function o(w){for(var v=1;v<arguments.length;v++){var y=arguments[v]!=null?arguments[v]:{};v%2?r(Object(y),!0).forEach(function(f){l(w,f,y[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(f){Object.defineProperty(w,f,Object.getOwnPropertyDescriptor(y,f))})}return w}function l(w,v,y){return(v=s(v))in w?Object.defineProperty(w,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):w[v]=y,w}function u(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,s(f.key),f)}}function s(w){var v=function(y,f){if(typeof y!="object"||y===null)return y;var p=y[Symbol.toPrimitive];if(p!==void 0){var S=p.call(y,f||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}(w,"string");return typeof v=="symbol"?v:String(v)}var g=n(5).Buffer,c=n(185).inspect,d=c&&c.custom||"inspect";e.exports=function(){function w(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,w),this.head=null,this.tail=null,this.length=0}var v,y;return v=w,(y=[{key:"push",value:function(f){var p={data:f,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(f){var p={data:f,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var p=this.head,S=""+p.data;p=p.next;)S+=f+p.data;return S}},{key:"concat",value:function(f){if(this.length===0)return g.alloc(0);for(var p,S,N,B=g.allocUnsafe(f>>>0),E=this.head,T=0;E;)p=E.data,S=B,N=T,g.prototype.copy.call(p,S,N),T+=E.data.length,E=E.next;return B}},{key:"consume",value:function(f,p){var S;return f<this.head.data.length?(S=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):S=f===this.head.data.length?this.shift():p?this._getString(f):this._getBuffer(f),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var p=this.head,S=1,N=p.data;for(f-=N.length;p=p.next;){var B=p.data,E=f>B.length?B.length:f;if(E===B.length?N+=B:N+=B.slice(0,f),(f-=E)==0){E===B.length?(++S,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=B.slice(E));break}++S}return this.length-=S,N}},{key:"_getBuffer",value:function(f){var p=g.allocUnsafe(f),S=this.head,N=1;for(S.data.copy(p),f-=S.data.length;S=S.next;){var B=S.data,E=f>B.length?B.length:f;if(B.copy(p,p.length-f,0,E),(f-=E)==0){E===B.length?(++N,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=B.slice(E));break}++N}return this.length-=N,p}},{key:d,value:function(f,p){return c(this,o(o({},p),{},{depth:0,customInspect:!1}))}}])&&u(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()},function(e,t){},function(e,t,n){(function(r){var o;function l(E,T,h){return(T=function(R){var W=function(X,m){if(typeof X!="object"||X===null)return X;var _=X[Symbol.toPrimitive];if(_!==void 0){var G=_.call(X,m||"default");if(typeof G!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(X)}(R,"string");return typeof W=="symbol"?W:String(W)}(T))in E?Object.defineProperty(E,T,{value:h,enumerable:!0,configurable:!0,writable:!0}):E[T]=h,E}var u=n(48),s=Symbol("lastResolve"),g=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),w=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function f(E,T){return{value:E,done:T}}function p(E){var T=E[s];if(T!==null){var h=E[y].read();h!==null&&(E[w]=null,E[s]=null,E[g]=null,T(f(h,!1)))}}function S(E){r.nextTick(p,E)}var N=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((l(o={get stream(){return this[y]},next:function(){var E=this,T=this[c];if(T!==null)return Promise.reject(T);if(this[d])return Promise.resolve(f(void 0,!0));if(this[y].destroyed)return new Promise(function(X,m){r.nextTick(function(){E[c]?m(E[c]):X(f(void 0,!0))})});var h,R=this[w];if(R)h=new Promise(function(X,m){return function(_,G){X.then(function(){m[d]?_(f(void 0,!0)):m[v](_,G)},G)}}(R,this));else{var W=this[y].read();if(W!==null)return Promise.resolve(f(W,!1));h=new Promise(this[v])}return this[w]=h,h}},Symbol.asyncIterator,function(){return this}),l(o,"return",function(){var E=this;return new Promise(function(T,h){E[y].destroy(null,function(R){R?h(R):T(f(void 0,!0))})})}),o),N);e.exports=function(E){var T,h=Object.create(B,(l(T={},y,{value:E,writable:!0}),l(T,s,{value:null,writable:!0}),l(T,g,{value:null,writable:!0}),l(T,c,{value:null,writable:!0}),l(T,d,{value:E._readableState.endEmitted,writable:!0}),l(T,v,{value:function(R,W){var X=h[y].read();X?(h[w]=null,h[s]=null,h[g]=null,R(f(X,!1))):(h[s]=R,h[g]=W)},writable:!0}),T));return h[w]=null,u(E,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var W=h[g];return W!==null&&(h[w]=null,h[s]=null,h[g]=null,W(R)),void(h[c]=R)}var X=h[s];X!==null&&(h[w]=null,h[s]=null,h[g]=null,X(f(void 0,!0))),h[d]=!0}),E.on("readable",S.bind(null,h)),h}}).call(this,n(2))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){e.exports=o;var r=n(82);function o(l){if(!(this instanceof o))return new o(l);r.call(this,l)}n(7)(o,r),o.prototype._transform=function(l,u,s){s(null,l)}},function(e,t,n){var r,o=n(24).codes,l=o.ERR_MISSING_ARGS,u=o.ERR_STREAM_DESTROYED;function s(v){if(v)throw v}function g(v,y,f,p){p=function(B){var E=!1;return function(){E||(E=!0,B.apply(void 0,arguments))}}(p);var S=!1;v.on("close",function(){S=!0}),r===void 0&&(r=n(48)),r(v,{readable:y,writable:f},function(B){if(B)return p(B);S=!0,p()});var N=!1;return function(B){if(!S&&!N)return N=!0,function(E){return E.setHeader&&typeof E.abort=="function"}(v)?v.abort():typeof v.destroy=="function"?v.destroy():void p(B||new u("pipe"))}}function c(v){v()}function d(v,y){return v.pipe(y)}function w(v){return v.length?typeof v[v.length-1]!="function"?s:v.pop():s}e.exports=function(){for(var v=arguments.length,y=new Array(v),f=0;f<v;f++)y[f]=arguments[f];var p,S=w(y);if(Array.isArray(y[0])&&(y=y[0]),y.length<2)throw new l("streams");var N=y.map(function(B,E){var T=E<y.length-1;return g(B,T,E>0,function(h){p||(p=h),h&&N.forEach(c),T||(N.forEach(c),S(p))})});return y.reduce(d)}},function(e,t,n){var r=n(191)(function o(l,u){return(u=u||{}).namespace=l,u.prod=!0,u.dev=!1,u.force||o.force?o.yep(u):o.nope(u)});e.exports=r},function(e,t){var n=[],r=[],o=function(){};function l(f){return!~n.indexOf(f)&&(n.push(f),!0)}function u(f){o=f}function s(f){for(var p=[],S=0;S<n.length;S++)if(n[S].async)p.push(n[S]);else if(n[S](f))return!0;return!!p.length&&new Promise(function(N){Promise.all(p.map(function(B){return B(f)})).then(function(B){N(B.some(Boolean))})})}function g(f){return!~r.indexOf(f)&&(r.push(f),!0)}function c(){o.apply(o,arguments)}function d(f){for(var p=0;p<r.length;p++)f=r[p].apply(r[p],arguments);return f}function w(f,p){var S=Object.prototype.hasOwnProperty;for(var N in p)S.call(p,N)&&(f[N]=p[N]);return f}function v(f){return f.enabled=!1,f.modify=g,f.set=u,f.use=l,w(function(){return!1},f)}function y(f){return f.enabled=!0,f.modify=g,f.set=u,f.use=l,w(function(){var p=Array.prototype.slice.call(arguments,0);return c.call(c,f,d(p,f)),!0},f)}e.exports=function(f){return f.introduce=w,f.enabled=s,f.process=d,f.modify=g,f.write=c,f.nope=v,f.yep=y,f.set=u,f.use=l,f}},function(e,t,n){(function(r){var o=n(66),l=n(21).StringDecoder,u=n(33).Stream;function s(){}e.exports=function(g,c){var d=r.alloc(65536),w=new l("utf8"),v=new u,y="",f=0,p=0;return g.start===-1&&delete g.start,v.readable=!0,v.destroy=function(){v.destroyed=!0,v.emit("end"),v.emit("close")},o.open(g.file,"a+","0644",function(S,N){if(S)return c?c(S):v.emit("error",S),void v.destroy();(function B(){if(!v.destroyed)return o.read(N,d,0,d.length,f,function(E,T){if(E)return c?c(E):v.emit("error",E),void v.destroy();if(!T)return y&&((g.start==null||p>g.start)&&(c?c(null,y):v.emit("line",y)),p++,y=""),setTimeout(B,1e3);var h=w.write(d.slice(0,T));c||v.emit("data",h);for(var R=(h=(y+h).split(/\n+/)).length-1,W=0;W<R;W++)(g.start==null||p>g.start)&&(c?c(null,h[W]):v.emit("line",h[W])),p++;return y=h[R],f+=T,B()});o.close(N,s)})()}),c?v.destroy:v}}).call(this,n(5).Buffer)},function(e,t,n){(function(r,o){function l(T){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(T)}function u(T,h){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(T);h&&(W=W.filter(function(X){return Object.getOwnPropertyDescriptor(T,X).enumerable})),R.push.apply(R,W)}return R}function s(T){for(var h=1;h<arguments.length;h++){var R=arguments[h]!=null?arguments[h]:{};h%2?u(Object(R),!0).forEach(function(W){g(T,W,R[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(R)):u(Object(R)).forEach(function(W){Object.defineProperty(T,W,Object.getOwnPropertyDescriptor(R,W))})}return T}function g(T,h,R){return h in T?Object.defineProperty(T,h,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[h]=R,T}function c(T,h){if(!(T instanceof h))throw new TypeError("Cannot call a class as a function")}function d(T,h){for(var R=0;R<h.length;R++){var W=h[R];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(T,W.key,W)}}function w(T,h){return(w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,W){return R.__proto__=W,R})(T,h)}function v(T){var h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var R,W=f(T);if(h){var X=f(this).constructor;R=Reflect.construct(W,arguments,X)}else R=W.apply(this,arguments);return y(this,R)}}function y(T,h){if(h&&(l(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R}(T)}function f(T){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)})(T)}var p=n(83),S=n(204),N=n(33).Stream,B=n(14),E=n(29);e.exports=function(T){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),_&&w(m,_)})(X,T);var h,R,W=v(X);function X(){var m,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return c(this,X),(m=W.call(this,_)).options=_,m.name=_.name||"http",m.ssl=!!_.ssl,m.host=_.host||"localhost",m.port=_.port,m.auth=_.auth,m.path=_.path||"",m.agent=_.agent,m.headers=_.headers||{},m.headers["content-type"]="application/json",m.batch=_.batch||!1,m.batchInterval=_.batchInterval||5e3,m.batchCount=_.batchCount||10,m.batchOptions=[],m.batchTimeoutID=-1,m.batchCallback={},m.port||(m.port=m.ssl?443:80),m}return h=X,(R=[{key:"log",value:function(m,_){var G=this;this._request(m,function(j,C){C&&C.statusCode!==200&&(j=new Error("Invalid HTTP Status Code: ".concat(C.statusCode))),j?G.emit("warn",j):G.emit("logged",m)}),_&&r(_)}},{key:"query",value:function(m,_){typeof m=="function"&&(_=m,m={}),(m={method:"query",params:this.normalizeQuery(m)}).params.path&&(m.path=m.params.path,delete m.params.path),m.params.auth&&(m.auth=m.params.auth,delete m.params.auth),this._request(m,function(G,j,C){if(j&&j.statusCode!==200&&(G=new Error("Invalid HTTP Status Code: ".concat(j.statusCode))),G)return _(G);if(typeof C=="string")try{C=JSON.parse(C)}catch(z){return _(z)}_(null,C)})}},{key:"stream",value:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=new N;(m={method:"stream",params:m}).params.path&&(m.path=m.params.path,delete m.params.path),m.params.auth&&(m.auth=m.params.auth,delete m.params.auth);var G="",j=this._request(m);return _.destroy=function(){return j.destroy()},j.on("data",function(C){for(var z=(C=(G+C).split(/\n+/)).length-1,P=0;P<z;P++)try{_.emit("log",JSON.parse(C[P]))}catch(D){_.emit("error",D)}G=C[z]}),j.on("error",function(C){return _.emit("error",C)}),_}},{key:"_request",value:function(m,_){var G=(m=m||{}).auth||this.auth,j=m.path||this.path||"";delete m.auth,delete m.path,this.batch?this._doBatch(m,_,G,j):this._doRequest(m,_,G,j)}},{key:"_doBatch",value:function(m,_,G,j){if(this.batchOptions.push(m),this.batchOptions.length===1){var C=this;this.batchCallback=_,this.batchTimeoutID=setTimeout(function(){C.batchTimeoutID=-1,C._doBatchRequest(C.batchCallback,G,j)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,G,j)}},{key:"_doBatchRequest",value:function(m,_,G){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var j=this.batchOptions.slice();this.batchOptions=[],this._doRequest(j,m,_,G)}},{key:"_doRequest",value:function(m,_,G,j){var C=Object.assign({},this.headers);G&&G.bearer&&(C.Authorization="Bearer ".concat(G.bearer));var z=(this.ssl?S:p).request(s(s({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(j.replace(/^\//,"")),headers:C,auth:G&&G.username&&G.password?"".concat(G.username,":").concat(G.password):"",agent:this.agent}));z.on("error",_),z.on("response",function(P){return P.on("end",function(){return _(null,P)}).resume()}),z.end(o.from(E(m,this.options.replacer),"utf8"))}}])&&d(h.prototype,R),Object.defineProperty(h,"prototype",{writable:!1}),X}(B)}).call(this,n(19).setImmediate,n(5).Buffer)},function(e,t,n){(function(r,o,l){var u=n(84),s=n(7),g=n(85),c=n(31),d=n(195),w=g.IncomingMessage,v=g.readyStates,y=e.exports=function(p){var S,N=this;c.Writable.call(N),N._opts=p,N._body=[],N._headers={},p.auth&&N.setHeader("Authorization","Basic "+new r(p.auth).toString("base64")),Object.keys(p.headers).forEach(function(E){N.setHeader(E,p.headers[E])});var B=!0;if(p.mode==="disable-fetch"||"requestTimeout"in p&&!u.abortController)B=!1,S=!0;else if(p.mode==="prefer-streaming")S=!1;else if(p.mode==="allow-wrong-content-type")S=!u.overrideMimeType;else{if(p.mode&&p.mode!=="default"&&p.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");S=!0}N._mode=function(E,T){return u.fetch&&T?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&E?"arraybuffer":u.vbArray&&E?"text:vbarray":"text"}(S,B),N._fetchTimer=null,N.on("finish",function(){N._onFinish()})};s(y,c.Writable),y.prototype.setHeader=function(p,S){var N=p.toLowerCase();f.indexOf(N)===-1&&(this._headers[N]={name:p,value:S})},y.prototype.getHeader=function(p){var S=this._headers[p.toLowerCase()];return S?S.value:null},y.prototype.removeHeader=function(p){delete this._headers[p.toLowerCase()]},y.prototype._onFinish=function(){var p=this;if(!p._destroyed){var S=p._opts,N=p._headers,B=null;S.method!=="GET"&&S.method!=="HEAD"&&(B=u.arraybuffer?d(r.concat(p._body)):u.blobConstructor?new o.Blob(p._body.map(function(W){return d(W)}),{type:(N["content-type"]||{}).value||""}):r.concat(p._body).toString());var E=[];if(Object.keys(N).forEach(function(W){var X=N[W].name,m=N[W].value;Array.isArray(m)?m.forEach(function(_){E.push([X,_])}):E.push([X,m])}),p._mode==="fetch"){var T=null;if(u.abortController){var h=new AbortController;T=h.signal,p._fetchAbortController=h,"requestTimeout"in S&&S.requestTimeout!==0&&(p._fetchTimer=o.setTimeout(function(){p.emit("requestTimeout"),p._fetchAbortController&&p._fetchAbortController.abort()},S.requestTimeout))}o.fetch(p._opts.url,{method:p._opts.method,headers:E,body:B||void 0,mode:"cors",credentials:S.withCredentials?"include":"same-origin",signal:T}).then(function(W){p._fetchResponse=W,p._connect()},function(W){o.clearTimeout(p._fetchTimer),p._destroyed||p.emit("error",W)})}else{var R=p._xhr=new o.XMLHttpRequest;try{R.open(p._opts.method,p._opts.url,!0)}catch(W){return void l.nextTick(function(){p.emit("error",W)})}"responseType"in R&&(R.responseType=p._mode.split(":")[0]),"withCredentials"in R&&(R.withCredentials=!!S.withCredentials),p._mode==="text"&&"overrideMimeType"in R&&R.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in S&&(R.timeout=S.requestTimeout,R.ontimeout=function(){p.emit("requestTimeout")}),E.forEach(function(W){R.setRequestHeader(W[0],W[1])}),p._response=null,R.onreadystatechange=function(){switch(R.readyState){case v.LOADING:case v.DONE:p._onXHRProgress()}},p._mode==="moz-chunked-arraybuffer"&&(R.onprogress=function(){p._onXHRProgress()}),R.onerror=function(){p._destroyed||p.emit("error",new Error("XHR error"))};try{R.send(B)}catch(W){return void l.nextTick(function(){p.emit("error",W)})}}}},y.prototype._onXHRProgress=function(){(function(p){try{var S=p.status;return S!==null&&S!==0}catch{return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},y.prototype._connect=function(){var p=this;p._destroyed||(p._response=new w(p._xhr,p._fetchResponse,p._mode,p._fetchTimer),p._response.on("error",function(S){p.emit("error",S)}),p.emit("response",p._response))},y.prototype._write=function(p,S,N){this._body.push(p),N()},y.prototype.abort=y.prototype.destroy=function(){this._destroyed=!0,o.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},y.prototype.end=function(p,S,N){typeof p=="function"&&(N=p,p=void 0),c.Writable.prototype.end.call(this,p,S,N)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(5).Buffer,n(6),n(2))},function(e,t,n){var r=n(5).Buffer;e.exports=function(o){if(o instanceof Uint8Array){if(o.byteOffset===0&&o.byteLength===o.buffer.byteLength)return o.buffer;if(typeof o.buffer.slice=="function")return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}if(r.isBuffer(o)){for(var l=new Uint8Array(o.length),u=o.length,s=0;s<u;s++)l[s]=o[s];return l.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var r={},o=0;o<arguments.length;o++){var l=arguments[o];for(var u in l)n.call(l,u)&&(r[u]=l[u])}return r};var n=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){(function(r,o){var l;(function(u){t&&t.nodeType,r&&r.nodeType;var s=typeof o=="object"&&o;s.global!==s&&s.window!==s&&s.self;var g,c=2147483647,d=/^xn--/,w=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function S(m){throw new RangeError(y[m])}function N(m,_){for(var G=m.length,j=[];G--;)j[G]=_(m[G]);return j}function B(m,_){var G=m.split("@"),j="";return G.length>1&&(j=G[0]+"@",m=G[1]),j+N((m=m.replace(v,".")).split("."),_).join(".")}function E(m){for(var _,G,j=[],C=0,z=m.length;C<z;)(_=m.charCodeAt(C++))>=55296&&_<=56319&&C<z?(64512&(G=m.charCodeAt(C++)))==56320?j.push(((1023&_)<<10)+(1023&G)+65536):(j.push(_),C--):j.push(_);return j}function T(m){return N(m,function(_){var G="";return _>65535&&(G+=p((_-=65536)>>>10&1023|55296),_=56320|1023&_),G+=p(_)}).join("")}function h(m,_){return m+22+75*(m<26)-((_!=0)<<5)}function R(m,_,G){var j=0;for(m=G?f(m/700):m>>1,m+=f(m/_);m>455;j+=36)m=f(m/35);return f(j+36*m/(m+38))}function W(m){var _,G,j,C,z,P,D,O,L,U,A,V=[],q=m.length,Q=0,ee=128,te=72;for((G=m.lastIndexOf("-"))<0&&(G=0),j=0;j<G;++j)m.charCodeAt(j)>=128&&S("not-basic"),V.push(m.charCodeAt(j));for(C=G>0?G+1:0;C<q;){for(z=Q,P=1,D=36;C>=q&&S("invalid-input"),((O=(A=m.charCodeAt(C++))-48<10?A-22:A-65<26?A-65:A-97<26?A-97:36)>=36||O>f((c-Q)/P))&&S("overflow"),Q+=O*P,!(O<(L=D<=te?1:D>=te+26?26:D-te));D+=36)P>f(c/(U=36-L))&&S("overflow"),P*=U;te=R(Q-z,_=V.length+1,z==0),f(Q/_)>c-ee&&S("overflow"),ee+=f(Q/_),Q%=_,V.splice(Q++,0,ee)}return T(V)}function X(m){var _,G,j,C,z,P,D,O,L,U,A,V,q,Q,ee,te=[];for(V=(m=E(m)).length,_=128,G=0,z=72,P=0;P<V;++P)(A=m[P])<128&&te.push(p(A));for(j=C=te.length,C&&te.push("-");j<V;){for(D=c,P=0;P<V;++P)(A=m[P])>=_&&A<D&&(D=A);for(D-_>f((c-G)/(q=j+1))&&S("overflow"),G+=(D-_)*q,_=D,P=0;P<V;++P)if((A=m[P])<_&&++G>c&&S("overflow"),A==_){for(O=G,L=36;!(O<(U=L<=z?1:L>=z+26?26:L-z));L+=36)ee=O-U,Q=36-U,te.push(p(h(U+ee%Q,0))),O=f(ee/Q);te.push(p(h(O,0))),z=R(G,q,j==C),G=0,++j}++G,++_}return te.join("")}g={version:"1.4.1",ucs2:{decode:E,encode:T},decode:W,encode:X,toASCII:function(m){return B(m,function(_){return w.test(_)?"xn--"+X(_):_})},toUnicode:function(m){return B(m,function(_){return d.test(_)?W(_.slice(4).toLowerCase()):_})}},(l=function(){return g}.call(t,n,t,r))===void 0||(r.exports=l)})()}).call(this,n(199)(e),n(6))},function(e,t){e.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(e,t,n){e.exports={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}}},function(e,t,n){t.decode=t.parse=n(202),t.encode=t.stringify=n(203)},function(e,t,n){function r(l,u){return Object.prototype.hasOwnProperty.call(l,u)}e.exports=function(l,u,s,g){u=u||"&",s=s||"=";var c={};if(typeof l!="string"||l.length===0)return c;var d=/\+/g;l=l.split(u);var w=1e3;g&&typeof g.maxKeys=="number"&&(w=g.maxKeys);var v=l.length;w>0&&v>w&&(v=w);for(var y=0;y<v;++y){var f,p,S,N,B=l[y].replace(d,"%20"),E=B.indexOf(s);E>=0?(f=B.substr(0,E),p=B.substr(E+1)):(f=B,p=""),S=decodeURIComponent(f),N=decodeURIComponent(p),r(c,S)?o(c[S])?c[S].push(N):c[S]=[c[S],N]:c[S]=N}return c};var o=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"}},function(e,t,n){var r=function(s){switch(typeof s){case"string":return s;case"boolean":return s?"true":"false";case"number":return isFinite(s)?s:"";default:return""}};e.exports=function(s,g,c,d){return g=g||"&",c=c||"=",s===null&&(s=void 0),typeof s=="object"?l(u(s),function(w){var v=encodeURIComponent(r(w))+c;return o(s[w])?l(s[w],function(y){return v+encodeURIComponent(r(y))}).join(g):v+encodeURIComponent(r(s[w]))}).join(g):d?encodeURIComponent(r(d))+c+encodeURIComponent(r(s)):""};var o=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function l(s,g){if(s.map)return s.map(g);for(var c=[],d=0;d<s.length;d++)c.push(g(s[d],d));return c}var u=Object.keys||function(s){var g=[];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&g.push(c);return g}},function(e,t,n){var r=n(83),o=n(86),l=e.exports;for(var u in r)r.hasOwnProperty(u)&&(l[u]=r[u]);function s(g){if(typeof g=="string"&&(g=o.parse(g)),g.protocol||(g.protocol="https:"),g.protocol!=="https:")throw new Error('Protocol "'+g.protocol+'" not supported. Expected "https:"');return g}l.request=function(g,c){return g=s(g),r.request.call(this,g,c)},l.get=function(g,c){return g=s(g),r.get.call(this,g,c)}},function(e,t,n){(function(r){function o(p){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S})(p)}function l(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}function u(p,S){for(var N=0;N<S.length;N++){var B=S[N];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(p,B.key,B)}}function s(p,S){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N})(p,S)}function g(p){var S=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var N,B=d(p);if(S){var E=d(this).constructor;N=Reflect.construct(B,arguments,E)}else N=B.apply(this,arguments);return c(this,N)}}function c(p,S){if(S&&(o(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(p)}function d(p){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)})(p)}var w=n(87),v=n(3).MESSAGE,y=n(16),f=n(14);e.exports=function(p){(function(T,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(h&&h.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),h&&s(T,h)})(E,p);var S,N,B=g(E);function E(){var T,h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(l(this,E),T=B.call(this,h),!h.stream||!w(h.stream))throw new Error("options.stream is required.");return T._stream=h.stream,T._stream.setMaxListeners(1/0),T.isObjectMode=h.stream._writableState.objectMode,T.eol=typeof h.eol=="string"?h.eol:y.EOL,T}return S=E,(N=[{key:"log",value:function(T,h){var R=this;if(r(function(){return R.emit("logged",T)}),this.isObjectMode)return this._stream.write(T),void(h&&h());this._stream.write("".concat(T[v]).concat(this.eol)),h&&h()}}])&&u(S.prototype,N),Object.defineProperty(S,"prototype",{writable:!1}),E}(f)}).call(this,n(19).setImmediate)},function(e,t,n){(function(r){function o(j,C,z){return C in j?Object.defineProperty(j,C,{value:z,enumerable:!0,configurable:!0,writable:!0}):j[C]=z,j}function l(j){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(j)}function u(j,C){for(var z=0;z<C.length;z++){var P=C[z];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(j,P.key,P)}}function s(j,C){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(z,P){return z.__proto__=P,z})(j,C)}function g(j){var C=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var z,P=d(j);if(C){var D=d(this).constructor;z=Reflect.construct(P,arguments,D)}else z=P.apply(this,arguments);return c(this,z)}}function c(j,C){if(C&&(l(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(z){if(z===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z}(j)}function d(j){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(C){return C.__proto__||Object.getPrototypeOf(C)})(j)}var w=n(33),v=w.Stream,y=w.Transform,f=n(50),p=n(3),S=p.LEVEL,N=p.SPLAT,B=n(87),E=n(89),T=n(93),h=n(210),R=n(211),W=n(60).warn,X=n(49),m=/%[scdjifoO%]/g,_=function(j){(function(O,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(L&&L.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),Object.defineProperty(O,"prototype",{writable:!1}),L&&s(O,L)})(D,j);var C,z,P=g(D);function D(O){var L;return function(U,A){if(!(U instanceof A))throw new TypeError("Cannot call a class as a function")}(this,D),(L=P.call(this,{objectMode:!0})).configure(O),L}return C=D,(z=[{key:"child",value:function(O){var L=this;return Object.create(L,{write:{value:function(U){var A=Object.assign({},O,U);U instanceof Error&&(A.stack=U.stack,A.message=U.message),L.write(A)}}})}},{key:"configure",value:function(){var O=this,L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=L.silent,A=L.format,V=L.defaultMeta,q=L.levels,Q=L.level,ee=Q===void 0?"info":Q,te=L.exitOnError,k=te===void 0||te,x=L.transports,b=L.colors,I=L.emitErrs,$=L.formatters,K=L.padLevels,Y=L.rewriters,ne=L.stripColors,ie=L.exceptionHandlers,ue=L.rejectionHandlers;if(this.transports.length&&this.clear(),this.silent=U,this.format=A||this.format||n(212)(),this.defaultMeta=V||null,this.levels=q||this.levels||X.npm.levels,this.level=ee,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new E(this),this.rejections=new T(this),this.profilers={},this.exitOnError=k,x&&(x=Array.isArray(x)?x:[x]).forEach(function(we){return O.add(we)}),b||I||$||K||Y||ne)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
57
+ `));ie&&this.exceptions.handle(ie),ue&&this.rejections.handle(ue)}},{key:"isLevelEnabled",value:function(O){var L=this,U=G(this.levels,O);if(U===null)return!1;var A=G(this.levels,this.level);return A!==null&&(this.transports&&this.transports.length!==0?this.transports.findIndex(function(V){var q=G(L.levels,V.level);return q===null&&(q=A),q>=U})!==-1:A>=U)}},{key:"log",value:function(O,L){for(var U,A,V=arguments.length,q=new Array(V>2?V-2:0),Q=2;Q<V;Q++)q[Q-2]=arguments[Q];if(arguments.length===1)return O[S]=O.level,this._addDefaultMeta(O),this.write(O),this;if(arguments.length===2)return L&&l(L)==="object"?(L[S]=L.level=O,this._addDefaultMeta(L),this.write(L),this):(o(A={},S,O),o(A,"level",O),o(A,"message",L),L=A,this._addDefaultMeta(L),this.write(L),this);var ee=q[0];if(l(ee)==="object"&&ee!==null){var te=L&&L.match&&L.match(m);if(!te){var k,x=Object.assign({},this.defaultMeta,ee,(o(k={},S,O),o(k,N,q),o(k,"level",O),o(k,"message",L),k));return ee.message&&(x.message="".concat(x.message," ").concat(ee.message)),ee.stack&&(x.stack=ee.stack),this.write(x),this}}return this.write(Object.assign({},this.defaultMeta,(o(U={},S,O),o(U,N,q),o(U,"level",O),o(U,"message",L),U))),this}},{key:"_transform",value:function(O,L,U){if(this.silent)return U();O[S]||(O[S]=O.level),this.levels[O[S]]||this.levels[O[S]]===0||console.error("[winston] Unknown logger level: %s",O[S]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",O);try{this.push(this.format.transform(O,this.format.options))}finally{this._writableState.sync=!1,U()}}},{key:"_final",value:function(O){var L=this.transports.slice();f(L,function(U,A){if(!U||U.finished)return r(A);U.once("finish",A),U.end()},O)}},{key:"add",value:function(O){var L=!B(O)||O.log.length>2?new h({transport:O}):O;if(!L._writableState||!L._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",L),this._onEvent("warn",L),this.pipe(L),O.handleExceptions&&this.exceptions.handle(),O.handleRejections&&this.rejections.handle(),this}},{key:"remove",value:function(O){if(!O)return this;var L=O;return(!B(O)||O.log.length>2)&&(L=this.transports.filter(function(U){return U.transport===O})[0]),L&&this.unpipe(L),this}},{key:"clear",value:function(){return this.unpipe(),this}},{key:"close",value:function(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}},{key:"setLevels",value:function(){W.deprecated("setLevels")}},{key:"query",value:function(O,L){typeof O=="function"&&(L=O,O={}),O=O||{};var U={},A=Object.assign({},O.query||{});f(this.transports.filter(function(V){return!!V.query}),function(V,q){(function(Q,ee){O.query&&typeof Q.formatQuery=="function"&&(O.query=Q.formatQuery(A)),Q.query(O,function(te,k){if(te)return ee(te);typeof Q.formatResults=="function"&&(k=Q.formatResults(k,O.format)),ee(null,k)})})(V,function(Q,ee){q&&((ee=Q||ee)&&(U[V.name]=ee),q()),q=null})},function(){return L(null,U)})}},{key:"stream",value:function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},L=new v,U=[];return L._streams=U,L.destroy=function(){for(var A=U.length;A--;)U[A].destroy()},this.transports.filter(function(A){return!!A.stream}).forEach(function(A){var V=A.stream(O);V&&(U.push(V),V.on("log",function(q){q.transport=q.transport||[],q.transport.push(A.name),L.emit("log",q)}),V.on("error",function(q){q.transport=q.transport||[],q.transport.push(A.name),L.emit("error",q)}))}),L}},{key:"startTimer",value:function(){return new R(this)}},{key:"profile",value:function(O){var L=Date.now();if(this.profilers[O]){var U=this.profilers[O];delete this.profilers[O];for(var A=arguments.length,V=new Array(A>1?A-1:0),q=1;q<A;q++)V[q-1]=arguments[q];typeof V[V.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),V.pop());var Q=l(V[V.length-1])==="object"?V.pop():{};return Q.level=Q.level||"info",Q.durationMs=L-U,Q.message=Q.message||O,this.write(Q)}return this.profilers[O]=L,this}},{key:"handleExceptions",value:function(){var O;console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),(O=this.exceptions).handle.apply(O,arguments)}},{key:"unhandleExceptions",value:function(){var O;console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),(O=this.exceptions).unhandle.apply(O,arguments)}},{key:"cli",value:function(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
58
+ `))}},{key:"_onEvent",value:function(O,L){L["__winston"+O]||(L["__winston"+O]=function(U){O!=="error"||this.transports.includes(L)||this.add(L),this.emit(O,U,L)}.bind(this),L.on(O,L["__winston"+O]))}},{key:"_addDefaultMeta",value:function(O){this.defaultMeta&&Object.assign(O,this.defaultMeta)}}])&&u(C.prototype,z),Object.defineProperty(C,"prototype",{writable:!1}),D}(y);function G(j,C){var z=j[C];return z||z===0?z:null}Object.defineProperty(_.prototype,"transports",{configurable:!1,enumerable:!0,get:function(){var j=this._readableState.pipes;return Array.isArray(j)?j:[j].filter(Boolean)}}),e.exports=_}).call(this,n(19).setImmediate)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(44)),o=d(n(45)),l=d(n(67)),u=d(n(68)),s=d(n(69)),g=d(n(23)),c=d(n(30));function d(y){return y&&y.__esModule?y:{default:y}}function w(y,f,p){p=(0,u.default)(p);var S=0,N=0,{length:B}=y,E=!1;function T(h,R){h===!1&&(E=!0),E!==!0&&(h?p(h):++N!==B&&R!==o.default||p(null))}for(B===0&&p(null);S<B;S++)f(y[S],S,(0,s.default)(T))}function v(y,f,p){return(0,l.default)(y,1/0,f,p)}t.default=(0,c.default)(function(y,f,p){return((0,r.default)(y)?w:v)(y,(0,g.default)(f),p)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return(o,l,u)=>r(o,u)},e.exports=t.default},function(e,t,n){var r=Object.prototype.toString;e.exports=function(o){if(typeof o.displayName=="string"&&o.constructor.name)return o.displayName;if(typeof o.name=="string"&&o.name)return o.name;if(typeof o=="object"&&o.constructor&&typeof o.constructor.name=="string")return o.constructor.name;var l=o.toString(),u=r.call(o).slice(8,-1);return(l=u==="Function"?l.substring(l.indexOf("(")+1,l.indexOf(")")):u)||"anonymous"}},function(e,t,n){const r=n(13),{LEVEL:o}=n(3),l=n(14),u=e.exports=function(s={}){if(l.call(this,s),!s.transport||typeof s.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=s.transport,this.level=this.level||s.transport.level,this.handleExceptions=this.handleExceptions||s.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=function(g){this.emit("error",g,this.transport)}.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(u,l),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);(!this.level||this.levels[this.level]>=this.levels[s[o]])&&this.transport.log(s[o],s.message,s,this._nop),c(null)},u.prototype._writev=function(s,g){for(let c=0;c<s.length;c++)this._accept(s[c])&&(this.transport.log(s[c].chunk[o],s[c].chunk.message,s[c].chunk,this._nop),s[c].callback());return g(null)},u.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
59
+ `))},u.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(l)}function o(l,u){for(var s=0;s<u.length;s++){var g=u[s];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}e.exports=function(){function l(g){if(function(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}(this,l),!g)throw new Error("Logger is required for profiling.");this.logger=g,this.start=Date.now()}var u,s;return u=l,(s=[{key:"done",value:function(){for(var g=arguments.length,c=new Array(g),d=0;d<g;d++)c[d]=arguments[d];typeof c[c.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),c.pop());var w=r(c[c.length-1])==="object"?c.pop():{};return w.level=w.level||"info",w.durationMs=Date.now()-this.start,this.logger.write(w)}}])&&o(u.prototype,s),Object.defineProperty(u,"prototype",{writable:!1}),l}()},function(e,t,n){const r=n(213),{MESSAGE:o}=n(3),l=n(29);function u(s,g){return typeof g=="bigint"?g.toString():g}e.exports=r((s,g)=>{const c=l.configure(g);return s[o]=c(s,g.replacer||u,g.space),s})},function(e,t,n){class r extends Error{constructor(l){super(`Format functions must be synchronous taking a two arguments: (info, opts)
42
60
  Found: ${l.toString().split(`
43
61
  `)[0]}
44
- `),Error.captureStackTrace(this,r)}}e.exports=o=>{if(o.length>2)throw new r(o);function l(s={}){this.options=s}function u(s){return new l(s)}return l.prototype.transform=o,u.Format=l,u}},function(e,t,n){function r(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}function o(u,s){for(var g=0;g<s.length;g++){var c=s[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}var l=n(88);e.exports=function(){function u(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,u),this.loggers=new Map,this.options=c}var s,g;return s=u,(g=[{key:"add",value:function(c,f){var T=this;if(!this.loggers.has(c)){var v=(f=Object.assign({},f||this.options)).transports||this.options.transports;f.transports=v?v.slice():[];var p=l(f);p.on("close",function(){return T._delete(c)}),this.loggers.set(c,p)}return this.loggers.get(c)}},{key:"get",value:function(c,f){return this.add(c,f)}},{key:"has",value:function(c){return!!this.loggers.has(c)}},{key:"close",value:function(c){var f=this;if(c)return this._removeLogger(c);this.loggers.forEach(function(T,v){return f._removeLogger(v)})}},{key:"_removeLogger",value:function(c){this.loggers.has(c)&&(this.loggers.get(c).close(),this._delete(c))}},{key:"_delete",value:function(c){this.loggers.delete(c)}}])&&o(s.prototype,g),u}()},function(e,t,n){(function(r){const o=n(52),l=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(u,s,g,c){let f,T,v=!1,p=!1;const d=n(94);function h(L){c(s,L)}function S(L,O){let R=`"${s}" ${O}`;throw L&&(R=`${R}`),T&&(R=`${R}. An example of a valid value would be: ${T}`),new o(R)}const I={convertFromBase64:function(){return h("marking for base64 conversion"),v=!0,I},default:function(L){if(typeof L=="number")f=L.toString();else if(Array.isArray(L)||typeof L=="object"&&L!==null)f=JSON.stringify(L);else{if(typeof L!="string")throw new o("values passed to default() must be of Number, String, Array, or Object type");f=L}return h(`setting default value to "${f}"`),I},required:function(L){return L===void 0?(h("marked as required"),p=!0):(h(`setting required flag to ${L}`),p=L),I},example:function(L){return T=L,I}};return Object.entries({...d,...g}).forEach(([L,O])=>{I[L]=function(R){return function(){let m=u[s];if(h(`will be read from the environment using "${R.name}" accessor`),m===void 0)if(f===void 0&&p)h("was not found in the environment, but is required to be set"),S(void 0,"is a required variable, but it was not set");else{if(f===void 0)return void h("was not found in the environment, but is not required. returning undefined");h(`was not found in the environment, parsing default value "${f}" instead`),m=f}p&&(h("verifying variable value is not an empty string"),m.trim().length===0&&S(void 0,"is a required variable, but its value was empty")),v&&(h("verifying variable is a valid base64 string"),m.match(l)||S(m,"should be a valid base64 string if using convertFromBase64"),h("converting from base64 to utf8 string"),m=r.from(m,"base64").toString());const M=[m].concat(Array.prototype.slice.call(arguments));try{h(`passing value "${m}" to "${R.name}" accessor`);const G=R.apply(R,M);return h(`parsed successfully, returning ${G}`),G}catch(G){S(m,G.message)}}}(O)}),I}}).call(this,n(5).Buffer)},function(e,t,n){const r=n(34);e.exports=function(o,l){return l=l||",",o.length?r(o).split(l).filter(Boolean):[]}},function(e,t,n){e.exports=function(r){const o=r.toLowerCase();if(o!=="false"&&o!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return o!=="false"}},function(e,t,n){e.exports=function(r){const o=r.toLowerCase();if(["false","0","true","1"].indexOf(o)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(o==="0"||o==="false")}},function(e,t,n){const r=n(95);e.exports=function(o){var l=r(o);if(l>65535)throw new Error("cannot assign a port number greater than 65535");return l}},function(e,t,n){const r=n(34);e.exports=function(o,l){const u=r(o);if(l.indexOf(u)<0)throw new Error(`should be one of [${l.join(", ")}]`);return u}},function(e,t,n){const r=n(54);e.exports=function(o){const l=r(o);if(l>0)throw new Error("should be a negative float");return l}},function(e,t,n){const r=n(54);e.exports=function(o){const l=r(o);if(l<0)throw new Error("should be a positive float");return l}},function(e,t,n){const r=n(53);e.exports=function(o){const l=r(o);if(l>0)throw new Error("should be a negative integer");return l}},function(e,t,n){const r=n(55);e.exports=function(o){var l=r(o);if(!Array.isArray(l))throw new Error("should be a parseable JSON Array");return l}},function(e,t,n){const r=n(55);e.exports=function(o){var l=r(o);if(Array.isArray(l))throw new Error("should be a parseable JSON Object");return l}},function(e,t,n){e.exports=function(r,o){try{RegExp(void 0,o)}catch{throw new Error("invalid regexp flags")}try{return new RegExp(r,o)}catch{throw new Error("should be a valid regexp")}}},function(e,t,n){const r=n(96);e.exports=function(o){return r(o).toString()}},function(e,t,n){const r=n(34),o=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021\u0023-\u005b\u005d-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021-\u005a\u0053-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])+)\])$/;e.exports=function(l){const u=r(l);if(!o.test(u))throw new Error("should be a valid email address");return u}},function(e,t,n){e.exports=function(r,o){return function(l,u){o&&o.match(/prod|production/)||r(`env-var (${l}): ${u}`)}}},function(e,t,n){(function(r){(function(){var o,l,u,s,g,c;typeof performance<"u"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:r!=null&&r.hrtime?(e.exports=function(){return(o()-g)/1e6},l=r.hrtime,s=(o=function(){var f;return 1e9*(f=l())[0]+f[1]})(),c=1e9*r.uptime(),g=s-c):Date.now?(e.exports=function(){return Date.now()-u},u=Date.now()):(e.exports=function(){return new Date().getTime()-u},u=new Date().getTime())}).call(this)}).call(this,n(2))},function(e,t,n){(function(r){(function(o){function l(s){if((s=s===void 0?"utf-8":s)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+s+"') is invalid.")}function u(s,g){if(g=g===void 0?{fatal:!1}:g,(s=s===void 0?"utf-8":s)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+s+"') is invalid.");if(g.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(o.TextEncoder&&o.TextDecoder)return!1;Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),l.prototype.encode=function(s,g){if((g=g===void 0?{stream:!1}:g).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");g=0;for(var c=s.length,f=0,T=Math.max(32,c+(c>>1)+7),v=new Uint8Array(T>>3<<3);g<c;){var p=s.charCodeAt(g++);if(55296<=p&&56319>=p){if(g<c){var d=s.charCodeAt(g);(64512&d)==56320&&(++g,p=((1023&p)<<10)+(1023&d)+65536)}if(55296<=p&&56319>=p)continue}if(f+4>v.length&&(T+=8,T=(T*=1+g/s.length*2)>>3<<3,(d=new Uint8Array(T)).set(v),v=d),(4294967168&p)==0)v[f++]=p;else{if(!(4294965248&p))v[f++]=p>>6&31|192;else if(!(4294901760&p))v[f++]=p>>12&15|224,v[f++]=p>>6&63|128;else{if(4292870144&p)continue;v[f++]=p>>18&7|240,v[f++]=p>>12&63|128,v[f++]=p>>6&63|128}v[f++]=63&p|128}}return v.slice(0,f)},Object.defineProperty(u.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(u.prototype,"fatal",{value:!1}),Object.defineProperty(u.prototype,"ignoreBOM",{value:!1}),u.prototype.decode=function(s,g){if((g=g===void 0?{stream:!1}:g).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");g=0;for(var c=(s=new Uint8Array(s)).length,f=[];g<c;){var T=s[g++];if(T===0)break;if(!(128&T))f.push(T);else if((224&T)==192){var v=63&s[g++];f.push((31&T)<<6|v)}else if((240&T)==224){v=63&s[g++];var p=63&s[g++];f.push((31&T)<<12|v<<6|p)}else(248&T)==240&&(65535<(T=(7&T)<<18|(v=63&s[g++])<<12|(p=63&s[g++])<<6|63&s[g++])&&(T-=65536,f.push(T>>>10&1023|55296),T=56320|1023&T),f.push(T))}return String.fromCharCode.apply(null,f)},o.TextEncoder=l,o.TextDecoder=u})(typeof window<"u"?window:r!==void 0?r:this)}).call(this,n(6))},function(e,t,n){n.r(t),n.d(t,"AuthClient",function(){return l}),n.d(t,"RtcSignalingClient",function(){return s}),n.d(t,"Credentials",function(){return H}),n.d(t,"SignalingPromiseClient",function(){return U.SignalingPromiseClient}),n.d(t,"RtcClient",function(){return vt}),n.d(t,"RtcClientV1",function(){return Ot}),n.d(t,"createRtcStreamMessage",function(){return nt});var r=n(28),o=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class l extends r.a{adminSignup(P,z){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:z,method:"POST",body:P})})}login(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:P,allowUnsafeRetries:!0})})}loginWithGoogleToken(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:P,allowUnsafeRetries:!0})})}refresh(P,z){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:{refreshToken:P,tokenExpirationSeconds:z},allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:P})})}forgotPassword(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:{email:P}})})}confirmForgotPassword(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:P})})}resendInvitation(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:{email:P}})})}changePassword({token:P,refreshToken:z,currentPassword:J,newPassword:ie}){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:P,method:"POST",body:{refreshToken:z,currentPassword:J,newPassword:ie}})})}getDeviceCredentials(P){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:P,method:"POST",allowUnsafeRetries:!0})})}impersonate(P,z){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:P,method:"POST",allowUnsafeRetries:!0,body:{userId:z}})})}createServiceAccount(P,z,J,ie){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:P,method:"POST",allowUnsafeRetries:!0,body:{name:z,roleId:J,tags:ie}})})}getFeatures(P){return o(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:P})).features})}}var u=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class s extends r.a{createPeer(P,z){return u(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:P,method:"POST",body:z})})}getPeers(P){return u(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:P})).items})}refreshPeer(P,z){return u(this,void 0,void 0,function*(){yield this.fetch(`peers/${z}/refresh`,{token:P,method:"POST",allowUnsafeRetries:!0})})}createSession(P,z){return u(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:P,method:"POST",body:z})})}refreshSession(P,z){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${z}/refresh`,{token:P,method:"POST",allowUnsafeRetries:!0})})}deleteSession(P,z){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${z}`,{token:P,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(P){return u(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:P})).items})}getIceServers(P){return u(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:P})).items})}addSignals(P,z,J){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${z}/add-signals`,{token:P,method:"POST",body:J})})}takeSignals(P,z){return u(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${z}/take-signals`,{token:P,method:"POST"})).items})}}var g=n(1),c=n(8),f=n(14),T=n.n(f),v=n(103),p=n.n(v),d=n(4),h=n(0),S=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class I extends class{constructor(P,z){this.type=P,this.name=z}}{constructor(P){super("simple","LogReporter"),this.message=P}send(P){return S(this,void 0,void 0,function*(){var z,J;h.a.debug(this.message,(z=P.reduce((ie,se)=>Object.assign(Object.assign({},ie),{[se.name]:se.stat}),{}),J=ie=>{const{sum:se,count:ge}=ie,me=se/ge;return Object.assign(Object.assign({},ie),{average:me})},Object.keys(z).reduce((ie,se)=>Object.assign(Object.assign({},ie),{[se]:J(z[se])}),{})))})}}var L=n(39);function O(be){return!!be.match(/^[a-zA-Z0-9-_.,:?'"()@\/\\#$+ ]{1,255}$/)}var R=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};function m({func:be,delay:P,immediate:z=!1}){let J=!1,ie=setTimeout(function ge(){return R(this,void 0,void 0,function*(){if(J)return;const me=new Date().getTime();try{se=be(),yield se}finally{if(!J){const ye=new Date().getTime();ie=setTimeout(ge,Math.max(P-(ye-me),0))}}})},z?0:P),se=Promise.resolve();return{stop(){return R(this,void 0,void 0,function*(){J=!0,clearTimeout(ie),yield se})}}}var M=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};const G=n(225);class Z{constructor(P){this.buffer={},this.reporters=[],this.flushInterval=m({func:()=>this.flushStats(),delay:Z.samplePeriodMs}),this.tags=this.filterTags((P==null?void 0:P.tags)||{app:d.a,version:d.j,namespace:d.i,instanceId:L.a})}shutdown(){return M(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(c.a)(2*g.a.second)})}aggregate(P,z,J){this.addToBuffer(this.buffer,this.encodeKey({metric:P,tags:this.filterTags(J||{})}),typeof z=="number"?{min:z,max:z,sum:z,count:1}:z)}increment(P,z){this.aggregate(P,1,z)}timer(P,z,J){return M(this,void 0,void 0,function*(){const ie=G(),se=yield z(),ge=G();return this.aggregate(P,ge-ie,J),se})}registerStatsReporter(P){this.reporters.push(P)}setTag(P,z){const J=this.filterTags({[P]:z});this.tags=Object.assign(Object.assign({},this.tags),J)}addToBuffer(P,z,J){if(P[z]){const{min:ie,max:se,sum:ge,count:me}=P[z];P[z]={min:Math.min(ie,J.min),max:Math.max(se,J.max),sum:ge+J.sum,count:me+J.count}}else P[z]=J}write(P){return M(this,void 0,void 0,function*(){yield Promise.all(this.reporters.map(z=>M(this,void 0,void 0,function*(){let J;const ie={};switch(z.type){case"simple":for(const[ge,me]of Object.entries(P)){const{metric:ye}=this.decodeKey(ge);this.addToBuffer(ie,this.encodeKey({metric:ye}),me)}J=ie;break;case"tagged":J=P;break;default:(function(ge){throw new Error(`Unreachable type encountered (${ge})`)})(z.type)}const se=Object.entries(J);if(se.length>0)return z.send(se.map(([ge,me])=>{const{metric:ye,tags:fe}=this.decodeKey(ge);return{name:ye,tags:Object.assign(Object.assign({},fe),this.tags),stat:me}}),Z.samplePeriodMs).catch(ge=>{h.a.debug(`Failed to write stats to ${z.name}`,{error:ge})})})))})}flushStats(){return M(this,void 0,void 0,function*(){yield this.write(this.buffer),this.buffer={}})}encodeKey(P){return T()(Object.assign(Object.assign({},P),Object.keys(P.tags||{}).length>0?{tags:P.tags}:{}))}decodeKey(P){return JSON.parse(P)}filterTags(P){return Object.entries(P||{}).reduce((z,[J,ie])=>(O(J)&&O(ie)&&(z[J]=ie),z),{})}}Z.samplePeriodMs=5*g.a.minute;const _=!!d.c,y=new Z;_||["local","on-prem"].includes(d.i)||y.registerStatsReporter(new I("stats"));var C=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class w extends class{constructor(P){this.options=P,this.cache=new p.a(Object.assign(Object.assign(Object.assign({},P.dispose||P.disposeAfter?{ttlAutopurge:!0}:{}),P),{dispose:(...z)=>{var J;z[2]==="evict"&&y.increment("lru-eviction",{name:P.name}),(J=P.dispose)===null||J===void 0||J.call(P,...z)},disposeAfter:(...z)=>{var J;this.updateStats(),(J=P.disposeAfter)===null||J===void 0||J.call(P,...z)}})),this.stringify=P.fastStringify?JSON.stringify:T.a}set(P,z,J){const ie=this.stringify(P);if(!this.cache.set(ie,z,{ttl:J})){const se=this.cache.sizeCalculation?this.cache.sizeCalculation(z,ie):"unknown";throw Error(`Value too large (${se} > ${this.cache.max})`)}this.updateStats()}get(P){const{name:z}=this.options,J=this.stringify(P),ie=this.cache.getRemainingTTL(J);return ie<=0?y.increment("cache-miss",{name:z}):ie!==1/0&&y.aggregate("cache-item-ttl",ie,{name:z}),this.cache.get(J)}delete(P){this.cache.delete(this.stringify(P))}peek(P){return this.cache.peek(this.stringify(P))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(P){this.cache.forEach(P)}purgeStale(){return this.cache.purgeStale()}updateStats(){const{name:P}=this.options;y.aggregate("cache-item-count",this.cache.size,{name:P}),this.cache.calculatedSize!==void 0&&y.aggregate("cache-length",this.cache.calculatedSize,{name:P})}}{constructor(P){if(super(P),this.expireRejectedPromiseValues=P.expireRejectedPromiseValues===void 0||P.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=P.rejectedPromiseValueTtl!==void 0?P.rejectedPromiseValueTtl:g.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(P,z,J){super.set(P,z,J),this.expireRejectedPromiseValues&&z.catch(()=>C(this,void 0,void 0,function*(){yield Object(c.a)(this.rejectedPromiseValueTtl),this.peek(P)===z&&this.delete(P)}))}}var x=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class H{constructor(P,z,J){this.authClient=P,this.email=z,this.password=J,this.tokenTtlMs=1*g.a.hour,this.tokenCache=new w({name:"Credentials-tokenCache",max:100,ttl:this.tokenTtlMs-5*g.a.minute,fastStringify:!0})}getToken(){return x(this,void 0,void 0,function*(){let P=this.tokenCache.get(this.email);return P||(P=(()=>x(this,void 0,void 0,function*(){const{authentication:z}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/g.a.second});if(!z)throw new Error("User account not verified.");return z.accessToken}))(),this.tokenCache.set(this.email,P)),P})}}var U=n(97),N=n(24),k=n(228),F=n(40),A=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class b extends F.a{constructor(P){super(P)}postLanRtcOffer(P){return A(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:P})})}}var B=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};function W(be){return B(this,void 0,void 0,function*(){return(yield Promise.all(be.map(P=>P.catch(z=>z)))).filter(P=>P instanceof Error)})}function Q(be,P){if(be===void 0)throw new Error(`Value is undefined${P?`: ${P}`:""}`)}function ee(be,P){if(be===null)throw new Error(`Value is null${P?`: ${P}`:""}`)}function ne(be){return Q(be),be}function X(be,P){const z=be.reduce((J,ie)=>[...J,...ie.urls],[]).filter(J=>$(J,P)).sort(J=>E(J,"udp")?-1:0).shift();if(z)return Object.assign(Object.assign({},ne(be.find(J=>J.urls.includes(z)))),{urls:[z]})}function $(be,P){switch(P){case"stun":return/^stuns?:/.test(be);case"turn":return/^turns?:/.test(be)}}function E(be,P){return be.endsWith(`transport=${P}`)}var j=n(9);class V extends Error{constructor(P,z){super(`Deadline expired after ${P}ms + ${z}ms`)}}class K{static withDeadline(P,z){const J=new Promise((ie,se)=>{setTimeout(()=>{se(new V(z,this.grpcCallDeadlineSlopMs))},z+this.grpcCallDeadlineSlopMs)});return Promise.race([P,J])}}K.grpcCallDeadlineSlopMs=500*g.a.millisecond;var Y=n(29);const re={ordered:!1,maxPacketLifeTime:300*g.a.millisecond},oe={ordered:!0},ue={ordered:!0},ve={ordered:!1,maxRetransmits:0},Re={ordered:!1,maxRetransmits:0},Te=be=>"received"in be&&be.received!==void 0,Ne=be=>!("received"in be)||be.received===void 0,Oe=2*g.a.second;function Ce(be,P={}){const z=Array.from(be.values()),J=z.filter(Te),ie=J.length>0,se=Math.max(...J.map(fe=>fe.received));let ge;if(ie){const fe=z.length,le=J.length,Ee=J.map(Le=>Le.received-Le.sent),{standardDeviation:Ie,mean:De,jitter:Ve}=function(Le){const Be=Le.length;if(Be===0)return{mean:NaN,standardDeviation:-1,jitter:NaN};const qe=Le.reduce((He,at)=>He+at,0)/Be,Ye=Math.sqrt(Le.map(He=>Math.pow(He-qe,2)).reduce((He,at)=>He+at)/Be);if(Be===1)return{mean:qe,standardDeviation:Ye,jitter:NaN};let Ke=0;for(let He=1;He<Be;He++)Ke+=Math.abs(Le[He]-Le[He-1]);return{mean:qe,standardDeviation:Ye,jitter:Ke/(Be-1)}}(Ee),Ze=z.filter(Le=>Le.sent<se-Oe),Xe=Ze.filter(Ne),ot=Xe.length===0?0:Xe.length/Ze.length;ge={pingsSent:fe,pongsReceived:le,average:De,standardDeviation:Ie,jitter:Ve,max:Math.max(...Ee),min:Math.min(...Ee),loss:ot}}else ge=null;const{temporalNow:me=Date.now()}=P,ye=(ie?se:me)-4*Oe;return Array.from(be.entries()).forEach(fe=>{const[le,Ee]=fe;Ee.sent<ye&&be.delete(le)}),ge}function Me({entityId:be,streamName:P,streamType:z}){return`${be}.${P}.${z}`}var Fe=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class $e{constructor(P,z){this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=P,this.connection=z}updateRemoteMessagesCounts(P){if(P.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const z of P.payload.streamsInfo.items)this.counts.remoteSent.set(z.streamId,z.sentCount),this.counts.remoteReceived.set(z.streamId,z.receivedCount)}}getLocalStreamsInfo(P){const{localSent:z,localReceived:J}=this.counts;return{items:[...new Set([...z.keys(),...J.keys()])].map(ie=>{var se,ge;return{streamId:ie,sentCount:(se=z.get(ie))!==null&&se!==void 0?se:0,receivedCount:(ge=J.get(ie))!==null&&ge!==void 0?ge:0}}),timestamp:P}}incrementLocalSent(P){const{localSent:z}=this.counts,J=Me(P.header.stream);z.set(J,(z.get(J)||0)+1)}incrementLocalReceived(P){const{localReceived:z}=this.counts,J=Me(P.header.stream),ie=z.get(J)||0;if(ie===0){const{streamName:se,streamType:ge}=P.header.stream;h.a.debug("RTC client received first message for stream",{streamName:se,streamType:ge})}z.set(J,ie+1)}uploadMetrics(){return Fe(this,void 0,void 0,function*(){const{sessionId:P}=this,z=yield this.connection.peerConnection.getStats(),J={};z.forEach(fe=>J[fe.id]=fe),h.a.debug("rtc-stats",Object.assign(Object.assign({},J),{sessionId:P}));const{localSent:ie,localReceived:se,remoteSent:ge,remoteReceived:me}=this.counts,ye=[...new Set([...ie.keys(),...se.keys()])].reduce((fe,le)=>{const Ee=ie.get(le),Ie=se.get(le),De=ge.get(le),Ve=me.get(le);return Object.assign(Object.assign({},fe),{[`local-${le}-sent`]:Ee,[`local-${le}-received`]:Ie,[`remote-${le}-sent`]:De,[`remote-${le}-received`]:Ve})},{sessionId:P});h.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},ye))})}}function nt(be,P,z){return{header:{stream:be,created:Date.now(),frameId:z||""},payload:P}}function Et(be){const P=be.localCandidate.candidateType,z=be.remoteCandidate.candidateType;return P==="host"&&z==="host"?"local":P==="relay"||z==="relay"?"TURN":"STUN"}function ut(be){return new Set(["disconnected","failed","closed"]).has(be.iceConnectionState)}function Tt(be){switch(be.header.stream.streamType){case"twist":{const{twist:P}=be.payload;if(!P)throw Error("twist not in payload of RTC message with type twist");return{header:be.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},P.linear),angular:Object.assign({x:0,y:0,z:0},P.angular)}}}}case"pose":{const{pose:P}=be.payload;if(!P)throw Error("pose not in payload of RTC message with type pose");return{header:be.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},P.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},P.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:P}=be.payload;if(!P)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const z=new Array(36).fill(0);return P.covariance.forEach((J,ie)=>{if(ie>=36)throw Error("covariance contains more than 36 elements");z[ie]=J}),{header:be.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},P.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},P.pose.rotation)},covariance:z}}}}case"point":{const{point:P}=be.payload;if(!P)throw Error("point not in payload of RTC message with type point");return{header:be.header,payload:{point:Object.assign({x:0,y:0,z:0},P)}}}default:return be}}var ct=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class bt{get peerConnection(){return ee(this._peerConnection,"RTCPeerConnection is closed!"),this._peerConnection}constructor(P,z,J,ie){this.iceServers=z,this.config=J,this.dataChannelNotifier=ie,this.connectTimeoutMs=20*g.a.second,this.iceGatheringTimeoutMs=3*g.a.second,this.pingUpdateTimeoutMs=1*g.a.second,this.pingV2UpdateTimeoutMs=250*g.a.millisecond,this.pingV2MetricsGatherTimeoutMs=1*g.a.second,this.streamsInfoUpdateTimeoutMs=2*g.a.second,this.reassemblyTimeoutMs=500*g.a.millisecond,this.reassemblyTableCleanupMs=1*g.a.second,this.heartbeatTimeoutMs=20*g.a.millisecond,this._peerConnection=null,this.heartbeatChannel=null,this.latestTtlStreamChannel=null,this.reliableStreamChannel=null,this.latestReliableStreamChannel=null,this.latestTryOnceStreamChannel=null,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1,this.pingV2Map=new Map,this.sendPingV2=()=>{const{latestTryOnceStreamChannel:ge}=this;if(!ge)return;const me=new Date().getTime(),ye=Object(k.a)();this.sendSystemMessage(ge,{type:"ping-v2",payload:{timestamp:me,id:ye}}),this.pingV2Map.set(ye,{sent:me})},this.gatherPingV2Metrics=()=>{const ge=Ce(this.pingV2Map);if(ge){const me=this.getRemoteDeviceId();this.pingInfo=ge,y.aggregate("rtc-ping-average",ge.average,Object.assign({},me?{deviceId:me}:{})),y.aggregate("rtc-ping-loss",ge.loss,Object.assign({},me?{deviceId:me}:{})),y.aggregate("rtc-jitter",ge.jitter,Object.assign({},me?{deviceId:me}:{}))}},this._peerConnection=P;const{isOffer:se}=J.baseConfig;se?this.initializeChannels(P):P.ondatachannel=ge=>{switch(ge.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ge.channel;break;case"stream.reliable":this.reliableStreamChannel=ge.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ge.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ge.channel;break;case"heartbeat":return void(this.heartbeatChannel=ge.channel);default:return void this.dataChannelNotifier(ge.channel)}this.setupChannel(ge.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ge}=this;ge&&this.sendSystemMessage(ge,{type:"ping"})},this.pingUpdateTimeoutMs),this.pingV2UpdateTimeout=setInterval(this.sendPingV2,this.pingV2UpdateTimeoutMs),this.pingV2MetricsGatherTimeout=setInterval(this.gatherPingV2Metrics,this.pingV2MetricsGatherTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:ge}=this;ge&&this.sendSystemMessage(ge,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const ge=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((me,ye,fe)=>{ge>ye+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(me)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:ge}=this;ge&&ge.readyState==="open"&&ge.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(P){return ct(this,void 0,void 0,function*(){const{peerConnection:z}=this,{track:J}=this.config.baseConfig,ie=(()=>{try{return JSON.parse(P.getPayload())}catch{return}})();if(!ie)return void h.a.error("Received unparseable signal.");h.a.debug("Handling signal",{description:ie});const{sdp:se,type:ge}=ie;if(!se||!ge)return void h.a.warn("Received non-SDP signal");const{signalingState:me,connectionState:ye}=z;if(me!=="stable"||ye!=="connected")if(z.remoteDescription)h.a.warn(`Received SDP after remote description was set: ${se}`);else{if(ge==="offer"){if(me!=="stable")return void h.a.warn("Received offer SDP when signaling is ongoing.");yield z.setRemoteDescription(ie);const fe=yield z.createAnswer();yield z.setLocalDescription(fe);const le=P.clone();return J==null||J("Answer Received",le),le.setPayload(JSON.stringify(fe)),le.setReceiverId(P.getSenderId()),le.setSenderId(P.getReceiverId()),le}if(ge==="answer"){if(me==="stable")return void h.a.warn("Received answer SDP when signaling hasn't started.");yield z.setRemoteDescription(ie)}}else h.a.warn(`Received SDP when already connected: ${se}`)})}send(P,z){const J=this.getChannelFromLabel(z.channelLabel);J?this.sendOnChannel(J,P):h.a.warn("Send called with unexpected channel label",{channelLabel:z.channelLabel})}controlRemoteStream(P){var z;this.sendSystemMessage((ee(z=this.reliableStreamChannel),z),{type:"stream-control",streamControl:P})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:P,latestTtlStreamChannel:z,latestTryOnceStreamChannel:J,latestReliableStreamChannel:ie}=this;return(P==null?void 0:P.readyState)==="open"&&(z==null?void 0:z.readyState)==="open"&&(J==null?void 0:J.readyState)==="open"&&(ie==null?void 0:ie.readyState)==="open"}close(){var P,z,J,ie,se,ge,me;return ct(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield(P=this.sessionMetrics)===null||P===void 0?void 0:P.uploadMetrics(),dt(this.pingUpdateTimeout),dt(this.pingV2UpdateTimeout),dt(this.pingV2MetricsGatherTimeout),dt(this.reassemblyTableCleanupTimeout),dt(this.streamsInfoUpdateTimeout),dt(this.heartbeatTimeout),(z=this._peerConnection)===null||z===void 0||z.close(),(J=this.heartbeatChannel)===null||J===void 0||J.close(),(ie=this.latestReliableStreamChannel)===null||ie===void 0||ie.close(),(se=this.latestTryOnceStreamChannel)===null||se===void 0||se.close(),(ge=this.latestTtlStreamChannel)===null||ge===void 0||ge.close(),(me=this.reliableStreamChannel)===null||me===void 0||me.close(),this._peerConnection=null,this.heartbeatChannel=null,this.latestReliableStreamChannel=null,this.latestTryOnceStreamChannel=null,this.latestTtlStreamChannel=null,this.reliableStreamChannel=null)})}getPing(){return this.pingTimeMs}getPingInfo(){return this.pingInfo}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var P;return(P=this.config.remoteConfig)===null||P===void 0?void 0:P.sessionCreatedTimestamp}setSessionCreatedTimestamp(P){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=P)}getSessionId(){var P;return(P=this.config.remoteConfig)===null||P===void 0?void 0:P.sessionId}setSessionId(P){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=P,this.sessionMetrics=new $e(P,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var P;return(P=this.config.baseConfig)===null||P===void 0?void 0:P.remoteDeviceId}setRemoteDeviceId(P){this.config.baseConfig.remoteDeviceId=P}getSessionMetricsMessageCounts(){var P;return(P=this.sessionMetrics)===null||P===void 0?void 0:P.counts}getConnectionStatsInfo(){return ct(this,void 0,void 0,function*(){const{peerConnection:P}=this;if(!P)return;const z=yield P.getStats(null),J=[];z.forEach(ye=>{J.push(ye)});const ie=J.find(ye=>ye.type==="transport");if(!ie)return;const se=J.find(ye=>(ye.type==="candidate-pair"||ye.type==="candidatepair")&&ye.id===ie.selectedCandidatePairId);if(!se)return;const ge=J.find(ye=>ye.id===se.localCandidateId),me=J.find(ye=>ye.id===se.remoteCandidateId);return ge&&me&&(ge.address=ge.address||ge.ip,me.address=me.address||me.ip,ge.address!==void 0&&me.address!==void 0)?{transport:ie,localCandidate:ge,remoteCandidate:me}:void 0})}initializeChannels(P){this.heartbeatChannel=P.createDataChannel("heartbeat",Re),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=P.createDataChannel("stream.latest-ttl",re),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=P.createDataChannel("stream.reliable",oe),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=P.createDataChannel("stream.latest-reliable",ue),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=P.createDataChannel("stream.latest-try-once",ve),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var P,z;return ct(this,void 0,void 0,function*(){const{gotOffer:J}=this,{peerConnection:ie,config:se}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const ge=(P=this.config.remoteConfig)===null||P===void 0?void 0:P.sessionId;if(J)return void h.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,ut(this.peerConnection))return void h.a.debug("Failed to generate offer because the peer connection was inactive.");const me=se.baseConfig.track;ie.onicecandidate=()=>{this.hasIceCandidate=!0},ie.oniceconnectionstatechange=()=>ct(this,void 0,void 0,function*(){const De=ie.iceConnectionState;if(De==="connected"||De==="completed"){const Ve=yield this.getConnectionStatsInfo(),Ze=Ve?Et(Ve):void 0;h.a.info(`ICE connection state changed to ${De}`,{sessionId:ge,connectionStatsInfo:Ve,iceMode:Ze}),me==null||me("ICE connection state change",{iceConnectionState:De,sessionId:ge,connectionStatsInfo:Ve,iceMode:Ze})}}),yield ie.setLocalDescription(yield ie.createOffer());const ye=ie.getConfiguration?ie.getConfiguration().iceTransportPolicy:"all",fe=new Date().getTime();for(;;){const De=new Date().getTime()-fe;if(De>this.connectTimeoutMs)return void h.a.debug("Failed to generate offer because ICE gathering timed out.");if(De>this.iceGatheringTimeoutMs&&this.hasIceCandidate){h.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:ye,waitTime:De}),me==null||me("ICE gathering partially completed",{sessionId:ge,iceTransportPolicy:ye,waitTime:De});break}if(ie.iceGatheringState==="complete"){h.a.debug("ICE gathering complete",{iceTransportPolicy:ye,waitTime:De}),me==null||me("ICE gathering completed",{sessionId:ge,iceTransportPolicy:ye,waitTime:De});break}yield Object(c.a)(.1*g.a.second)}const le=(z=this.iceServers)!==null&&z!==void 0?z:[];for(const De of le)"credentialType"in De&&(De.credentialType=void 0);const Ee=JSON.stringify(le),Ie=new j.Signal;return Ie.setPayload(JSON.stringify(ie.localDescription)),Ie.setSenderId(this.config.baseConfig.localPeerId),Ie.setReceiverId(this.config.baseConfig.remotePeerId),Ie.setIceServers(Ee),Ie.setIceTransportPolicy(ye??"all"),this.config.baseConfig.sessionType!==void 0?Ie.setSessionType(this.config.baseConfig.sessionType):Ie.setSessionType(j.SessionType.TELEOP),h.a.debug("Sending offer signal with description",{description:Ie.getPayload()}),Ie})}getLanOffer(){return ct(this,void 0,void 0,function*(){const{peerConnection:P,gotOffer:z}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if(z)return void h.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,ut(this.peerConnection))return void h.a.debug("Failed to generate offer because the peer connection was inactive.");yield P.setLocalDescription(yield P.createOffer());const J=new Date().getTime();for(;;){if(new Date().getTime()-J>this.iceGatheringTimeoutMs)return void h.a.debug("Failed to generate offer because ICE gathering timed out.");if(P.iceGatheringState==="complete")break;yield Object(c.a)(.1*g.a.second)}const ie=P.localDescription;if(ie)return h.a.debug("Sending LAN offer signal with description",{description:ie}),ie;h.a.error("Failed to generate LAN offer description")})}handleLanAnswer(P){return ct(this,void 0,void 0,function*(){const{peerConnection:z}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield z.setRemoteDescription(P)})}getChannelFromLabel(P){switch(P){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(P,z){var J;let ie;try{ie=Object(Y.encode)(JSON.stringify(z))}catch(se){return void h.a.warn("Failed to encode RTC message",{error:se})}try{P.send(ie),(J=this.sessionMetrics)===null||J===void 0||J.incrementLocalSent(z)}catch(se){h.a.warn("Failed to send message to channel",{error:se,channel:P.label})}}channelNotRecognized(P){return P!==this.latestTtlStreamChannel&&P!==this.latestReliableStreamChannel&&P!==this.latestTryOnceStreamChannel&&P!==this.reliableStreamChannel}setupChannel(P){P.onmessage=z=>{if(this.channelNotRecognized(P))return void h.a.warn("Received message on unrecognized data channel.");let J;try{J=JSON.parse(Object(Y.decode)(z.data))}catch(ie){return void h.a.warn("Received unparseable message on RTC stream data channel",{error:ie,channel:P.label})}J.communicationType==="message-chunk"?this.receiveChannelMessageChunk(P,J):this.receiveChannelMessage(P,J)},P.onerror=z=>{h.a.warn(`Channel error: ${z.error}`,{error:z.error,sessionId:this.getSessionId(),channelLabel:P.label})},P.onopen=()=>{h.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:P.label})},P.onclose=()=>{const z={bufferedAmount:P.bufferedAmount,sessionId:this.getSessionId(),channelLabel:P.label};this.closeCalled===!1?h.a.debug("Unexpected channel closed",z):h.a.debug("Channel closed",z)}}receiveChannelMessage(P,z){var J;const{config:ie}=this,{remotePeerId:se}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),z=Tt(z),(J=this.sessionMetrics)===null||J===void 0||J.incrementLocalReceived(z),this.handleSystemMessage(P,z)||(P===this.latestTryOnceStreamChannel||P===this.latestTtlStreamChannel||P===this.latestReliableStreamChannel)&&!this.isLatestMessage(z)||ie.baseConfig.receive(se,z)}receiveChannelMessageChunk(P,z){const J=this.reassemblyTable.get(z.id)||[];if(J.push(z),J.length===z.total){const ie=function(se){const ge=se.sort((me,ye)=>me.seq<ye.seq?-1:1).map(me=>me.part).reduce((me,ye)=>me+ye);try{return JSON.parse(ge)}catch{return void h.a.warn("Could not reassemble RTC message chunks")}}(J);return ie&&this.receiveChannelMessage(P,ie),void this.reassemblyTable.delete(z.id)}this.reassemblyTable.set(z.id,J),this.reassemblyTableLastTimestamp.set(z.id,new Date().getTime())}handleSystemMessage(P,z){var J,ie;const{config:se}=this,{baseConfig:ge}=se,{remotePeerId:me,remoteDeviceId:ye}=ge;switch(z.header.stream.streamType){case"ping":return this.sendSystemMessage(P,{type:"pong",timestamp:ne(z.payload.ping)}),!0;case"pong":{const fe=new Date().getTime()-ne(z.payload.pong);return this.pingTimeMs=fe,y.aggregate("rtc-ping-time",fe,Object.assign({},ye?{deviceId:ye}:{})),!0}case"ping-v2":return this.sendPingV2(),!0;case"pong-v2":{const fe=ne(z.payload.pongV2),le=this.pingV2Map.get(fe.id);return(le==null?void 0:le.sent)!==fe.timestamp&&h.a.warn("Pong timestamp doesn't match stored value",{currentEntry:le,pong:fe}),this.pingV2Map.set(fe.id,{sent:fe.timestamp,received:new Date().getTime()}),!0}case"streams-info":{const{sessionMetrics:fe}=this,le=(J=z.payload.streamsInfo)===null||J===void 0?void 0:J.timestamp;return!!le&&(fe==null||fe.updateRemoteMessagesCounts(z),(ie=ge.onStreamsInfoUpdate)===null||ie===void 0||ie.call(ge,me,le),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(P,z){var J;const{localUserId:ie,localPeerId:se}=this.config.baseConfig;if(P.readyState!=="open")return;const ge={entityId:ie??se,streamName:`$.${z.type}`,streamType:z.type};let me;switch(z.type){case"ping":me={ping:new Date().getTime()};break;case"pong":me={pong:z.timestamp};break;case"ping-v2":me={pingV2:z.payload};break;case"pong-v2":me={pongV2:z.payload};break;case"stream-control":me={streamControl:z.streamControl};break;case"streams-info":me={streamsInfo:(J=this.sessionMetrics)===null||J===void 0?void 0:J.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(P,nt(ge,me))}isLatestMessage(P){const z=Me(P.header.stream),J=(this.streamLatestTimestamp.get(z)||0)<=P.header.created;return J&&this.streamLatestTimestamp.set(z,P.header.created),J}}function dt(be){be&&clearInterval(be)}function kt(){h.a.debug("forceGarbageCollection() triggered"),queueMicrotask(()=>{let be=document.createElement("img");be.src=window.URL.createObjectURL(new Blob([new ArrayBuffer(5e7)])),be.onerror=function(){window.URL.revokeObjectURL(this.src),be=null}})}function gt(be){try{return be instanceof Error?`${be.name}: ${be.message}`:typeof be=="object"?JSON.stringify(be):String(be)}catch{return"Unknown error"}}function ht(be){var P,z;return{userId:(P=be.getUserId())===null||P===void 0?void 0:P.getValue(),deviceId:(z=be.getDeviceId())===null||z===void 0?void 0:z.getValue(),organizationId:be.getOrganizationId(),id:be.getPeerId(),capabilities:[],capabilitySet:{}}}var ke=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class vt{constructor(P){this.config=P,this.grpcCallDeadline=5*g.a.second,this.refreshIntervalDelayMs=2*g.a.second,this.iceServersTtl=30*g.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new WeakSet,this.isOutgoingConnection=new Set,this.peerDataChannelListeners=[],this.rtcInstancesConstructed=0,this.statsLoopsExecuted=0;const{refreshIntervalDelayMs:z}=this;this.refreshInterval=m({func:()=>ke(this,void 0,void 0,function*(){try{yield this.update()}catch(J){h.a.warn("RTC refresh failed",{error:J})}}),delay:z,immediate:!0})}send(P,z,J){const ie=this.getActiveConnection(P);ie?ie.isReady()?ie.send(z,J):h.a.warn("Send called with unready connection."):h.a.warn("Send called with no connection.")}controlRemoteStream(P,z){const J=this.getActiveConnection(P);J?J.isReady()?J.controlRemoteStream(z):h.a.warn("controlRemoteStream called with unready connection."):h.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return ke(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(c.a)(.1*g.a.second);return ht(this.localPeer)})}connect(P,z){var J,ie,se;return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:ge,signalingClient:me}=this.config,{localPeer:ye,receiveSignalStream:fe,iceServers:le}=this;if(!ye||!fe||!le)return void h.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(P))return void h.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.has(P))return void h.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.add(P);const Ee=function(Le,Be,qe){const{rtcIceTransportPolicies:Ye,rtcIceServerProtocol:Ke,useAllServers:He}=Be||{},at=Le.map(it=>Object.assign(Object.assign({},it),{urls:it.urls.filter(yt=>{const Dt=(Ye===void 0||Ye.some(Lt=>$(yt,Lt)))&&(Ke===void 0||E(yt,Ke));return Dt||h.a.debug(`Ignoring ICE server: ${yt}`,{organizationId:qe}),Dt})})).filter(({urls:it})=>it.filter(yt=>yt).length>0);return He?at:[X(at,"stun"),X(at,"turn")].filter(it=>it!==void 0).map(it=>ne(it))}(le,z);h.a.debug("Received ICE servers:",le),h.a.debug("Using ICE servers:",Ee);const Ie=new bt(yield this.createRTCPeerConnection(Ee),Ee,{baseConfig:{isOffer:!0,isLan:!1,receive:(Le,Be)=>this.config.receive(Le,Be),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Le,Be)=>{var qe,Ye;return(Ye=(qe=this.config).onStreamsInfoUpdate)===null||Ye===void 0?void 0:Ye.call(qe,Le,Be)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(J=ye.getUserId())===null||J===void 0?void 0:J.getValue(),localPeerId:ye.getPeerId(),remotePeerId:P,sessionType:this.config.sessionType},remoteConfig:{}},Le=>this.onCustomDataChannel(P,Le)),De=yield Ie.getOffer();if(!De)return h.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(P);h.a.debug("Sending offer."),ge==null||ge("Sending offer",De);const Ve=new j.SendSignalRequest;Ve.setSignal(De);const Ze=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(me.sendSignal(Ve,yield this.getMetadata({})),this.grpcCallDeadline)}catch(Le){h.a.warn("Error when sending signal",{error:Le})}}))();if(!this.isOutgoingConnection.has(P))return void h.a.debug("No offer set after receiving offer signal response.");h.a.debug("Offer sent.");const Xe=(ie=Ze==null?void 0:Ze.getSessionId())===null||ie===void 0?void 0:ie.getValue(),ot=(se=Ze==null?void 0:Ze.getSessionCreatedTimestamp())===null||se===void 0?void 0:se.getValue();return Xe&&ot?(Ie.setSessionId(Xe),Ie.setSessionCreatedTimestamp(ot),this.isOutgoingConnection.delete(P),this.connections.push(Ie),this.isConnectionInitiator.add(Ie),this.setupHandlers(Ie),Xe):(h.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(P))})}connectLan(P){var z,J;return ke(this,void 0,void 0,function*(){const ie=new b(P),se=new bt(yield this.createRTCPeerConnection([]),[],{baseConfig:{isOffer:!0,isLan:!0,receive:(fe,le)=>this.config.receive(fe,le),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(fe,le)=>{var Ee,Ie;return(Ie=(Ee=this.config).onStreamsInfoUpdate)===null||Ie===void 0?void 0:Ie.call(Ee,fe,le)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(J=(z=this.localPeer)===null||z===void 0?void 0:z.getUserId())===null||J===void 0?void 0:J.getValue(),localPeerId:"lan_client",remotePeerId:P}},fe=>this.onCustomDataChannel(P,fe)),ge=yield se.getLanOffer();if(!ge)return h.a.warn("Could not generate LAN offer"),!1;const me=yield ie.postLanRtcOffer({offer:JSON.stringify(ge)}),ye=new RTCSessionDescription(JSON.parse(me.answer));return yield se.handleLanAnswer(ye),this.localConnections.push(se),this.isConnectionInitiator.add(se),Object(k.a)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(P,z,J,ie,se){const ge=this.getActiveConnection(P);if(ge&&this.isConnectionInitiator.has(ge)){const ye=ge.peerConnection.createDataChannel("custom."+z,J);return ie&&(ye.binaryType="arraybuffer"),se(P,ye),()=>{}}const me=(ye,fe)=>{P===ye&&fe.label==="custom."+z&&se(P,fe)};return this.peerDataChannelListeners.push(me),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(ye=>ye!==me)}}onCustomDataChannel(P,z){this.peerDataChannelListeners.forEach(J=>J(P,z))}getConnectionStatus(P){if(this.isOutgoingConnection.has(P))return"connecting";const z=this.getActiveConnection(P);return z?z.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(P){return ke(this,void 0,void 0,function*(){const z=this.getActiveConnection(P);if(z)return yield z.getConnectionStatsInfo()})}disconnect(P){return ke(this,void 0,void 0,function*(){const z=this.getActiveConnection(P);z&&(yield z.close(),this.connections=this.connections.filter(J=>J!==z),this.localConnections=this.localConnections.filter(J=>J!==z))})}getPeers(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:P}=this.config,z=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(P.getPeers(new j.GetPeersRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(se){h.a.warn("Error when getting peers",{error:se})}}))();if(!z)return[];const J=z.getPeersList();if(!J)return[];const ie=se=>{var ge,me;return(me=(ge=se.getPeerCreatedTimestamp())===null||ge===void 0?void 0:ge.getValue())!==null&&me!==void 0?me:0};return J.sort((se,ge)=>ie(ge)-ie(se)).map(se=>ht(se))})}getSessions(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:P}=this.config,z=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(P.getPeers(new j.GetPeersRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(se){h.a.warn("Error when getting peers",{error:se})}}))();if(!z)return{};const J=z.getPeersList(),ie={};for(const se of J)ie[se.getPeerId()]=se.getSessionIdsList();return ie})}getPing(P){const z=this.getActiveConnection(P);if(z)return z.getPing();h.a.warn("Attempted to get ping time from inactive peer.")}getPingInfo(P){const z=this.getActiveConnection(P);if(z)return z.getPingInfo();h.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(P){const z=this.getActiveConnection(P);if(z)return z.getLastMessageTimestamp();h.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(P){const z=this.getActiveConnection(P);if(z)return z.getSessionMetricsMessageCounts();h.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:P,receiveSignalStream:z,iceServers:J}=this;return!!(P&&z&&J)}shutdown(){return ke(this,void 0,void 0,function*(){h.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const P=this.connections;this.connections=[],yield this.closeConnections(P);const z=this.localConnections;this.localConnections=[],yield this.closeConnections(z),this.isOutgoingConnection.clear(),this.peerDataChannelListeners=[];const{localPeer:J}=this;if(!J||this.config.lanOnlyMode)return;const{signalingClient:ie}=this.config;yield(()=>ke(this,void 0,void 0,function*(){try{const se=new j.DeletePeerRequest;se.setPeerId(J.getPeerId()),yield K.withDeadline(ie.deletePeer(se,yield this.getMetadata({})),this.grpcCallDeadline)}catch(se){return void h.a.warn("Error deleting local peer",{error:se})}}))()})}createPeer(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:P}=this.config,z=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(P.createPeer(new j.CreatePeerRequest,yield this.getMetadata({})),this.grpcCallDeadline)}catch(ie){const se=ie;h.a.debug("createPeer failed",{error:se});const ge=gt(se);throw new Error(`Was not able to create peer: ${ge}`)}}))(),J=z==null?void 0:z.getPeer();if(!J)throw new Error("Response did not provide peer.");return this.localPeer=J})}createReceiveSignalStream(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:P}=this.config,{localPeer:z,iceServers:J}=this;if(!z||!J)return;const{receiveSignalStream:ie}=this;ie&&ie.cancel();const se=new j.ReceiveSignalStreamRequest;se.setPeerId(z.getPeerId());const ge=yield(()=>ke(this,void 0,void 0,function*(){try{return P.receiveSignalStream(se,yield this.getMetadata({hasDeadline:!1}))}catch(me){h.a.debug("createReceiveSignalStream failed",{error:me});const ye=gt(me);throw new Error(`Unable to create receive signal stream: ${ye}`)}}))();if(!ge)throw new Error("Response did not provide stream.");return ge.on("data",me=>ke(this,void 0,void 0,function*(){var ye,fe,le,Ee;const Ie=me.getSignal(),De=(ye=Ie==null?void 0:Ie.getSessionId())===null||ye===void 0?void 0:ye.getValue(),Ve=Ie==null?void 0:Ie.getSenderId(),Ze=Ie==null?void 0:Ie.getReceiverId(),Xe=(fe=Ie==null?void 0:Ie.getSessionCreatedTimestamp())===null||fe===void 0?void 0:fe.getValue();if(!(Ie&&De&&Ve&&Ze&&Xe))return void h.a.warn("Received signal with missing information.");const ot=this.getActiveConnection(Ve);if(ot)if(ot.getSessionId()!==De){if(h.a.debug("Received signal: different session for a peer we're already connected to."),(ot.getSessionCreatedTimestamp()||0)>Xe)return;const Le=new bt(yield this.createRTCPeerConnection(J),J,{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,qe)=>this.config.receive(Be,qe),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,qe)=>{var Ye,Ke;return(Ke=(Ye=this.config).onStreamsInfoUpdate)===null||Ke===void 0?void 0:Ke.call(Ye,Be,qe)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:z.getPeerId(),localUserId:(Ee=z.getUserId())===null||Ee===void 0?void 0:Ee.getValue(),remotePeerId:Ve},remoteConfig:{sessionId:De,sessionCreatedTimestamp:Xe}},Be=>this.onCustomDataChannel(Ve,Be));yield Le.handleSignal(Ie),this.connections.push(Le)}else h.a.debug("Received signal: for an existing connection."),yield ot.handleSignal(Ie);else{h.a.debug("Received signal: new connection.");const Le=new bt(yield this.createRTCPeerConnection(J),J,{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,qe)=>this.config.receive(Be,qe),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,qe)=>{var Ye,Ke;return(Ke=(Ye=this.config).onStreamsInfoUpdate)===null||Ke===void 0?void 0:Ke.call(Ye,Be,qe)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:z.getPeerId(),localUserId:(le=z.getUserId())===null||le===void 0?void 0:le.getValue(),remotePeerId:Ve},remoteConfig:{sessionId:De,sessionCreatedTimestamp:Xe}},Be=>this.onCustomDataChannel(Ve,Be));yield Le.handleSignal(Ie),this.connections.push(Le)}})),ge.on("end",()=>{ge.cancel(),this.receiveSignalStream=void 0}),ge.on("error",me=>{switch(me.code){case N.StatusCode.CANCELLED:case N.StatusCode.UNAVAILABLE:case N.StatusCode.UNKNOWN:h.a.debug("Receive signal stream error",{error:me});break;case N.StatusCode.UNAUTHENTICATED:h.a.warn("Receive signal stream error",{error:me});break;default:h.a.error("Receive signal stream error",{error:me})}ge.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=ge})}createRTCPeerConnection(P){var z;return ke(this,void 0,void 0,function*(){const J=(z=this.config.alternateRTCPeerConnection)!==null&&z!==void 0?z:window.RTCPeerConnection;if(!J)throw function(){const{userAgent:ie}=navigator;return ie.includes("Firefox/")?"Firefox":ie.includes("Edg/")?"Edge":ie.includes("Chrome/")?"Chrome":ie.includes("Safari/")?"Safari":ie.includes("MSIE/")||ie.includes("Trident/")?"IE":"Other"}()!=="Chrome"?new Error("WebRTC is not enabled. Please try again with the latest version of Google Chrome."):new Error("WebRTC is not enabled. Please ensure WebRTC is not disabled by ad blocking software.");this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||kt();try{return new J({iceServers:P})}catch(ie){throw h.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),ie}})}closeConnections(P){return ke(this,void 0,void 0,function*(){const z=yield W(P.map(J=>ke(this,void 0,void 0,function*(){yield J.close()})));for(const J of z)h.a.warn("Request to close session failed",{error:J})})}getActiveConnection(P){return this.getConnections().find(z=>z.getRemotePeerId()===P&&z.isActive())}update(){var P;return ke(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(Ee=>Ee.isActive()),this.config.lanOnlyMode)return;const{signalingClient:z}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers){const Ee=[];return this.localPeer||Ee.push(this.createPeer()),this.iceServers||Ee.push(this.updateIceServers()),yield Promise.all(Ee),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()))}const[J,ie]=(se=this.connections,ge=Ee=>Ee.isActive(),se.reduce((Ee,Ie,De,Ve)=>{const[Ze,Xe]=Ee;return(ge(Ie,De,Ve)?Ze:Xe).push(Ie),Ee},[[],[]]));var se,ge;yield this.closeConnections(ie),this.connections=J,this.gatherConnectionStats().catch(Ee=>{h.a.warn("Error calling gatherConnectionStats",{error:Ee})}),this.statsLoopsExecuted++;const{localPeer:me}=this,ye=this.connections.filter(Ee=>Ee.getSessionId).map(Ee=>ne(Ee.getSessionId()));me.setSessionIdsList(ye);const fe=new j.RefreshPeerRequest;fe.setPeer(me);try{yield K.withDeadline(z.refreshPeer(fe,yield this.getMetadata({})),this.grpcCallDeadline)}catch(Ee){Ee.code===N.StatusCode.NOT_FOUND?(h.a.warn("Peer expired, creating new peer",{peerId:me.getPeerId()}),yield this.reset()):h.a.warn("Error calling RefreshPeer",{error:Ee})}const le=yield this.getPeers();for(const Ee of this.connections)Ee.setRemoteDeviceId((P=le.find(Ie=>Ie.id===Ee.getRemotePeerId()))===null||P===void 0?void 0:P.deviceId)})}gatherConnectionStats(){return ke(this,void 0,void 0,function*(){if(this.statsLoopsExecuted%10!=0||this.connections.length!==1)return;const P=yield this.connections[0].getConnectionStatsInfo(),z=P?Et(P):void 0;z?(h.a.info(`Detected RTC connection type: ${z}`),y.setTag("rtc-connection-type",z)):y.setTag("rtc-connection-type","unknown")})}reset(){return ke(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection.clear(),yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:P,iceServersTtl:z}=this,J=new Date().getTime();if(!P||J-P>z)try{const ie=(yield K.withDeadline(this.config.signalingClient.getIceServers(new j.GetIceServersRequest,yield this.getMetadata({})),this.grpcCallDeadline)).getIceServers();this.iceServers=JSON.parse(ie),this.iceServersLastUpdate=J}catch(ie){h.a.warn("Error in updateIceServers",{error:ie})}})}setupHandlers(P){const{peerConnection:z}=P,J=P.getSessionCreatedTimestamp();z.onconnectionstatechange=()=>ke(this,void 0,void 0,function*(){const ie=z.connectionState;if(!J)return;const se=P.getRemoteDeviceId();switch(ie){case"connected":y.aggregate("rtc-connect-time",new Date().getTime()-J,Object.assign({},se?{deviceId:se}:{}));break;case"failed":y.increment("rtc-connect-failed",Object.assign({},se?{deviceId:se}:{}))}})}getMetadata(P){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:z}=this.config,{grpcCallDeadline:J}=this,{hasDeadline:ie}=P,se=ie===!1?void 0:new Date().getTime()+J;try{return{authorization:yield z(),deadline:se}}catch(ge){throw h.a.error("getToken() failed",{error:ge}),new Error("Cannot get authorization token")}})}}var pt=n(11),mt=n(10),jt=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class At{constructor(P,z){this.sentMessagesCounts=new Map,this.receivedMessagesCounts=new Map,this.sessionId=P,this.connection=z}incrementMessageSent(P){const z=Me(P.header.stream);this.sentMessagesCounts.set(z,(this.sentMessagesCounts.get(z)||0)+1)}incrementMessageReceived(P){const z=Me(P.header.stream);this.receivedMessagesCounts.set(z,(this.receivedMessagesCounts.get(z)||0)+1)}uploadMetrics(){return jt(this,void 0,void 0,function*(){const{sessionId:P}=this,z=yield this.connection.peerConnection.getStats(),J={};z.forEach(se=>J[se.id]=se),h.a.debug("rtc-stats",Object.assign(Object.assign({},J),{sessionId:P}));const ie=[...new Set(Array.from(this.sentMessagesCounts.keys()).concat(Array.from(this.receivedMessagesCounts.keys())))].reduce((se,ge)=>{const me=this.sentMessagesCounts.get(ge),ye=this.receivedMessagesCounts.get(ge);return Object.assign(Object.assign({},se),{[`${ge}-sent`]:me,[`${ge}-received`]:ye})},{sessionId:P});h.a.debug("rtc-message-report",ie)})}}function Rt(be,P){return Me(be)===Me(P)}var rt=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class Nt{constructor(P,z){this.peerConnection=P,this.config=z,this.connectTimeoutMs=10*g.a.second,this.gatherIceTimeoutMs=5*g.a.second,this.pingUpdateTimeoutMs=2*g.a.second,this.streamLatestTimestamp=new Map,this.closeCalled=!1,this.connectCalled=!1,this.sentOffer=!1,this.receivedIceCandidate=!1;const{isOffer:J}=z;J?this.initializeChannels(P):P.ondatachannel=ie=>{switch(ie.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ie.channel;break;case"stream.reliable":this.reliableStreamChannel=ie.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ie.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ie.channel}this.setupChannel(ie.channel)},this.sessionMetrics=new At(this.getSessionId(),this)}connect(){return rt(this,void 0,void 0,function*(){if(this.connectCalled)return;this.connectCalled=!0,this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ie}=this;ie&&this.sendSystemMessage(ie,{type:"ping"})},this.pingUpdateTimeoutMs),this.connectTimeout=setTimeout(()=>rt(this,void 0,void 0,function*(){this.isReady()||(h.a.warn("RTC connect timed out, closing connection"),yield this.close())}),this.connectTimeoutMs);const{peerConnection:P,config:{isOffer:z,sessionId:J}}=this;if(z){const ie=yield P.createOffer();yield P.setLocalDescription(ie)}z&&(this.gatherIceTimeout=setTimeout(()=>rt(this,void 0,void 0,function*(){this.sentOffer||(h.a.warn("ICE gathering timed out"),this.receivedIceCandidate?(h.a.warn("Attempting to connect with partial ICE candidate pool"),yield this.sendOffer()):yield this.close())}),this.gatherIceTimeoutMs),P.onicecandidate=ie=>rt(this,void 0,void 0,function*(){ie.candidate?this.receivedIceCandidate=!0:yield this.sendOffer()}),P.onicegatheringstatechange=()=>rt(this,void 0,void 0,function*(){P.iceGatheringState==="complete"&&(yield this.sendOffer())}),P.onnegotiationneeded=()=>{h.a.debug("Negotiation needed",{sessionId:J})})})}handleSignal(P){return rt(this,void 0,void 0,function*(){const{peerConnection:z,config:{sessionId:J,sendSignal:ie}}=this,{description:se}=JSON.parse(P.payload);if(h.a.debug("Handling signal",{sessionId:J,description:JSON.stringify(se)}),se)if(z.signalingState!=="stable"||z.connectionState!=="connected")if(z.remoteDescription)h.a.warn(`Received SDP signal during negotiation when remote description is already set: ${JSON.stringify(P)}`);else if(se.type==="offer"){yield z.setRemoteDescription(se);const ge=yield z.createAnswer();yield z.setLocalDescription(ge),yield ie({payload:JSON.stringify({description:ge})})}else se.type==="answer"&&(yield z.setRemoteDescription(se));else h.a.warn(`Received SDP signal when signaling is stable and connected: ${JSON.stringify(P)}`);else h.a.warn(`Received non-SDP signal: ${JSON.stringify(P)}`)})}send(P,z){const J=this.getChannelFromLabel(z.channelLabel);J?this.sendOnChannel(J,P):h.a.warn("Send called with unexpected channel label",{channelLabel:z.channelLabel})}controlRemoteStream(P){this.sendSystemMessage(ne(this.reliableStreamChannel),{type:"stream-control",streamControl:P})}isActive(){return new Set(["new","connecting","connected"]).has(this.peerConnection.connectionState)}isReady(){const{peerConnection:P,latestTtlStreamChannel:z,reliableStreamChannel:J,latestTryOnceStreamChannel:ie}=this;return!!(J&&z&&ie)&&P.connectionState==="connected"&&J.readyState==="open"&&z.readyState==="open"&&ie.readyState==="open"}isClosed(){const{peerConnection:P,reliableStreamChannel:z,latestTryOnceStreamChannel:J,latestTtlStreamChannel:ie}=this;return!(P.connectionState!=="closed"||z!==void 0&&z.readyState!=="closed"||J!==void 0&&J.readyState!=="closed"||ie!==void 0&&ie.readyState!=="closed")}needsClosing(){const{peerConnection:P,latestTtlStreamChannel:z,reliableStreamChannel:J,latestTryOnceStreamChannel:ie}=this;if(this.isClosed())return!1;const se=new Set(["closing","closed"]),ge=me=>me&&se.has(me.readyState);return ut(P)||ge(z)||ge(J)||ge(ie)}close(){return rt(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield this.sessionMetrics.uploadMetrics(),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.connectTimeout&&clearTimeout(this.connectTimeout),this.gatherIceTimeout&&clearTimeout(this.gatherIceTimeout),this.peerConnection.close())})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionId(){return this.config.sessionId}getRemotePeer(){return this.config.remotePeer}initializeChannels(P){this.latestTtlStreamChannel=P.createDataChannel("stream.latest-ttl",re),this.reliableStreamChannel=P.createDataChannel("stream.reliable",oe),this.latestReliableStreamChannel=P.createDataChannel("stream.latest-reliable",ue),this.latestTryOnceStreamChannel=P.createDataChannel("stream.latest-try-once",ve),this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}sendOffer(){return rt(this,void 0,void 0,function*(){if(this.sentOffer||(this.sentOffer=!0,ut(this.peerConnection)))return;const{peerConnection:P,config:{sendSignal:z}}=this,J=yield P.createOffer();yield P.setLocalDescription(J);const ie={payload:JSON.stringify({description:J})};yield z(ie)})}getChannelFromLabel(P){switch(P){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(P,z){let J;try{J=Object(Y.encode)(JSON.stringify(z))}catch(ie){return void h.a.warn("Failed to encode RTC message",{error:ie})}try{P.send(J),this.sessionMetrics.incrementMessageSent(z)}catch(ie){h.a.warn("Failed to send message to channel",{error:ie,channel:P.label})}}channelNotRecognized(P){return P!==this.latestTtlStreamChannel&&P!==this.latestReliableStreamChannel&&P!==this.latestTryOnceStreamChannel&&P!==this.reliableStreamChannel}setupChannel(P){P.onmessage=z=>{if(this.channelNotRecognized(P))return void h.a.warn("Received message on unrecognized data channel.");let J;try{J=JSON.parse(Object(Y.decode)(z.data))}catch(ie){return void h.a.warn("Received unparseable RTC message",{error:ie,channel:P.label})}if(this.lastMessageTimestamp=new Date().getTime(),J=Tt(J),this.sessionMetrics.incrementMessageReceived(J),!this.handleSystemMessage(P,J)){if(!this.hasCapabilities(J))return void h.a.warn("Received RTC message that was not within the capability scope of the connection.");(P===this.latestTryOnceStreamChannel||P===this.latestTtlStreamChannel||P===this.latestReliableStreamChannel)&&!this.isLatestMessage(J)||this.config.receive(this.config.remotePeer.id,J)}},P.onerror=z=>{h.a.warn(`Channel error: ${z.error}`,{error:z.error,sessionId:this.getSessionId(),channelLabel:P.label})},P.onopen=()=>{h.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:P.label})},P.onclose=()=>{const z={bufferedAmount:P.bufferedAmount,sessionId:this.getSessionId(),channelLabel:P.label};this.closeCalled===!1?h.a.debug("Unexpected channel closed",z):h.a.debug("Channel closed",z)}}handleSystemMessage(P,z){switch(z.header.stream.streamType){case"ping":return this.sendSystemMessage(P,{type:"pong",timestamp:ne(z.payload.ping)}),!0;case"pong":{const J=new Date().getTime()-ne(z.payload.pong);return this.pingTimeMs=J,y.aggregate("rtc-ping-time",J),!0}case"stream-control":return!0;default:return!1}}sendSystemMessage(P,z){if(P.readyState!=="open")return;const J={entityId:ne(this.config.localPeer.deviceId||this.config.localPeer.userId),streamName:`$.${z.type}`,streamType:z.type};let ie;switch(z.type){case"ping":ie={ping:new Date().getTime()};break;case"pong":ie={pong:z.timestamp};break;case"stream-control":ie={streamControl:z.streamControl}}this.sendOnChannel(P,nt(J,ie))}hasCapabilities(P){var z,J;const{localPeer:ie,remotePeer:se}=this.config,ge=(z=ie.capabilitySet.streaming)===null||z===void 0?void 0:z.streams,me=ge&&ge.some(le=>le.receive&&Rt(le.stream,P.header.stream)),ye=(J=se.capabilitySet.streaming)===null||J===void 0?void 0:J.streams,fe=ye&&ye.some(le=>le.send&&Rt(le.stream,P.header.stream));return me||fe}isLatestMessage(P){const z=Me(P.header.stream),J=(this.streamLatestTimestamp.get(z)||0)<=P.header.created;return J&&this.streamLatestTimestamp.set(z,P.header.created),J}}var Ue=function(be,P,z,J){return new(z||(z=Promise))(function(ie,se){function ge(fe){try{ye(J.next(fe))}catch(le){se(le)}}function me(fe){try{ye(J.throw(fe))}catch(le){se(le)}}function ye(fe){var le;fe.done?ie(fe.value):(le=fe.value,le instanceof z?le:new z(function(Ee){Ee(le)})).then(ge,me)}ye((J=J.apply(be,P||[])).next())})};class Ot{constructor(P){this.config=P,this.connections=[],this.connectingSessions=new Map,this.rtcInstancesConstructed=0,this.updateInterval=m({func:()=>Ue(this,void 0,void 0,function*(){try{yield this.update()}catch(z){h.a.warn("RTC update failed",{error:z})}}),delay:250*g.a.millisecond,immediate:!0}),this.localPeer=this.createPeer()}send(P,z,J){const ie=this.getActiveConnection(P);ie?ie.isReady()?ie.send(z,J):h.a.warn("Attempted to send with an active connection to that peer which was not yet ready."):h.a.warn("Attempted to send with no active connection to that peer.")}controlRemoteStream(P,z){const J=this.getActiveConnection(P);J?J.isReady()?J.controlRemoteStream(z):h.a.warn("Attempted to control remote stream with an active connection to that peer which was not yet ready."):h.a.warn("Attempted to control remote stream with no active connection to that peer.")}connect(P){return Ue(this,void 0,void 0,function*(){const z=yield this.getLocalPeer();if(this.getActiveConnection(P))return void h.a.warn("Attempted to connect to peer with an already active connection.");let J;try{J=yield this.config.signalingClient.createSession(yield this.config.getToken(),{offerPeerId:z.id,answerPeerId:P})}catch(ie){Object(pt.a)(ie,mt.a,se=>se.statusCode===404),h.a.warn("Attempted to connect to peer that does not exist.")}if(J)for(this.connectingSessions.set(J.id,new Date().getTime()),yield this.connectToSession(J);;)switch(yield Object(c.a)(.1),this.getConnectionStatus(P)){case"connecting":continue;case"connected":return J.id;case"disconnected":return}})}getConnectionStatus(P){const z=this.getActiveConnection(P);return z?z.isReady()?"connected":"connecting":"disconnected"}getIceMode(P){const z=this.getActiveConnection(P);if(z)return z.iceMode}disconnect(P){return Ue(this,void 0,void 0,function*(){const z=this.getActiveConnection(P);z&&(yield this.closeConnection(z))})}getLocalPeer(){return Ue(this,void 0,void 0,function*(){return yield this.localPeer})}getPeers(){return Ue(this,void 0,void 0,function*(){return yield this.config.signalingClient.getPeers(yield this.config.getToken())})}getPing(P){const z=this.getActiveConnection(P);if(z)return z.getPing();h.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(P){const z=this.getActiveConnection(P);if(z)return z.getLastMessageTimestamp();h.a.warn("Attempted to get ping time from inactive peer.")}shutdown(){return Ue(this,void 0,void 0,function*(){yield this.updateInterval.stop();const P=this.connections;this.connections=[],yield this.closeConnections(P)})}closeConnection(P){return Ue(this,void 0,void 0,function*(){this.connectingSessions.delete(P.getSessionId()),yield P.close();try{yield this.config.signalingClient.deleteSession(yield this.config.getToken(),P.getSessionId())}catch(z){Object(pt.a)(z,mt.a,J=>J.statusCode===404)}})}getSessions(){return Ue(this,void 0,void 0,function*(){const P=yield this.getLocalPeer();return(yield this.config.signalingClient.getSessions(yield this.config.getToken())).filter(z=>z.offer.peer.id===P.id||z.answer.peer.id===P.id)})}createPeer(){return Ue(this,void 0,void 0,function*(){return yield this.config.signalingClient.createPeer(yield this.config.getToken(),{capabilitySet:this.config.capabilitySet||{}})})}createRTCPeerConnection(P={}){return Ue(this,void 0,void 0,function*(){const z=this.config.alternateRTCPeerConnection||RTCPeerConnection;this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||kt();try{return new z(Object.assign({iceServers:yield this.config.signalingClient.getIceServers(yield this.config.getToken())},P))}catch(J){throw h.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),J}})}closeConnections(P){return Ue(this,void 0,void 0,function*(){const z=yield W(P.map(J=>Ue(this,void 0,void 0,function*(){yield this.closeConnection(J)})));for(const J of z)h.a.warn("Request to close session failed",{error:J})})}reset(){return Ue(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.connectingSessions=new Map,this.localPeer=this.createPeer(),yield this.localPeer})}getActiveConnection(P){return this.connections.find(z=>z.getRemotePeer().id===P&&z.isActive())}update(){return Ue(this,void 0,void 0,function*(){const P=yield this.getLocalPeer();try{yield this.config.signalingClient.refreshPeer(yield this.config.getToken(),P.id)}catch(z){Object(pt.a)(z,mt.a,J=>J.statusCode===404),h.a.warn("Peer expired, creating new peer",{peerId:P.id}),yield this.reset()}yield this.handleSessions(yield this.getSessions())})}handleSessions(P){return Ue(this,void 0,void 0,function*(){yield this.syncConnectionsAndSessions(P);const z=P.map(J=>({session:J,connection:this.connections.find(ie=>ie.getSessionId()===J.id)}));yield Promise.all(z.map(({session:J,connection:ie})=>Ue(this,void 0,void 0,function*(){return yield this.maintainConnection(J,ie)})))})}syncConnectionsAndSessions(P){return Ue(this,void 0,void 0,function*(){const z=new Set(P.map(se=>se.id)),J=se=>z.has(se.getSessionId())||this.connectingSessions.has(se.getSessionId());this.connections=this.connections.filter(se=>J(se));const ie=this.connections.filter(se=>!J(se)||se.needsClosing());yield Promise.all(ie.map(se=>Ue(this,void 0,void 0,function*(){yield this.closeConnection(se)})))})}maintainConnection(P,z){return Ue(this,void 0,void 0,function*(){const J=yield this.getLocalPeer(),ie=P.offer.peer.id===J.id;if(z){if(z.isReady())try{yield this.config.signalingClient.refreshSession(yield this.config.getToken(),P.id)}catch(se){Object(pt.a)(se,mt.a,ge=>ge.statusCode===404),h.a.debug("Refresh session not found",{sessionId:P.id})}else if(z.isActive())try{yield this.consumeSignals(z)}catch(se){h.a.warn("Failed to ingest signals, closing connection",{error:se}),yield this.closeConnection(z)}}else{if(ie)return;yield this.connectToSession(P)}})}connectToSession(P){return Ue(this,void 0,void 0,function*(){const z=yield this.getLocalPeer(),J=P.offer.peer.id===z.id,ie=yield this.createRTCPeerConnection(),se=new Nt(ie,{localPeer:J?P.offer.peer:P.answer.peer,remotePeer:J?P.answer.peer:P.offer.peer,sessionId:P.id,isOffer:J,sendSignal:ge=>this.sendSignal(P.id,ge),receive:(ge,me)=>this.config.receive(ge,me)});if(this.connections.find(ge=>ge.getSessionId()===P.id))return h.a.warn("connectToSession called on a session that already has a connection.",{sessionId:P.id}),void(yield se.close());this.setupHandlers(se),this.connections.push(se);try{yield se.connect()}catch(ge){h.a.warn("Failed to handle negotiation, closing connection",{error:ge}),yield this.closeConnection(se)}})}setupHandlers(P){const{peerConnection:z}=P,J=P.getSessionId();z.onconnectionstatechange=()=>Ue(this,void 0,void 0,function*(){const ie=this.connectingSessions.get(J);if(ie===void 0)return;const se=z.connectionState;switch(ut(z)&&this.connectingSessions.delete(J),se){case"connected":{this.connectingSessions.delete(J);const ge=new Date().getTime()-ie;y.aggregate("rtc-connect-time",ge);break}case"failed":y.increment("rtc-connect-failed"),yield this.closeConnection(P)}})}consumeSignals(P){return Ue(this,void 0,void 0,function*(){let z=[];try{z=yield this.config.signalingClient.takeSignals(yield this.config.getToken(),P.getSessionId())}catch(J){Object(pt.a)(J,mt.a,ie=>ie.statusCode===404)}for(const J of z)yield P.handleSignal(J)})}sendSignal(P,z){return Ue(this,void 0,void 0,function*(){try{yield this.config.signalingClient.addSignals(yield this.config.getToken(),P,{signals:[z]})}catch(J){Object(pt.a)(J,mt.a,ie=>ie.statusCode===404)}})}}},function(e,t,n){var r={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const l=new Uint8Array(16);function u(){if(!o&&(o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(l)}const s=[];for(let c=0;c<256;++c)s.push((c+256).toString(16).slice(1));function g(c,f=0){return(s[c[f+0]]+s[c[f+1]]+s[c[f+2]]+s[c[f+3]]+"-"+s[c[f+4]]+s[c[f+5]]+"-"+s[c[f+6]]+s[c[f+7]]+"-"+s[c[f+8]]+s[c[f+9]]+"-"+s[c[f+10]]+s[c[f+11]]+s[c[f+12]]+s[c[f+13]]+s[c[f+14]]+s[c[f+15]]).toLowerCase()}t.a=function(c,f,T){if(r.randomUUID&&!f&&!c)return r.randomUUID();const v=(c=c||{}).random||(c.rng||u)();if(v[6]=15&v[6]|64,v[8]=63&v[8]|128,f){T=T||0;for(let p=0;p<16;++p)f[T+p]=v[p];return f}return g(v)}},,function(e,t,n){n.r(t),n.d(t,"LogClient",function(){return s});var r=n(28),o=n(11),l=n(10),u=function(g,c,f,T){return new(f||(f=Promise))(function(v,p){function d(I){try{S(T.next(I))}catch(L){p(L)}}function h(I){try{S(T.throw(I))}catch(L){p(L)}}function S(I){var L;I.done?v(I.value):(L=I.value,L instanceof f?L:new f(function(O){O(L)})).then(d,h)}S((T=T.apply(g,c||[])).next())})};class s extends r.a{log(c){return u(this,void 0,void 0,function*(){const f=s.token;try{yield this.fetch("logs",{token:f,method:"POST",body:{logs:c},allowUnsafeRetries:!0})}catch(T){Object(o.a)(T,l.a,v=>v.statusCode===401&&f!==void 0),s.token===f&&delete s.token,yield this.log(c)}})}}}])})})(dist);var distExports=dist.exports;const SessionTypes={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3},SessionTypeConstants={...SessionTypes,Unknown:SessionTypes.UNKNOWN,Teleop:SessionTypes.TELEOP,PortForward:SessionTypes.PORT_FORWARD,Observe:SessionTypes.OBSERVE,unknown:SessionTypes.UNKNOWN,teleop:SessionTypes.TELEOP,portForward:SessionTypes.PORT_FORWARD,observe:SessionTypes.OBSERVE},singleton=Symbol("RtcClientPool.instance");class RtcClientPool{constructor(t){_e(this,et,null);_e(this,"createClient");_e(this,"ttlMs");_e(this,"proxyHandler");_e(this,"proxyReceivers",new Map);_e(this,"teardownTimeout",null);_e(this,"dispatch",(t,n)=>{this.proxyReceivers.forEach(r=>r==null?void 0:r(t,n))});const{createClient:n,ttlMs:r=0}=t;this.createClient=n,this.ttlMs=Math.max(r,0),this.proxyHandler={get:(o,l,u)=>{switch(l){case"shutdown":return()=>this.releaseInstance(u);default:return Reflect.get(o,l,u)}}}}get isActive(){return this[singleton]!==null}get size(){return this.proxyReceivers.size}get(t){const n=new Proxy(this.allocate(),this.proxyHandler);return this.proxyReceivers.set(n,t??null),n}allocate(){if(this[singleton])return this.teardownTimeout&&(clearTimeout(this.teardownTimeout),this.teardownTimeout=null),this[singleton];const t=this.createClient(this.dispatch);return this[singleton]=t,t}async teardown(){const t=this[singleton];if(!t){console.warn("singleton has already been shutdown!");return}try{await t.shutdown()}finally{this[singleton]=null}}async releaseInstance(t){return this.proxyReceivers.delete(t)?this.proxyReceivers.size!==0?!1:(!this.teardownTimeout&&Number.isFinite(this.ttlMs)&&(this.ttlMs===0?await this.teardown():this.teardownTimeout=setTimeout(()=>{this.teardown().catch(n=>console.error("teardown failed",{err:n})).finally(()=>this.teardownTimeout=null)},this.ttlMs)),!0):(console.warn("this instance has already been released!"),!1)}}et=singleton;const getToken=async()=>defined(Authentication.token,"Realtime when user isn't authorized"),EnumRtcClientPools={[SessionTypes.UNKNOWN]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.UNKNOWN,receive:e})}),[SessionTypes.TELEOP]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.TELEOP,receive:e})}),[SessionTypes.PORT_FORWARD]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.PORT_FORWARD,receive:e})}),[SessionTypes.OBSERVE]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.OBSERVE,receive:e})})},AppRtcClientPools={...EnumRtcClientPools,unknown:EnumRtcClientPools[SessionTypes.UNKNOWN],teleop:EnumRtcClientPools[SessionTypes.TELEOP],portForward:EnumRtcClientPools[SessionTypes.PORT_FORWARD],observe:EnumRtcClientPools[SessionTypes.OBSERVE]},defaultRtcClientPool=EnumRtcClientPools[SessionTypes.TELEOP],getRtcClientPool=e=>{const{sessionType:t}=e;return t?AppRtcClientPools[t]:defaultRtcClientPool};class CaptureStream{constructor(t){_e(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=r.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}function delay(e){return new Promise(t=>setTimeout(t,e))}const isRtcPeer=e=>e!==void 0&&e.capabilities!==void 0&&e.capabilitySet!==void 0;class DataChannel{constructor(t){_e(this,"ready",!1);_e(this,"listeners",[]);_e(this,"openListeners",[]);_e(this,"closeListeners",[]);_e(this,"errorListeners",[]);_e(this,"binaryListeners",[]);_e(this,"error");_e(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.setReady()},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(n=>n())},this.dataChannel.onerror=n=>{console.error(n),this.error="An error occurred in DataChannel",this.errorListeners.forEach(r=>r(n))},this.dataChannel.onmessage=n=>{this.listeners.forEach(r=>{const o=new Uint8Array(n.data),l=this.decoder.decode(o);r(l)}),this.binaryListeners.forEach(r=>{r(new Uint8Array(n.data))})}}setReady(){this.ready=!0,this.openListeners.forEach(t=>t())}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(n=>n!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(n=>n!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(n=>n!==t)}async waitTilReady(){return this.ready?!0:new Promise((n,r)=>{let o=setInterval(()=>{this.dataChannel.readyState==="open"&&this.setReady(),this.ready&&(clearInterval(o),n(!0)),this.error&&r(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(n,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const n=this.binaryListeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(n,1)}}var eventemitter3={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(g,c,f){this.fn=g,this.context=c,this.once=f||!1}function l(g,c,f,T,v){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new o(f,T||g,v),d=n?n+c:c;return g._events[d]?g._events[d].fn?g._events[d]=[g._events[d],p]:g._events[d].push(p):(g._events[d]=p,g._eventsCount++),g}function u(g,c){--g._eventsCount===0?g._events=new r:delete g._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],f,T;if(this._eventsCount===0)return c;for(T in f=this._events)t.call(f,T)&&c.push(n?T.slice(1):T);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(f)):c},s.prototype.listeners=function(c){var f=n?n+c:c,T=this._events[f];if(!T)return[];if(T.fn)return[T.fn];for(var v=0,p=T.length,d=new Array(p);v<p;v++)d[v]=T[v].fn;return d},s.prototype.listenerCount=function(c){var f=n?n+c:c,T=this._events[f];return T?T.fn?1:T.length:0},s.prototype.emit=function(c,f,T,v,p,d){var h=n?n+c:c;if(!this._events[h])return!1;var S=this._events[h],I=arguments.length,L,O;if(S.fn){switch(S.once&&this.removeListener(c,S.fn,void 0,!0),I){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,f),!0;case 3:return S.fn.call(S.context,f,T),!0;case 4:return S.fn.call(S.context,f,T,v),!0;case 5:return S.fn.call(S.context,f,T,v,p),!0;case 6:return S.fn.call(S.context,f,T,v,p,d),!0}for(O=1,L=new Array(I-1);O<I;O++)L[O-1]=arguments[O];S.fn.apply(S.context,L)}else{var R=S.length,m;for(O=0;O<R;O++)switch(S[O].once&&this.removeListener(c,S[O].fn,void 0,!0),I){case 1:S[O].fn.call(S[O].context);break;case 2:S[O].fn.call(S[O].context,f);break;case 3:S[O].fn.call(S[O].context,f,T);break;case 4:S[O].fn.call(S[O].context,f,T,v);break;default:if(!L)for(m=1,L=new Array(I-1);m<I;m++)L[m-1]=arguments[m];S[O].fn.apply(S[O].context,L)}}return!0},s.prototype.on=function(c,f,T){return l(this,c,f,T,!1)},s.prototype.once=function(c,f,T){return l(this,c,f,T,!0)},s.prototype.removeListener=function(c,f,T,v){var p=n?n+c:c;if(!this._events[p])return this;if(!f)return u(this,p),this;var d=this._events[p];if(d.fn)d.fn===f&&(!v||d.once)&&(!T||d.context===T)&&u(this,p);else{for(var h=0,S=[],I=d.length;h<I;h++)(d[h].fn!==f||v&&!d[h].once||T&&d[h].context!==T)&&S.push(d[h]);S.length?this._events[p]=S.length===1?S[0]:S:u(this,p)}return this},s.prototype.removeAllListeners=function(c){var f;return c?(f=n?n+c:c,this._events[f]&&u(this,f)):(this._events=new r,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})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class Manipulator{constructor(t,n){_e(this,"currentListeners",[]);_e(this,"onRealtimeMessage",(t,n)=>{n.payload.jointState&&this.currentListeners.forEach(r=>{n.payload.jointState&&r(n.payload.jointState)})});this.device=t,this.config=n}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,n,r){_e(this,"channel");_e(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=n,this.timeout=r}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);_e(this,"RESPONSE_SUCCESS_BYTE",0);_e(this,"decoder",new TextDecoder)}generateBinaryId(){const n=new Uint8Array(16);for(let r=0;r<n.length;r++)n[r]=Math.floor(Math.random()*256);return n}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(n=>{const o=n.slice(0,16).toString();if(o.length===0)throw new Error("Invalid response");const l=n.slice(16);if(l.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(o)&&this.requestIdToResponseMap.set(o,l)})}async request(n){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:o,timeout:l}=this;await r.waitTilReady();const u=this.generateBinaryId(),s=u.toString();o.set(s,!0),r.sendBinary(new Uint8Array([...u,...n]));const g=new Date().getTime();for(;new Date().getTime()<g+l;)if(await delay(50),o.has(s)){const c=o.get(s);if(c!==!0){o.delete(s);const f=c[0]===this.RESPONSE_SUCCESS_BYTE,T=c.slice(1);if(f)return T;throw console.error({name:"AdapterError",message:this.decoder.decode(T)}),new Error("Binary request datachannel adapter error")}}throw o.delete(s),console.error({name:"TimeoutError",message:`Request timed out after ${l/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const n=JSON.parse(t),{id:r,data:o,error:l}=n;if(!r)throw new Error("Invalid response");if(!o&&!l)throw new Error("Invalid response");this.requestIdToResponseMap.has(r)&&this.requestIdToResponseMap.set(r,n)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:r,timeout:o}=this;await n.waitTilReady();const l=this.generateTextId();r.set(l,!0),n.send(JSON.stringify({id:l,data:t}));const u=new Date().getTime();for(;new Date().getTime()<u+o;)if(await delay(50),r.has(l)){const s=r.get(l);if(s!==!0){r.delete(l);const{data:g,error:c}=s;if(g)return g;if(c)throw console.error({name:"AdapterError",message:c}),new Error("Text request datachannel adapter error")}}throw r.delete(l),console.error({name:"TimeoutError",message:`Request timed out after ${o/1e3} seconds`}),new Error("Text request datachannel request timed out")}}class BaseDevice extends EventEmitter{constructor(){super(...arguments);_e(this,"rtcClient");_e(this,"remoteDevicePeerId",null);_e(this,"realtimeListeners",[]);_e(this,"connectionMonitorInterval");_e(this,"handleMessage",(n,r)=>{this.realtimeListeners.forEach(o=>o(n,r))})}stopConnectionMonitoring(){clearInterval(this.connectionMonitorInterval),this.connectionMonitorInterval=void 0}assertNotCancelled(n){if(n)throw new Error("Cancelled by deadline")}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}addRealtimeListener(n){this.realtimeListeners.push(n)}removeRealtimeListener(n){const r=this.realtimeListeners.indexOf(n);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeManipulators(){const n=await this.getConfiguration(),r=[];for(const o of n.teleop.rosStreams??[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async getRealtimeVideoStreams(){var o,l,u;const n=await this.getConfiguration(),r=[];for(const s of((o=n.teleop)==null?void 0:o.hardwareStreams)??[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of((l=n.teleop)==null?void 0:l.rosStreams)??[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName}),(s.topicType==="sensor_msgs/Image"||s.topicType==="sensor_msgs/CompressedImage")&&s.encodeVideo&&r.push({name:s.topicName});for(const s of((u=n.teleop)==null?void 0:u.customStreams)??[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}createCustomRequestDataChannel(n,r=3e3){return new TextRequestDataChannel(this,n,r)}createCustomBinaryRequestDataChannel(n,r=3e3){return new BinaryRequestDataChannel(this,n,r)}async startListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n,enablePriorityUpload:!1,pipeline:"telemetry"})}async changeStreamAudioType(n,r){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer();o.controlRemoteStream(defined(l).id,{streamName:n,setAudioFormat:r})}async createCustomDataChannel(n,r){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer(),u=await new Promise(s=>{o.createCustomDataChannel(defined(l).id,n,{ordered:!0,...r},!1,(g,c)=>{const f=new DataChannel(c);s(f)})});return await u.waitTilReady(),u}async sendRealtimeMessage(n,r={channelLabel:"stream.reliable"}){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer();o.send(defined(l).id,n,r)}async getRealtimeAudioStreams(){var o,l,u;const n=await this.getConfiguration(),r=[];for(const s of((o=n.teleop)==null?void 0:o.hardwareStreams)??[])s.rtcStreamType==="audio-chunk"&&r.push({name:s.name});for(const s of((l=n.teleop)==null?void 0:l.rosStreams)??[])s.topicType=="audio_common_msgs/AudioData"&&r.push({name:s.topicName});for(const s of((u=n.teleop)==null?void 0:u.customStreams)??[])s.rtcStreamType==="audio-chunk"&&r.push({name:s.name});return r}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(e){let t=e.length;for(;--t>=0;)e[t]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const d_code=e=>e<256?_dist_code[e]:_dist_code[256+(e>>>7)],put_short=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},send_bits=(e,t,n)=>{e.bi_valid>Buf_size-n?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>Buf_size-e.bi_valid,e.bi_valid+=n-Buf_size):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},send_code=(e,t,n)=>{send_bits(e,n[t*2],n[t*2+1])},bi_reverse=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},bi_flush=e=>{e.bi_valid===16?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},gen_bitlen=(e,t)=>{const n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,l=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,g=t.stat_desc.max_length;let c,f,T,v,p,d,h=0;for(v=0;v<=MAX_BITS$1;v++)e.bl_count[v]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<HEAP_SIZE$1;c++)f=e.heap[c],v=n[n[f*2+1]*2+1]+1,v>g&&(v=g,h++),n[f*2+1]=v,!(f>r)&&(e.bl_count[v]++,p=0,f>=s&&(p=u[f-s]),d=n[f*2],e.opt_len+=d*(v+p),l&&(e.static_len+=d*(o[f*2+1]+p)));if(h!==0){do{for(v=g-1;e.bl_count[v]===0;)v--;e.bl_count[v]--,e.bl_count[v+1]+=2,e.bl_count[g]--,h-=2}while(h>0);for(v=g;v!==0;v--)for(f=e.bl_count[v];f!==0;)T=e.heap[--c],!(T>r)&&(n[T*2+1]!==v&&(e.opt_len+=(v-n[T*2+1])*n[T*2],n[T*2+1]=v),f--)}},gen_codes=(e,t,n)=>{const r=new Array(MAX_BITS$1+1);let o=0,l,u;for(l=1;l<=MAX_BITS$1;l++)o=o+n[l-1]<<1,r[l]=o;for(u=0;u<=t;u++){let s=e[u*2+1];s!==0&&(e[u*2]=bi_reverse(r[s]++,s))}},tr_static_init=()=>{let e,t,n,r,o;const l=new Array(MAX_BITS$1+1);for(n=0,r=0;r<LENGTH_CODES$1-1;r++)for(base_length[r]=n,e=0;e<1<<extra_lbits[r];e++)_length_code[n++]=r;for(_length_code[n-1]=r,o=0,r=0;r<16;r++)for(base_dist[r]=o,e=0;e<1<<extra_dbits[r];e++)_dist_code[o++]=r;for(o>>=7;r<D_CODES$1;r++)for(base_dist[r]=o<<7,e=0;e<1<<extra_dbits[r]-7;e++)_dist_code[256+o++]=r;for(t=0;t<=MAX_BITS$1;t++)l[t]=0;for(e=0;e<=143;)static_ltree[e*2+1]=8,e++,l[8]++;for(;e<=255;)static_ltree[e*2+1]=9,e++,l[9]++;for(;e<=279;)static_ltree[e*2+1]=7,e++,l[7]++;for(;e<=287;)static_ltree[e*2+1]=8,e++,l[8]++;for(gen_codes(static_ltree,L_CODES$1+1,l),e=0;e<D_CODES$1;e++)static_dtree[e*2+1]=5,static_dtree[e*2]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=e=>{let t;for(t=0;t<L_CODES$1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<D_CODES$1;t++)e.dyn_dtree[t*2]=0;for(t=0;t<BL_CODES$1;t++)e.bl_tree[t*2]=0;e.dyn_ltree[END_BLOCK*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},bi_windup=e=>{e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},smaller=(e,t,n,r)=>{const o=t*2,l=n*2;return e[o]<e[l]||e[o]===e[l]&&r[t]<=r[n]},pqdownheap=(e,t,n)=>{const r=e.heap[n];let o=n<<1;for(;o<=e.heap_len&&(o<e.heap_len&&smaller(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!smaller(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r},compress_block=(e,t,n)=>{let r,o,l=0,u,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+l++]&255,r+=(e.pending_buf[e.sym_buf+l++]&255)<<8,o=e.pending_buf[e.sym_buf+l++],r===0?send_code(e,o,t):(u=_length_code[o],send_code(e,u+LITERALS$1+1,t),s=extra_lbits[u],s!==0&&(o-=base_length[u],send_bits(e,o,s)),r--,u=d_code(r),send_code(e,u,n),s=extra_dbits[u],s!==0&&(r-=base_dist[u],send_bits(e,r,s)));while(l<e.sym_next);send_code(e,END_BLOCK,t)},build_tree=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems;let u,s,g=-1,c;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,u=0;u<l;u++)n[u*2]!==0?(e.heap[++e.heap_len]=g=u,e.depth[u]=0):n[u*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=g<2?++g:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=r[c*2+1]);for(t.max_code=g,u=e.heap_len>>1;u>=1;u--)pqdownheap(e,n,u);c=l;do u=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=u,e.heap[--e.heap_max]=s,n[c*2]=n[u*2]+n[s*2],e.depth[c]=(e.depth[u]>=e.depth[s]?e.depth[u]:e.depth[s])+1,n[u*2+1]=n[s*2+1]=c,e.heap[1]=c++,pqdownheap(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,t),gen_codes(n,g,e.bl_count)},scan_tree=(e,t,n)=>{let r,o=-1,l,u=t[0*2+1],s=0,g=7,c=4;for(u===0&&(g=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)l=u,u=t[(r+1)*2+1],!(++s<g&&l===u)&&(s<c?e.bl_tree[l*2]+=s:l!==0?(l!==o&&e.bl_tree[l*2]++,e.bl_tree[REP_3_6*2]++):s<=10?e.bl_tree[REPZ_3_10*2]++:e.bl_tree[REPZ_11_138*2]++,s=0,o=l,u===0?(g=138,c=3):l===u?(g=6,c=3):(g=7,c=4))},send_tree=(e,t,n)=>{let r,o=-1,l,u=t[0*2+1],s=0,g=7,c=4;for(u===0&&(g=138,c=3),r=0;r<=n;r++)if(l=u,u=t[(r+1)*2+1],!(++s<g&&l===u)){if(s<c)do send_code(e,l,e.bl_tree);while(--s!==0);else l!==0?(l!==o&&(send_code(e,l,e.bl_tree),s--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,s-3,2)):s<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,s-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,s-11,7));s=0,o=l,u===0?(g=138,c=3):l===u?(g=6,c=3):(g=7,c=4)}},build_bl_tree=e=>{let t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=BL_CODES$1-1;t>=3&&e.bl_tree[bl_order[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},send_all_trees=(e,t,n,r)=>{let o;for(send_bits(e,t-257,5),send_bits(e,n-1,5),send_bits(e,r-4,4),o=0;o<r;o++)send_bits(e,e.bl_tree[bl_order[o]*2+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,n-1)},detect_data_type=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Z_BINARY;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Z_TEXT;for(n=32;n<LITERALS$1;n++)if(e.dyn_ltree[n*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=e=>{static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)},_tr_stored_block$1=(e,t,n,r)=>{send_bits(e,(STORED_BLOCK<<1)+(r?1:0),3),bi_windup(e),put_short(e,n),put_short(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},_tr_align$1=e=>{send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)},_tr_flush_block$1=(e,t,n,r)=>{let o,l,u=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$1&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),u=build_bl_tree(e),o=e.opt_len+3+7>>>3,l=e.static_len+3+7>>>3,l<=o&&(o=l)):o=l=n+5,n+4<=o&&t!==-1?_tr_stored_block$1(e,t,n,r):e.strategy===Z_FIXED$1||l===o?(send_bits(e,(STATIC_TREES<<1)+(r?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(r?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),r&&bi_windup(e)},_tr_tally$1=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(_length_code[n]+LITERALS$1+1)*2]++,e.dyn_dtree[d_code(t)*2]++),e.sym_next===e.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(e,t,n,r)=>{let o=e&65535|0,l=e>>>16&65535|0,u=0;for(;n!==0;){u=n>2e3?2e3:n,n-=u;do o=o+t[r++]|0,l=l+o|0;while(--u);o%=65521,l%=65521}return o|l<<16|0};var adler32_1=adler32;const makeTable=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},crcTable=new Uint32Array(makeTable()),crc32=(e,t,n,r)=>{const o=crcTable,l=r+n;e^=-1;for(let u=r;u<l;u++)e=e>>>8^o[(e^t[u])&255];return e^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(e,t)=>(e.msg=messages[t],t),rank=e=>e*2-(e>4?9:0),zero=e=>{let t=e.length;for(;--t>=0;)e[t]=0},slide_hash=e=>{let t,n,r,o=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=o?n-o:0;while(--t);t=o,r=t;do n=e.prev[--r],e.prev[r]=n>=o?n-o:0;while(--t)};let HASH_ZLIB=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,HASH=HASH_ZLIB;const flush_pending=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},flush_block_only=(e,t)=>{_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)},put_byte=(e,t)=>{e.pending_buf[e.pending++]=t},putShortMSB=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},read_buf=(e,t,n,r)=>{let o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),n),e.state.wrap===1?e.adler=adler32_1(e.adler,t,o,n):e.state.wrap===2&&(e.adler=crc32_1(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)},longest_match=(e,t)=>{let n=e.max_chain_length,r=e.strstart,o,l,u=e.prev_length,s=e.nice_match;const g=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,c=e.window,f=e.w_mask,T=e.prev,v=e.strstart+MAX_MATCH;let p=c[r+u-1],d=c[r+u];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+u]!==d||c[o+u-1]!==p||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&r<v);if(l=MAX_MATCH-(v-r),r=v-MAX_MATCH,l>u){if(e.match_start=t,u=l,l>=s)break;p=c[r+u-1],d=c[r+u]}}while((t=T[t&f])>g&&--n!==0);return u<=e.lookahead?u:e.lookahead},fill_window=e=>{const t=e.w_size;let n,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-MIN_LOOKAHEAD)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),slide_hash(e),r+=t),e.strm.avail_in===0)break;if(n=read_buf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=MIN_MATCH)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=HASH(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=HASH(e,e.ins_h,e.window[o+MIN_MATCH-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&e.strm.avail_in!==0)},deflate_stored=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,o,l,u=0,s=e.strm.avail_in;do{if(r=65535,l=e.bi_valid+42>>3,e.strm.avail_out<l||(l=e.strm.avail_out-l,o=e.strstart-e.block_start,r>o+e.strm.avail_in&&(r=o+e.strm.avail_in),r>l&&(r=l),r<n&&(r===0&&t!==Z_FINISH$3||t===Z_NO_FLUSH$2||r!==o+e.strm.avail_in)))break;u=t===Z_FINISH$3&&r===o+e.strm.avail_in?1:0,_tr_stored_block(e,0,0,u),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,flush_pending(e.strm),o&&(o>r&&(o=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+o),e.strm.next_out),e.strm.next_out+=o,e.strm.avail_out-=o,e.strm.total_out+=o,e.block_start+=o,r-=o),r&&(read_buf(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(u===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),u?BS_FINISH_DONE:t!==Z_NO_FLUSH$2&&t!==Z_FINISH$3&&e.strm.avail_in===0&&e.strstart===e.block_start?BS_BLOCK_DONE:(l=e.window_size-e.strstart,e.strm.avail_in>l&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,l+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),l>e.strm.avail_in&&(l=e.strm.avail_in),l&&(read_buf(e.strm,e.window,e.strstart,l),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.high_water<e.strstart&&(e.high_water=e.strstart),l=e.bi_valid+42>>3,l=e.pending_buf_size-l>65535?65535:e.pending_buf_size-l,n=l>e.w_size?e.w_size:l,o=e.strstart-e.block_start,(o>=n||(o||t===Z_FINISH$3)&&t!==Z_NO_FLUSH$2&&e.strm.avail_in===0&&o<=l)&&(r=o>l?l:o,u=t===Z_FINISH$3&&e.strm.avail_in===0&&r===o?1:0,_tr_stored_block(e,e.block_start,r,u),e.block_start+=r,flush_pending(e.strm)),u?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(e,t)=>{let n,r;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n)),e.match_length>=MIN_MATCH)if(r=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do e.strstart++,e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+1]);else r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(e,t)=>{let n,r,o;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n),e.match_length<=5&&(e.strategy===Z_FILTERED||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-MIN_MATCH,r=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}else if(e.match_available){if(r=_tr_tally(e,0,e.window[e.strstart-1]),r&&flush_block_only(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(e,t)=>{let n,r,o,l;const u=e.window;for(;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(o=e.strstart-1,r=u[o],r===u[++o]&&r===u[++o]&&r===u[++o])){l=e.strstart+MAX_MATCH;do;while(r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&o<l);e.match_length=MAX_MATCH-(l-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(n=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(fill_window(e),e.lookahead===0)){if(t===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(e.match_length=0,n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=e=>{e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==INIT_STATE&&t.status!==GZIP_STATE&&t.status!==EXTRA_STATE&&t.status!==NAME_STATE&&t.status!==COMMENT_STATE&&t.status!==HCRC_STATE&&t.status!==BUSY_STATE&&t.status!==FINISH_STATE?1:0},deflateResetKeep=e=>{if(deflateStateCheck(e))return err(e,Z_STREAM_ERROR$2);e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?GZIP_STATE:t.wrap?INIT_STATE:BUSY_STATE,e.adler=t.wrap===2?0:1,t.last_flush=-2,_tr_init(t),Z_OK$3},deflateReset=e=>{const t=deflateResetKeep(e);return t===Z_OK$3&&lm_init(e.state),t},deflateSetHeader=(e,t)=>deflateStateCheck(e)||e.state.wrap!==2?Z_STREAM_ERROR$2:(e.state.gzhead=t,Z_OK$3),deflateInit2=(e,t,n,r,o,l)=>{if(!e)return Z_STREAM_ERROR$2;let u=1;if(t===Z_DEFAULT_COMPRESSION$1&&(t=6),r<0?(u=0,r=-r):r>15&&(u=2,r-=16),o<1||o>MAX_MEM_LEVEL||n!==Z_DEFLATED$2||r<8||r>15||t<0||t>9||l<0||l>Z_FIXED||r===8&&u!==1)return err(e,Z_STREAM_ERROR$2);r===8&&(r=9);const s=new DeflateState;return e.state=s,s.strm=e,s.status=INIT_STATE,s.wrap=u,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+MIN_MATCH-1)/MIN_MATCH),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=l,s.method=n,deflateReset(e)},deflateInit=(e,t)=>deflateInit2(e,t,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(e,t)=>{if(deflateStateCheck(e)||t>Z_BLOCK$1||t<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===FINISH_STATE&&t!==Z_FINISH$3)return err(e,e.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(flush_pending(e),e.avail_out===0)return n.last_flush=-1,Z_OK$3}else if(e.avail_in===0&&rank(t)<=rank(r)&&t!==Z_FINISH$3)return err(e,Z_BUF_ERROR$1);if(n.status===FINISH_STATE&&e.avail_in!==0)return err(e,Z_BUF_ERROR$1);if(n.status===INIT_STATE&&n.wrap===0&&(n.status=BUSY_STATE),n.status===INIT_STATE){let o=Z_DEFLATED$2+(n.w_bits-8<<4)<<8,l=-1;if(n.strategy>=Z_HUFFMAN_ONLY||n.level<2?l=0:n.level<6?l=1:n.level===6?l=2:l=3,o|=l<<6,n.strstart!==0&&(o|=PRESET_DICT),o+=31-o%31,putShortMSB(n,o),n.strstart!==0&&(putShortMSB(n,e.adler>>>16),putShortMSB(n,e.adler&65535)),e.adler=1,n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(n.status===GZIP_STATE){if(e.adler=0,put_byte(n,31),put_byte(n,139),put_byte(n,8),n.gzhead)put_byte(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),put_byte(n,n.gzhead.time&255),put_byte(n,n.gzhead.time>>8&255),put_byte(n,n.gzhead.time>>16&255),put_byte(n,n.gzhead.time>>24&255),put_byte(n,n.level===9?2:n.strategy>=Z_HUFFMAN_ONLY||n.level<2?4:0),put_byte(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(put_byte(n,n.gzhead.extra.length&255),put_byte(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=EXTRA_STATE;else if(put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,n.level===9?2:n.strategy>=Z_HUFFMAN_ONLY||n.level<2?4:0),put_byte(n,OS_CODE),n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(n.status===EXTRA_STATE){if(n.gzhead.extra){let o=n.pending,l=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+l>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex+=s,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0,l-=s}let u=new Uint8Array(n.gzhead.extra);n.pending_buf.set(u.subarray(n.gzindex,n.gzindex+l),n.pending),n.pending+=l,n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=NAME_STATE}if(n.status===NAME_STATE){if(n.gzhead.name){let o=n.pending,l;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0}n.gzindex<n.gzhead.name.length?l=n.gzhead.name.charCodeAt(n.gzindex++)&255:l=0,put_byte(n,l)}while(l!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=COMMENT_STATE}if(n.status===COMMENT_STATE){if(n.gzhead.comment){let o=n.pending,l;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0}n.gzindex<n.gzhead.comment.length?l=n.gzhead.comment.charCodeAt(n.gzindex++)&255:l=0,put_byte(n,l)}while(l!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o))}n.status=HCRC_STATE}if(n.status===HCRC_STATE){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(flush_pending(e),n.pending!==0))return n.last_flush=-1,Z_OK$3;put_byte(n,e.adler&255),put_byte(n,e.adler>>8&255),e.adler=0}if(n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(e.avail_in!==0||n.lookahead!==0||t!==Z_NO_FLUSH$2&&n.status!==FINISH_STATE){let o=n.level===0?deflate_stored(n,t):n.strategy===Z_HUFFMAN_ONLY?deflate_huff(n,t):n.strategy===Z_RLE?deflate_rle(n,t):configuration_table[n.level].func(n,t);if((o===BS_FINISH_STARTED||o===BS_FINISH_DONE)&&(n.status=FINISH_STATE),o===BS_NEED_MORE||o===BS_FINISH_STARTED)return e.avail_out===0&&(n.last_flush=-1),Z_OK$3;if(o===BS_BLOCK_DONE&&(t===Z_PARTIAL_FLUSH?_tr_align(n):t!==Z_BLOCK$1&&(_tr_stored_block(n,0,0,!1),t===Z_FULL_FLUSH$1&&(zero(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),flush_pending(e),e.avail_out===0))return n.last_flush=-1,Z_OK$3}return t!==Z_FINISH$3?Z_OK$3:n.wrap<=0?Z_STREAM_END$3:(n.wrap===2?(put_byte(n,e.adler&255),put_byte(n,e.adler>>8&255),put_byte(n,e.adler>>16&255),put_byte(n,e.adler>>24&255),put_byte(n,e.total_in&255),put_byte(n,e.total_in>>8&255),put_byte(n,e.total_in>>16&255),put_byte(n,e.total_in>>24&255)):(putShortMSB(n,e.adler>>>16),putShortMSB(n,e.adler&65535)),flush_pending(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=e=>{if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const t=e.state.status;return e.state=null,t===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(e,t)=>{let n=t.length;if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const r=e.state,o=r.wrap;if(o===2||o===1&&r.status!==INIT_STATE||r.lookahead)return Z_STREAM_ERROR$2;if(o===1&&(e.adler=adler32_1(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){o===0&&(zero(r.head),r.strstart=0,r.block_start=0,r.insert=0);let g=new Uint8Array(r.w_size);g.set(t.subarray(n-r.w_size,n),0),t=g,n=r.w_size}const l=e.avail_in,u=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,fill_window(r);r.lookahead>=MIN_MATCH;){let g=r.strstart,c=r.lookahead-(MIN_MATCH-1);do r.ins_h=HASH(r,r.ins_h,r.window[g+MIN_MATCH-1]),r.prev[g&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=g,g++;while(--c);r.strstart=g,r.lookahead=MIN_MATCH-1,fill_window(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=MIN_MATCH-1,r.match_available=0,e.next_in=u,e.input=s,e.avail_in=l,r.wrap=o,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)_has(n,r)&&(e[r]=n[r])}}return e},flattenChunks=e=>{let t=0;for(let r=0,o=e.length;r<o;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,o=0,l=e.length;r<l;r++){let u=e[r];n.set(u,o),o+=u.length}return n},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let e=0;e<256;e++)_utf8len[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,o,l,u=e.length,s=0;for(o=0;o<u;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<u&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),l=0,o=0;l<s;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<u&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[l++]=n:n<2048?(t[l++]=192|n>>>6,t[l++]=128|n&63):n<65536?(t[l++]=224|n>>>12,t[l++]=128|n>>>6&63,t[l++]=128|n&63):(t[l++]=240|n>>>18,t[l++]=128|n>>>12&63,t[l++]=128|n>>>6&63,t[l++]=128|n&63);return t};const buf2binstring=(e,t)=>{if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var buf2string=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,o;const l=new Array(n*2);for(o=0,r=0;r<n;){let u=e[r++];if(u<128){l[o++]=u;continue}let s=_utf8len[u];if(s>4){l[o++]=65533,r+=s-1;continue}for(u&=s===2?31:s===3?15:7;s>1&&r<n;)u=u<<6|e[r++]&63,s--;if(s>1){l[o++]=65533;continue}u<65536?l[o++]=u:(u-=65536,l[o++]=55296|u>>10&1023,l[o++]=56320|u&1023)}return buf2binstring(l,o)},utf8border=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+_utf8len[e[n]]>t?n:t},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(e){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=deflate_1$2.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Z_OK$2)throw new Error(messages[n]);if(t.header&&deflate_1$2.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=strings.string2buf(t.dictionary):toString$1.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=deflate_1$2.deflateSetDictionary(this.strm,r),n!==Z_OK$2)throw new Error(messages[n]);this._dict_set=!0}}Deflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let o,l;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof e=="string"?n.input=strings.string2buf(e):toString$1.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(l===Z_SYNC_FLUSH||l===Z_FULL_FLUSH)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(o=deflate_1$2.deflate(n,l),o===Z_STREAM_END$2)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=deflate_1$2.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Z_OK$2;if(n.avail_out===0){this.onData(n.output);continue}if(l>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(e){this.chunks.push(e)},Deflate$1.prototype.onEnd=function(e){e===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function deflate$1(e,t){const n=new Deflate$1(t);if(n.push(e,!0),n.err)throw n.msg||messages[n.err];return n.result}function deflateRaw$1(e,t){return t=t||{},t.raw=!0,deflate$1(e,t)}function gzip$1(e,t){return t=t||{},t.gzip=!0,deflate$1(e,t)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,constants$1=constants$2,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1,constants:constants$1};const BAD$1=16209,TYPE$1=16191;var inffast=function e(t,n){let r,o,l,u,s,g,c,f,T,v,p,d,h,S,I,L,O,R,m,M,G,Z,_,y;const C=t.state;r=t.next_in,_=t.input,o=r+(t.avail_in-5),l=t.next_out,y=t.output,u=l-(n-t.avail_out),s=l+(t.avail_out-257),g=C.dmax,c=C.wsize,f=C.whave,T=C.wnext,v=C.window,p=C.hold,d=C.bits,h=C.lencode,S=C.distcode,I=(1<<C.lenbits)-1,L=(1<<C.distbits)-1;e:do{d<15&&(p+=_[r++]<<d,d+=8,p+=_[r++]<<d,d+=8),O=h[p&I];t:for(;;){if(R=O>>>24,p>>>=R,d-=R,R=O>>>16&255,R===0)y[l++]=O&65535;else if(R&16){m=O&65535,R&=15,R&&(d<R&&(p+=_[r++]<<d,d+=8),m+=p&(1<<R)-1,p>>>=R,d-=R),d<15&&(p+=_[r++]<<d,d+=8,p+=_[r++]<<d,d+=8),O=S[p&L];n:for(;;){if(R=O>>>24,p>>>=R,d-=R,R=O>>>16&255,R&16){if(M=O&65535,R&=15,d<R&&(p+=_[r++]<<d,d+=8,d<R&&(p+=_[r++]<<d,d+=8)),M+=p&(1<<R)-1,M>g){t.msg="invalid distance too far back",C.mode=BAD$1;break e}if(p>>>=R,d-=R,R=l-u,M>R){if(R=M-R,R>f&&C.sane){t.msg="invalid distance too far back",C.mode=BAD$1;break e}if(G=0,Z=v,T===0){if(G+=c-R,R<m){m-=R;do y[l++]=v[G++];while(--R);G=l-M,Z=y}}else if(T<R){if(G+=c+T-R,R-=T,R<m){m-=R;do y[l++]=v[G++];while(--R);if(G=0,T<m){R=T,m-=R;do y[l++]=v[G++];while(--R);G=l-M,Z=y}}}else if(G+=T-R,R<m){m-=R;do y[l++]=v[G++];while(--R);G=l-M,Z=y}for(;m>2;)y[l++]=Z[G++],y[l++]=Z[G++],y[l++]=Z[G++],m-=3;m&&(y[l++]=Z[G++],m>1&&(y[l++]=Z[G++]))}else{G=l-M;do y[l++]=y[G++],y[l++]=y[G++],y[l++]=y[G++],m-=3;while(m>2);m&&(y[l++]=y[G++],m>1&&(y[l++]=y[G++]))}}else if(R&64){t.msg="invalid distance code",C.mode=BAD$1;break e}else{O=S[(O&65535)+(p&(1<<R)-1)];continue n}break}}else if(R&64)if(R&32){C.mode=TYPE$1;break e}else{t.msg="invalid literal/length code",C.mode=BAD$1;break e}else{O=h[(O&65535)+(p&(1<<R)-1)];continue t}break}}while(r<o&&l<s);m=d>>3,r-=m,d-=m<<3,p&=(1<<d)-1,t.next_in=r,t.next_out=l,t.avail_in=r<o?5+(o-r):5-(r-o),t.avail_out=l<s?257+(s-l):257-(l-s),C.hold=p,C.bits=d};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(e,t,n,r,o,l,u,s)=>{const g=s.bits;let c=0,f=0,T=0,v=0,p=0,d=0,h=0,S=0,I=0,L=0,O,R,m,M,G,Z=null,_;const y=new Uint16Array(MAXBITS+1),C=new Uint16Array(MAXBITS+1);let w=null,x,H,U;for(c=0;c<=MAXBITS;c++)y[c]=0;for(f=0;f<r;f++)y[t[n+f]]++;for(p=g,v=MAXBITS;v>=1&&y[v]===0;v--);if(p>v&&(p=v),v===0)return o[l++]=1<<24|64<<16|0,o[l++]=1<<24|64<<16|0,s.bits=1,0;for(T=1;T<v&&y[T]===0;T++);for(p<T&&(p=T),S=1,c=1;c<=MAXBITS;c++)if(S<<=1,S-=y[c],S<0)return-1;if(S>0&&(e===CODES$1||v!==1))return-1;for(C[1]=0,c=1;c<MAXBITS;c++)C[c+1]=C[c]+y[c];for(f=0;f<r;f++)t[n+f]!==0&&(u[C[t[n+f]]++]=f);if(e===CODES$1?(Z=w=u,_=20):e===LENS$1?(Z=lbase,w=lext,_=257):(Z=dbase,w=dext,_=0),L=0,f=0,c=T,G=l,d=p,h=0,m=-1,I=1<<p,M=I-1,e===LENS$1&&I>ENOUGH_LENS$1||e===DISTS$1&&I>ENOUGH_DISTS$1)return 1;for(;;){x=c-h,u[f]+1<_?(H=0,U=u[f]):u[f]>=_?(H=w[u[f]-_],U=Z[u[f]-_]):(H=32+64,U=0),O=1<<c-h,R=1<<d,T=R;do R-=O,o[G+(L>>h)+R]=x<<24|H<<16|U|0;while(R!==0);for(O=1<<c-1;L&O;)O>>=1;if(O!==0?(L&=O-1,L+=O):L=0,f++,--y[c]===0){if(c===v)break;c=t[n+u[f]]}if(c>p&&(L&M)!==m){for(h===0&&(h=p),G+=T,d=c-h,S=1<<d;d+h<v&&(S-=y[d+h],!(S<=0));)d++,S<<=1;if(I+=1<<d,e===LENS$1&&I>ENOUGH_LENS$1||e===DISTS$1&&I>ENOUGH_DISTS$1)return 1;m=L&M,o[m]=p<<24|d<<16|G-l|0}}return L!==0&&(o[G+L]=c-h<<24|64<<16|0),s.bits=p,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<HEAD||t.mode>SYNC?1:0},inflateResetKeep=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=HEAD,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=(e,t)=>{let n;if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))},inflateInit2=(e,t)=>{if(!e)return Z_STREAM_ERROR$1;const n=new InflateState;e.state=n,n.strm=e,n.window=null,n.mode=HEAD;const r=inflateReset2(e,t);return r!==Z_OK$1&&(e.state=null),r},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,t,n,r)=>{let o;const l=e.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new Uint8Array(l.wsize)),r>=l.wsize?(l.window.set(t.subarray(n-l.wsize,n),0),l.wnext=0,l.whave=l.wsize):(o=l.wsize-l.wnext,o>r&&(o=r),l.window.set(t.subarray(n-r,n-r+o),l.wnext),r-=o,r?(l.window.set(t.subarray(n-r,n),0),l.wnext=r,l.whave=l.wsize):(l.wnext+=o,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=o))),0},inflate$2=(e,t)=>{let n,r,o,l,u,s,g,c,f,T,v,p,d,h,S=0,I,L,O,R,m,M,G,Z;const _=new Uint8Array(4);let y,C;const w=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(e)||!e.output||!e.input&&e.avail_in!==0)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),u=e.next_out,o=e.output,g=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,c=n.hold,f=n.bits,T=s,v=g,Z=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(n.wrap===0){n.mode=TYPEDO;break}for(;f<16;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(n.wrap&2&&c===35615){n.wbits===0&&(n.wbits=15),n.check=0,_[0]=c&255,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0),c=0,f=0,n.mode=FLAGS;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((c&15)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(c>>>=4,f-=4,G=(c&15)+8,n.wbits===0&&(n.wbits=G),G>15||G>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=c&512?DICTID:TYPE,c=0,f=0;break;case FLAGS:for(;f<16;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(n.flags=c,(n.flags&255)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&n.wrap&4&&(_[0]=c&255,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,f=0,n.mode=TIME;case TIME:for(;f<32;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}n.head&&(n.head.time=c),n.flags&512&&n.wrap&4&&(_[0]=c&255,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,n.check=crc32_1(n.check,_,4,0)),c=0,f=0,n.mode=OS;case OS:for(;f<16;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&n.wrap&4&&(_[0]=c&255,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,f=0,n.mode=EXLEN;case EXLEN:if(n.flags&1024){for(;f<16;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&n.wrap&4&&(_[0]=c&255,_[1]=c>>>8&255,n.check=crc32_1(n.check,_,2,0)),c=0,f=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(G=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(l,l+p),G)),n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,p,l)),s-=p,l+=p,n.length-=p),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(n.flags&2048){if(s===0)break e;p=0;do G=r[l+p++],n.head&&G&&n.length<65536&&(n.head.name+=String.fromCharCode(G));while(G&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,p,l)),s-=p,l+=p,G)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(n.flags&4096){if(s===0)break e;p=0;do G=r[l+p++],n.head&&G&&n.length<65536&&(n.head.comment+=String.fromCharCode(G));while(G&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,p,l)),s-=p,l+=p,G)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(n.flags&512){for(;f<16;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(n.wrap&4&&c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=BAD;break}c=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;f<32;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}e.adler=n.check=zswap32(c),c=0,f=0,n.mode=DICT;case DICT:if(n.havedict===0)return e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=f,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK||t===Z_TREES)break e;case TYPEDO:if(n.last){c>>>=f&7,f-=f&7,n.mode=CHECK;break}for(;f<3;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}switch(n.last=c&1,c>>>=1,f-=1,c&3){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES){c>>>=2,f-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}c>>>=2,f-=2;break;case STORED:for(c>>>=f&7,f-=f&7;f<32;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=c&65535,c=0,f=0,n.mode=COPY_,t===Z_TREES)break e;case COPY_:n.mode=COPY;case COPY:if(p=n.length,p){if(p>s&&(p=s),p>g&&(p=g),p===0)break e;o.set(r.subarray(l,l+p),u),s-=p,l+=p,g-=p,u+=p,n.length-=p;break}n.mode=TYPE;break;case TABLE:for(;f<14;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(n.nlen=(c&31)+257,c>>>=5,f-=5,n.ndist=(c&31)+1,c>>>=5,f-=5,n.ncode=(c&15)+4,c>>>=4,f-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;f<3;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}n.lens[w[n.have++]]=c&7,c>>>=3,f-=3}for(;n.have<19;)n.lens[w[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,y={bits:n.lenbits},Z=inftrees(CODES,n.lens,0,19,n.lencode,0,n.work,y),n.lenbits=y.bits,Z){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;S=n.lencode[c&(1<<n.lenbits)-1],I=S>>>24,L=S>>>16&255,O=S&65535,!(I<=f);){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(O<16)c>>>=I,f-=I,n.lens[n.have++]=O;else{if(O===16){for(C=I+2;f<C;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(c>>>=I,f-=I,n.have===0){e.msg="invalid bit length repeat",n.mode=BAD;break}G=n.lens[n.have-1],p=3+(c&3),c>>>=2,f-=2}else if(O===17){for(C=I+3;f<C;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}c>>>=I,f-=I,G=0,p=3+(c&7),c>>>=3,f-=3}else{for(C=I+7;f<C;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}c>>>=I,f-=I,G=0,p=11+(c&127),c>>>=7,f-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;p--;)n.lens[n.have++]=G}}if(n.mode===BAD)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,y={bits:n.lenbits},Z=inftrees(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,y),n.lenbits=y.bits,Z){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,y={bits:n.distbits},Z=inftrees(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,y),n.distbits=y.bits,Z){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES)break e;case LEN_:n.mode=LEN;case LEN:if(s>=6&&g>=258){e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=f,inffast(e,v),u=e.next_out,o=e.output,g=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,c=n.hold,f=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;S=n.lencode[c&(1<<n.lenbits)-1],I=S>>>24,L=S>>>16&255,O=S&65535,!(I<=f);){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(L&&!(L&240)){for(R=I,m=L,M=O;S=n.lencode[M+((c&(1<<R+m)-1)>>R)],I=S>>>24,L=S>>>16&255,O=S&65535,!(R+I<=f);){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}c>>>=R,f-=R,n.back+=R}if(c>>>=I,f-=I,n.back+=I,n.length=O,L===0){n.mode=LIT;break}if(L&32){n.back=-1,n.mode=TYPE;break}if(L&64){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=L&15,n.mode=LENEXT;case LENEXT:if(n.extra){for(C=n.extra;f<C;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;S=n.distcode[c&(1<<n.distbits)-1],I=S>>>24,L=S>>>16&255,O=S&65535,!(I<=f);){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(!(L&240)){for(R=I,m=L,M=O;S=n.distcode[M+((c&(1<<R+m)-1)>>R)],I=S>>>24,L=S>>>16&255,O=S&65535,!(R+I<=f);){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}c>>>=R,f-=R,n.back+=R}if(c>>>=I,f-=I,n.back+=I,L&64){e.msg="invalid distance code",n.mode=BAD;break}n.offset=O,n.extra=L&15,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(C=n.extra;f<C;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(g===0)break e;if(p=v-g,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}p>n.wnext?(p-=n.wnext,d=n.wsize-p):d=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=o,d=u-n.offset,p=n.length;p>g&&(p=g),g-=p,n.length-=p;do o[u++]=h[d++];while(--p);n.length===0&&(n.mode=LEN);break;case LIT:if(g===0)break e;o[u++]=n.length,g--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;f<32;){if(s===0)break e;s--,c|=r[l++]<<f,f+=8}if(v-=g,e.total_out+=v,n.total+=v,n.wrap&4&&v&&(e.adler=n.check=n.flags?crc32_1(n.check,o,v,u-v):adler32_1(n.check,o,v,u-v)),v=g,n.wrap&4&&(n.flags?c:zswap32(c))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}c=0,f=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;f<32;){if(s===0)break e;s--,c+=r[l++]<<f,f+=8}if(n.wrap&4&&c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=BAD;break}c=0,f=0}n.mode=DONE;case DONE:Z=Z_STREAM_END$1;break e;case BAD:Z=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=f,(n.wsize||v!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,v-e.avail_out),T-=e.avail_in,v-=e.avail_out,e.total_in+=T,e.total_out+=v,n.total+=v,n.wrap&4&&v&&(e.adler=n.check=n.flags?crc32_1(n.check,o,v,e.next_out-v):adler32_1(n.check,o,v,e.next_out-v)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(T===0&&v===0||t===Z_FINISH$1)&&Z===Z_OK$1&&(Z=Z_BUF_ERROR),Z},inflateEnd=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;let t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,t)=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(e,t)=>{const n=t.length;let r,o,l;return inflateStateCheck(e)||(r=e.state,r.wrap!==0&&r.mode!==DICT)?Z_STREAM_ERROR$1:r.mode===DICT&&(o=1,o=adler32_1(o,t,n,0),o!==r.check)?Z_DATA_ERROR$1:(l=updatewindow(e,t,n,n),l?(r.mode=MEM,Z_MEM_ERROR$1):(r.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(n!==Z_OK)throw new Error(messages[n]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=strings.string2buf(t.dictionary):toString.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary),n!==Z_OK)))throw new Error(messages[n])}Inflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let l,u,s;if(this.ended)return!1;for(t===~~t?u=t:u=t===!0?Z_FINISH:Z_NO_FLUSH,toString.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),l=inflate_1$2.inflate(n,u),l===Z_NEED_DICT&&o&&(l=inflate_1$2.inflateSetDictionary(n,o),l===Z_OK?l=inflate_1$2.inflate(n,u):l===Z_DATA_ERROR&&(l=Z_NEED_DICT));n.avail_in>0&&l===Z_STREAM_END&&n.state.wrap>0&&e[n.next_in]!==0;)inflate_1$2.inflateReset(n),l=inflate_1$2.inflate(n,u);switch(l){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(l),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||l===Z_STREAM_END))if(this.options.to==="string"){let g=strings.utf8border(n.output,n.next_out),c=n.next_out-g,f=strings.buf2string(n.output,g);n.next_out=c,n.avail_out=r-c,c&&n.output.set(n.output.subarray(g,g+c),0),this.onData(f)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(l===Z_OK&&s===0)){if(l===Z_STREAM_END)return l=inflate_1$2.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(e){this.chunks.push(e)},Inflate$1.prototype.onEnd=function(e){e===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1;for(var deflate_1=deflate,fromByteArray_1=fromByteArray,lookup=[],code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i];function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var r,o=[],l=t;l<n;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(tripletToBase64(r));return o.join("")}function fromByteArray(e){for(var t,n=e.length,r=n%3,o=[],l=16383,u=0,s=n-r;u<s;u+=l)o.push(encodeChunk(e,u,u+l>s?s:u+l));return r===1?(t=e[n-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}const encoder=new TextEncoder;new TextDecoder;function serializeHash(e){const t=JSON.stringify(e),n=encoder.encode(t),r=deflate_1(n);return fromByteArray_1(r)}async function getViews(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/views`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function createShareLink(e,t){if(!Authentication.token)throw new Error("Not authenticated");const r=(await getViews()).filter(s=>s.name===t);if(r.length===0)return console.warn("View does not exist or it is misspell"),null;const o=await fetch(`${FORMANT_API_URL}/v1/admin/shares`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=FORMANT_API_URL.replace("api","app"),{code:u}=await o.json();return`${l}/shares/${u}#${serializeHash({viewId:r[0].id})}`}const vailableAggregationIntervals=["day","week","month","year","hour","minute","quarter"],aggregateFunctions=["interval","start","end","sub","get"];function getVariance(e){return e.count<2?0:e.sumOfSquares/(e.count-1)}function getStandardDeviation(e){return Math.sqrt(getVariance(e))}function getMax(e){return e.max}function getMin(e){return e.min}function getAverage(e){return e.count===0?-1:e.sum/e.count}function getSum(e){return e.sum}function getCount(e){return e.count}const aggregateFunctionMap={min:getMin,max:getMax,"standard deviation":getStandardDeviation,average:getAverage,sum:getSum,count:getCount},aggregateByDateFunctions={day:{interval:eachDayOfInterval,start:startOfDay,end:endOfDay,sub:subDays,get:getDay},week:{interval:eachWeekOfInterval,start:startOfWeek,end:endOfWeek,sub:subWeeks,get:getWeek},month:{interval:eachMonthOfInterval,start:startOfMonth,end:endOfMonth,sub:subMonths,get:getMonth},year:{interval:eachYearOfInterval,start:startOfYear,end:endOfYear,sub:subYears,get:getYear},hour:{interval:eachHourOfInterval,start:startOfHour,end:endOfHour,sub:subHours,get:getHours},minute:{interval:eachMinuteOfInterval,start:startOfMinute,end:endOfMinute,sub:subMinutes,get:getMinutes},quarter:{interval:eachQuarterOfInterval,start:startOfQuarter,end:endOfQuarter,sub:subQuarters,get:getQuarter}},formatTimeFrameText=(e,t)=>e.split("/")[0]+"/"+e.split("/")[1]+"–"+t.split("/")[0]+"/"+t.split("/")[1];async function queryEvents(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function eventsCounter(e,t,n,r,o){const l=aggregateByDateFunctions[t];return await Promise.all(Array(n).fill(0).map(async(u,s)=>{const g=new Date(r),c=l.sub(l.start(g),n-s-1),f=l.sub(l.end(g),n-s-1),T=formatTimeFrameText(c.toLocaleDateString(),f.toLocaleDateString()),v=await queryEvents({...o,eventTypes:e,start:new Date(c).toISOString(),end:new Date(f).toISOString()});return{date:T,events:v}}))}async function getAnnotationCount(e,t){return(await queryEvents({...e,eventTypes:["annotation"]})).filter(l=>!!l.tags&&Object.keys(l.tags).includes(t)).reduce((l,u)=>{const s=u.tags[t];return s in l?(l[s]+=1,l):(l[s]=1,l)},{})}async function getAnnotationCountByIntervals(e,t,n){const{end:r,start:o}=e,u=aggregateByDateFunctions[n].interval({start:new Date(o),end:new Date(r)}),s=u.map((c,f)=>{const T=new Date(c).toISOString(),v=f===u.length-1?new Date(Date.now()).toISOString():new Date(u[f+1]);return getAnnotationCount({...e,start:T,end:v},t)}),g=await Promise.all(s);return u.map((c,f)=>({date:new Date(c).toISOString(),annotations:g[f]}))}async function getTelemetry(e,t,n,r,o){let l=e;Array.isArray(e)||(l=[e]);let u=t;return Array.isArray(t)||(u=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:l,end:r.toISOString(),names:u,start:n.toISOString(),tags:o}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");const e=defaultRtcClientPool.get();try{return await e.getSessions()}finally{await e.shutdown()}}async function getPeers(){if(!Authentication.token)throw new Error("Not authenticated");const e=defaultRtcClientPool.get();try{return await e.getPeers()}finally{await e.shutdown()}}async function createDevice(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchDevice(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getDevicesData(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function queryDevicesData(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function disableDevice(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}/disable`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}class Device extends BaseDevice{constructor(t,n,r,o){super(),this.id=t,this.name=n,this.organizationId=r,this.tags=o}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(){let t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const n=await t.json();if(!n.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const r=n.state.reportedConfiguration.version;return t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${r}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await t.json()).document}async getFileUrl(t){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}async startRealtimeConnection(t={}){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const{sessionType:n,deadlineMs:r=1e4,maxConnectRetries:o=3}=typeof t=="number"?{sessionType:t}:t,u=getRtcClientPool({sessionType:n}).get(this.handleMessage);let s=!1;const g=new Promise((f,T)=>setTimeout(()=>{s=!0,T(new Error("Connection timed out: the connection could not be finalized in time, possibly due to network issues or misconfigured settings."))},r)),c=async()=>{if("isReady"in u)for(;!u.isReady();)this.assertNotCancelled(s),await delay(100);const f=await this.getRemoteDevicePeerId(u);this.assertNotCancelled(s);let T;for(let p=0;p<o&&(T=await u.connect(f),!T);p++)delay(100),this.assertNotCancelled(s);if(!T)throw new Error(`Session could not be created: exhausted ${o} retries`);let v=0;for(;!s&&u.getConnectionStatus(f)!=="connected";)await delay(100),v+=1;return this.assertNotCancelled(s),console.debug(`${new Date().toISOString()} :: Connection completed after ${v} retries`),f};return Promise.race([c(),g]).then(f=>{this.remoteDevicePeerId=f,this.initConnectionMonitoring(),this.rtcClient=u,this.emit("connect")}).catch(f=>{throw console.debug(`${new Date().toISOString()} :: Connection failed: %o`,f),this.remoteDevicePeerId=null,u.shutdown().catch(T=>{console.error("rtcClient cannot shutdown: %o",T)}),this.emit("connection_failed",f),f})}async getRemoteDevicePeerId(t){const r=(await t.getPeers()).find(o=>o.deviceId===this.id);if(!isRtcPeer(r))throw new Error("Cannot find peer, is the robot offline?");return r.id}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let t=!1;if(this.rtcClient){const r=this.rtcClient.getConnections().find(o=>o.getRemotePeerId()===this.remoteDevicePeerId&&o.isActive());(r===void 0||!r.isReady())&&(console.debug(`${new Date().toISOString()} :: data channel closed`),t=!0)}(!this.rtcClient||!this.remoteDevicePeerId||await this.rtcClient.getConnectionStatsInfo(this.remoteDevicePeerId)===void 0||t)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(n=>{console.error(n)}))},1e3)}async getRemotePeer(){const n=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(r=>r.deviceId===this.id);return defined(n,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){let t=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.remoteDevicePeerId?(await this.rtcClient.disconnect(this.remoteDevicePeerId),this.remoteDevicePeerId=null):t=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(t)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){const t=await getPeers(),n=await getRealtimeSessions(),r=t.find(o=>o.deviceId===this.id);return r?n[r.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(r=>({name:r.name,id:r.id,command:r.command,description:r.description,parameterEnabled:r.parameterEnabled,parameterValue:r.parameterValue,parameterMeta:r.parameterMeta,enabled:r.enabled,tags:r.tags}))}async sendCommand(t,n,r,o){var f;const u=(await this.getAvailableCommands()).find(T=>T.name===t);if(!u)throw new Error(`Could not find command with name "${t}"`);let s="";n===void 0?u.parameterEnabled&&u.parameterValue&&(s=u.parameterValue):s=n;let g={value:s,scrubberTime:(r||new Date).toISOString(),meta:{...u.parameterMeta,...o}};return await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:u.id,organizationId:this.organizationId,deviceId:this.id,command:u.command,parameter:g,userId:(f=Authentication.currentUser)==null?void 0:f.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async getCommand(t){return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCaptureStream(t){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:t,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(r)}async getTelemetry(t,n,r,o){return await getTelemetry(this.id,t,n,r,o)}async getTelemetryStreams(){var s,g;const t=await this.getConfiguration(),n=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=[],o=[];return(g=(s=t.telemetry)==null?void 0:s.streams)==null||g.forEach(c=>{c.disabled!==!0&&r.push(c.name),c.onDemand===!0&&o.push(c.name)}),console.log(o),(await n.json()).items.filter(c=>!r.includes(c)).map(c=>({name:c,onDemand:o.includes(c)}))}async createInterventionRequest(t,n,r,o){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:t,interventionType:n,time:new Date().toISOString(),deviceId:this.id,tags:o,data:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(t,n,r){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:t,interventionType:n,data:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async getAnnotationCount(t,n){return await getAnnotationCount({...t,deviceIds:[this.id]},n)}async getAnnotationCountByIntervals(t,n,r){return await getAnnotationCountByIntervals({...t,deviceIds:[this.id]},n,r)}async eventsCounter(t,n,r,o,l){return await eventsCounter(t,n,r,o,{...l,deviceIds:[this.id]})}async createShareLink(t,n){return t.scope.deviceIds=[this.id],await createShareLink(t,n)}}_e(Device,"createDevice",createDevice),_e(Device,"patchDevice",patchDevice),_e(Device,"getDevicesData",getDevicesData),_e(Device,"queryDevicesData",queryDevicesData),_e(Device,"disableDevice",disableDevice);class PeerDevice extends BaseDevice{constructor(n){super();_e(this,"id");_e(this,"telemetryStreamActive",!1);_e(this,"streamTelemetry",{});this.peerUrl=n}async getLatestTelemetry(){this.telemetryStreamActive||this.subscribeToTelemetry();const n=this.streamTelemetry;return Object.entries(n).map(([o,l])=>({deviceId:this.id,streamName:o,streamType:"json",currentValue:l,currentValueTime:l.timestamp,tags:{}}))}subscribeToTelemetry(){this.telemetryStreamActive=!0;let n=0;const r=new XMLHttpRequest;r.responseType="text",r.addEventListener("error",o=>{this.handleXHRError("error")}),r.addEventListener("abort",o=>{this.handleXHRError("abort")}),r.addEventListener("timeout",o=>{this.handleXHRError("timeout")}),r.addEventListener("readystatechange",o=>{r.readyState===XMLHttpRequest.DONE&&this.handleXHRError("closed")}),r.addEventListener("progress",o=>{const l=o.loaded,u=l-n;n=l,r.responseText.substr(-u).split(`
45
- `).forEach(c=>{var f;if(c.length>0){const T=JSON.parse(c);if((f=T.result)!=null&&f.datapoint){const v=T.result.datapoint,p=v.stream;delete v.stream,this.streamTelemetry[p]=v}}})}),r.open("POST",`${this.peerUrl}/v1/telemetry`),r.send()}handleXHRError(n){console.warn(`Telemetry stream ended: ${n}`),this.telemetryStreamActive=!1}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.document}async startRealtimeConnection(n){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const r=new distExports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage,sessionType:n});for(await r.connectLan(this.peerUrl);r.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=r,this.initConnectionMonitoring()}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let n=!1;this.rtcClient&&this.rtcClient.getConnectionStatus(this.peerUrl)!=="connected"&&(console.debug(`${new Date().toISOString()} :: data channel closed`),n=!0),(!this.rtcClient||n)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(r=>{console.error(r)}))},1e3)}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){let n=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.id?(await this.rtcClient.disconnect(this.id),this.remoteDevicePeerId=null):n=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(n)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async sendCommand(n,r,o,l){const u={value:r,scrubberTime:(o||new Date).toISOString(),meta:l};return await fetch(`${this.peerUrl}/v1/enqueue-command`,{method:"POST",body:JSON.stringify({command:n,parameter:u}),headers:{"Content-Type":"application/json"}})}}async function addDeviceToFleet(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"PATCH",body:JSON.stringify({fleetId:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function aggregateTelemetry(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).aggregates}async function deleteFleet(e){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async function getAnalyticStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getAnalyticsModules(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/analytics-modules`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getAnalyticsRows(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/rows`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function queryDevices(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(r=>new Device(r.id,r.name,r.organizationId,r.tags))}async function getCurrentGroup(){if(!Authentication.token)throw new Error("Not authenticated");let e=new URLSearchParams("");typeof window<"u"&&window.location&&(e=new URLSearchParams(window.location.search));const t=e.get("group");if(t===null||t.trim()==="")return;const n=await fetch(`${FORMANT_API_URL}/v1/admin/groups/`+t,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),{tagKey:r,tagValue:o}=await n.json();return await queryDevices({tags:{[r]:[o]},enabled:!0,type:"default"})}async function getDevice(e){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),r=n.name;return new Device(e,r,n.organizationId,n.tags)}async function getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const t=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return t.items,t.items.map(n=>new Device(n.id,n.name,n.organizationId,n.tags))}async function getEvent(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getFileUrl(e){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[e]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(n.fileUrls.length===0)throw new Error("File not found");return n.fileUrls[0]}async function getFleet(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getFleetDevices(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}/devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getLatestTelemetry(...e){const t=e.flat().filter(o=>!!o);return t.length===0?[]:(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await getDevices()).filter(o=>n.includes(o.id))}async function getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(o=>o.deviceId);return(await getDevices()).filter(o=>n.includes(o.id))}async function getStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.filter(n=>n.enabled)}async function getTaskReportRows(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-report-rows`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getTaskReportTables(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-reports`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function listFleets(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function patchFleet(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchStream(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/streams/${e.id}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchView(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/views/${e.id}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function queryAnalytics(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function createFleet(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}const Je=class{static async setDefaultDevice(t){Je.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Je.defaultDeviceId)throw new Error("No known default device");const r=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(u=>u.id===Je.defaultDeviceId),o=r.name,l=new Device(Je.defaultDeviceId,o,defined(Authentication.currentOrganization),r.tags);return Je.knownContext.push(new WeakRef(l)),l}static async getPeerDevice(t){const n=new PeerDevice(t);return n.id=await n.getDeviceId(),n}static async getDevice(t){const n=await getDevice(t);return Je.knownContext.push(new WeakRef(n)),n}};let Fleet=Je;_e(Fleet,"defaultDeviceId"),_e(Fleet,"knownContext",[]),_e(Fleet,"createFleet",createFleet),_e(Fleet,"listFleets",listFleets),_e(Fleet,"getFleet",getFleet),_e(Fleet,"patchFleet",patchFleet),_e(Fleet,"deleteFleet",deleteFleet),_e(Fleet,"addDeviceToFleet",addDeviceToFleet),_e(Fleet,"getFleetDevices",getFleetDevices),_e(Fleet,"aggregateTelemetry",aggregateTelemetry),_e(Fleet,"createShareLink",createShareLink),_e(Fleet,"eventsCounter",eventsCounter),_e(Fleet,"getAnalyticStreams",getAnalyticStreams),_e(Fleet,"getAnalyticsModules",getAnalyticsModules),_e(Fleet,"getAnalyticsRows",getAnalyticsRows),_e(Fleet,"getAnnotationCount",getAnnotationCount),_e(Fleet,"getAnnotationCountByIntervals",getAnnotationCountByIntervals),_e(Fleet,"getCurrentGroup",getCurrentGroup),_e(Fleet,"getDevices",getDevices),_e(Fleet,"getEvent",getEvent),_e(Fleet,"getFileUrl",getFileUrl),_e(Fleet,"getInterventions",getInterventions),_e(Fleet,"getLatestTelemetry",getLatestTelemetry),_e(Fleet,"getOnlineDevices",getOnlineDevices),_e(Fleet,"getPeers",getPeers),_e(Fleet,"getRealtimeDevices",getRealtimeDevices),_e(Fleet,"getRealtimeSessions",getRealtimeSessions),_e(Fleet,"getStreams",getStreams),_e(Fleet,"getTaskReportRows",getTaskReportRows),_e(Fleet,"getTaskReportTables",getTaskReportTables),_e(Fleet,"getTelemetry",getTelemetry),_e(Fleet,"getViews",getViews),_e(Fleet,"patchStream",patchStream),_e(Fleet,"patchView",patchView),_e(Fleet,"queryAnalytics",queryAnalytics),_e(Fleet,"queryDevices",queryDevices),_e(Fleet,"queryEvents",queryEvents),_e(Fleet,"queryTelemetry",queryTelemetry);class KeyValue{static async set(t,n,r){try{const o=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:n,tags:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=await o.json();if(o.status!==200)throw new Error(l.message)}catch(o){throw o}}static async get(t){try{const n=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await n.json();if(n.status!==200)throw new Error(r.message);return r.value}catch(n){throw n}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await t.json();if(t.status!==200)throw new Error(n.message);return n.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(n){throw n}}static async query(t){try{const n=await fetch(FORMANT_API_URL+"/v1/admin/key-value/query",{method:"POST",body:JSON.stringify({keys:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});if(!n.ok)throw new Error("Unable to handle request");return(await n.json()).items}catch(n){throw n}}}function stringToArrayBuffer(e){return Uint8Array.from(base64Exports.decode(e),t=>t.charCodeAt(0))}function browser(){const{userAgent:e}=navigator;return e?e.includes("Firefox/")?"Firefox":e.includes("Edg/")?"Edge":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":e.includes("MSIE/")||e.includes("Trident/")?"IE":"Other":"Other"}const rtcAudioChunkStreamType="audio-chunk";class AudioPlayer{constructor(t,n){_e(this,"muted",!1);_e(this,"hasReceivedData",!1);_e(this,"audioContext");_e(this,"chunks",[]);_e(this,"isPlaying",!1);_e(this,"startTime",0);_e(this,"lastChunkOffset",0);_e(this,"bufferSize",3);_e(this,"receive",async t=>{var u;const n=(u=t.payload.audioChunk)==null?void 0:u.chunk_data;if(!n)return;this.hasReceivedData||(this.hasReceivedData=!0);const{audioContext:r,muted:o}=this;if(!r||t.header.stream.streamType!==rtcAudioChunkStreamType||o!==!1)return;const l=stringToArrayBuffer(n);try{await r.decodeAudioData(l.buffer,this.scheduleChunk)}catch(s){console.warn("Error decoding audio buffer, changing audioWireFormat on agent",{error:s}),this.changeAudioWireFormat("wav")}});_e(this,"scheduleChunk",t=>{const{audioContext:n}=this;if(!n)return;(this.chunks.length>this.bufferSize||this.isPlaying===!1)&&(this.chunks.forEach(o=>{o.stop()}),this.isPlaying=!1,this.chunks=[]);const r=this.createChunk(t);r&&r.buffer&&(this.isPlaying===!1&&(this.startTime=n.currentTime,this.lastChunkOffset=0,this.isPlaying=!0),r.start(this.startTime+this.lastChunkOffset,0,t.duration),this.lastChunkOffset+=r.buffer.duration,this.chunks.push(r))});this.device=t,this.stream=n,this.device.startListeningToRealtimeDataStream(n),this.device.addRealtimeListener((o,l)=>{this.receive(l)}),browser()==="Safari"||browser()==="IE"?this.changeAudioWireFormat("wav"):this.changeAudioWireFormat("opus");const r=window.AudioContext||window.webkitAudioContext;this.audioContext=new r}async play(){var t,n;((t=this.audioContext)==null?void 0:t.state)==="suspended"&&await((n=this.audioContext)==null?void 0:n.resume()),this.muted=!1}async pause(){await this.audioContext.suspend(),this.muted=!0}destroy(){this.device.stopListeningToRealtimeDataStream(this.stream)}createChunk(t){const{audioContext:n}=this;if(!n)return;const r=n.createBufferSource();return r.buffer=t,r.connect(n.destination),r.loop=!1,r.onended=o=>{this.chunks.splice(this.chunks.indexOf(r),1),this.chunks.length===0&&(this.isPlaying=!1)},r}changeAudioWireFormat(t){const{stream:n}=this;(async()=>await this.device.changeStreamAudioType(n.name,t))()}}class Account{static async listAccounts(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createAccounts(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getAccount(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchAccount(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteAccount(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}static async getAccountTree(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}/tree`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}}class Role{static async listRoles(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/roles`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createRole(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getRole(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchRole(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteRole(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}}class User{static async listUsers(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/users`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createUser(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getUser(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchUser(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteUser(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"PATCH",body:JSON.stringify({enabled:!1,roleId:null,teamId:null}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"],timeout=e=>new Promise(t=>setTimeout(t,e*1e3));try{const e=typeof window<"u"&&window.location?new URLSearchParams(window.location.search):new URLSearchParams(""),t=e.get("device");t&&Fleet.setDefaultDevice(t);const n=e.get("auth");n&&Authentication.loginWithToken(n),e.get("module")&&Authentication.listenForRefresh(),typeof window<"u"&&App.listenForConnectionEvents()}catch(e){}exports.Account=Account,exports.App=App,exports.AudioPlayer=AudioPlayer,exports.Authentication=Authentication,exports.BinaryRequestDataChannel=BinaryRequestDataChannel,exports.CaptureStream=CaptureStream,exports.DataChannel=DataChannel,exports.Device=Device,exports.Fleet=Fleet,exports.KeyValue=KeyValue,exports.Manipulator=Manipulator,exports.PeerDevice=PeerDevice,exports.Role=Role,exports.SessionType=SessionTypeConstants,exports.TextRequestDataChannel=TextRequestDataChannel,exports.User=User,exports.accessLevels=accessLevels,exports.administrator=administrator,exports.aggregateByDateFunctions=aggregateByDateFunctions,exports.aggregateFunctionMap=aggregateFunctionMap,exports.aggregateFunctions=aggregateFunctions,exports.aggregateLevels=aggregateLevels,exports.annotationTypes=annotationTypes,exports.eventTypes=eventTypes,exports.formatTimeFrameText=formatTimeFrameText,exports.getAverage=getAverage,exports.getCount=getCount,exports.getMax=getMax,exports.getMin=getMin,exports.getStandardDeviation=getStandardDeviation,exports.getSum=getSum,exports.getVariance=getVariance,exports.healthStatuses=healthStatuses,exports.interventionTypes=interventionTypes,exports.operator=operator,exports.severities=severities,exports.timeout=timeout,exports.vailableAggregationIntervals=vailableAggregationIntervals,exports.videoMimeTypes=videoMimeTypes,exports.viewer=viewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
62
+ `),Error.captureStackTrace(this,r)}}e.exports=o=>{if(o.length>2)throw new r(o);function l(s={}){this.options=s}function u(s){return new l(s)}return l.prototype.transform=o,u.Format=l,u}},function(e,t,n){function r(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}function o(u,s){for(var g=0;g<s.length;g++){var c=s[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}var l=n(88);e.exports=function(){function u(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,u),this.loggers=new Map,this.options=c}var s,g;return s=u,(g=[{key:"add",value:function(c,d){var w=this;if(!this.loggers.has(c)){var v=(d=Object.assign({},d||this.options)).transports||this.options.transports;d.transports=v?v.slice():[];var y=l(d);y.on("close",function(){return w._delete(c)}),this.loggers.set(c,y)}return this.loggers.get(c)}},{key:"get",value:function(c,d){return this.add(c,d)}},{key:"has",value:function(c){return!!this.loggers.has(c)}},{key:"close",value:function(c){var d=this;if(c)return this._removeLogger(c);this.loggers.forEach(function(w,v){return d._removeLogger(v)})}},{key:"_removeLogger",value:function(c){this.loggers.has(c)&&(this.loggers.get(c).close(),this._delete(c))}},{key:"_delete",value:function(c){this.loggers.delete(c)}}])&&o(s.prototype,g),Object.defineProperty(s,"prototype",{writable:!1}),u}()},function(e,t,n){(function(r){const o=n(51),l=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(u,s,g,c){let d,w,v=!1,y=!1;const f=n(94);function p(B){c(s,B)}function S(B,E){let T=`"${s}" ${E}`;throw B&&(T=`${T}`),w&&(T=`${T}. An example of a valid value would be: ${w}`),new o(T)}const N={convertFromBase64:function(){return p("marking for base64 conversion"),v=!0,N},default:function(B){if(typeof B=="number")d=B.toString();else if(Array.isArray(B)||typeof B=="object"&&B!==null)d=JSON.stringify(B);else{if(typeof B!="string")throw new o("values passed to default() must be of Number, String, Array, or Object type");d=B}return p(`setting default value to "${d}"`),N},required:function(B){return B===void 0?(p("marked as required"),y=!0):(p(`setting required flag to ${B}`),y=B),N},example:function(B){return w=B,N}};return Object.entries({...f,...g}).forEach(([B,E])=>{N[B]=function(T){return function(){let h=u[s];if(p(`will be read from the environment using "${T.name}" accessor`),h===void 0)if(d===void 0&&y)p("was not found in the environment, but is required to be set"),S(void 0,"is a required variable, but it was not set");else{if(d===void 0)return void p("was not found in the environment, but is not required. returning undefined");p(`was not found in the environment, parsing default value "${d}" instead`),h=d}y&&(p("verifying variable value is not an empty string"),h.trim().length===0&&S(void 0,"is a required variable, but its value was empty")),v&&(p("verifying variable is a valid base64 string"),h.match(l)||S(h,"should be a valid base64 string if using convertFromBase64"),p("converting from base64 to utf8 string"),h=r.from(h,"base64").toString());const R=[h].concat(Array.prototype.slice.call(arguments));try{p(`passing value "${h}" to "${T.name}" accessor`);const W=T.apply(T,R);return p(`parsed successfully, returning ${W}`),W}catch(W){S(h,W.message)}}}(E)}),N}}).call(this,n(5).Buffer)},function(e,t,n){const r=n(34);e.exports=function(o,l){return l=l||",",o.length?r(o).split(l).filter(Boolean):[]}},function(e,t,n){e.exports=function(r){const o=r.toLowerCase();if(o!=="false"&&o!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return o!=="false"}},function(e,t,n){e.exports=function(r){const o=r.toLowerCase();if(["false","0","true","1"].indexOf(o)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(o==="0"||o==="false")}},function(e,t,n){const r=n(95);e.exports=function(o){var l=r(o);if(l>65535)throw new Error("cannot assign a port number greater than 65535");return l}},function(e,t,n){const r=n(34);e.exports=function(o,l){const u=r(o);if(l.indexOf(u)<0)throw new Error(`should be one of [${l.join(", ")}]`);return u}},function(e,t,n){const r=n(53);e.exports=function(o){const l=r(o);if(l>0)throw new Error("should be a negative float");return l}},function(e,t,n){const r=n(53);e.exports=function(o){const l=r(o);if(l<0)throw new Error("should be a positive float");return l}},function(e,t,n){const r=n(52);e.exports=function(o){const l=r(o);if(l>0)throw new Error("should be a negative integer");return l}},function(e,t,n){const r=n(54);e.exports=function(o){var l=r(o);if(!Array.isArray(l))throw new Error("should be a parseable JSON Array");return l}},function(e,t,n){const r=n(54);e.exports=function(o){var l=r(o);if(Array.isArray(l))throw new Error("should be a parseable JSON Object");return l}},function(e,t,n){e.exports=function(r,o){try{RegExp(void 0,o)}catch{throw new Error("invalid regexp flags")}try{return new RegExp(r,o)}catch{throw new Error("should be a valid regexp")}}},function(e,t,n){const r=n(96);e.exports=function(o){return r(o).toString()}},function(e,t,n){const r=n(34),o=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021\u0023-\u005b\u005d-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021-\u005a\u0053-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])+)\])$/;e.exports=function(l){const u=r(l);if(!o.test(u))throw new Error("should be a valid email address");return u}},function(e,t,n){e.exports=function(r,o){return function(l,u){o&&o.match(/prod|production/)||r(`env-var (${l}): ${u}`)}}},function(e,t,n){(function(r){(function(){var o,l,u,s,g,c;typeof performance<"u"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:r!=null&&r.hrtime?(e.exports=function(){return(o()-g)/1e6},l=r.hrtime,s=(o=function(){var d;return 1e9*(d=l())[0]+d[1]})(),c=1e9*r.uptime(),g=s-c):Date.now?(e.exports=function(){return Date.now()-u},u=Date.now()):(e.exports=function(){return new Date().getTime()-u},u=new Date().getTime())}).call(this)}).call(this,n(2))},function(e,t,n){(function(r){(function(o){function l(s){if((s=s===void 0?"utf-8":s)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+s+"') is invalid.")}function u(s,g){if(g=g===void 0?{fatal:!1}:g,(s=s===void 0?"utf-8":s)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+s+"') is invalid.");if(g.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(o.TextEncoder&&o.TextDecoder)return!1;Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),l.prototype.encode=function(s,g){if((g=g===void 0?{stream:!1}:g).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");g=0;for(var c=s.length,d=0,w=Math.max(32,c+(c>>1)+7),v=new Uint8Array(w>>3<<3);g<c;){var y=s.charCodeAt(g++);if(55296<=y&&56319>=y){if(g<c){var f=s.charCodeAt(g);(64512&f)==56320&&(++g,y=((1023&y)<<10)+(1023&f)+65536)}if(55296<=y&&56319>=y)continue}if(d+4>v.length&&(w+=8,w=(w*=1+g/s.length*2)>>3<<3,(f=new Uint8Array(w)).set(v),v=f),(4294967168&y)==0)v[d++]=y;else{if(!(4294965248&y))v[d++]=y>>6&31|192;else if(!(4294901760&y))v[d++]=y>>12&15|224,v[d++]=y>>6&63|128;else{if(4292870144&y)continue;v[d++]=y>>18&7|240,v[d++]=y>>12&63|128,v[d++]=y>>6&63|128}v[d++]=63&y|128}}return v.slice(0,d)},Object.defineProperty(u.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(u.prototype,"fatal",{value:!1}),Object.defineProperty(u.prototype,"ignoreBOM",{value:!1}),u.prototype.decode=function(s,g){if((g=g===void 0?{stream:!1}:g).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");g=0;for(var c=(s=new Uint8Array(s)).length,d=[];g<c;){var w=s[g++];if(w===0)break;if(!(128&w))d.push(w);else if((224&w)==192){var v=63&s[g++];d.push((31&w)<<6|v)}else if((240&w)==224){v=63&s[g++];var y=63&s[g++];d.push((31&w)<<12|v<<6|y)}else(248&w)==240&&(65535<(w=(7&w)<<18|(v=63&s[g++])<<12|(y=63&s[g++])<<6|63&s[g++])&&(w-=65536,d.push(w>>>10&1023|55296),w=56320|1023&w),d.push(w))}return String.fromCharCode.apply(null,d)},o.TextEncoder=l,o.TextDecoder=u})(typeof window<"u"?window:r!==void 0?r:this)}).call(this,n(6))},function(e,t,n){n.r(t),n.d(t,"AuthClient",function(){return l}),n.d(t,"RtcSignalingClient",function(){return s}),n.d(t,"Credentials",function(){return z}),n.d(t,"SignalingPromiseClient",function(){return P.SignalingPromiseClient}),n.d(t,"RtcClient",function(){return Ht}),n.d(t,"RtcClientV1",function(){return Nt}),n.d(t,"createRtcStreamMessage",function(){return rt});var r=n(26),o=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class l extends r.a{adminSignup(F,H){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:H,method:"POST",body:F})})}login(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:F,allowUnsafeRetries:!0})})}loginWithGoogleToken(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:F,allowUnsafeRetries:!0})})}refresh(F,H){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:{refreshToken:F,tokenExpirationSeconds:H},allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:F})})}forgotPassword(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:{email:F}})})}confirmForgotPassword(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:F})})}resendInvitation(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:{email:F}})})}changePassword({token:F,refreshToken:H,currentPassword:J,newPassword:oe}){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:F,method:"POST",body:{refreshToken:H,currentPassword:J,newPassword:oe}})})}getDeviceCredentials(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:F,method:"POST",allowUnsafeRetries:!0})})}impersonate(F,H){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:F,method:"POST",allowUnsafeRetries:!0,body:{userId:H}})})}createServiceAccount(F,H,J,oe){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:F,method:"POST",allowUnsafeRetries:!0,body:{name:H,roleId:J,tags:oe}})})}getFeatures(F){return o(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:F})).features})}}var u=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class s extends r.a{createPeer(F,H){return u(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:F,method:"POST",body:H})})}getPeers(F){return u(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:F})).items})}refreshPeer(F,H){return u(this,void 0,void 0,function*(){yield this.fetch(`peers/${H}/refresh`,{token:F,method:"POST",allowUnsafeRetries:!0})})}createSession(F,H){return u(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:F,method:"POST",body:H})})}refreshSession(F,H){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/refresh`,{token:F,method:"POST",allowUnsafeRetries:!0})})}deleteSession(F,H){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}`,{token:F,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(F){return u(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:F})).items})}getIceServers(F){return u(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:F})).items})}addSignals(F,H,J){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/add-signals`,{token:F,method:"POST",body:J})})}takeSignals(F,H){return u(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${H}/take-signals`,{token:F,method:"POST"})).items})}}var g=n(1),c=n(9),d=n(15),w=n.n(d),v=n(102),y=n.n(v),f=n(4),p=n(0),S=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class N extends class{constructor(F,H){this.type=F,this.name=H}}{constructor(F){super("simple","LogReporter"),this.message=F}send(F){return S(this,void 0,void 0,function*(){var H,J;p.a.debug(this.message,(H=F.reduce((oe,se)=>Object.assign(Object.assign({},oe),{[se.name]:se.stat}),{}),J=oe=>{const{sum:se,count:ce}=oe,he=se/ce;return Object.assign(Object.assign({},oe),{average:he})},Object.keys(H).reduce((oe,se)=>Object.assign(Object.assign({},oe),{[se]:J(H[se])}),{})))})}}var B=n(40);function E(be){return!!be.match(/^[a-zA-Z0-9-_.,:?'"()@\/\\#$+ ]{1,255}$/)}var T=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};function h({func:be,delay:F,immediate:H=!1}){let J=!1,oe=setTimeout(function ce(){return T(this,void 0,void 0,function*(){if(J)return;const he=new Date().getTime();try{se=be(),yield se}finally{if(!J){const pe=new Date().getTime();oe=setTimeout(ce,Math.max(F-(pe-he),0))}}})},H?0:F),se=Promise.resolve();return{stop(){return T(this,void 0,void 0,function*(){J=!0,clearTimeout(oe),yield se})}}}var R=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};const W=n(230);class X{constructor(F){this.buffer={},this.reporters=[],this.flushInterval=h({func:()=>this.flushStats(),delay:X.samplePeriodMs}),this.tags=this.filterTags((F==null?void 0:F.tags)||{app:f.a,version:f.j,namespace:f.i,instanceId:B.a})}shutdown(){return R(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(c.a)(2*g.a.second)})}aggregate(F,H,J){this.addToBuffer(this.buffer,this.encodeKey({metric:F,tags:this.filterTags(J||{})}),typeof H=="number"?{min:H,max:H,sum:H,count:1}:H)}increment(F,H){this.aggregate(F,1,H)}timer(F,H,J){return R(this,void 0,void 0,function*(){const oe=W(),se=yield H(),ce=W();return this.aggregate(F,ce-oe,J),se})}registerStatsReporter(F){this.reporters.push(F)}setTag(F,H){const J=this.filterTags({[F]:H});this.tags=Object.assign(Object.assign({},this.tags),J)}addToBuffer(F,H,J){if(F[H]){const{min:oe,max:se,sum:ce,count:he}=F[H];F[H]={min:Math.min(oe,J.min),max:Math.max(se,J.max),sum:ce+J.sum,count:he+J.count}}else F[H]=J}write(F){return R(this,void 0,void 0,function*(){yield Promise.all(this.reporters.map(H=>R(this,void 0,void 0,function*(){let J;const oe={};switch(H.type){case"simple":for(const[ce,he]of Object.entries(F)){const{metric:pe}=this.decodeKey(ce);this.addToBuffer(oe,this.encodeKey({metric:pe}),he)}J=oe;break;case"tagged":J=F;break;default:(function(ce){throw new Error(`Unreachable type encountered (${ce})`)})(H.type)}const se=Object.entries(J);if(se.length>0)return H.send(se.map(([ce,he])=>{const{metric:pe,tags:fe}=this.decodeKey(ce);return{name:pe,tags:Object.assign(Object.assign({},fe),this.tags),stat:he}}),X.samplePeriodMs).catch(ce=>{p.a.debug(`Failed to write stats to ${H.name}`,{error:ce})})})))})}flushStats(){return R(this,void 0,void 0,function*(){yield this.write(this.buffer),this.buffer={}})}encodeKey(F){return w()(Object.assign(Object.assign({},F),Object.keys(F.tags||{}).length>0?{tags:F.tags}:{}))}decodeKey(F){return JSON.parse(F)}filterTags(F){return Object.entries(F||{}).reduce((H,[J,oe])=>(E(J)&&E(oe)&&(H[J]=oe),H),{})}}X.samplePeriodMs=5*g.a.minute;const m=!!f.c,_=new X;m||["local","on-prem"].includes(f.i)||_.registerStatsReporter(new N("stats"));var G=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class j extends class{constructor(F){this.options=F,this.cache=new y.a(Object.assign(Object.assign(Object.assign({},F.dispose||F.disposeAfter?{ttlAutopurge:!0}:{}),F),{dispose:(...H)=>{var J;H[2]==="evict"&&_.increment("lru-eviction",{name:F.name}),(J=F.dispose)===null||J===void 0||J.call(F,...H)},disposeAfter:(...H)=>{var J;this.updateStats(),(J=F.disposeAfter)===null||J===void 0||J.call(F,...H)}})),this.stringify=F.fastStringify?JSON.stringify:w.a}set(F,H,J){const oe=this.stringify(F);if(!this.cache.set(oe,H,{ttl:J})){const se=this.cache.sizeCalculation?this.cache.sizeCalculation(H,oe):"unknown";throw Error(`Value too large (${se} > ${this.cache.max})`)}this.updateStats()}get(F){const{name:H}=this.options,J=this.stringify(F),oe=this.cache.getRemainingTTL(J);return oe<=0?_.increment("cache-miss",{name:H}):oe!==1/0&&_.aggregate("cache-item-ttl",oe,{name:H}),this.cache.get(J)}delete(F){this.cache.delete(this.stringify(F))}peek(F){return this.cache.peek(this.stringify(F))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(F){this.cache.forEach(F)}purgeStale(){return this.cache.purgeStale()}updateStats(){const{name:F}=this.options;_.aggregate("cache-item-count",this.cache.size,{name:F}),this.cache.calculatedSize!==void 0&&_.aggregate("cache-length",this.cache.calculatedSize,{name:F})}}{constructor(F){if(super(F),this.expireRejectedPromiseValues=F.expireRejectedPromiseValues===void 0||F.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=F.rejectedPromiseValueTtl!==void 0?F.rejectedPromiseValueTtl:g.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(F,H,J){super.set(F,H,J),this.expireRejectedPromiseValues&&H.catch(()=>G(this,void 0,void 0,function*(){yield Object(c.a)(this.rejectedPromiseValueTtl),this.peek(F)===H&&this.delete(F)}))}}var C=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class z{constructor(F,H,J){this.authClient=F,this.email=H,this.password=J,this.tokenTtlMs=1*g.a.hour,this.tokenCache=new j({name:"Credentials-tokenCache",max:100,ttl:this.tokenTtlMs-5*g.a.minute,fastStringify:!0})}getToken(){return C(this,void 0,void 0,function*(){let F=this.tokenCache.get(this.email);return F||(F=(()=>C(this,void 0,void 0,function*(){const{authentication:H}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/g.a.second});if(!H)throw new Error("User account not verified.");return H.accessToken}))(),this.tokenCache.set(this.email,F)),F})}}var P=n(97),D=n(17),O=n(233),L=n(41),U=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class A extends L.a{constructor(F){super(F)}postLanRtcOffer(F){return U(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:F})})}}var V=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};function q(be){return V(this,void 0,void 0,function*(){return(yield Promise.all(be.map(F=>F.catch(H=>H)))).filter(F=>F instanceof Error)})}function Q(be,F){if(be===void 0)throw new Error(`Value is undefined${F?`: ${F}`:""}`)}function ee(be,F){if(be===null)throw new Error(`Value is null${F?`: ${F}`:""}`)}function te(be){return Q(be),be}function k(be,F){const H=be.reduce((J,oe)=>[...J,...oe.urls],[]).filter(J=>x(J,F)).sort(J=>b(J,"udp")?-1:0).shift();if(H)return Object.assign(Object.assign({},te(be.find(J=>J.urls.includes(H)))),{urls:[H]})}function x(be,F){switch(F){case"stun":return/^stuns?:/.test(be);case"turn":return/^turns?:/.test(be)}}function b(be,F){return be.endsWith(`transport=${F}`)}var I=n(10);class $ extends Error{constructor(F,H){super(`Deadline expired after ${F}ms + ${H}ms`)}}class K{static withDeadline(F,H){const J=new Promise((oe,se)=>{setTimeout(()=>{se(new $(H,this.grpcCallDeadlineSlopMs))},H+this.grpcCallDeadlineSlopMs)});return Promise.race([F,J])}}K.grpcCallDeadlineSlopMs=500*g.a.millisecond;var Y=n(27);const ne={ordered:!1,maxPacketLifeTime:300*g.a.millisecond},ie={ordered:!0},ue={ordered:!0},we={ordered:!1,maxRetransmits:0},Oe={ordered:!1,maxRetransmits:0},Ee=be=>"received"in be&&be.received!==void 0,Ne=be=>!("received"in be)||be.received===void 0,Te=2*g.a.second;function Ae(be,F={}){const H=Array.from(be.values()),J=H.filter(Ee),oe=J.length>0,se=Math.max(...J.map(fe=>fe.received));let ce;if(oe){const fe=H.length,le=J.length,Se=J.map(Le=>Le.received-Le.sent),{standardDeviation:je,mean:Pe,jitter:We}=function(Le){const Be=Le.length;if(Be===0)return{mean:NaN,standardDeviation:-1,jitter:NaN};const $e=Le.reduce((Xe,ct)=>Xe+ct,0)/Be,Ze=Math.sqrt(Le.map(Xe=>Math.pow(Xe-$e,2)).reduce((Xe,ct)=>Xe+ct)/Be);if(Be===1)return{mean:$e,standardDeviation:Ze,jitter:NaN};let Ke=0;for(let Xe=1;Xe<Be;Xe++)Ke+=Math.abs(Le[Xe]-Le[Xe-1]);return{mean:$e,standardDeviation:Ze,jitter:Ke/(Be-1)}}(Se),Ge=H.filter(Le=>Le.sent<se-Te),Ye=Ge.filter(Ne),tt=Ye.length===0?0:Ye.length/Ge.length;ce={pingsSent:fe,pongsReceived:le,average:Pe,standardDeviation:je,jitter:We,max:Math.max(...Se),min:Math.min(...Se),loss:tt}}else ce=null;const{temporalNow:he=Date.now()}=F,pe=(oe?se:he)-4*Te;return Array.from(be.entries()).forEach(fe=>{const[le,Se]=fe;Se.sent<pe&&be.delete(le)}),ce}function Ie({entityId:be,streamName:F,streamType:H}){return`${be}.${F}.${H}`}var Fe=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class Ve{constructor(F,H){this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=F,this.connection=H}updateRemoteMessagesCounts(F){if(F.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const H of F.payload.streamsInfo.items)this.counts.remoteSent.set(H.streamId,H.sentCount),this.counts.remoteReceived.set(H.streamId,H.receivedCount)}}getLocalStreamsInfo(F){const{localSent:H,localReceived:J}=this.counts;return{items:[...new Set([...H.keys(),...J.keys()])].map(oe=>{var se,ce;return{streamId:oe,sentCount:(se=H.get(oe))!==null&&se!==void 0?se:0,receivedCount:(ce=J.get(oe))!==null&&ce!==void 0?ce:0}}),timestamp:F}}incrementLocalSent(F){const{localSent:H}=this.counts,J=Ie(F.header.stream);H.set(J,(H.get(J)||0)+1)}incrementLocalReceived(F){const{localReceived:H}=this.counts,J=Ie(F.header.stream),oe=H.get(J)||0;if(oe===0){const{streamName:se,streamType:ce}=F.header.stream;p.a.debug("RTC client received first message for stream",{streamName:se,streamType:ce})}H.set(J,oe+1)}uploadMetrics(){return Fe(this,void 0,void 0,function*(){const{sessionId:F}=this,H=yield this.connection.peerConnection.getStats(),J={};H.forEach(fe=>J[fe.id]=fe),p.a.debug("rtc-stats",Object.assign(Object.assign({},J),{sessionId:F}));const{localSent:oe,localReceived:se,remoteSent:ce,remoteReceived:he}=this.counts,pe=[...new Set([...oe.keys(),...se.keys()])].reduce((fe,le)=>{const Se=oe.get(le),je=se.get(le),Pe=ce.get(le),We=he.get(le);return Object.assign(Object.assign({},fe),{[`local-${le}-sent`]:Se,[`local-${le}-received`]:je,[`remote-${le}-sent`]:Pe,[`remote-${le}-received`]:We})},{sessionId:F});p.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},pe))})}}function rt(be,F,H){return{header:{stream:be,created:Date.now(),frameId:H||""},payload:F}}function vt(be){const F=be.localCandidate.candidateType,H=be.remoteCandidate.candidateType;return F==="host"&&H==="host"?"local":F==="relay"||H==="relay"?"TURN":"STUN"}function wt(be){return new Set(["disconnected","failed","closed"]).has(be.iceConnectionState)}function Ot(be){switch(be.header.stream.streamType){case"twist":{const{twist:F}=be.payload;if(!F)throw Error("twist not in payload of RTC message with type twist");return{header:be.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},F.linear),angular:Object.assign({x:0,y:0,z:0},F.angular)}}}}case"pose":{const{pose:F}=be.payload;if(!F)throw Error("pose not in payload of RTC message with type pose");return{header:be.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},F.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},F.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:F}=be.payload;if(!F)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const H=new Array(36).fill(0);return F.covariance.forEach((J,oe)=>{if(oe>=36)throw Error("covariance contains more than 36 elements");H[oe]=J}),{header:be.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},F.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},F.pose.rotation)},covariance:H}}}}case"point":{const{point:F}=be.payload;if(!F)throw Error("point not in payload of RTC message with type point");return{header:be.header,payload:{point:Object.assign({x:0,y:0,z:0},F)}}}default:return be}}var lt=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class mt{get peerConnection(){return ee(this._peerConnection,"RTCPeerConnection is closed!"),this._peerConnection}constructor(F,H,J,oe){this.iceServers=H,this.config=J,this.dataChannelNotifier=oe,this.connectTimeoutMs=20*g.a.second,this.iceGatheringTimeoutMs=3*g.a.second,this.pingUpdateTimeoutMs=1*g.a.second,this.pingV2UpdateTimeoutMs=250*g.a.millisecond,this.pingV2MetricsGatherTimeoutMs=1*g.a.second,this.streamsInfoUpdateTimeoutMs=2*g.a.second,this.reassemblyTimeoutMs=500*g.a.millisecond,this.reassemblyTableCleanupMs=1*g.a.second,this.heartbeatTimeoutMs=20*g.a.millisecond,this._peerConnection=null,this.heartbeatChannel=null,this.latestTtlStreamChannel=null,this.reliableStreamChannel=null,this.latestReliableStreamChannel=null,this.latestTryOnceStreamChannel=null,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1,this.pingV2Map=new Map,this.sendPingV2=()=>{const{latestTryOnceStreamChannel:ce}=this;if(!ce)return;const he=new Date().getTime(),pe=Object(O.a)();this.sendSystemMessage(ce,{type:"ping-v2",payload:{timestamp:he,id:pe}}),this.pingV2Map.set(pe,{sent:he})},this.gatherPingV2Metrics=()=>{const ce=Ae(this.pingV2Map);if(ce){const he=this.getRemoteDeviceId();this.pingInfo=ce,_.aggregate("rtc-ping-average",ce.average,Object.assign({},he?{deviceId:he}:{})),_.aggregate("rtc-ping-loss",ce.loss,Object.assign({},he?{deviceId:he}:{})),_.aggregate("rtc-jitter",ce.jitter,Object.assign({},he?{deviceId:he}:{}))}},this._peerConnection=F;const{isOffer:se}=J.baseConfig;se?this.initializeChannels(F):F.ondatachannel=ce=>{switch(ce.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ce.channel;break;case"stream.reliable":this.reliableStreamChannel=ce.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ce.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ce.channel;break;case"heartbeat":return void(this.heartbeatChannel=ce.channel);default:return void this.dataChannelNotifier(ce.channel)}this.setupChannel(ce.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ce}=this;ce&&this.sendSystemMessage(ce,{type:"ping"})},this.pingUpdateTimeoutMs),this.pingV2UpdateTimeout=setInterval(this.sendPingV2,this.pingV2UpdateTimeoutMs),this.pingV2MetricsGatherTimeout=setInterval(this.gatherPingV2Metrics,this.pingV2MetricsGatherTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:ce}=this;ce&&this.sendSystemMessage(ce,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const ce=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((he,pe,fe)=>{ce>pe+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(he)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:ce}=this;ce&&ce.readyState==="open"&&ce.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(F){return lt(this,void 0,void 0,function*(){const{peerConnection:H}=this,{track:J}=this.config.baseConfig,oe=(()=>{try{return JSON.parse(F.getPayload())}catch{return}})();if(!oe)return void p.a.error("Received unparseable signal.");p.a.debug("Handling signal",{description:oe});const{sdp:se,type:ce}=oe;if(!se||!ce)return void p.a.warn("Received non-SDP signal");const{signalingState:he,connectionState:pe}=H;if(he!=="stable"||pe!=="connected")if(H.remoteDescription)p.a.warn(`Received SDP after remote description was set: ${se}`);else{if(ce==="offer"){if(he!=="stable")return void p.a.warn("Received offer SDP when signaling is ongoing.");yield H.setRemoteDescription(oe);const fe=yield H.createAnswer();yield H.setLocalDescription(fe);const le=F.clone();return J==null||J("Answer Received",le),le.setPayload(JSON.stringify(fe)),le.setReceiverId(F.getSenderId()),le.setSenderId(F.getReceiverId()),le}if(ce==="answer"){if(he==="stable")return void p.a.warn("Received answer SDP when signaling hasn't started.");yield H.setRemoteDescription(oe)}}else p.a.warn(`Received SDP when already connected: ${se}`)})}send(F,H){const J=this.getChannelFromLabel(H.channelLabel);J?this.sendOnChannel(J,F):p.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(F){var H;this.sendSystemMessage((ee(H=this.reliableStreamChannel),H),{type:"stream-control",streamControl:F})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:F,latestTtlStreamChannel:H,latestTryOnceStreamChannel:J,latestReliableStreamChannel:oe}=this;return(F==null?void 0:F.readyState)==="open"&&(H==null?void 0:H.readyState)==="open"&&(J==null?void 0:J.readyState)==="open"&&(oe==null?void 0:oe.readyState)==="open"}close(){var F,H,J,oe,se,ce,he;return lt(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield(F=this.sessionMetrics)===null||F===void 0?void 0:F.uploadMetrics(),ft(this.pingUpdateTimeout),ft(this.pingV2UpdateTimeout),ft(this.pingV2MetricsGatherTimeout),ft(this.reassemblyTableCleanupTimeout),ft(this.streamsInfoUpdateTimeout),ft(this.heartbeatTimeout),(H=this._peerConnection)===null||H===void 0||H.close(),(J=this.heartbeatChannel)===null||J===void 0||J.close(),(oe=this.latestReliableStreamChannel)===null||oe===void 0||oe.close(),(se=this.latestTryOnceStreamChannel)===null||se===void 0||se.close(),(ce=this.latestTtlStreamChannel)===null||ce===void 0||ce.close(),(he=this.reliableStreamChannel)===null||he===void 0||he.close(),this._peerConnection=null,this.heartbeatChannel=null,this.latestReliableStreamChannel=null,this.latestTryOnceStreamChannel=null,this.latestTtlStreamChannel=null,this.reliableStreamChannel=null)})}getPing(){return this.pingTimeMs}getPingInfo(){return this.pingInfo}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var F;return(F=this.config.remoteConfig)===null||F===void 0?void 0:F.sessionCreatedTimestamp}setSessionCreatedTimestamp(F){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=F)}getSessionId(){var F;return(F=this.config.remoteConfig)===null||F===void 0?void 0:F.sessionId}setSessionId(F){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=F,this.sessionMetrics=new Ve(F,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var F;return(F=this.config.baseConfig)===null||F===void 0?void 0:F.remoteDeviceId}setRemoteDeviceId(F){this.config.baseConfig.remoteDeviceId=F}getSessionMetricsMessageCounts(){var F;return(F=this.sessionMetrics)===null||F===void 0?void 0:F.counts}getConnectionStatsInfo(){return lt(this,void 0,void 0,function*(){const{peerConnection:F}=this;if(!F)return;const H=yield F.getStats(null),J=[];H.forEach(pe=>{J.push(pe)});const oe=J.find(pe=>pe.type==="transport");if(!oe)return;const se=J.find(pe=>(pe.type==="candidate-pair"||pe.type==="candidatepair")&&pe.id===oe.selectedCandidatePairId);if(!se)return;const ce=J.find(pe=>pe.id===se.localCandidateId),he=J.find(pe=>pe.id===se.remoteCandidateId);return ce&&he&&(ce.address=ce.address||ce.ip,he.address=he.address||he.ip,ce.address!==void 0&&he.address!==void 0)?{transport:oe,localCandidate:ce,remoteCandidate:he}:void 0})}initializeChannels(F){this.heartbeatChannel=F.createDataChannel("heartbeat",Oe),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=F.createDataChannel("stream.latest-ttl",ne),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=F.createDataChannel("stream.reliable",ie),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=F.createDataChannel("stream.latest-reliable",ue),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=F.createDataChannel("stream.latest-try-once",we),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var F,H;return lt(this,void 0,void 0,function*(){const{gotOffer:J}=this,{peerConnection:oe,config:se}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const ce=(F=this.config.remoteConfig)===null||F===void 0?void 0:F.sessionId;if(J)return void p.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,wt(this.peerConnection))return void p.a.debug("Failed to generate offer because the peer connection was inactive.");const he=se.baseConfig.track;oe.onicecandidate=()=>{this.hasIceCandidate=!0},oe.oniceconnectionstatechange=()=>lt(this,void 0,void 0,function*(){const Pe=oe.iceConnectionState;if(Pe==="connected"||Pe==="completed"){const We=yield this.getConnectionStatsInfo(),Ge=We?vt(We):void 0;p.a.info(`ICE connection state changed to ${Pe}`,{sessionId:ce,connectionStatsInfo:We,iceMode:Ge}),he==null||he("ICE connection state change",{iceConnectionState:Pe,sessionId:ce,connectionStatsInfo:We,iceMode:Ge})}}),yield oe.setLocalDescription(yield oe.createOffer());const pe=oe.getConfiguration?oe.getConfiguration().iceTransportPolicy:"all",fe=new Date().getTime();for(;;){const Pe=new Date().getTime()-fe;if(Pe>this.connectTimeoutMs)return void p.a.debug("Failed to generate offer because ICE gathering timed out.");if(Pe>this.iceGatheringTimeoutMs&&this.hasIceCandidate){p.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:pe,waitTime:Pe}),he==null||he("ICE gathering partially completed",{sessionId:ce,iceTransportPolicy:pe,waitTime:Pe});break}if(oe.iceGatheringState==="complete"){p.a.debug("ICE gathering complete",{iceTransportPolicy:pe,waitTime:Pe}),he==null||he("ICE gathering completed",{sessionId:ce,iceTransportPolicy:pe,waitTime:Pe});break}yield Object(c.a)(.1*g.a.second)}const le=(H=this.iceServers)!==null&&H!==void 0?H:[];for(const Pe of le)"credentialType"in Pe&&(Pe.credentialType=void 0);const Se=JSON.stringify(le),je=new I.Signal;return je.setPayload(JSON.stringify(oe.localDescription)),je.setSenderId(this.config.baseConfig.localPeerId),je.setReceiverId(this.config.baseConfig.remotePeerId),je.setIceServers(Se),je.setIceTransportPolicy(pe??"all"),this.config.baseConfig.sessionType!==void 0?je.setSessionType(this.config.baseConfig.sessionType):je.setSessionType(I.SessionType.TELEOP),p.a.debug("Sending offer signal with description",{description:je.getPayload()}),je})}getLanOffer(){return lt(this,void 0,void 0,function*(){const{peerConnection:F,gotOffer:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if(H)return void p.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,wt(this.peerConnection))return void p.a.debug("Failed to generate offer because the peer connection was inactive.");yield F.setLocalDescription(yield F.createOffer());const J=new Date().getTime();for(;;){if(new Date().getTime()-J>this.iceGatheringTimeoutMs)return void p.a.debug("Failed to generate offer because ICE gathering timed out.");if(F.iceGatheringState==="complete")break;yield Object(c.a)(.1*g.a.second)}const oe=F.localDescription;if(oe)return p.a.debug("Sending LAN offer signal with description",{description:oe}),oe;p.a.error("Failed to generate LAN offer description")})}handleLanAnswer(F){return lt(this,void 0,void 0,function*(){const{peerConnection:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield H.setRemoteDescription(F)})}getChannelFromLabel(F){switch(F){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(F,H){var J;let oe;try{oe=Object(Y.encode)(JSON.stringify(H))}catch(se){return void p.a.warn("Failed to encode RTC message",{error:se})}try{F.send(oe),(J=this.sessionMetrics)===null||J===void 0||J.incrementLocalSent(H)}catch(se){p.a.warn("Failed to send message to channel",{error:se,channel:F.label})}}channelNotRecognized(F){return F!==this.latestTtlStreamChannel&&F!==this.latestReliableStreamChannel&&F!==this.latestTryOnceStreamChannel&&F!==this.reliableStreamChannel}setupChannel(F){F.onmessage=H=>{if(this.channelNotRecognized(F))return void p.a.warn("Received message on unrecognized data channel.");let J;try{J=JSON.parse(Object(Y.decode)(H.data))}catch(oe){return void p.a.warn("Received unparseable message on RTC stream data channel",{error:oe,channel:F.label})}J.communicationType==="message-chunk"?this.receiveChannelMessageChunk(F,J):this.receiveChannelMessage(F,J)},F.onerror=H=>{p.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:F.label})},F.onopen=()=>{p.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:F.label})},F.onclose=()=>{const H={bufferedAmount:F.bufferedAmount,sessionId:this.getSessionId(),channelLabel:F.label};this.closeCalled===!1?p.a.debug("Unexpected channel closed",H):p.a.debug("Channel closed",H)}}receiveChannelMessage(F,H){var J;const{config:oe}=this,{remotePeerId:se}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),H=Ot(H),(J=this.sessionMetrics)===null||J===void 0||J.incrementLocalReceived(H),this.handleSystemMessage(F,H)||(F===this.latestTryOnceStreamChannel||F===this.latestTtlStreamChannel||F===this.latestReliableStreamChannel)&&!this.isLatestMessage(H)||oe.baseConfig.receive(se,H)}receiveChannelMessageChunk(F,H){const J=this.reassemblyTable.get(H.id)||[];if(J.push(H),J.length===H.total){const oe=function(se){const ce=se.sort((he,pe)=>he.seq<pe.seq?-1:1).map(he=>he.part).reduce((he,pe)=>he+pe);try{return JSON.parse(ce)}catch{return void p.a.warn("Could not reassemble RTC message chunks")}}(J);return oe&&this.receiveChannelMessage(F,oe),void this.reassemblyTable.delete(H.id)}this.reassemblyTable.set(H.id,J),this.reassemblyTableLastTimestamp.set(H.id,new Date().getTime())}handleSystemMessage(F,H){var J,oe;const{config:se}=this,{baseConfig:ce}=se,{remotePeerId:he,remoteDeviceId:pe}=ce;switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(F,{type:"pong",timestamp:te(H.payload.ping)}),!0;case"pong":{const fe=new Date().getTime()-te(H.payload.pong);return this.pingTimeMs=fe,_.aggregate("rtc-ping-time",fe,Object.assign({},pe?{deviceId:pe}:{})),!0}case"ping-v2":return this.sendPingV2(),!0;case"pong-v2":{const fe=te(H.payload.pongV2),le=this.pingV2Map.get(fe.id);return(le==null?void 0:le.sent)!==fe.timestamp&&p.a.warn("Pong timestamp doesn't match stored value",{currentEntry:le,pong:fe}),this.pingV2Map.set(fe.id,{sent:fe.timestamp,received:new Date().getTime()}),!0}case"streams-info":{const{sessionMetrics:fe}=this,le=(J=H.payload.streamsInfo)===null||J===void 0?void 0:J.timestamp;return!!le&&(fe==null||fe.updateRemoteMessagesCounts(H),(oe=ce.onStreamsInfoUpdate)===null||oe===void 0||oe.call(ce,he,le),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(F,H){var J;const{localUserId:oe,localPeerId:se}=this.config.baseConfig;if(F.readyState!=="open")return;const ce={entityId:oe??se,streamName:`$.${H.type}`,streamType:H.type};let he;switch(H.type){case"ping":he={ping:new Date().getTime()};break;case"pong":he={pong:H.timestamp};break;case"ping-v2":he={pingV2:H.payload};break;case"pong-v2":he={pongV2:H.payload};break;case"stream-control":he={streamControl:H.streamControl};break;case"streams-info":he={streamsInfo:(J=this.sessionMetrics)===null||J===void 0?void 0:J.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(F,rt(ce,he))}isLatestMessage(F){const H=Ie(F.header.stream),J=(this.streamLatestTimestamp.get(H)||0)<=F.header.created;return J&&this.streamLatestTimestamp.set(H,F.header.created),J}}function ft(be){be&&clearInterval(be)}function xt(){p.a.debug("forceGarbageCollection() triggered"),queueMicrotask(()=>{let be=document.createElement("img");be.src=window.URL.createObjectURL(new Blob([new ArrayBuffer(5e7)])),be.onerror=function(){window.URL.revokeObjectURL(this.src),be=null}})}function Lt(be){try{return be instanceof Error?`${be.name}: ${be.message}`:typeof be=="object"?JSON.stringify(be):String(be)}catch{return"Unknown error"}}function Ct(be){var F,H;return{userId:(F=be.getUserId())===null||F===void 0?void 0:F.getValue(),deviceId:(H=be.getDeviceId())===null||H===void 0?void 0:H.getValue(),organizationId:be.getOrganizationId(),id:be.getPeerId(),capabilities:[],capabilitySet:{}}}var ke=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};const dt=be=>be.map(F=>Object.assign(Object.assign(Object.assign({},F),F.username?{username:"<REDACTED>"}:null),F.credential?{credential:"<REDACTED>"}:null));class Ht{constructor(F){this.config=F,this.grpcCallDeadline=5*g.a.second,this.refreshIntervalDelayMs=2*g.a.second,this.iceServersTtl=30*g.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new WeakSet,this.isOutgoingConnection=new Set,this.peerDataChannelListeners=[],this.rtcInstancesConstructed=0,this.statsLoopsExecuted=0;const{refreshIntervalDelayMs:H}=this;this.refreshInterval=h({func:()=>ke(this,void 0,void 0,function*(){try{yield this.update()}catch(J){p.a.warn("RTC refresh failed",{error:J})}}),delay:H,immediate:!0})}send(F,H,J){const oe=this.getActiveConnection(F);oe?oe.isReady()?oe.send(H,J):p.a.warn("Send called with unready connection."):p.a.warn("Send called with no connection.")}controlRemoteStream(F,H){const J=this.getActiveConnection(F);J?J.isReady()?J.controlRemoteStream(H):p.a.warn("controlRemoteStream called with unready connection."):p.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return ke(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(c.a)(.1*g.a.second);return Ct(this.localPeer)})}connect(F,H){var J,oe,se;return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:ce,signalingClient:he}=this.config,{localPeer:pe,receiveSignalStream:fe,iceServers:le}=this;if(!pe||!fe||!le)return void p.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(F))return void p.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.has(F))return void p.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.add(F);const Se=function(Le,Be,$e){const{rtcIceTransportPolicies:Ze,rtcIceServerProtocol:Ke,useAllServers:Xe}=Be||{},ct=Le.map(ut=>Object.assign(Object.assign({},ut),{urls:ut.urls.filter(_t=>{const Bt=(Ze===void 0||Ze.some(It=>x(_t,It)))&&(Ke===void 0||b(_t,Ke));return Bt||p.a.debug(`Ignoring ICE server: ${_t}`,{organizationId:$e}),Bt})})).filter(({urls:ut})=>ut.filter(_t=>_t).length>0);return Xe?ct:[k(ct,"stun"),k(ct,"turn")].filter(ut=>ut!==void 0).map(ut=>te(ut))}(le,H);p.a.debug("Received ICE servers:",dt(le)),p.a.debug("Using ICE servers:",dt(Se));const je=new mt(yield this.createRTCPeerConnection(Se),Se,{baseConfig:{isOffer:!0,isLan:!1,receive:(Le,Be)=>this.config.receive(Le,Be),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Le,Be)=>{var $e,Ze;return(Ze=($e=this.config).onStreamsInfoUpdate)===null||Ze===void 0?void 0:Ze.call($e,Le,Be)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(J=pe.getUserId())===null||J===void 0?void 0:J.getValue(),localPeerId:pe.getPeerId(),remotePeerId:F,sessionType:this.config.sessionType},remoteConfig:{}},Le=>this.onCustomDataChannel(F,Le)),Pe=yield je.getOffer();if(!Pe)return p.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(F);p.a.debug("Sending offer."),ce==null||ce("Sending offer",Pe);const We=new I.SendSignalRequest;We.setSignal(Pe);const Ge=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(he.sendSignal(We,yield this.getMetadata()),this.grpcCallDeadline)}catch(Le){p.a.warn("Error when sending signal",{error:Le})}}))();if(!this.isOutgoingConnection.has(F))return void p.a.debug("No offer set after receiving offer signal response.");p.a.debug("Offer sent.");const Ye=(oe=Ge==null?void 0:Ge.getSessionId())===null||oe===void 0?void 0:oe.getValue(),tt=(se=Ge==null?void 0:Ge.getSessionCreatedTimestamp())===null||se===void 0?void 0:se.getValue();return Ye&&tt?(je.setSessionId(Ye),je.setSessionCreatedTimestamp(tt),this.isOutgoingConnection.delete(F),this.connections.push(je),this.isConnectionInitiator.add(je),this.setupHandlers(je),Ye):(p.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(F))})}connectLan(F){var H,J;return ke(this,void 0,void 0,function*(){const oe=new A(F),se=new mt(yield this.createRTCPeerConnection([]),[],{baseConfig:{isOffer:!0,isLan:!0,receive:(fe,le)=>this.config.receive(fe,le),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(fe,le)=>{var Se,je;return(je=(Se=this.config).onStreamsInfoUpdate)===null||je===void 0?void 0:je.call(Se,fe,le)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(J=(H=this.localPeer)===null||H===void 0?void 0:H.getUserId())===null||J===void 0?void 0:J.getValue(),localPeerId:"lan_client",remotePeerId:F}},fe=>this.onCustomDataChannel(F,fe)),ce=yield se.getLanOffer();if(!ce)return p.a.warn("Could not generate LAN offer"),!1;const he=yield oe.postLanRtcOffer({offer:JSON.stringify(ce)}),pe=new RTCSessionDescription(JSON.parse(he.answer));return yield se.handleLanAnswer(pe),this.localConnections.push(se),this.isConnectionInitiator.add(se),Object(O.a)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(F,H,J,oe,se){const ce=this.getActiveConnection(F);if(ce&&this.isConnectionInitiator.has(ce)){const pe=ce.peerConnection.createDataChannel("custom."+H,J);return oe&&(pe.binaryType="arraybuffer"),se(F,pe),()=>{}}const he=(pe,fe)=>{F===pe&&fe.label==="custom."+H&&se(F,fe)};return this.peerDataChannelListeners.push(he),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(pe=>pe!==he)}}onCustomDataChannel(F,H){this.peerDataChannelListeners.forEach(J=>J(F,H))}getConnectionStatus(F){if(this.isOutgoingConnection.has(F))return"connecting";const H=this.getActiveConnection(F);return H?H.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(F){return ke(this,void 0,void 0,function*(){const H=this.getActiveConnection(F);if(H)return yield H.getConnectionStatsInfo()})}disconnect(F){return ke(this,void 0,void 0,function*(){const H=this.getActiveConnection(F);H&&(yield H.close(),this.connections=this.connections.filter(J=>J!==H),this.localConnections=this.localConnections.filter(J=>J!==H))})}getPeers(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:F}=this.config,H=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(F.getPeers(new I.GetPeersRequest,yield this.getMetadata()),this.grpcCallDeadline)}catch(se){p.a.warn("Error when getting peers",{error:se})}}))();if(!H)return[];const J=H.getPeersList();if(!J)return[];const oe=se=>{var ce,he;return(he=(ce=se.getPeerCreatedTimestamp())===null||ce===void 0?void 0:ce.getValue())!==null&&he!==void 0?he:0};return J.sort((se,ce)=>oe(ce)-oe(se)).map(se=>Ct(se))})}getSessions(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:F}=this.config,H=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(F.getPeers(new I.GetPeersRequest,yield this.getMetadata()),this.grpcCallDeadline)}catch(se){p.a.warn("Error when getting peers",{error:se})}}))();if(!H)return{};const J=H.getPeersList(),oe={};for(const se of J)oe[se.getPeerId()]=se.getSessionIdsList();return oe})}getPing(F){const H=this.getActiveConnection(F);if(H)return H.getPing();p.a.warn("Attempted to get ping time from inactive peer.")}getPingInfo(F){const H=this.getActiveConnection(F);if(H)return H.getPingInfo();p.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(F){const H=this.getActiveConnection(F);if(H)return H.getLastMessageTimestamp();p.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(F){const H=this.getActiveConnection(F);if(H)return H.getSessionMetricsMessageCounts();p.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:F,receiveSignalStream:H,iceServers:J}=this;return!!(F&&H&&J)}shutdown(){return ke(this,void 0,void 0,function*(){p.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const F=this.connections;this.connections=[],yield this.closeConnections(F);const H=this.localConnections;this.localConnections=[],yield this.closeConnections(H),this.isOutgoingConnection.clear(),this.peerDataChannelListeners=[];const{localPeer:J}=this;if(!J||this.config.lanOnlyMode)return;const{signalingClient:oe}=this.config;yield(()=>ke(this,void 0,void 0,function*(){try{const se=new I.DeletePeerRequest;se.setPeerId(J.getPeerId()),yield K.withDeadline(oe.deletePeer(se,yield this.getMetadata()),this.grpcCallDeadline)}catch(se){return void p.a.warn("Error deleting local peer",{error:se})}}))()})}createPeer(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:F}=this.config,H=yield(()=>ke(this,void 0,void 0,function*(){try{return yield K.withDeadline(F.createPeer(new I.CreatePeerRequest,yield this.getMetadata()),this.grpcCallDeadline)}catch(oe){const se=oe;p.a.debug("createPeer failed",{error:se});const ce=Lt(se);throw new Error(`Was not able to create peer: ${ce}`)}}))(),J=H==null?void 0:H.getPeer();if(!J)throw new Error("Response did not provide peer.");return this.localPeer=J})}createReceiveSignalStream(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:F}=this.config,{localPeer:H,iceServers:J}=this;if(!H||!J)return;const{receiveSignalStream:oe}=this;oe&&oe.cancel();const se=new I.ReceiveSignalStreamRequest;se.setPeerId(H.getPeerId());const ce=yield(()=>ke(this,void 0,void 0,function*(){try{return F.receiveSignalStream(se,yield this.getMetadata({hasDeadline:!1}))}catch(he){p.a.debug("createReceiveSignalStream failed",{error:he});const pe=Lt(he);throw new Error(`Unable to create receive signal stream: ${pe}`)}}))();if(!ce)throw new Error("Response did not provide stream.");return ce.on("data",he=>ke(this,void 0,void 0,function*(){var pe,fe,le,Se;const je=he.getSignal(),Pe=(pe=je==null?void 0:je.getSessionId())===null||pe===void 0?void 0:pe.getValue(),We=je==null?void 0:je.getSenderId(),Ge=je==null?void 0:je.getReceiverId(),Ye=(fe=je==null?void 0:je.getSessionCreatedTimestamp())===null||fe===void 0?void 0:fe.getValue();if(!(je&&Pe&&We&&Ge&&Ye))return void p.a.warn("Received signal with missing information.");const tt=this.getActiveConnection(We);if(tt)if(tt.getSessionId()!==Pe){if(p.a.debug("Received signal: different session for a peer we're already connected to."),(tt.getSessionCreatedTimestamp()||0)>Ye)return;const Le=new mt(yield this.createRTCPeerConnection(J),J,{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,$e)=>this.config.receive(Be,$e),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,$e)=>{var Ze,Ke;return(Ke=(Ze=this.config).onStreamsInfoUpdate)===null||Ke===void 0?void 0:Ke.call(Ze,Be,$e)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(Se=H.getUserId())===null||Se===void 0?void 0:Se.getValue(),remotePeerId:We},remoteConfig:{sessionId:Pe,sessionCreatedTimestamp:Ye}},Be=>this.onCustomDataChannel(We,Be));yield Le.handleSignal(je),this.connections.push(Le)}else p.a.debug("Received signal: for an existing connection."),yield tt.handleSignal(je);else{p.a.debug("Received signal: new connection.");const Le=new mt(yield this.createRTCPeerConnection(J),J,{baseConfig:{isOffer:!1,isLan:!1,receive:(Be,$e)=>this.config.receive(Be,$e),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Be,$e)=>{var Ze,Ke;return(Ke=(Ze=this.config).onStreamsInfoUpdate)===null||Ke===void 0?void 0:Ke.call(Ze,Be,$e)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(le=H.getUserId())===null||le===void 0?void 0:le.getValue(),remotePeerId:We},remoteConfig:{sessionId:Pe,sessionCreatedTimestamp:Ye}},Be=>this.onCustomDataChannel(We,Be));yield Le.handleSignal(je),this.connections.push(Le)}})),ce.on("end",()=>{ce.cancel(),this.receiveSignalStream=void 0}),ce.on("error",he=>{switch(he.code){case D.StatusCode.CANCELLED:case D.StatusCode.UNAVAILABLE:case D.StatusCode.UNKNOWN:p.a.debug("Receive signal stream error",{error:he});break;case D.StatusCode.UNAUTHENTICATED:p.a.warn("Receive signal stream error",{error:he});break;default:p.a.error("Receive signal stream error",{error:he})}ce.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=ce})}createRTCPeerConnection(F){var H;return ke(this,void 0,void 0,function*(){const J=(H=this.config.alternateRTCPeerConnection)!==null&&H!==void 0?H:window.RTCPeerConnection;if(!J)throw function(){const{userAgent:oe}=navigator;return oe.includes("Firefox/")?"Firefox":oe.includes("Edg/")?"Edge":oe.includes("Chrome/")?"Chrome":oe.includes("Safari/")?"Safari":oe.includes("MSIE/")||oe.includes("Trident/")?"IE":"Other"}()!=="Chrome"?new Error("WebRTC is not enabled. Please try again with the latest version of Google Chrome."):new Error("WebRTC is not enabled. Please ensure WebRTC is not disabled by ad blocking software.");this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||xt();try{return new J({iceServers:F})}catch(oe){throw p.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),oe}})}closeConnections(F){return ke(this,void 0,void 0,function*(){const H=yield q(F.map(J=>ke(this,void 0,void 0,function*(){yield J.close()})));for(const J of H)p.a.warn("Request to close session failed",{error:J})})}getActiveConnection(F){return this.getConnections().find(H=>H.getRemotePeerId()===F&&H.isActive())}update(){var F;return ke(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(Se=>Se.isActive()),this.config.lanOnlyMode)return;const{signalingClient:H}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers){const Se=[];return this.localPeer||Se.push(this.createPeer()),this.iceServers||Se.push(this.updateIceServers()),yield Promise.all(Se),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()))}const[J,oe]=(se=this.connections,ce=Se=>Se.isActive(),se.reduce((Se,je,Pe,We)=>{const[Ge,Ye]=Se;return(ce(je,Pe,We)?Ge:Ye).push(je),Se},[[],[]]));var se,ce;yield this.closeConnections(oe),this.connections=J,this.gatherConnectionStats().catch(Se=>{p.a.warn("Error calling gatherConnectionStats",{error:Se})}),this.statsLoopsExecuted++;const{localPeer:he}=this,pe=this.connections.filter(Se=>Se.getSessionId).map(Se=>te(Se.getSessionId()));he.setSessionIdsList(pe);const fe=new I.RefreshPeerRequest;fe.setPeer(he);try{yield K.withDeadline(H.refreshPeer(fe,yield this.getMetadata()),this.grpcCallDeadline)}catch(Se){Se instanceof D.RpcError&&Se.code===D.StatusCode.NOT_FOUND?(p.a.warn("Peer expired, creating new peer",{peerId:he.getPeerId()}),yield this.reset()):p.a.warn("Error calling RefreshPeer",{error:Se})}const le=yield this.getPeers();for(const Se of this.connections)Se.setRemoteDeviceId((F=le.find(je=>je.id===Se.getRemotePeerId()))===null||F===void 0?void 0:F.deviceId)})}gatherConnectionStats(){return ke(this,void 0,void 0,function*(){if(this.statsLoopsExecuted%10!=0||this.connections.length!==1)return;const F=yield this.connections[0].getConnectionStatsInfo(),H=F?vt(F):void 0;H?(p.a.info(`Detected RTC connection type: ${H}`),_.setTag("rtc-connection-type",H)):_.setTag("rtc-connection-type","unknown")})}reset(){return ke(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection.clear(),yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:F,iceServersTtl:H}=this,J=new Date().getTime();if(!F||J-F>H)try{const oe=(yield K.withDeadline(this.config.signalingClient.getIceServers(new I.GetIceServersRequest,yield this.getMetadata()),this.grpcCallDeadline)).getIceServers();this.iceServers=JSON.parse(oe),this.iceServersLastUpdate=J}catch(oe){p.a.warn("Error in updateIceServers",{error:oe})}})}setupHandlers(F){const{peerConnection:H}=F,J=F.getSessionCreatedTimestamp();H.onconnectionstatechange=()=>ke(this,void 0,void 0,function*(){const oe=H.connectionState;if(!J)return;const se=F.getRemoteDeviceId();switch(oe){case"connected":_.aggregate("rtc-connect-time",new Date().getTime()-J,Object.assign({},se?{deviceId:se}:{}));break;case"failed":_.increment("rtc-connect-failed",Object.assign({},se?{deviceId:se}:{}))}})}getMetadata(F={}){return ke(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:H}=this.config,{grpcCallDeadline:J}=this,{hasDeadline:oe=!0}=F,se=oe?{deadline:(Date.now()+J).toString(10)}:null;try{const ce=yield H();return Object.assign({authorization:ce},se)}catch(ce){throw p.a.error("getToken() failed",{error:ce}),new Error("Cannot get authorization token")}})}}var it=n(12),yt=n(11),St=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class Wt{constructor(F,H){this.sentMessagesCounts=new Map,this.receivedMessagesCounts=new Map,this.sessionId=F,this.connection=H}incrementMessageSent(F){const H=Ie(F.header.stream);this.sentMessagesCounts.set(H,(this.sentMessagesCounts.get(H)||0)+1)}incrementMessageReceived(F){const H=Ie(F.header.stream);this.receivedMessagesCounts.set(H,(this.receivedMessagesCounts.get(H)||0)+1)}uploadMetrics(){return St(this,void 0,void 0,function*(){const{sessionId:F}=this,H=yield this.connection.peerConnection.getStats(),J={};H.forEach(se=>J[se.id]=se),p.a.debug("rtc-stats",Object.assign(Object.assign({},J),{sessionId:F}));const oe=[...new Set(Array.from(this.sentMessagesCounts.keys()).concat(Array.from(this.receivedMessagesCounts.keys())))].reduce((se,ce)=>{const he=this.sentMessagesCounts.get(ce),pe=this.receivedMessagesCounts.get(ce);return Object.assign(Object.assign({},se),{[`${ce}-sent`]:he,[`${ce}-received`]:pe})},{sessionId:F});p.a.debug("rtc-message-report",oe)})}}function kt(be,F){return Ie(be)===Ie(F)}var ot=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class Et{constructor(F,H){this.peerConnection=F,this.config=H,this.connectTimeoutMs=10*g.a.second,this.gatherIceTimeoutMs=5*g.a.second,this.pingUpdateTimeoutMs=2*g.a.second,this.streamLatestTimestamp=new Map,this.closeCalled=!1,this.connectCalled=!1,this.sentOffer=!1,this.receivedIceCandidate=!1;const{isOffer:J}=H;J?this.initializeChannels(F):F.ondatachannel=oe=>{switch(oe.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=oe.channel;break;case"stream.reliable":this.reliableStreamChannel=oe.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=oe.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=oe.channel}this.setupChannel(oe.channel)},this.sessionMetrics=new Wt(this.getSessionId(),this)}connect(){return ot(this,void 0,void 0,function*(){if(this.connectCalled)return;this.connectCalled=!0,this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:oe}=this;oe&&this.sendSystemMessage(oe,{type:"ping"})},this.pingUpdateTimeoutMs),this.connectTimeout=setTimeout(()=>ot(this,void 0,void 0,function*(){this.isReady()||(p.a.warn("RTC connect timed out, closing connection"),yield this.close())}),this.connectTimeoutMs);const{peerConnection:F,config:{isOffer:H,sessionId:J}}=this;if(H){const oe=yield F.createOffer();yield F.setLocalDescription(oe)}H&&(this.gatherIceTimeout=setTimeout(()=>ot(this,void 0,void 0,function*(){this.sentOffer||(p.a.warn("ICE gathering timed out"),this.receivedIceCandidate?(p.a.warn("Attempting to connect with partial ICE candidate pool"),yield this.sendOffer()):yield this.close())}),this.gatherIceTimeoutMs),F.onicecandidate=oe=>ot(this,void 0,void 0,function*(){oe.candidate?this.receivedIceCandidate=!0:yield this.sendOffer()}),F.onicegatheringstatechange=()=>ot(this,void 0,void 0,function*(){F.iceGatheringState==="complete"&&(yield this.sendOffer())}),F.onnegotiationneeded=()=>{p.a.debug("Negotiation needed",{sessionId:J})})})}handleSignal(F){return ot(this,void 0,void 0,function*(){const{peerConnection:H,config:{sessionId:J,sendSignal:oe}}=this,{description:se}=JSON.parse(F.payload);if(p.a.debug("Handling signal",{sessionId:J,description:JSON.stringify(se)}),se)if(H.signalingState!=="stable"||H.connectionState!=="connected")if(H.remoteDescription)p.a.warn(`Received SDP signal during negotiation when remote description is already set: ${JSON.stringify(F)}`);else if(se.type==="offer"){yield H.setRemoteDescription(se);const ce=yield H.createAnswer();yield H.setLocalDescription(ce),yield oe({payload:JSON.stringify({description:ce})})}else se.type==="answer"&&(yield H.setRemoteDescription(se));else p.a.warn(`Received SDP signal when signaling is stable and connected: ${JSON.stringify(F)}`);else p.a.warn(`Received non-SDP signal: ${JSON.stringify(F)}`)})}send(F,H){const J=this.getChannelFromLabel(H.channelLabel);J?this.sendOnChannel(J,F):p.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(F){this.sendSystemMessage(te(this.reliableStreamChannel),{type:"stream-control",streamControl:F})}isActive(){return new Set(["new","connecting","connected"]).has(this.peerConnection.connectionState)}isReady(){const{peerConnection:F,latestTtlStreamChannel:H,reliableStreamChannel:J,latestTryOnceStreamChannel:oe}=this;return!!(J&&H&&oe)&&F.connectionState==="connected"&&J.readyState==="open"&&H.readyState==="open"&&oe.readyState==="open"}isClosed(){const{peerConnection:F,reliableStreamChannel:H,latestTryOnceStreamChannel:J,latestTtlStreamChannel:oe}=this;return!(F.connectionState!=="closed"||H!==void 0&&H.readyState!=="closed"||J!==void 0&&J.readyState!=="closed"||oe!==void 0&&oe.readyState!=="closed")}needsClosing(){const{peerConnection:F,latestTtlStreamChannel:H,reliableStreamChannel:J,latestTryOnceStreamChannel:oe}=this;if(this.isClosed())return!1;const se=new Set(["closing","closed"]),ce=he=>he&&se.has(he.readyState);return wt(F)||ce(H)||ce(J)||ce(oe)}close(){return ot(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield this.sessionMetrics.uploadMetrics(),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.connectTimeout&&clearTimeout(this.connectTimeout),this.gatherIceTimeout&&clearTimeout(this.gatherIceTimeout),this.peerConnection.close())})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionId(){return this.config.sessionId}getRemotePeer(){return this.config.remotePeer}initializeChannels(F){this.latestTtlStreamChannel=F.createDataChannel("stream.latest-ttl",ne),this.reliableStreamChannel=F.createDataChannel("stream.reliable",ie),this.latestReliableStreamChannel=F.createDataChannel("stream.latest-reliable",ue),this.latestTryOnceStreamChannel=F.createDataChannel("stream.latest-try-once",we),this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}sendOffer(){return ot(this,void 0,void 0,function*(){if(this.sentOffer||(this.sentOffer=!0,wt(this.peerConnection)))return;const{peerConnection:F,config:{sendSignal:H}}=this,J=yield F.createOffer();yield F.setLocalDescription(J);const oe={payload:JSON.stringify({description:J})};yield H(oe)})}getChannelFromLabel(F){switch(F){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(F,H){let J;try{J=Object(Y.encode)(JSON.stringify(H))}catch(oe){return void p.a.warn("Failed to encode RTC message",{error:oe})}try{F.send(J),this.sessionMetrics.incrementMessageSent(H)}catch(oe){p.a.warn("Failed to send message to channel",{error:oe,channel:F.label})}}channelNotRecognized(F){return F!==this.latestTtlStreamChannel&&F!==this.latestReliableStreamChannel&&F!==this.latestTryOnceStreamChannel&&F!==this.reliableStreamChannel}setupChannel(F){F.onmessage=H=>{if(this.channelNotRecognized(F))return void p.a.warn("Received message on unrecognized data channel.");let J;try{J=JSON.parse(Object(Y.decode)(H.data))}catch(oe){return void p.a.warn("Received unparseable RTC message",{error:oe,channel:F.label})}if(this.lastMessageTimestamp=new Date().getTime(),J=Ot(J),this.sessionMetrics.incrementMessageReceived(J),!this.handleSystemMessage(F,J)){if(!this.hasCapabilities(J))return void p.a.warn("Received RTC message that was not within the capability scope of the connection.");(F===this.latestTryOnceStreamChannel||F===this.latestTtlStreamChannel||F===this.latestReliableStreamChannel)&&!this.isLatestMessage(J)||this.config.receive(this.config.remotePeer.id,J)}},F.onerror=H=>{p.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:F.label})},F.onopen=()=>{p.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:F.label})},F.onclose=()=>{const H={bufferedAmount:F.bufferedAmount,sessionId:this.getSessionId(),channelLabel:F.label};this.closeCalled===!1?p.a.debug("Unexpected channel closed",H):p.a.debug("Channel closed",H)}}handleSystemMessage(F,H){switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(F,{type:"pong",timestamp:te(H.payload.ping)}),!0;case"pong":{const J=new Date().getTime()-te(H.payload.pong);return this.pingTimeMs=J,_.aggregate("rtc-ping-time",J),!0}case"stream-control":return!0;default:return!1}}sendSystemMessage(F,H){if(F.readyState!=="open")return;const J={entityId:te(this.config.localPeer.deviceId||this.config.localPeer.userId),streamName:`$.${H.type}`,streamType:H.type};let oe;switch(H.type){case"ping":oe={ping:new Date().getTime()};break;case"pong":oe={pong:H.timestamp};break;case"stream-control":oe={streamControl:H.streamControl}}this.sendOnChannel(F,rt(J,oe))}hasCapabilities(F){var H,J;const{localPeer:oe,remotePeer:se}=this.config,ce=(H=oe.capabilitySet.streaming)===null||H===void 0?void 0:H.streams,he=ce&&ce.some(le=>le.receive&&kt(le.stream,F.header.stream)),pe=(J=se.capabilitySet.streaming)===null||J===void 0?void 0:J.streams,fe=pe&&pe.some(le=>le.send&&kt(le.stream,F.header.stream));return he||fe}isLatestMessage(F){const H=Ie(F.header.stream),J=(this.streamLatestTimestamp.get(H)||0)<=F.header.created;return J&&this.streamLatestTimestamp.set(H,F.header.created),J}}var Ue=function(be,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(be,F||[])).next())})};class Nt{constructor(F){this.config=F,this.connections=[],this.connectingSessions=new Map,this.rtcInstancesConstructed=0,this.updateInterval=h({func:()=>Ue(this,void 0,void 0,function*(){try{yield this.update()}catch(H){p.a.warn("RTC update failed",{error:H})}}),delay:250*g.a.millisecond,immediate:!0}),this.localPeer=this.createPeer()}send(F,H,J){const oe=this.getActiveConnection(F);oe?oe.isReady()?oe.send(H,J):p.a.warn("Attempted to send with an active connection to that peer which was not yet ready."):p.a.warn("Attempted to send with no active connection to that peer.")}controlRemoteStream(F,H){const J=this.getActiveConnection(F);J?J.isReady()?J.controlRemoteStream(H):p.a.warn("Attempted to control remote stream with an active connection to that peer which was not yet ready."):p.a.warn("Attempted to control remote stream with no active connection to that peer.")}connect(F){return Ue(this,void 0,void 0,function*(){const H=yield this.getLocalPeer();if(this.getActiveConnection(F))return void p.a.warn("Attempted to connect to peer with an already active connection.");let J;try{J=yield this.config.signalingClient.createSession(yield this.config.getToken(),{offerPeerId:H.id,answerPeerId:F})}catch(oe){Object(it.a)(oe,yt.a,se=>se.statusCode===404),p.a.warn("Attempted to connect to peer that does not exist.")}if(J)for(this.connectingSessions.set(J.id,new Date().getTime()),yield this.connectToSession(J);;)switch(yield Object(c.a)(.1),this.getConnectionStatus(F)){case"connecting":continue;case"connected":return J.id;case"disconnected":return}})}getConnectionStatus(F){const H=this.getActiveConnection(F);return H?H.isReady()?"connected":"connecting":"disconnected"}getIceMode(F){const H=this.getActiveConnection(F);if(H)return H.iceMode}disconnect(F){return Ue(this,void 0,void 0,function*(){const H=this.getActiveConnection(F);H&&(yield this.closeConnection(H))})}getLocalPeer(){return Ue(this,void 0,void 0,function*(){return yield this.localPeer})}getPeers(){return Ue(this,void 0,void 0,function*(){return yield this.config.signalingClient.getPeers(yield this.config.getToken())})}getPing(F){const H=this.getActiveConnection(F);if(H)return H.getPing();p.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(F){const H=this.getActiveConnection(F);if(H)return H.getLastMessageTimestamp();p.a.warn("Attempted to get ping time from inactive peer.")}shutdown(){return Ue(this,void 0,void 0,function*(){yield this.updateInterval.stop();const F=this.connections;this.connections=[],yield this.closeConnections(F)})}closeConnection(F){return Ue(this,void 0,void 0,function*(){this.connectingSessions.delete(F.getSessionId()),yield F.close();try{yield this.config.signalingClient.deleteSession(yield this.config.getToken(),F.getSessionId())}catch(H){Object(it.a)(H,yt.a,J=>J.statusCode===404)}})}getSessions(){return Ue(this,void 0,void 0,function*(){const F=yield this.getLocalPeer();return(yield this.config.signalingClient.getSessions(yield this.config.getToken())).filter(H=>H.offer.peer.id===F.id||H.answer.peer.id===F.id)})}createPeer(){return Ue(this,void 0,void 0,function*(){return yield this.config.signalingClient.createPeer(yield this.config.getToken(),{capabilitySet:this.config.capabilitySet||{}})})}createRTCPeerConnection(F={}){return Ue(this,void 0,void 0,function*(){const H=this.config.alternateRTCPeerConnection||RTCPeerConnection;this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||xt();try{return new H(Object.assign({iceServers:yield this.config.signalingClient.getIceServers(yield this.config.getToken())},F))}catch(J){throw p.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),J}})}closeConnections(F){return Ue(this,void 0,void 0,function*(){const H=yield q(F.map(J=>Ue(this,void 0,void 0,function*(){yield this.closeConnection(J)})));for(const J of H)p.a.warn("Request to close session failed",{error:J})})}reset(){return Ue(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.connectingSessions=new Map,this.localPeer=this.createPeer(),yield this.localPeer})}getActiveConnection(F){return this.connections.find(H=>H.getRemotePeer().id===F&&H.isActive())}update(){return Ue(this,void 0,void 0,function*(){const F=yield this.getLocalPeer();try{yield this.config.signalingClient.refreshPeer(yield this.config.getToken(),F.id)}catch(H){Object(it.a)(H,yt.a,J=>J.statusCode===404),p.a.warn("Peer expired, creating new peer",{peerId:F.id}),yield this.reset()}yield this.handleSessions(yield this.getSessions())})}handleSessions(F){return Ue(this,void 0,void 0,function*(){yield this.syncConnectionsAndSessions(F);const H=F.map(J=>({session:J,connection:this.connections.find(oe=>oe.getSessionId()===J.id)}));yield Promise.all(H.map(({session:J,connection:oe})=>Ue(this,void 0,void 0,function*(){return yield this.maintainConnection(J,oe)})))})}syncConnectionsAndSessions(F){return Ue(this,void 0,void 0,function*(){const H=new Set(F.map(se=>se.id)),J=se=>H.has(se.getSessionId())||this.connectingSessions.has(se.getSessionId());this.connections=this.connections.filter(se=>J(se));const oe=this.connections.filter(se=>!J(se)||se.needsClosing());yield Promise.all(oe.map(se=>Ue(this,void 0,void 0,function*(){yield this.closeConnection(se)})))})}maintainConnection(F,H){return Ue(this,void 0,void 0,function*(){const J=yield this.getLocalPeer(),oe=F.offer.peer.id===J.id;if(H){if(H.isReady())try{yield this.config.signalingClient.refreshSession(yield this.config.getToken(),F.id)}catch(se){Object(it.a)(se,yt.a,ce=>ce.statusCode===404),p.a.debug("Refresh session not found",{sessionId:F.id})}else if(H.isActive())try{yield this.consumeSignals(H)}catch(se){p.a.warn("Failed to ingest signals, closing connection",{error:se}),yield this.closeConnection(H)}}else{if(oe)return;yield this.connectToSession(F)}})}connectToSession(F){return Ue(this,void 0,void 0,function*(){const H=yield this.getLocalPeer(),J=F.offer.peer.id===H.id,oe=yield this.createRTCPeerConnection(),se=new Et(oe,{localPeer:J?F.offer.peer:F.answer.peer,remotePeer:J?F.answer.peer:F.offer.peer,sessionId:F.id,isOffer:J,sendSignal:ce=>this.sendSignal(F.id,ce),receive:(ce,he)=>this.config.receive(ce,he)});if(this.connections.find(ce=>ce.getSessionId()===F.id))return p.a.warn("connectToSession called on a session that already has a connection.",{sessionId:F.id}),void(yield se.close());this.setupHandlers(se),this.connections.push(se);try{yield se.connect()}catch(ce){p.a.warn("Failed to handle negotiation, closing connection",{error:ce}),yield this.closeConnection(se)}})}setupHandlers(F){const{peerConnection:H}=F,J=F.getSessionId();H.onconnectionstatechange=()=>Ue(this,void 0,void 0,function*(){const oe=this.connectingSessions.get(J);if(oe===void 0)return;const se=H.connectionState;switch(wt(H)&&this.connectingSessions.delete(J),se){case"connected":{this.connectingSessions.delete(J);const ce=new Date().getTime()-oe;_.aggregate("rtc-connect-time",ce);break}case"failed":_.increment("rtc-connect-failed"),yield this.closeConnection(F)}})}consumeSignals(F){return Ue(this,void 0,void 0,function*(){let H=[];try{H=yield this.config.signalingClient.takeSignals(yield this.config.getToken(),F.getSessionId())}catch(J){Object(it.a)(J,yt.a,oe=>oe.statusCode===404)}for(const J of H)yield F.handleSignal(J)})}sendSignal(F,H){return Ue(this,void 0,void 0,function*(){try{yield this.config.signalingClient.addSignals(yield this.config.getToken(),F,{signals:[H]})}catch(J){Object(it.a)(J,yt.a,oe=>oe.statusCode===404)}})}}},function(e,t,n){var r={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const l=new Uint8Array(16);function u(){if(!o&&(o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(l)}const s=[];for(let c=0;c<256;++c)s.push((c+256).toString(16).slice(1));function g(c,d=0){return(s[c[d+0]]+s[c[d+1]]+s[c[d+2]]+s[c[d+3]]+"-"+s[c[d+4]]+s[c[d+5]]+"-"+s[c[d+6]]+s[c[d+7]]+"-"+s[c[d+8]]+s[c[d+9]]+"-"+s[c[d+10]]+s[c[d+11]]+s[c[d+12]]+s[c[d+13]]+s[c[d+14]]+s[c[d+15]]).toLowerCase()}t.a=function(c,d,w){if(r.randomUUID&&!d&&!c)return r.randomUUID();const v=(c=c||{}).random||(c.rng||u)();if(v[6]=15&v[6]|64,v[8]=63&v[8]|128,d){w=w||0;for(let y=0;y<16;++y)d[w+y]=v[y];return d}return g(v)}},,function(e,t,n){n.r(t),n.d(t,"LogClient",function(){return s});var r=n(26),o=n(12),l=n(11),u=function(g,c,d,w){return new(d||(d=Promise))(function(v,y){function f(N){try{S(w.next(N))}catch(B){y(B)}}function p(N){try{S(w.throw(N))}catch(B){y(B)}}function S(N){var B;N.done?v(N.value):(B=N.value,B instanceof d?B:new d(function(E){E(B)})).then(f,p)}S((w=w.apply(g,c||[])).next())})};class s extends r.a{log(c){return u(this,void 0,void 0,function*(){const d=s.token;try{yield this.fetch("logs",{token:d,method:"POST",body:{logs:c},allowUnsafeRetries:!0})}catch(w){Object(o.a)(w,l.a,v=>v.statusCode===401&&d!==void 0),s.token===d&&delete s.token,yield this.log(c)}})}}}])})})(dist);var distExports=dist.exports;const SessionTypes={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3,HEADLESS:4},SessionTypeConstants={...SessionTypes,Unknown:SessionTypes.UNKNOWN,Teleop:SessionTypes.TELEOP,PortForward:SessionTypes.PORT_FORWARD,Observe:SessionTypes.OBSERVE,Headless:SessionTypes.HEADLESS,unknown:SessionTypes.UNKNOWN,teleop:SessionTypes.TELEOP,portForward:SessionTypes.PORT_FORWARD,observe:SessionTypes.OBSERVE,headless:SessionTypes.HEADLESS},singleton=Symbol("RtcClientPool.instance");class RtcClientPool{constructor(t){_e(this,et,null);_e(this,"createClient");_e(this,"ttlMs");_e(this,"proxyHandler");_e(this,"proxyReceivers",new Map);_e(this,"teardownTimeout",null);_e(this,"dispatch",(t,n)=>{this.proxyReceivers.forEach(r=>r==null?void 0:r(t,n))});const{createClient:n,ttlMs:r=0}=t;this.createClient=n,this.ttlMs=Math.max(r,0),this.proxyHandler={get:(o,l,u)=>{switch(l){case"shutdown":return()=>this.releaseInstance(u);default:return Reflect.get(o,l,u)}}}}get isActive(){return this[singleton]!==null}get size(){return this.proxyReceivers.size}get(t){const n=new Proxy(this.allocate(),this.proxyHandler);return this.proxyReceivers.set(n,t??null),n}allocate(){if(this[singleton])return this.teardownTimeout&&(clearTimeout(this.teardownTimeout),this.teardownTimeout=null),this[singleton];const t=this.createClient(this.dispatch);return this[singleton]=t,t}async teardown(){const t=this[singleton];if(!t){console.warn("singleton has already been shutdown!");return}try{await t.shutdown()}finally{this[singleton]=null}}async releaseInstance(t){return this.proxyReceivers.delete(t)?this.proxyReceivers.size!==0?!1:(!this.teardownTimeout&&Number.isFinite(this.ttlMs)&&(this.ttlMs===0?await this.teardown():this.teardownTimeout=setTimeout(()=>{this.teardown().catch(n=>console.error("teardown failed",{err:n})).finally(()=>this.teardownTimeout=null)},this.ttlMs)),!0):(console.warn("this instance has already been released!"),!1)}}et=singleton;const getToken=async()=>defined(Authentication.token,"Realtime when user isn't authorized"),EnumRtcClientPools={[SessionTypes.UNKNOWN]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.UNKNOWN,receive:e})}),[SessionTypes.TELEOP]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.TELEOP,receive:e})}),[SessionTypes.PORT_FORWARD]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.PORT_FORWARD,receive:e})}),[SessionTypes.OBSERVE]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.OBSERVE,receive:e})}),[SessionTypes.HEADLESS]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.HEADLESS,receive:e})})},AppRtcClientPools={...EnumRtcClientPools,unknown:EnumRtcClientPools[SessionTypes.UNKNOWN],teleop:EnumRtcClientPools[SessionTypes.TELEOP],portForward:EnumRtcClientPools[SessionTypes.PORT_FORWARD],observe:EnumRtcClientPools[SessionTypes.OBSERVE],headless:EnumRtcClientPools[SessionTypes.HEADLESS]},defaultRtcClientPool=EnumRtcClientPools[SessionTypes.TELEOP],getRtcClientPool=e=>{const{sessionType:t}=e;return t?AppRtcClientPools[t]:defaultRtcClientPool};class CaptureStream{constructor(t){_e(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=r.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}function delay(e){return new Promise(t=>setTimeout(t,e))}const isRtcPeer=e=>e!==void 0&&e.capabilities!==void 0&&e.capabilitySet!==void 0;class DataChannel{constructor(t){_e(this,"ready",!1);_e(this,"listeners",[]);_e(this,"openListeners",[]);_e(this,"closeListeners",[]);_e(this,"errorListeners",[]);_e(this,"binaryListeners",[]);_e(this,"error");_e(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.setReady()},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(n=>n())},this.dataChannel.onerror=n=>{console.error(n),this.error="An error occurred in DataChannel",this.errorListeners.forEach(r=>r(n))},this.dataChannel.onmessage=n=>{this.listeners.forEach(r=>{const o=new Uint8Array(n.data),l=this.decoder.decode(o);r(l)}),this.binaryListeners.forEach(r=>{r(new Uint8Array(n.data))})}}setReady(){this.ready=!0,this.openListeners.forEach(t=>t())}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(n=>n!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(n=>n!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(n=>n!==t)}async waitTilReady(){return this.ready?!0:new Promise((n,r)=>{let o=setInterval(()=>{this.dataChannel.readyState==="open"&&this.setReady(),this.ready&&(clearInterval(o),n(!0)),this.error&&r(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(n,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const n=this.binaryListeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(n,1)}}var eventemitter3={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(g,c,d){this.fn=g,this.context=c,this.once=d||!1}function l(g,c,d,w,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var y=new o(d,w||g,v),f=n?n+c:c;return g._events[f]?g._events[f].fn?g._events[f]=[g._events[f],y]:g._events[f].push(y):(g._events[f]=y,g._eventsCount++),g}function u(g,c){--g._eventsCount===0?g._events=new r:delete g._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],d,w;if(this._eventsCount===0)return c;for(w in d=this._events)t.call(d,w)&&c.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},s.prototype.listeners=function(c){var d=n?n+c:c,w=this._events[d];if(!w)return[];if(w.fn)return[w.fn];for(var v=0,y=w.length,f=new Array(y);v<y;v++)f[v]=w[v].fn;return f},s.prototype.listenerCount=function(c){var d=n?n+c:c,w=this._events[d];return w?w.fn?1:w.length:0},s.prototype.emit=function(c,d,w,v,y,f){var p=n?n+c:c;if(!this._events[p])return!1;var S=this._events[p],N=arguments.length,B,E;if(S.fn){switch(S.once&&this.removeListener(c,S.fn,void 0,!0),N){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,d),!0;case 3:return S.fn.call(S.context,d,w),!0;case 4:return S.fn.call(S.context,d,w,v),!0;case 5:return S.fn.call(S.context,d,w,v,y),!0;case 6:return S.fn.call(S.context,d,w,v,y,f),!0}for(E=1,B=new Array(N-1);E<N;E++)B[E-1]=arguments[E];S.fn.apply(S.context,B)}else{var T=S.length,h;for(E=0;E<T;E++)switch(S[E].once&&this.removeListener(c,S[E].fn,void 0,!0),N){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,d);break;case 3:S[E].fn.call(S[E].context,d,w);break;case 4:S[E].fn.call(S[E].context,d,w,v);break;default:if(!B)for(h=1,B=new Array(N-1);h<N;h++)B[h-1]=arguments[h];S[E].fn.apply(S[E].context,B)}}return!0},s.prototype.on=function(c,d,w){return l(this,c,d,w,!1)},s.prototype.once=function(c,d,w){return l(this,c,d,w,!0)},s.prototype.removeListener=function(c,d,w,v){var y=n?n+c:c;if(!this._events[y])return this;if(!d)return u(this,y),this;var f=this._events[y];if(f.fn)f.fn===d&&(!v||f.once)&&(!w||f.context===w)&&u(this,y);else{for(var p=0,S=[],N=f.length;p<N;p++)(f[p].fn!==d||v&&!f[p].once||w&&f[p].context!==w)&&S.push(f[p]);S.length?this._events[y]=S.length===1?S[0]:S:u(this,y)}return this},s.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&u(this,d)):(this._events=new r,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})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class Manipulator{constructor(t,n){_e(this,"currentListeners",[]);_e(this,"onRealtimeMessage",(t,n)=>{n.payload.jointState&&this.currentListeners.forEach(r=>{n.payload.jointState&&r(n.payload.jointState)})});this.device=t,this.config=n}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,n,r){_e(this,"channel");_e(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=n,this.timeout=r}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);_e(this,"RESPONSE_SUCCESS_BYTE",0);_e(this,"decoder",new TextDecoder)}generateBinaryId(){const n=new Uint8Array(16);for(let r=0;r<n.length;r++)n[r]=Math.floor(Math.random()*256);return n}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(n=>{const o=n.slice(0,16).toString();if(o.length===0)throw new Error("Invalid response");const l=n.slice(16);if(l.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(o)&&this.requestIdToResponseMap.set(o,l)})}async request(n){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:o,timeout:l}=this;await r.waitTilReady();const u=this.generateBinaryId(),s=u.toString();o.set(s,!0),r.sendBinary(new Uint8Array([...u,...n]));const g=new Date().getTime();for(;new Date().getTime()<g+l;)if(await delay(50),o.has(s)){const c=o.get(s);if(c!==!0){o.delete(s);const d=c[0]===this.RESPONSE_SUCCESS_BYTE,w=c.slice(1);if(d)return w;throw console.error({name:"AdapterError",message:this.decoder.decode(w)}),new Error("Binary request datachannel adapter error")}}throw o.delete(s),console.error({name:"TimeoutError",message:`Request timed out after ${l/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const n=JSON.parse(t),{id:r,data:o,error:l}=n;if(!r)throw new Error("Invalid response");if(!o&&!l)throw new Error("Invalid response");this.requestIdToResponseMap.has(r)&&this.requestIdToResponseMap.set(r,n)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:r,timeout:o}=this;await n.waitTilReady();const l=this.generateTextId();r.set(l,!0),n.send(JSON.stringify({id:l,data:t}));const u=new Date().getTime();for(;new Date().getTime()<u+o;)if(await delay(50),r.has(l)){const s=r.get(l);if(s!==!0){r.delete(l);const{data:g,error:c}=s;if(g)return g;if(c)throw console.error({name:"AdapterError",message:c}),new Error("Text request datachannel adapter error")}}throw r.delete(l),console.error({name:"TimeoutError",message:`Request timed out after ${o/1e3} seconds`}),new Error("Text request datachannel request timed out")}}class BaseDevice extends EventEmitter{constructor(){super(...arguments);_e(this,"rtcClient");_e(this,"remoteDevicePeerId",null);_e(this,"realtimeListeners",[]);_e(this,"connectionMonitorInterval");_e(this,"handleMessage",(n,r)=>{this.realtimeListeners.forEach(o=>o(n,r))})}stopConnectionMonitoring(){clearInterval(this.connectionMonitorInterval),this.connectionMonitorInterval=void 0}assertNotCancelled(n){if(n)throw new Error("Cancelled by deadline")}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}addRealtimeListener(n){this.realtimeListeners.push(n)}removeRealtimeListener(n){const r=this.realtimeListeners.indexOf(n);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeManipulators(){const n=await this.getConfiguration(),r=[];for(const o of n.teleop.rosStreams??[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async getRealtimeVideoStreams(){var o,l,u;const n=await this.getConfiguration(),r=[];for(const s of((o=n.teleop)==null?void 0:o.hardwareStreams)??[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of((l=n.teleop)==null?void 0:l.rosStreams)??[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName}),(s.topicType==="sensor_msgs/Image"||s.topicType==="sensor_msgs/CompressedImage")&&s.encodeVideo&&r.push({name:s.topicName});for(const s of((u=n.teleop)==null?void 0:u.customStreams)??[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}createCustomRequestDataChannel(n,r=3e3){return new TextRequestDataChannel(this,n,r)}createCustomBinaryRequestDataChannel(n,r=3e3){return new BinaryRequestDataChannel(this,n,r)}async startListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n,enablePriorityUpload:!1,pipeline:"telemetry"})}async changeStreamAudioType(n,r){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer();o.controlRemoteStream(defined(l).id,{streamName:n,setAudioFormat:r})}async createCustomDataChannel(n,r){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer(),u=await new Promise(s=>{o.createCustomDataChannel(defined(l).id,n,{ordered:!0,...r},!1,(g,c)=>{const d=new DataChannel(c);s(d)})});return await u.waitTilReady(),u}async sendRealtimeMessage(n,r={channelLabel:"stream.reliable"}){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer();o.send(defined(l).id,n,r)}async getRealtimeAudioStreams(){var o,l,u;const n=await this.getConfiguration(),r=[];for(const s of((o=n.teleop)==null?void 0:o.hardwareStreams)??[])s.rtcStreamType==="audio-chunk"&&r.push({name:s.name});for(const s of((l=n.teleop)==null?void 0:l.rosStreams)??[])s.topicType=="audio_common_msgs/AudioData"&&r.push({name:s.topicName});for(const s of((u=n.teleop)==null?void 0:u.customStreams)??[])s.rtcStreamType==="audio-chunk"&&r.push({name:s.name});return r}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(e){let t=e.length;for(;--t>=0;)e[t]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const d_code=e=>e<256?_dist_code[e]:_dist_code[256+(e>>>7)],put_short=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},send_bits=(e,t,n)=>{e.bi_valid>Buf_size-n?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>Buf_size-e.bi_valid,e.bi_valid+=n-Buf_size):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},send_code=(e,t,n)=>{send_bits(e,n[t*2],n[t*2+1])},bi_reverse=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},bi_flush=e=>{e.bi_valid===16?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},gen_bitlen=(e,t)=>{const n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,l=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,g=t.stat_desc.max_length;let c,d,w,v,y,f,p=0;for(v=0;v<=MAX_BITS$1;v++)e.bl_count[v]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<HEAP_SIZE$1;c++)d=e.heap[c],v=n[n[d*2+1]*2+1]+1,v>g&&(v=g,p++),n[d*2+1]=v,!(d>r)&&(e.bl_count[v]++,y=0,d>=s&&(y=u[d-s]),f=n[d*2],e.opt_len+=f*(v+y),l&&(e.static_len+=f*(o[d*2+1]+y)));if(p!==0){do{for(v=g-1;e.bl_count[v]===0;)v--;e.bl_count[v]--,e.bl_count[v+1]+=2,e.bl_count[g]--,p-=2}while(p>0);for(v=g;v!==0;v--)for(d=e.bl_count[v];d!==0;)w=e.heap[--c],!(w>r)&&(n[w*2+1]!==v&&(e.opt_len+=(v-n[w*2+1])*n[w*2],n[w*2+1]=v),d--)}},gen_codes=(e,t,n)=>{const r=new Array(MAX_BITS$1+1);let o=0,l,u;for(l=1;l<=MAX_BITS$1;l++)o=o+n[l-1]<<1,r[l]=o;for(u=0;u<=t;u++){let s=e[u*2+1];s!==0&&(e[u*2]=bi_reverse(r[s]++,s))}},tr_static_init=()=>{let e,t,n,r,o;const l=new Array(MAX_BITS$1+1);for(n=0,r=0;r<LENGTH_CODES$1-1;r++)for(base_length[r]=n,e=0;e<1<<extra_lbits[r];e++)_length_code[n++]=r;for(_length_code[n-1]=r,o=0,r=0;r<16;r++)for(base_dist[r]=o,e=0;e<1<<extra_dbits[r];e++)_dist_code[o++]=r;for(o>>=7;r<D_CODES$1;r++)for(base_dist[r]=o<<7,e=0;e<1<<extra_dbits[r]-7;e++)_dist_code[256+o++]=r;for(t=0;t<=MAX_BITS$1;t++)l[t]=0;for(e=0;e<=143;)static_ltree[e*2+1]=8,e++,l[8]++;for(;e<=255;)static_ltree[e*2+1]=9,e++,l[9]++;for(;e<=279;)static_ltree[e*2+1]=7,e++,l[7]++;for(;e<=287;)static_ltree[e*2+1]=8,e++,l[8]++;for(gen_codes(static_ltree,L_CODES$1+1,l),e=0;e<D_CODES$1;e++)static_dtree[e*2+1]=5,static_dtree[e*2]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=e=>{let t;for(t=0;t<L_CODES$1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<D_CODES$1;t++)e.dyn_dtree[t*2]=0;for(t=0;t<BL_CODES$1;t++)e.bl_tree[t*2]=0;e.dyn_ltree[END_BLOCK*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},bi_windup=e=>{e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},smaller=(e,t,n,r)=>{const o=t*2,l=n*2;return e[o]<e[l]||e[o]===e[l]&&r[t]<=r[n]},pqdownheap=(e,t,n)=>{const r=e.heap[n];let o=n<<1;for(;o<=e.heap_len&&(o<e.heap_len&&smaller(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!smaller(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r},compress_block=(e,t,n)=>{let r,o,l=0,u,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+l++]&255,r+=(e.pending_buf[e.sym_buf+l++]&255)<<8,o=e.pending_buf[e.sym_buf+l++],r===0?send_code(e,o,t):(u=_length_code[o],send_code(e,u+LITERALS$1+1,t),s=extra_lbits[u],s!==0&&(o-=base_length[u],send_bits(e,o,s)),r--,u=d_code(r),send_code(e,u,n),s=extra_dbits[u],s!==0&&(r-=base_dist[u],send_bits(e,r,s)));while(l<e.sym_next);send_code(e,END_BLOCK,t)},build_tree=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems;let u,s,g=-1,c;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,u=0;u<l;u++)n[u*2]!==0?(e.heap[++e.heap_len]=g=u,e.depth[u]=0):n[u*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=g<2?++g:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=r[c*2+1]);for(t.max_code=g,u=e.heap_len>>1;u>=1;u--)pqdownheap(e,n,u);c=l;do u=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=u,e.heap[--e.heap_max]=s,n[c*2]=n[u*2]+n[s*2],e.depth[c]=(e.depth[u]>=e.depth[s]?e.depth[u]:e.depth[s])+1,n[u*2+1]=n[s*2+1]=c,e.heap[1]=c++,pqdownheap(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,t),gen_codes(n,g,e.bl_count)},scan_tree=(e,t,n)=>{let r,o=-1,l,u=t[0*2+1],s=0,g=7,c=4;for(u===0&&(g=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)l=u,u=t[(r+1)*2+1],!(++s<g&&l===u)&&(s<c?e.bl_tree[l*2]+=s:l!==0?(l!==o&&e.bl_tree[l*2]++,e.bl_tree[REP_3_6*2]++):s<=10?e.bl_tree[REPZ_3_10*2]++:e.bl_tree[REPZ_11_138*2]++,s=0,o=l,u===0?(g=138,c=3):l===u?(g=6,c=3):(g=7,c=4))},send_tree=(e,t,n)=>{let r,o=-1,l,u=t[0*2+1],s=0,g=7,c=4;for(u===0&&(g=138,c=3),r=0;r<=n;r++)if(l=u,u=t[(r+1)*2+1],!(++s<g&&l===u)){if(s<c)do send_code(e,l,e.bl_tree);while(--s!==0);else l!==0?(l!==o&&(send_code(e,l,e.bl_tree),s--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,s-3,2)):s<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,s-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,s-11,7));s=0,o=l,u===0?(g=138,c=3):l===u?(g=6,c=3):(g=7,c=4)}},build_bl_tree=e=>{let t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=BL_CODES$1-1;t>=3&&e.bl_tree[bl_order[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},send_all_trees=(e,t,n,r)=>{let o;for(send_bits(e,t-257,5),send_bits(e,n-1,5),send_bits(e,r-4,4),o=0;o<r;o++)send_bits(e,e.bl_tree[bl_order[o]*2+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,n-1)},detect_data_type=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Z_BINARY;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Z_TEXT;for(n=32;n<LITERALS$1;n++)if(e.dyn_ltree[n*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=e=>{static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)},_tr_stored_block$1=(e,t,n,r)=>{send_bits(e,(STORED_BLOCK<<1)+(r?1:0),3),bi_windup(e),put_short(e,n),put_short(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},_tr_align$1=e=>{send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)},_tr_flush_block$1=(e,t,n,r)=>{let o,l,u=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$1&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),u=build_bl_tree(e),o=e.opt_len+3+7>>>3,l=e.static_len+3+7>>>3,l<=o&&(o=l)):o=l=n+5,n+4<=o&&t!==-1?_tr_stored_block$1(e,t,n,r):e.strategy===Z_FIXED$1||l===o?(send_bits(e,(STATIC_TREES<<1)+(r?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(r?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),r&&bi_windup(e)},_tr_tally$1=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(_length_code[n]+LITERALS$1+1)*2]++,e.dyn_dtree[d_code(t)*2]++),e.sym_next===e.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(e,t,n,r)=>{let o=e&65535|0,l=e>>>16&65535|0,u=0;for(;n!==0;){u=n>2e3?2e3:n,n-=u;do o=o+t[r++]|0,l=l+o|0;while(--u);o%=65521,l%=65521}return o|l<<16|0};var adler32_1=adler32;const makeTable=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},crcTable=new Uint32Array(makeTable()),crc32=(e,t,n,r)=>{const o=crcTable,l=r+n;e^=-1;for(let u=r;u<l;u++)e=e>>>8^o[(e^t[u])&255];return e^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(e,t)=>(e.msg=messages[t],t),rank=e=>e*2-(e>4?9:0),zero=e=>{let t=e.length;for(;--t>=0;)e[t]=0},slide_hash=e=>{let t,n,r,o=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=o?n-o:0;while(--t);t=o,r=t;do n=e.prev[--r],e.prev[r]=n>=o?n-o:0;while(--t)};let HASH_ZLIB=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,HASH=HASH_ZLIB;const flush_pending=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},flush_block_only=(e,t)=>{_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)},put_byte=(e,t)=>{e.pending_buf[e.pending++]=t},putShortMSB=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},read_buf=(e,t,n,r)=>{let o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),n),e.state.wrap===1?e.adler=adler32_1(e.adler,t,o,n):e.state.wrap===2&&(e.adler=crc32_1(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)},longest_match=(e,t)=>{let n=e.max_chain_length,r=e.strstart,o,l,u=e.prev_length,s=e.nice_match;const g=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,c=e.window,d=e.w_mask,w=e.prev,v=e.strstart+MAX_MATCH;let y=c[r+u-1],f=c[r+u];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+u]!==f||c[o+u-1]!==y||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&r<v);if(l=MAX_MATCH-(v-r),r=v-MAX_MATCH,l>u){if(e.match_start=t,u=l,l>=s)break;y=c[r+u-1],f=c[r+u]}}while((t=w[t&d])>g&&--n!==0);return u<=e.lookahead?u:e.lookahead},fill_window=e=>{const t=e.w_size;let n,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-MIN_LOOKAHEAD)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),slide_hash(e),r+=t),e.strm.avail_in===0)break;if(n=read_buf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=MIN_MATCH)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=HASH(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=HASH(e,e.ins_h,e.window[o+MIN_MATCH-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&e.strm.avail_in!==0)},deflate_stored=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,o,l,u=0,s=e.strm.avail_in;do{if(r=65535,l=e.bi_valid+42>>3,e.strm.avail_out<l||(l=e.strm.avail_out-l,o=e.strstart-e.block_start,r>o+e.strm.avail_in&&(r=o+e.strm.avail_in),r>l&&(r=l),r<n&&(r===0&&t!==Z_FINISH$3||t===Z_NO_FLUSH$2||r!==o+e.strm.avail_in)))break;u=t===Z_FINISH$3&&r===o+e.strm.avail_in?1:0,_tr_stored_block(e,0,0,u),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,flush_pending(e.strm),o&&(o>r&&(o=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+o),e.strm.next_out),e.strm.next_out+=o,e.strm.avail_out-=o,e.strm.total_out+=o,e.block_start+=o,r-=o),r&&(read_buf(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(u===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),u?BS_FINISH_DONE:t!==Z_NO_FLUSH$2&&t!==Z_FINISH$3&&e.strm.avail_in===0&&e.strstart===e.block_start?BS_BLOCK_DONE:(l=e.window_size-e.strstart,e.strm.avail_in>l&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,l+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),l>e.strm.avail_in&&(l=e.strm.avail_in),l&&(read_buf(e.strm,e.window,e.strstart,l),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.high_water<e.strstart&&(e.high_water=e.strstart),l=e.bi_valid+42>>3,l=e.pending_buf_size-l>65535?65535:e.pending_buf_size-l,n=l>e.w_size?e.w_size:l,o=e.strstart-e.block_start,(o>=n||(o||t===Z_FINISH$3)&&t!==Z_NO_FLUSH$2&&e.strm.avail_in===0&&o<=l)&&(r=o>l?l:o,u=t===Z_FINISH$3&&e.strm.avail_in===0&&r===o?1:0,_tr_stored_block(e,e.block_start,r,u),e.block_start+=r,flush_pending(e.strm)),u?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(e,t)=>{let n,r;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n)),e.match_length>=MIN_MATCH)if(r=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do e.strstart++,e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+1]);else r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(e,t)=>{let n,r,o;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n),e.match_length<=5&&(e.strategy===Z_FILTERED||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-MIN_MATCH,r=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}else if(e.match_available){if(r=_tr_tally(e,0,e.window[e.strstart-1]),r&&flush_block_only(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(e,t)=>{let n,r,o,l;const u=e.window;for(;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(o=e.strstart-1,r=u[o],r===u[++o]&&r===u[++o]&&r===u[++o])){l=e.strstart+MAX_MATCH;do;while(r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&o<l);e.match_length=MAX_MATCH-(l-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(n=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(fill_window(e),e.lookahead===0)){if(t===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(e.match_length=0,n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=e=>{e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==INIT_STATE&&t.status!==GZIP_STATE&&t.status!==EXTRA_STATE&&t.status!==NAME_STATE&&t.status!==COMMENT_STATE&&t.status!==HCRC_STATE&&t.status!==BUSY_STATE&&t.status!==FINISH_STATE?1:0},deflateResetKeep=e=>{if(deflateStateCheck(e))return err(e,Z_STREAM_ERROR$2);e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?GZIP_STATE:t.wrap?INIT_STATE:BUSY_STATE,e.adler=t.wrap===2?0:1,t.last_flush=-2,_tr_init(t),Z_OK$3},deflateReset=e=>{const t=deflateResetKeep(e);return t===Z_OK$3&&lm_init(e.state),t},deflateSetHeader=(e,t)=>deflateStateCheck(e)||e.state.wrap!==2?Z_STREAM_ERROR$2:(e.state.gzhead=t,Z_OK$3),deflateInit2=(e,t,n,r,o,l)=>{if(!e)return Z_STREAM_ERROR$2;let u=1;if(t===Z_DEFAULT_COMPRESSION$1&&(t=6),r<0?(u=0,r=-r):r>15&&(u=2,r-=16),o<1||o>MAX_MEM_LEVEL||n!==Z_DEFLATED$2||r<8||r>15||t<0||t>9||l<0||l>Z_FIXED||r===8&&u!==1)return err(e,Z_STREAM_ERROR$2);r===8&&(r=9);const s=new DeflateState;return e.state=s,s.strm=e,s.status=INIT_STATE,s.wrap=u,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+MIN_MATCH-1)/MIN_MATCH),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=l,s.method=n,deflateReset(e)},deflateInit=(e,t)=>deflateInit2(e,t,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(e,t)=>{if(deflateStateCheck(e)||t>Z_BLOCK$1||t<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===FINISH_STATE&&t!==Z_FINISH$3)return err(e,e.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(flush_pending(e),e.avail_out===0)return n.last_flush=-1,Z_OK$3}else if(e.avail_in===0&&rank(t)<=rank(r)&&t!==Z_FINISH$3)return err(e,Z_BUF_ERROR$1);if(n.status===FINISH_STATE&&e.avail_in!==0)return err(e,Z_BUF_ERROR$1);if(n.status===INIT_STATE&&n.wrap===0&&(n.status=BUSY_STATE),n.status===INIT_STATE){let o=Z_DEFLATED$2+(n.w_bits-8<<4)<<8,l=-1;if(n.strategy>=Z_HUFFMAN_ONLY||n.level<2?l=0:n.level<6?l=1:n.level===6?l=2:l=3,o|=l<<6,n.strstart!==0&&(o|=PRESET_DICT),o+=31-o%31,putShortMSB(n,o),n.strstart!==0&&(putShortMSB(n,e.adler>>>16),putShortMSB(n,e.adler&65535)),e.adler=1,n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(n.status===GZIP_STATE){if(e.adler=0,put_byte(n,31),put_byte(n,139),put_byte(n,8),n.gzhead)put_byte(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),put_byte(n,n.gzhead.time&255),put_byte(n,n.gzhead.time>>8&255),put_byte(n,n.gzhead.time>>16&255),put_byte(n,n.gzhead.time>>24&255),put_byte(n,n.level===9?2:n.strategy>=Z_HUFFMAN_ONLY||n.level<2?4:0),put_byte(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(put_byte(n,n.gzhead.extra.length&255),put_byte(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=EXTRA_STATE;else if(put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,n.level===9?2:n.strategy>=Z_HUFFMAN_ONLY||n.level<2?4:0),put_byte(n,OS_CODE),n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(n.status===EXTRA_STATE){if(n.gzhead.extra){let o=n.pending,l=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+l>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex+=s,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0,l-=s}let u=new Uint8Array(n.gzhead.extra);n.pending_buf.set(u.subarray(n.gzindex,n.gzindex+l),n.pending),n.pending+=l,n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=NAME_STATE}if(n.status===NAME_STATE){if(n.gzhead.name){let o=n.pending,l;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0}n.gzindex<n.gzhead.name.length?l=n.gzhead.name.charCodeAt(n.gzindex++)&255:l=0,put_byte(n,l)}while(l!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=COMMENT_STATE}if(n.status===COMMENT_STATE){if(n.gzhead.comment){let o=n.pending,l;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0}n.gzindex<n.gzhead.comment.length?l=n.gzhead.comment.charCodeAt(n.gzindex++)&255:l=0,put_byte(n,l)}while(l!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o))}n.status=HCRC_STATE}if(n.status===HCRC_STATE){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(flush_pending(e),n.pending!==0))return n.last_flush=-1,Z_OK$3;put_byte(n,e.adler&255),put_byte(n,e.adler>>8&255),e.adler=0}if(n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(e.avail_in!==0||n.lookahead!==0||t!==Z_NO_FLUSH$2&&n.status!==FINISH_STATE){let o=n.level===0?deflate_stored(n,t):n.strategy===Z_HUFFMAN_ONLY?deflate_huff(n,t):n.strategy===Z_RLE?deflate_rle(n,t):configuration_table[n.level].func(n,t);if((o===BS_FINISH_STARTED||o===BS_FINISH_DONE)&&(n.status=FINISH_STATE),o===BS_NEED_MORE||o===BS_FINISH_STARTED)return e.avail_out===0&&(n.last_flush=-1),Z_OK$3;if(o===BS_BLOCK_DONE&&(t===Z_PARTIAL_FLUSH?_tr_align(n):t!==Z_BLOCK$1&&(_tr_stored_block(n,0,0,!1),t===Z_FULL_FLUSH$1&&(zero(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),flush_pending(e),e.avail_out===0))return n.last_flush=-1,Z_OK$3}return t!==Z_FINISH$3?Z_OK$3:n.wrap<=0?Z_STREAM_END$3:(n.wrap===2?(put_byte(n,e.adler&255),put_byte(n,e.adler>>8&255),put_byte(n,e.adler>>16&255),put_byte(n,e.adler>>24&255),put_byte(n,e.total_in&255),put_byte(n,e.total_in>>8&255),put_byte(n,e.total_in>>16&255),put_byte(n,e.total_in>>24&255)):(putShortMSB(n,e.adler>>>16),putShortMSB(n,e.adler&65535)),flush_pending(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=e=>{if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const t=e.state.status;return e.state=null,t===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(e,t)=>{let n=t.length;if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const r=e.state,o=r.wrap;if(o===2||o===1&&r.status!==INIT_STATE||r.lookahead)return Z_STREAM_ERROR$2;if(o===1&&(e.adler=adler32_1(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){o===0&&(zero(r.head),r.strstart=0,r.block_start=0,r.insert=0);let g=new Uint8Array(r.w_size);g.set(t.subarray(n-r.w_size,n),0),t=g,n=r.w_size}const l=e.avail_in,u=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,fill_window(r);r.lookahead>=MIN_MATCH;){let g=r.strstart,c=r.lookahead-(MIN_MATCH-1);do r.ins_h=HASH(r,r.ins_h,r.window[g+MIN_MATCH-1]),r.prev[g&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=g,g++;while(--c);r.strstart=g,r.lookahead=MIN_MATCH-1,fill_window(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=MIN_MATCH-1,r.match_available=0,e.next_in=u,e.input=s,e.avail_in=l,r.wrap=o,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)_has(n,r)&&(e[r]=n[r])}}return e},flattenChunks=e=>{let t=0;for(let r=0,o=e.length;r<o;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,o=0,l=e.length;r<l;r++){let u=e[r];n.set(u,o),o+=u.length}return n},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let e=0;e<256;e++)_utf8len[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,o,l,u=e.length,s=0;for(o=0;o<u;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<u&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),l=0,o=0;l<s;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<u&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[l++]=n:n<2048?(t[l++]=192|n>>>6,t[l++]=128|n&63):n<65536?(t[l++]=224|n>>>12,t[l++]=128|n>>>6&63,t[l++]=128|n&63):(t[l++]=240|n>>>18,t[l++]=128|n>>>12&63,t[l++]=128|n>>>6&63,t[l++]=128|n&63);return t};const buf2binstring=(e,t)=>{if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var buf2string=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,o;const l=new Array(n*2);for(o=0,r=0;r<n;){let u=e[r++];if(u<128){l[o++]=u;continue}let s=_utf8len[u];if(s>4){l[o++]=65533,r+=s-1;continue}for(u&=s===2?31:s===3?15:7;s>1&&r<n;)u=u<<6|e[r++]&63,s--;if(s>1){l[o++]=65533;continue}u<65536?l[o++]=u:(u-=65536,l[o++]=55296|u>>10&1023,l[o++]=56320|u&1023)}return buf2binstring(l,o)},utf8border=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+_utf8len[e[n]]>t?n:t},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(e){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=deflate_1$2.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Z_OK$2)throw new Error(messages[n]);if(t.header&&deflate_1$2.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=strings.string2buf(t.dictionary):toString$1.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=deflate_1$2.deflateSetDictionary(this.strm,r),n!==Z_OK$2)throw new Error(messages[n]);this._dict_set=!0}}Deflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let o,l;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof e=="string"?n.input=strings.string2buf(e):toString$1.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(l===Z_SYNC_FLUSH||l===Z_FULL_FLUSH)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(o=deflate_1$2.deflate(n,l),o===Z_STREAM_END$2)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=deflate_1$2.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Z_OK$2;if(n.avail_out===0){this.onData(n.output);continue}if(l>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(e){this.chunks.push(e)},Deflate$1.prototype.onEnd=function(e){e===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function deflate$1(e,t){const n=new Deflate$1(t);if(n.push(e,!0),n.err)throw n.msg||messages[n.err];return n.result}function deflateRaw$1(e,t){return t=t||{},t.raw=!0,deflate$1(e,t)}function gzip$1(e,t){return t=t||{},t.gzip=!0,deflate$1(e,t)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,constants$1=constants$2,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1,constants:constants$1};const BAD$1=16209,TYPE$1=16191;var inffast=function e(t,n){let r,o,l,u,s,g,c,d,w,v,y,f,p,S,N,B,E,T,h,R,W,X,m,_;const G=t.state;r=t.next_in,m=t.input,o=r+(t.avail_in-5),l=t.next_out,_=t.output,u=l-(n-t.avail_out),s=l+(t.avail_out-257),g=G.dmax,c=G.wsize,d=G.whave,w=G.wnext,v=G.window,y=G.hold,f=G.bits,p=G.lencode,S=G.distcode,N=(1<<G.lenbits)-1,B=(1<<G.distbits)-1;e:do{f<15&&(y+=m[r++]<<f,f+=8,y+=m[r++]<<f,f+=8),E=p[y&N];t:for(;;){if(T=E>>>24,y>>>=T,f-=T,T=E>>>16&255,T===0)_[l++]=E&65535;else if(T&16){h=E&65535,T&=15,T&&(f<T&&(y+=m[r++]<<f,f+=8),h+=y&(1<<T)-1,y>>>=T,f-=T),f<15&&(y+=m[r++]<<f,f+=8,y+=m[r++]<<f,f+=8),E=S[y&B];n:for(;;){if(T=E>>>24,y>>>=T,f-=T,T=E>>>16&255,T&16){if(R=E&65535,T&=15,f<T&&(y+=m[r++]<<f,f+=8,f<T&&(y+=m[r++]<<f,f+=8)),R+=y&(1<<T)-1,R>g){t.msg="invalid distance too far back",G.mode=BAD$1;break e}if(y>>>=T,f-=T,T=l-u,R>T){if(T=R-T,T>d&&G.sane){t.msg="invalid distance too far back",G.mode=BAD$1;break e}if(W=0,X=v,w===0){if(W+=c-T,T<h){h-=T;do _[l++]=v[W++];while(--T);W=l-R,X=_}}else if(w<T){if(W+=c+w-T,T-=w,T<h){h-=T;do _[l++]=v[W++];while(--T);if(W=0,w<h){T=w,h-=T;do _[l++]=v[W++];while(--T);W=l-R,X=_}}}else if(W+=w-T,T<h){h-=T;do _[l++]=v[W++];while(--T);W=l-R,X=_}for(;h>2;)_[l++]=X[W++],_[l++]=X[W++],_[l++]=X[W++],h-=3;h&&(_[l++]=X[W++],h>1&&(_[l++]=X[W++]))}else{W=l-R;do _[l++]=_[W++],_[l++]=_[W++],_[l++]=_[W++],h-=3;while(h>2);h&&(_[l++]=_[W++],h>1&&(_[l++]=_[W++]))}}else if(T&64){t.msg="invalid distance code",G.mode=BAD$1;break e}else{E=S[(E&65535)+(y&(1<<T)-1)];continue n}break}}else if(T&64)if(T&32){G.mode=TYPE$1;break e}else{t.msg="invalid literal/length code",G.mode=BAD$1;break e}else{E=p[(E&65535)+(y&(1<<T)-1)];continue t}break}}while(r<o&&l<s);h=f>>3,r-=h,f-=h<<3,y&=(1<<f)-1,t.next_in=r,t.next_out=l,t.avail_in=r<o?5+(o-r):5-(r-o),t.avail_out=l<s?257+(s-l):257-(l-s),G.hold=y,G.bits=f};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(e,t,n,r,o,l,u,s)=>{const g=s.bits;let c=0,d=0,w=0,v=0,y=0,f=0,p=0,S=0,N=0,B=0,E,T,h,R,W,X=null,m;const _=new Uint16Array(MAXBITS+1),G=new Uint16Array(MAXBITS+1);let j=null,C,z,P;for(c=0;c<=MAXBITS;c++)_[c]=0;for(d=0;d<r;d++)_[t[n+d]]++;for(y=g,v=MAXBITS;v>=1&&_[v]===0;v--);if(y>v&&(y=v),v===0)return o[l++]=1<<24|64<<16|0,o[l++]=1<<24|64<<16|0,s.bits=1,0;for(w=1;w<v&&_[w]===0;w++);for(y<w&&(y=w),S=1,c=1;c<=MAXBITS;c++)if(S<<=1,S-=_[c],S<0)return-1;if(S>0&&(e===CODES$1||v!==1))return-1;for(G[1]=0,c=1;c<MAXBITS;c++)G[c+1]=G[c]+_[c];for(d=0;d<r;d++)t[n+d]!==0&&(u[G[t[n+d]]++]=d);if(e===CODES$1?(X=j=u,m=20):e===LENS$1?(X=lbase,j=lext,m=257):(X=dbase,j=dext,m=0),B=0,d=0,c=w,W=l,f=y,p=0,h=-1,N=1<<y,R=N-1,e===LENS$1&&N>ENOUGH_LENS$1||e===DISTS$1&&N>ENOUGH_DISTS$1)return 1;for(;;){C=c-p,u[d]+1<m?(z=0,P=u[d]):u[d]>=m?(z=j[u[d]-m],P=X[u[d]-m]):(z=32+64,P=0),E=1<<c-p,T=1<<f,w=T;do T-=E,o[W+(B>>p)+T]=C<<24|z<<16|P|0;while(T!==0);for(E=1<<c-1;B&E;)E>>=1;if(E!==0?(B&=E-1,B+=E):B=0,d++,--_[c]===0){if(c===v)break;c=t[n+u[d]]}if(c>y&&(B&R)!==h){for(p===0&&(p=y),W+=w,f=c-p,S=1<<f;f+p<v&&(S-=_[f+p],!(S<=0));)f++,S<<=1;if(N+=1<<f,e===LENS$1&&N>ENOUGH_LENS$1||e===DISTS$1&&N>ENOUGH_DISTS$1)return 1;h=B&R,o[h]=y<<24|f<<16|W-l|0}}return B!==0&&(o[W+B]=c-p<<24|64<<16|0),s.bits=y,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<HEAD||t.mode>SYNC?1:0},inflateResetKeep=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=HEAD,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=(e,t)=>{let n;if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))},inflateInit2=(e,t)=>{if(!e)return Z_STREAM_ERROR$1;const n=new InflateState;e.state=n,n.strm=e,n.window=null,n.mode=HEAD;const r=inflateReset2(e,t);return r!==Z_OK$1&&(e.state=null),r},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,t,n,r)=>{let o;const l=e.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new Uint8Array(l.wsize)),r>=l.wsize?(l.window.set(t.subarray(n-l.wsize,n),0),l.wnext=0,l.whave=l.wsize):(o=l.wsize-l.wnext,o>r&&(o=r),l.window.set(t.subarray(n-r,n-r+o),l.wnext),r-=o,r?(l.window.set(t.subarray(n-r,n),0),l.wnext=r,l.whave=l.wsize):(l.wnext+=o,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=o))),0},inflate$2=(e,t)=>{let n,r,o,l,u,s,g,c,d,w,v,y,f,p,S=0,N,B,E,T,h,R,W,X;const m=new Uint8Array(4);let _,G;const j=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(e)||!e.output||!e.input&&e.avail_in!==0)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),u=e.next_out,o=e.output,g=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,c=n.hold,d=n.bits,w=s,v=g,X=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(n.wrap===0){n.mode=TYPEDO;break}for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.wrap&2&&c===35615){n.wbits===0&&(n.wbits=15),n.check=0,m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0),c=0,d=0,n.mode=FLAGS;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((c&15)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(c>>>=4,d-=4,W=(c&15)+8,n.wbits===0&&(n.wbits=W),W>15||W>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=c&512?DICTID:TYPE,c=0,d=0;break;case FLAGS:for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.flags=c,(n.flags&255)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0)),c=0,d=0,n.mode=TIME;case TIME:for(;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.head&&(n.head.time=c),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,m[2]=c>>>16&255,m[3]=c>>>24&255,n.check=crc32_1(n.check,m,4,0)),c=0,d=0,n.mode=OS;case OS:for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0)),c=0,d=0,n.mode=EXLEN;case EXLEN:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0)),c=0,d=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(n.flags&1024&&(y=n.length,y>s&&(y=s),y&&(n.head&&(W=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(l,l+y),W)),n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,y,l)),s-=y,l+=y,n.length-=y),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(n.flags&2048){if(s===0)break e;y=0;do W=r[l+y++],n.head&&W&&n.length<65536&&(n.head.name+=String.fromCharCode(W));while(W&&y<s);if(n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,y,l)),s-=y,l+=y,W)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(n.flags&4096){if(s===0)break e;y=0;do W=r[l+y++],n.head&&W&&n.length<65536&&(n.head.comment+=String.fromCharCode(W));while(W&&y<s);if(n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,y,l)),s-=y,l+=y,W)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(n.flags&512){for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.wrap&4&&c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=BAD;break}c=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}e.adler=n.check=zswap32(c),c=0,d=0,n.mode=DICT;case DICT:if(n.havedict===0)return e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=d,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK||t===Z_TREES)break e;case TYPEDO:if(n.last){c>>>=d&7,d-=d&7,n.mode=CHECK;break}for(;d<3;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}switch(n.last=c&1,c>>>=1,d-=1,c&3){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES){c>>>=2,d-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}c>>>=2,d-=2;break;case STORED:for(c>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=c&65535,c=0,d=0,n.mode=COPY_,t===Z_TREES)break e;case COPY_:n.mode=COPY;case COPY:if(y=n.length,y){if(y>s&&(y=s),y>g&&(y=g),y===0)break e;o.set(r.subarray(l,l+y),u),s-=y,l+=y,g-=y,u+=y,n.length-=y;break}n.mode=TYPE;break;case TABLE:for(;d<14;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.nlen=(c&31)+257,c>>>=5,d-=5,n.ndist=(c&31)+1,c>>>=5,d-=5,n.ncode=(c&15)+4,c>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;d<3;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.lens[j[n.have++]]=c&7,c>>>=3,d-=3}for(;n.have<19;)n.lens[j[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,_={bits:n.lenbits},X=inftrees(CODES,n.lens,0,19,n.lencode,0,n.work,_),n.lenbits=_.bits,X){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;S=n.lencode[c&(1<<n.lenbits)-1],N=S>>>24,B=S>>>16&255,E=S&65535,!(N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(E<16)c>>>=N,d-=N,n.lens[n.have++]=E;else{if(E===16){for(G=N+2;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(c>>>=N,d-=N,n.have===0){e.msg="invalid bit length repeat",n.mode=BAD;break}W=n.lens[n.have-1],y=3+(c&3),c>>>=2,d-=2}else if(E===17){for(G=N+3;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=N,d-=N,W=0,y=3+(c&7),c>>>=3,d-=3}else{for(G=N+7;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=N,d-=N,W=0,y=11+(c&127),c>>>=7,d-=7}if(n.have+y>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;y--;)n.lens[n.have++]=W}}if(n.mode===BAD)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,_={bits:n.lenbits},X=inftrees(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,_),n.lenbits=_.bits,X){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,_={bits:n.distbits},X=inftrees(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,_),n.distbits=_.bits,X){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES)break e;case LEN_:n.mode=LEN;case LEN:if(s>=6&&g>=258){e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=d,inffast(e,v),u=e.next_out,o=e.output,g=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,c=n.hold,d=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;S=n.lencode[c&(1<<n.lenbits)-1],N=S>>>24,B=S>>>16&255,E=S&65535,!(N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(B&&!(B&240)){for(T=N,h=B,R=E;S=n.lencode[R+((c&(1<<T+h)-1)>>T)],N=S>>>24,B=S>>>16&255,E=S&65535,!(T+N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=T,d-=T,n.back+=T}if(c>>>=N,d-=N,n.back+=N,n.length=E,B===0){n.mode=LIT;break}if(B&32){n.back=-1,n.mode=TYPE;break}if(B&64){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=B&15,n.mode=LENEXT;case LENEXT:if(n.extra){for(G=n.extra;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;S=n.distcode[c&(1<<n.distbits)-1],N=S>>>24,B=S>>>16&255,E=S&65535,!(N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(!(B&240)){for(T=N,h=B,R=E;S=n.distcode[R+((c&(1<<T+h)-1)>>T)],N=S>>>24,B=S>>>16&255,E=S&65535,!(T+N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=T,d-=T,n.back+=T}if(c>>>=N,d-=N,n.back+=N,B&64){e.msg="invalid distance code",n.mode=BAD;break}n.offset=E,n.extra=B&15,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(G=n.extra;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(g===0)break e;if(y=v-g,n.offset>y){if(y=n.offset-y,y>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}y>n.wnext?(y-=n.wnext,f=n.wsize-y):f=n.wnext-y,y>n.length&&(y=n.length),p=n.window}else p=o,f=u-n.offset,y=n.length;y>g&&(y=g),g-=y,n.length-=y;do o[u++]=p[f++];while(--y);n.length===0&&(n.mode=LEN);break;case LIT:if(g===0)break e;o[u++]=n.length,g--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;d<32;){if(s===0)break e;s--,c|=r[l++]<<d,d+=8}if(v-=g,e.total_out+=v,n.total+=v,n.wrap&4&&v&&(e.adler=n.check=n.flags?crc32_1(n.check,o,v,u-v):adler32_1(n.check,o,v,u-v)),v=g,n.wrap&4&&(n.flags?c:zswap32(c))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}c=0,d=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.wrap&4&&c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=BAD;break}c=0,d=0}n.mode=DONE;case DONE:X=Z_STREAM_END$1;break e;case BAD:X=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=d,(n.wsize||v!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,v-e.avail_out),w-=e.avail_in,v-=e.avail_out,e.total_in+=w,e.total_out+=v,n.total+=v,n.wrap&4&&v&&(e.adler=n.check=n.flags?crc32_1(n.check,o,v,e.next_out-v):adler32_1(n.check,o,v,e.next_out-v)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(w===0&&v===0||t===Z_FINISH$1)&&X===Z_OK$1&&(X=Z_BUF_ERROR),X},inflateEnd=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;let t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,t)=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(e,t)=>{const n=t.length;let r,o,l;return inflateStateCheck(e)||(r=e.state,r.wrap!==0&&r.mode!==DICT)?Z_STREAM_ERROR$1:r.mode===DICT&&(o=1,o=adler32_1(o,t,n,0),o!==r.check)?Z_DATA_ERROR$1:(l=updatewindow(e,t,n,n),l?(r.mode=MEM,Z_MEM_ERROR$1):(r.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(n!==Z_OK)throw new Error(messages[n]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=strings.string2buf(t.dictionary):toString.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary),n!==Z_OK)))throw new Error(messages[n])}Inflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let l,u,s;if(this.ended)return!1;for(t===~~t?u=t:u=t===!0?Z_FINISH:Z_NO_FLUSH,toString.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),l=inflate_1$2.inflate(n,u),l===Z_NEED_DICT&&o&&(l=inflate_1$2.inflateSetDictionary(n,o),l===Z_OK?l=inflate_1$2.inflate(n,u):l===Z_DATA_ERROR&&(l=Z_NEED_DICT));n.avail_in>0&&l===Z_STREAM_END&&n.state.wrap>0&&e[n.next_in]!==0;)inflate_1$2.inflateReset(n),l=inflate_1$2.inflate(n,u);switch(l){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(l),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||l===Z_STREAM_END))if(this.options.to==="string"){let g=strings.utf8border(n.output,n.next_out),c=n.next_out-g,d=strings.buf2string(n.output,g);n.next_out=c,n.avail_out=r-c,c&&n.output.set(n.output.subarray(g,g+c),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(l===Z_OK&&s===0)){if(l===Z_STREAM_END)return l=inflate_1$2.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(e){this.chunks.push(e)},Inflate$1.prototype.onEnd=function(e){e===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1;for(var deflate_1=deflate,fromByteArray_1=fromByteArray,lookup=[],code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i];function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var r,o=[],l=t;l<n;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(tripletToBase64(r));return o.join("")}function fromByteArray(e){for(var t,n=e.length,r=n%3,o=[],l=16383,u=0,s=n-r;u<s;u+=l)o.push(encodeChunk(e,u,u+l>s?s:u+l));return r===1?(t=e[n-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}const encoder=new TextEncoder;new TextDecoder;function serializeHash(e){const t=JSON.stringify(e),n=encoder.encode(t),r=deflate_1(n);return fromByteArray_1(r)}async function getViews(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/views`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function createShareLink(e,t){if(!Authentication.token)throw new Error("Not authenticated");const r=(await getViews()).filter(s=>s.name===t);if(r.length===0)return console.warn("View does not exist or it is misspell"),null;const o=await fetch(`${FORMANT_API_URL}/v1/admin/shares`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=FORMANT_API_URL.replace("api","app"),{code:u}=await o.json();return`${l}/shares/${u}#${serializeHash({viewId:r[0].id})}`}const vailableAggregationIntervals=["day","week","month","year","hour","minute","quarter"],aggregateFunctions=["interval","start","end","sub","get"];function getVariance(e){return e.count<2?0:e.sumOfSquares/(e.count-1)}function getStandardDeviation(e){return Math.sqrt(getVariance(e))}function getMax(e){return e.max}function getMin(e){return e.min}function getAverage(e){return e.count===0?-1:e.sum/e.count}function getSum(e){return e.sum}function getCount(e){return e.count}const aggregateFunctionMap={min:getMin,max:getMax,"standard deviation":getStandardDeviation,average:getAverage,sum:getSum,count:getCount},aggregateByDateFunctions={day:{interval:eachDayOfInterval,start:startOfDay,end:endOfDay,sub:subDays,get:getDay},week:{interval:eachWeekOfInterval,start:startOfWeek,end:endOfWeek,sub:subWeeks,get:getWeek},month:{interval:eachMonthOfInterval,start:startOfMonth,end:endOfMonth,sub:subMonths,get:getMonth},year:{interval:eachYearOfInterval,start:startOfYear,end:endOfYear,sub:subYears,get:getYear},hour:{interval:eachHourOfInterval,start:startOfHour,end:endOfHour,sub:subHours,get:getHours},minute:{interval:eachMinuteOfInterval,start:startOfMinute,end:endOfMinute,sub:subMinutes,get:getMinutes},quarter:{interval:eachQuarterOfInterval,start:startOfQuarter,end:endOfQuarter,sub:subQuarters,get:getQuarter}},formatTimeFrameText=(e,t)=>e.split("/")[0]+"/"+e.split("/")[1]+"–"+t.split("/")[0]+"/"+t.split("/")[1];async function queryEvents(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function eventsCounter(e,t,n,r,o){const l=aggregateByDateFunctions[t];return await Promise.all(Array(n).fill(0).map(async(u,s)=>{const g=new Date(r),c=l.sub(l.start(g),n-s-1),d=l.sub(l.end(g),n-s-1),w=formatTimeFrameText(c.toLocaleDateString(),d.toLocaleDateString()),v=await queryEvents({...o,eventTypes:e,start:new Date(c).toISOString(),end:new Date(d).toISOString()});return{date:w,events:v}}))}async function getAnnotationCount(e,t){return(await queryEvents({...e,eventTypes:["annotation"]})).filter(l=>!!l.tags&&Object.keys(l.tags).includes(t)).reduce((l,u)=>{const s=u.tags[t];return s in l?(l[s]+=1,l):(l[s]=1,l)},{})}async function getAnnotationCountByIntervals(e,t,n){const{end:r,start:o}=e,u=aggregateByDateFunctions[n].interval({start:new Date(o),end:new Date(r)}),s=u.map((c,d)=>{const w=new Date(c).toISOString(),v=d===u.length-1?new Date(Date.now()).toISOString():new Date(u[d+1]);return getAnnotationCount({...e,start:w,end:v},t)}),g=await Promise.all(s);return u.map((c,d)=>({date:new Date(c).toISOString(),annotations:g[d]}))}async function getTelemetry(e,t,n,r,o){let l=e;Array.isArray(e)||(l=[e]);let u=t;return Array.isArray(t)||(u=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:l,end:r.toISOString(),names:u,start:n.toISOString(),tags:o}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");const e=defaultRtcClientPool.get();try{return await e.getSessions()}finally{await e.shutdown()}}async function getPeers(){if(!Authentication.token)throw new Error("Not authenticated");const e=defaultRtcClientPool.get();try{return await e.getPeers()}finally{await e.shutdown()}}async function createDevice(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchDevice(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getDevicesData(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function queryDevicesData(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function disableDevice(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}/disable`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}class Device extends BaseDevice{constructor(t,n,r,o){super(),this.id=t,this.name=n,this.organizationId=r,this.tags=o}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(){let t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const n=await t.json();if(!n.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const r=n.state.reportedConfiguration.version;return t=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${r}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await t.json()).document}async getFileUrl(t){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}async startRealtimeConnection(t={}){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const{sessionType:n,deadlineMs:r=1e4,maxConnectRetries:o=3}=typeof t=="number"?{sessionType:t}:t,u=getRtcClientPool({sessionType:n}).get(this.handleMessage);let s=!1;const g=new Promise((d,w)=>setTimeout(()=>{s=!0,w(new Error("Connection timed out: the connection could not be finalized in time, possibly due to network issues or misconfigured settings."))},r)),c=async()=>{if("isReady"in u)for(;!u.isReady();)this.assertNotCancelled(s),await delay(100);const d=await this.getRemoteDevicePeerId(u);this.assertNotCancelled(s);let w;for(let y=0;y<o&&(w=await u.connect(d),!w);y++)delay(100),this.assertNotCancelled(s);if(!w)throw new Error(`Session could not be created: exhausted ${o} retries`);let v=0;for(;!s&&u.getConnectionStatus(d)!=="connected";)await delay(100),v+=1;return this.assertNotCancelled(s),console.debug(`${new Date().toISOString()} :: Connection completed after ${v} retries`),d};return Promise.race([c(),g]).then(d=>{this.remoteDevicePeerId=d,this.initConnectionMonitoring(),this.rtcClient=u,this.emit("connect")}).catch(d=>{throw console.debug(`${new Date().toISOString()} :: Connection failed: %o`,d),this.remoteDevicePeerId=null,u.shutdown().catch(w=>{console.error("rtcClient cannot shutdown: %o",w)}),this.emit("connection_failed",d),d})}async getRemoteDevicePeerId(t){const r=(await t.getPeers()).find(o=>o.deviceId===this.id);if(!isRtcPeer(r))throw new Error("Cannot find peer, is the robot offline?");return r.id}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let t=!1;if(this.rtcClient){const r=this.rtcClient.getConnections().find(o=>o.getRemotePeerId()===this.remoteDevicePeerId&&o.isActive());(r===void 0||!r.isReady())&&(console.debug(`${new Date().toISOString()} :: data channel closed`),t=!0)}(!this.rtcClient||!this.remoteDevicePeerId||await this.rtcClient.getConnectionStatsInfo(this.remoteDevicePeerId)===void 0||t)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(n=>{console.error(n)}))},1e3)}async getRemotePeer(){const n=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(r=>r.deviceId===this.id);return defined(n,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){let t=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.remoteDevicePeerId?(await this.rtcClient.disconnect(this.remoteDevicePeerId),this.remoteDevicePeerId=null):t=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(t)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){const t=await getPeers(),n=await getRealtimeSessions(),r=t.find(o=>o.deviceId===this.id);return r?n[r.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(r=>({name:r.name,id:r.id,command:r.command,description:r.description,parameterEnabled:r.parameterEnabled,parameterValue:r.parameterValue,parameterMeta:r.parameterMeta,enabled:r.enabled,tags:r.tags}))}async sendCommand(t,n,r,o){var d;const u=(await this.getAvailableCommands()).find(w=>w.name===t);if(!u)throw new Error(`Could not find command with name "${t}"`);let s="";n===void 0?u.parameterEnabled&&u.parameterValue&&(s=u.parameterValue):s=n;let g={value:s,scrubberTime:(r||new Date).toISOString(),meta:{...u.parameterMeta,...o}};return await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:u.id,organizationId:this.organizationId,deviceId:this.id,command:u.command,parameter:g,userId:(d=Authentication.currentUser)==null?void 0:d.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async getCommand(t){return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCaptureStream(t){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:t,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(r)}async getTelemetry(t,n,r,o){return await getTelemetry(this.id,t,n,r,o)}async getTelemetryStreams(){var s,g;const t=await this.getConfiguration(),n=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=[],o=[];return(g=(s=t.telemetry)==null?void 0:s.streams)==null||g.forEach(c=>{c.disabled!==!0&&r.push(c.name),c.onDemand===!0&&o.push(c.name)}),console.log(o),(await n.json()).items.filter(c=>!r.includes(c)).map(c=>({name:c,onDemand:o.includes(c)}))}async createInterventionRequest(t,n,r,o){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:t,interventionType:n,time:new Date().toISOString(),deviceId:this.id,tags:o,data:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(t,n,r){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:t,interventionType:n,data:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async getAnnotationCount(t,n){return await getAnnotationCount({...t,deviceIds:[this.id]},n)}async getAnnotationCountByIntervals(t,n,r){return await getAnnotationCountByIntervals({...t,deviceIds:[this.id]},n,r)}async eventsCounter(t,n,r,o,l){return await eventsCounter(t,n,r,o,{...l,deviceIds:[this.id]})}async createShareLink(t,n){return t.scope.deviceIds=[this.id],await createShareLink(t,n)}}_e(Device,"createDevice",createDevice),_e(Device,"patchDevice",patchDevice),_e(Device,"getDevicesData",getDevicesData),_e(Device,"queryDevicesData",queryDevicesData),_e(Device,"disableDevice",disableDevice);class PeerDevice extends BaseDevice{constructor(n){super();_e(this,"id");_e(this,"telemetryStreamActive",!1);_e(this,"streamTelemetry",{});this.peerUrl=n}async getLatestTelemetry(){this.telemetryStreamActive||this.subscribeToTelemetry();const n=this.streamTelemetry;return Object.entries(n).map(([o,l])=>({deviceId:this.id,streamName:o,streamType:"json",currentValue:l,currentValueTime:l.timestamp,tags:{}}))}subscribeToTelemetry(){this.telemetryStreamActive=!0;let n=0;const r=new XMLHttpRequest;r.responseType="text",r.addEventListener("error",o=>{this.handleXHRError("error")}),r.addEventListener("abort",o=>{this.handleXHRError("abort")}),r.addEventListener("timeout",o=>{this.handleXHRError("timeout")}),r.addEventListener("readystatechange",o=>{r.readyState===XMLHttpRequest.DONE&&this.handleXHRError("closed")}),r.addEventListener("progress",o=>{const l=o.loaded,u=l-n;n=l,r.responseText.substr(-u).split(`
63
+ `).forEach(c=>{var d;if(c.length>0){const w=JSON.parse(c);if((d=w.result)!=null&&d.datapoint){const v=w.result.datapoint,y=v.stream;delete v.stream,this.streamTelemetry[y]=v}}})}),r.open("POST",`${this.peerUrl}/v1/telemetry`),r.send()}handleXHRError(n){console.warn(`Telemetry stream ended: ${n}`),this.telemetryStreamActive=!1}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.document}async startRealtimeConnection(n){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const r=new distExports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage,sessionType:n});for(await r.connectLan(this.peerUrl);r.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=r,this.initConnectionMonitoring()}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let n=!1;this.rtcClient&&this.rtcClient.getConnectionStatus(this.peerUrl)!=="connected"&&(console.debug(`${new Date().toISOString()} :: data channel closed`),n=!0),(!this.rtcClient||n)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(r=>{console.error(r)}))},1e3)}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){let n=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.id?(await this.rtcClient.disconnect(this.id),this.remoteDevicePeerId=null):n=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(n)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async sendCommand(n,r,o,l){const u={value:r,scrubberTime:(o||new Date).toISOString(),meta:l};return await fetch(`${this.peerUrl}/v1/enqueue-command`,{method:"POST",body:JSON.stringify({command:n,parameter:u}),headers:{"Content-Type":"application/json"}})}}async function addDeviceToFleet(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"PATCH",body:JSON.stringify({fleetId:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function aggregateTelemetry(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).aggregates}async function deleteFleet(e){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async function getAnalyticStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getAnalyticsModules(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/analytics-modules`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getAnalyticsRows(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/rows`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function queryDevices(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(r=>new Device(r.id,r.name,r.organizationId,r.tags))}async function getCurrentGroup(){if(!Authentication.token)throw new Error("Not authenticated");let e=new URLSearchParams("");typeof window<"u"&&window.location&&(e=new URLSearchParams(window.location.search));const t=e.get("group");if(t===null||t.trim()==="")return;const n=await fetch(`${FORMANT_API_URL}/v1/admin/groups/`+t,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),{tagKey:r,tagValue:o}=await n.json();return await queryDevices({tags:{[r]:[o]},enabled:!0,type:"default"})}async function getDevice(e){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),r=n.name;return new Device(e,r,n.organizationId,n.tags)}async function getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const t=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return t.items,t.items.map(n=>new Device(n.id,n.name,n.organizationId,n.tags))}async function getEvent(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getFileUrl(e){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[e]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(n.fileUrls.length===0)throw new Error("File not found");return n.fileUrls[0]}async function getFleet(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getFleetDevices(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}/devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getLatestTelemetry(...e){const t=e.flat().filter(o=>!!o);return t.length===0?[]:(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await getDevices()).filter(o=>n.includes(o.id))}async function getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(o=>o.deviceId);return(await getDevices()).filter(o=>n.includes(o.id))}async function getStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.filter(n=>n.enabled)}async function getTaskReportRows(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-report-rows`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getTaskReportTables(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-reports`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function listFleets(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function patchFleet(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchStream(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/streams/${e.id}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchView(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/views/${e.id}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function queryAnalytics(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function createFleet(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getAllEventTriggerGroup(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/event-trigger-groups`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getEventTriggerGroup(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/event-trigger-groups/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchEventTriggerGroup(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/event-trigger-groups/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}const Je=class{static async setDefaultDevice(t){Je.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Je.defaultDeviceId)throw new Error("No known default device");const r=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(u=>u.id===Je.defaultDeviceId),o=r.name,l=new Device(Je.defaultDeviceId,o,defined(Authentication.currentOrganization),r.tags);return Je.knownContext.push(new WeakRef(l)),l}static async getPeerDevice(t){const n=new PeerDevice(t);return n.id=await n.getDeviceId(),n}static async getDevice(t){const n=await getDevice(t);return Je.knownContext.push(new WeakRef(n)),n}};let Fleet=Je;_e(Fleet,"defaultDeviceId"),_e(Fleet,"knownContext",[]),_e(Fleet,"createFleet",createFleet),_e(Fleet,"listFleets",listFleets),_e(Fleet,"getFleet",getFleet),_e(Fleet,"patchFleet",patchFleet),_e(Fleet,"deleteFleet",deleteFleet),_e(Fleet,"addDeviceToFleet",addDeviceToFleet),_e(Fleet,"getFleetDevices",getFleetDevices),_e(Fleet,"aggregateTelemetry",aggregateTelemetry),_e(Fleet,"createShareLink",createShareLink),_e(Fleet,"eventsCounter",eventsCounter),_e(Fleet,"getAnalyticStreams",getAnalyticStreams),_e(Fleet,"getAnalyticsModules",getAnalyticsModules),_e(Fleet,"getAnalyticsRows",getAnalyticsRows),_e(Fleet,"getAnnotationCount",getAnnotationCount),_e(Fleet,"getAnnotationCountByIntervals",getAnnotationCountByIntervals),_e(Fleet,"getCurrentGroup",getCurrentGroup),_e(Fleet,"getDevices",getDevices),_e(Fleet,"getEvent",getEvent),_e(Fleet,"getFileUrl",getFileUrl),_e(Fleet,"getInterventions",getInterventions),_e(Fleet,"getLatestTelemetry",getLatestTelemetry),_e(Fleet,"getOnlineDevices",getOnlineDevices),_e(Fleet,"getPeers",getPeers),_e(Fleet,"getRealtimeDevices",getRealtimeDevices),_e(Fleet,"getRealtimeSessions",getRealtimeSessions),_e(Fleet,"getStreams",getStreams),_e(Fleet,"getTaskReportRows",getTaskReportRows),_e(Fleet,"getTaskReportTables",getTaskReportTables),_e(Fleet,"getTelemetry",getTelemetry),_e(Fleet,"getViews",getViews),_e(Fleet,"patchStream",patchStream),_e(Fleet,"patchView",patchView),_e(Fleet,"queryAnalytics",queryAnalytics),_e(Fleet,"queryDevices",queryDevices),_e(Fleet,"queryEvents",queryEvents),_e(Fleet,"queryTelemetry",queryTelemetry),_e(Fleet,"getAllEventTriggerGroup",getAllEventTriggerGroup),_e(Fleet,"getEventTriggerGroup",getEventTriggerGroup),_e(Fleet,"patchEventTriggergroup",patchEventTriggerGroup);class KeyValue{static async set(t,n,r){try{const o=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:n,tags:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=await o.json();if(o.status!==200)throw new Error(l.message)}catch(o){throw o}}static async get(t){try{const n=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await n.json();if(n.status!==200)throw new Error(r.message);return r.value}catch(n){throw n}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await t.json();if(t.status!==200)throw new Error(n.message);return n.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(n){throw n}}static async query(t){try{const n=await fetch(FORMANT_API_URL+"/v1/admin/key-value/query",{method:"POST",body:JSON.stringify({keys:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});if(!n.ok)throw new Error("Unable to handle request");return(await n.json()).items}catch(n){throw n}}}function stringToArrayBuffer(e){return Uint8Array.from(base64Exports.decode(e),t=>t.charCodeAt(0))}function browser(){const{userAgent:e}=navigator;return e?e.includes("Firefox/")?"Firefox":e.includes("Edg/")?"Edge":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":e.includes("MSIE/")||e.includes("Trident/")?"IE":"Other":"Other"}const rtcAudioChunkStreamType="audio-chunk";class AudioPlayer{constructor(t,n){_e(this,"muted",!1);_e(this,"hasReceivedData",!1);_e(this,"audioContext");_e(this,"chunks",[]);_e(this,"isPlaying",!1);_e(this,"startTime",0);_e(this,"lastChunkOffset",0);_e(this,"bufferSize",3);_e(this,"receive",async t=>{var u;const n=(u=t.payload.audioChunk)==null?void 0:u.chunk_data;if(!n)return;this.hasReceivedData||(this.hasReceivedData=!0);const{audioContext:r,muted:o}=this;if(!r||t.header.stream.streamType!==rtcAudioChunkStreamType||o!==!1)return;const l=stringToArrayBuffer(n);try{await r.decodeAudioData(l.buffer,this.scheduleChunk)}catch(s){console.warn("Error decoding audio buffer, changing audioWireFormat on agent",{error:s}),this.changeAudioWireFormat("wav")}});_e(this,"scheduleChunk",t=>{const{audioContext:n}=this;if(!n)return;(this.chunks.length>this.bufferSize||this.isPlaying===!1)&&(this.chunks.forEach(o=>{o.stop()}),this.isPlaying=!1,this.chunks=[]);const r=this.createChunk(t);r&&r.buffer&&(this.isPlaying===!1&&(this.startTime=n.currentTime,this.lastChunkOffset=0,this.isPlaying=!0),r.start(this.startTime+this.lastChunkOffset,0,t.duration),this.lastChunkOffset+=r.buffer.duration,this.chunks.push(r))});this.device=t,this.stream=n,this.device.startListeningToRealtimeDataStream(n),this.device.addRealtimeListener((o,l)=>{this.receive(l)}),browser()==="Safari"||browser()==="IE"?this.changeAudioWireFormat("wav"):this.changeAudioWireFormat("opus");const r=window.AudioContext||window.webkitAudioContext;this.audioContext=new r}async play(){var t,n;((t=this.audioContext)==null?void 0:t.state)==="suspended"&&await((n=this.audioContext)==null?void 0:n.resume()),this.muted=!1}async pause(){await this.audioContext.suspend(),this.muted=!0}destroy(){this.device.stopListeningToRealtimeDataStream(this.stream)}createChunk(t){const{audioContext:n}=this;if(!n)return;const r=n.createBufferSource();return r.buffer=t,r.connect(n.destination),r.loop=!1,r.onended=o=>{this.chunks.splice(this.chunks.indexOf(r),1),this.chunks.length===0&&(this.isPlaying=!1)},r}changeAudioWireFormat(t){const{stream:n}=this;(async()=>await this.device.changeStreamAudioType(n.name,t))()}}class Account{static async listAccounts(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createAccounts(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getAccount(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchAccount(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteAccount(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}static async getAccountTree(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}/tree`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}}class Role{static async listRoles(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/roles`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createRole(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getRole(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchRole(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteRole(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}}class User{static async listUsers(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/users`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createUser(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getUser(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchUser(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteUser(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"PATCH",body:JSON.stringify({enabled:!1,roleId:null,teamId:null}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"],timeout=e=>new Promise(t=>setTimeout(t,e*1e3));try{const e=typeof window<"u"&&window.location?new URLSearchParams(window.location.search):new URLSearchParams(""),t=e.get("device");t&&Fleet.setDefaultDevice(t);const n=e.get("auth");n&&Authentication.loginWithToken(n),e.get("module")&&Authentication.listenForRefresh(),typeof window<"u"&&App.listenForConnectionEvents()}catch(e){}exports.Account=Account,exports.App=App,exports.AudioPlayer=AudioPlayer,exports.Authentication=Authentication,exports.BinaryRequestDataChannel=BinaryRequestDataChannel,exports.CaptureStream=CaptureStream,exports.DataChannel=DataChannel,exports.Device=Device,exports.Fleet=Fleet,exports.KeyValue=KeyValue,exports.Manipulator=Manipulator,exports.PeerDevice=PeerDevice,exports.Role=Role,exports.SessionType=SessionTypeConstants,exports.TextRequestDataChannel=TextRequestDataChannel,exports.User=User,exports.accessLevels=accessLevels,exports.administrator=administrator,exports.aggregateByDateFunctions=aggregateByDateFunctions,exports.aggregateFunctionMap=aggregateFunctionMap,exports.aggregateFunctions=aggregateFunctions,exports.aggregateLevels=aggregateLevels,exports.annotationTypes=annotationTypes,exports.eventTypes=eventTypes,exports.formatTimeFrameText=formatTimeFrameText,exports.getAverage=getAverage,exports.getCount=getCount,exports.getMax=getMax,exports.getMin=getMin,exports.getStandardDeviation=getStandardDeviation,exports.getSum=getSum,exports.getVariance=getVariance,exports.healthStatuses=healthStatuses,exports.interventionTypes=interventionTypes,exports.operator=operator,exports.severities=severities,exports.timeout=timeout,exports.vailableAggregationIntervals=vailableAggregationIntervals,exports.videoMimeTypes=videoMimeTypes,exports.viewer=viewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});