diffusion
Version:
Diffusion JavaScript client
2 lines • 55.2 kB
JavaScript
/*! For license information please see diffusion-feature-session-lock.js.LICENSE.txt */
(()=>{var t={526:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],f=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),c=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[c++]=e>>16&255,f[c++]=e>>8&255,f[c++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[c++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[c++]=e>>8&255,f[c++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,u=0,f=n-i;u<f;u+=s)o.push(a(t,u,u+s>f?f:u+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var i,o,s=[],u=e;u<n;u+=3)i=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(t,e,r)=>{"use strict";var n=r(526),i=r(251);e.hp=u,e.IS=50;var o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=u.prototype,e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(D(t,ArrayBuffer)||t&&D(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=u.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var i=function(t){if(u.isBuffer(t)){var e=0|l(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||F(t.length)?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return f(t),s(t<0?0:0|l(t))}function h(t){for(var e=t.length<0?0:0|l(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||D(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;o<u;o++)if(f(t,o)===f(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===a)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+a>u&&(r=u-a),o=r;o>=0;o--){for(var h=!0,l=0;l<a;l++)if(f(t,o+l)!==f(e,l)){h=!1;break}if(h)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(F(u))return s;t[r+s]=u}return s}function b(t,e,r,n){return P(M(e,t.length-r),t,r,n)}function m(t,e,r,n){return P(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return m(t,e,r,n)}function S(t,e,r,n){return P(j(e),t,r,n)}function _(t,e,r,n){return P(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,u,a,f=t[i],c=null,h=f>239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&f)<<6|63&o)>127&&(c=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(a=(15&f)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(c=a);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(a=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(c=a)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=L));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),u.poolSize=8192,u.from=function(t,e,r){return a(t,e,r)},u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,u.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},u.allocUnsafe=function(t){return c(t)},u.allocUnsafeSlow=function(t){return c(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(D(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),D(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(D(o,Uint8Array)&&(o=u.from(o)),!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(D(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),f=this.slice(n,i),c=t.slice(e,r),h=0;h<a;++h)if(f[h]!==c[h]){o=f[h],s=c[h];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function N(t,e,r){var n,i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var o="",s=e;s<r;++s)o+=(n=t[s])<16?"0"+n.toString(16):n.toString(16);return o}function k(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function T(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return e=+e,r>>>=0,o||T(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,o){return e=+e,r>>>=0,o||T(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=u.prototype,n},u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var o=0,s=1,u=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/s|0)-u&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var o=r-1,s=1,u=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/s|0)-u&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:u.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var x=/[^+/0-9A-Za-z-_]/g;function M(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function D(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function F(t){return t!=t}},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,f=a>>1,c=-7,h=r?i-1:0,l=r?-1:1,p=t[e+h];for(h+=l,o=p&(1<<-c)-1,p>>=-c,c+=u;c>0;o=256*o+t[e+h],h+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=l,c-=8);if(0===o)o=1-f;else{if(o===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,u,a,f=8*o-i-1,c=(1<<f)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+h>=1?l/a:l*Math.pow(2,1-h))*a>=2&&(s++,a/=2),s+h>=c?(u=0,s=c):s+h>=1?(u=(e*a-1)*Math.pow(2,i),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&u,p+=g,u/=256,i-=8);for(s=s<<i|u,f+=i;f>0;t[r+p]=255&s,p+=g,s/=256,f-=8);t[r+p-g]|=128*y}},65:function(t,e,r){var n,i;!function(o,s){"use strict";n=function(){var t=function(){},e="undefined",r=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(t,e){var r=t[e];if("function"==typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(e,r){for(var i=0;i<n.length;i++){var o=n[i];this[o]=i<e?t:this.methodFactory(o,e,r)}this.log=this.debug}function u(t,r,n){return function(){typeof console!==e&&(s.call(this,r,n),this[t].apply(this,arguments))}}function a(n,s,a){return function(n){return"debug"===n&&(n="log"),typeof console!==e&&("trace"===n&&r?o:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):t)}(n)||u.apply(this,arguments)}function f(t,r,i){var o,u=this,f="loglevel";function c(){var t;if(typeof window!==e&&f){try{t=window.localStorage[f]}catch(t){}if(typeof t===e)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(f)+"=");-1!==n&&(t=/^([^;]+)/.exec(r.slice(n))[1])}catch(t){}return void 0===u.levels[t]&&(t=void 0),t}}"string"==typeof t?f+=":"+t:"symbol"==typeof t&&(f=void 0),u.name=t,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=i||a,u.getLevel=function(){return o},u.setLevel=function(r,i){if("string"==typeof r&&void 0!==u.levels[r.toUpperCase()]&&(r=u.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=u.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(o=r,!1!==i&&function(t){var r=(n[t]||"silent").toUpperCase();if(typeof window!==e&&f){try{return void(window.localStorage[f]=r)}catch(t){}try{window.document.cookie=encodeURIComponent(f)+"="+r+";"}catch(t){}}}(r),s.call(u,r,t),typeof console===e&&r<u.levels.SILENT)return"No console available for logging"},u.setDefaultLevel=function(t){c()||u.setLevel(t,!1)},u.enableAll=function(t){u.setLevel(u.levels.TRACE,t)},u.disableAll=function(t){u.setLevel(u.levels.SILENT,t)};var h=c();null==h&&(h=null==r?"WARN":r),u.setLevel(h,!1)}var c=new f,h={};c.getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=h[t];return e||(e=h[t]=new f(t,c.getLevel(),c.methodFactory)),e};var l=typeof window!==e?window.log:void 0;return c.noConflict=function(){return typeof window!==e&&window.log===c&&(window.log=l),c},c.getLoggers=function(){return h},c.default=c,c},void 0===(i=n.call(e,r,e,t))||(t.exports=i)}()},570:t=>{t.exports=r;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function r(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function n(t){return!0===(t&&t.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},o={};function s(t,e){var r,n,s;return e?(s=0<=(t>>>=0)&&t<256)&&(n=o[t])?n:(r=a(t,(0|t)<0?-1:0,!0),s&&(o[t]=r),r):(s=-128<=(t|=0)&&t<128)&&(n=i[t])?n:(r=a(t,t<0?-1:0,!1),s&&(i[t]=r),r)}function u(t,e){if(isNaN(t))return e?v:d;if(e){if(t<0)return v;if(t>=p)return S}else{if(t<=-g)return _;if(t+1>=g)return E}return t<0?u(-t,e).neg():a(t%l|0,t/l|0,e)}function a(t,e,n){return new r(t,e,n)}r.fromInt=s,r.fromNumber=u,r.fromBits=a;var f=Math.pow;function c(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return d;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return c(t.substring(1),e,r).neg();for(var i=u(f(r,8)),o=d,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),h=parseInt(t.substring(s,s+a),r);if(a<8){var l=u(f(r,a));o=o.mul(l).add(u(h))}else o=(o=o.mul(i)).add(u(h))}return o.unsigned=e,o}function h(t,e){return"number"==typeof t?u(t,e):"string"==typeof t?c(t,e):a(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}r.fromString=c,r.fromValue=h;var l=4294967296,p=l*l,g=p/2,y=s(1<<24),d=s(0);r.ZERO=d;var v=s(0,!0);r.UZERO=v;var w=s(1);r.ONE=w;var b=s(1,!0);r.UONE=b;var m=s(-1);r.NEG_ONE=m;var E=a(-1,2147483647,!1);r.MAX_VALUE=E;var S=a(-1,-1,!0);r.MAX_UNSIGNED_VALUE=S;var _=a(0,-2147483648,!1);r.MIN_VALUE=_;var O=r.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low},O.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},O.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var e=u(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=u(f(t,6),this.unsigned),o=this,s="";;){var a=o.div(i),c=(o.sub(a.mul(i)).toInt()>>>0).toString(t);if((o=a).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},O.getHighBits=function(){return this.high},O.getHighBitsUnsigned=function(){return this.high>>>0},O.getLowBits=function(){return this.low},O.getLowBitsUnsigned=function(){return this.low>>>0},O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},O.isZero=function(){return 0===this.high&&0===this.low},O.eqz=O.isZero,O.isNegative=function(){return!this.unsigned&&this.high<0},O.isPositive=function(){return this.unsigned||this.high>=0},O.isOdd=function(){return!(1&~this.low)},O.isEven=function(){return!(1&this.low)},O.equals=function(t){return n(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},O.eq=O.equals,O.notEquals=function(t){return!this.eq(t)},O.neq=O.notEquals,O.ne=O.notEquals,O.lessThan=function(t){return this.comp(t)<0},O.lt=O.lessThan,O.lessThanOrEqual=function(t){return this.comp(t)<=0},O.lte=O.lessThanOrEqual,O.le=O.lessThanOrEqual,O.greaterThan=function(t){return this.comp(t)>0},O.gt=O.greaterThan,O.greaterThanOrEqual=function(t){return this.comp(t)>=0},O.gte=O.greaterThanOrEqual,O.ge=O.greaterThanOrEqual,O.compare=function(t){if(n(t)||(t=h(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},O.comp=O.compare,O.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(w)},O.neg=O.negate,O.add=function(t){n(t)||(t=h(t));var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,u=65535&t.high,f=t.low>>>16,c=0,l=0,p=0,g=0;return p+=(g+=o+(65535&t.low))>>>16,l+=(p+=i+f)>>>16,c+=(l+=r+u)>>>16,c+=e+s,a((p&=65535)<<16|(g&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},O.subtract=function(t){return n(t)||(t=h(t)),this.add(t.neg())},O.sub=O.subtract,O.multiply=function(t){if(this.isZero())return d;if(n(t)||(t=h(t)),e)return a(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return d;if(this.eq(_))return t.isOdd()?_:d;if(t.eq(_))return this.isOdd()?_:d;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(y)&&t.lt(y))return u(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,f=t.high>>>16,c=65535&t.high,l=t.low>>>16,p=65535&t.low,g=0,v=0,w=0,b=0;return w+=(b+=s*p)>>>16,v+=(w+=o*p)>>>16,w&=65535,v+=(w+=s*l)>>>16,g+=(v+=i*p)>>>16,v&=65535,g+=(v+=o*l)>>>16,v&=65535,g+=(v+=s*c)>>>16,g+=r*p+i*l+o*c+s*f,a((w&=65535)<<16|(b&=65535),(g&=65535)<<16|(v&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(t){if(n(t)||(t=h(t)),t.isZero())throw Error("division by zero");var r,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?a((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:d;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return b;o=v}else{if(this.eq(_))return t.eq(w)||t.eq(m)?_:t.eq(_)?w:(r=this.shr(1).div(t).shl(1)).eq(d)?t.isNegative()?w:m:(i=this.sub(t.mul(r)),o=r.add(i.div(t)));if(t.eq(_))return this.unsigned?v:d;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=d}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),c=s<=48?1:f(2,s-48),l=u(r),p=l.mul(t);p.isNegative()||p.gt(i);)p=(l=u(r-=c,this.unsigned)).mul(t);l.isZero()&&(l=w),o=o.add(l),i=i.sub(p)}return o},O.div=O.divide,O.modulo=function(t){return n(t)||(t=h(t)),e?a((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},O.mod=O.modulo,O.rem=O.modulo,O.not=function(){return a(~this.low,~this.high,this.unsigned)},O.and=function(t){return n(t)||(t=h(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},O.or=function(t){return n(t)||(t=h(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},O.xor=function(t){return n(t)||(t=h(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},O.shiftLeft=function(t){return n(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},O.shl=O.shiftLeft,O.shiftRight=function(t){return n(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},O.shr=O.shiftRight,O.shiftRightUnsigned=function(t){if(n(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?a(this.low>>>t|e<<32-t,e>>>t,this.unsigned):a(32===t?e:e>>>t-32,0,this.unsigned)},O.shru=O.shiftRightUnsigned,O.shr_u=O.shiftRightUnsigned,O.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},O.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},O.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},O.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},O.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},r.fromBytes=function(t,e,n){return n?r.fromBytesLE(t,e):r.fromBytesBE(t,e)},r.fromBytesLE=function(t,e){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},r.fromBytesBE=function(t,e){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},191:function(t,e){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InternalError=e.IllegalStateError=e.RetryLimitError=e.SchemaParseError=e.SchemaViolationError=e.InvalidScriptError=e.InvalidFilterError=e.OutOfBoundsError=e.IllegalArgumentError=e.SessionError=e.IOError=e.InvalidDataError=e.AssertionError=e.RuntimeError=e.NullValueError=void 0;var i=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="null_value_error",e}(Error);e.NullValueError=i;var o=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="runtime_error",e}(Error);e.RuntimeError=o;var s=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="assertion_error",e}(Error);e.AssertionError=s;var u=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_data_error",e}(Error);e.InvalidDataError=u;var a=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="io_error",e}(Error);e.IOError=a;var f=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="session_error",e}(Error);e.SessionError=f;var c=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_argument_error",e}(Error);e.IllegalArgumentError=c;var h=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="out_of_bounds_error",e}(Error);e.OutOfBoundsError=h;var l=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errors=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_filter_error",e}(Error);e.InvalidFilterError=l;var p=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errors=r,n}return n(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_script_error",e}(Error);e.InvalidScriptError=p;var g=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="schema_violation_error",e}(Error);e.SchemaViolationError=g;var y=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="schema_parse_error",e}(Error);e.SchemaParseError=y;var d=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="retry_limit_error",e}(Error);e.RetryLimitError=d;var v=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_state_error",e}(Error);e.IllegalStateError=v;var w=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getType=function(){return e.type},e.type="internal_error",e}(Error);e.InternalError=w},203:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.SessionLockOptions=e.SessionLockScope=void 0,function(t){t[t.UNLOCK_ON_SESSION_LOSS=0]="UNLOCK_ON_SESSION_LOSS",t[t.UNLOCK_ON_CONNECTION_LOSS=1]="UNLOCK_ON_CONNECTION_LOSS"}(r=e.SessionLockScope||(e.SessionLockScope={})),e.SessionLockOptions={SessionLockScope:r}},364:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.InternalSessionState=void 0,(r=e.InternalSessionState||(e.InternalSessionState={})).INITIALISING="initialising",r.CONNECTING="connecting",r.CONNECTED="connected",r.DISCONNECTED="disconnected",r.RECONNECTING="reconnecting",r.CLOSING="closing",r.CLOSED="closed"},368:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.InternalSessionLocks=e.SessionLockImpl=void 0;var o=r(364),s=r(102),u=r(97),a=r(400),f=r(203),c=u.create("diffusion.locks.SessionLocks"),h=function(){function t(t,e,r){var n=this;this.owned=!0,this.acquisition=t,this.unlockSessionLock=r,e.setOwned=function(t){n.owned=t}}return t.prototype.toString=function(){return"SessionLock [name="+this.acquisition.lockName+", sequence="+this.acquisition.sequence+", scope="+this.acquisition.scope+", owned="+this.owned+"]"},t.prototype.getName=function(){return this.acquisition.lockName},t.prototype.getSequence=function(){return this.acquisition.sequence},t.prototype.isOwned=function(){return this.owned},t.prototype.getScope=function(){return this.acquisition.scope},t.prototype.unlock=function(){return this.owned?(this.owned=!1,this.unlockSessionLock(this.acquisition)):Promise.resolve(!1)},t}();e.SessionLockImpl=h;var l=function(){function t(t,e){var r=this;this.locks={},this.nextRequestId=0,this.serviceLocator=t.getServiceLocator(),this.ACQUIRE_SESSION_LOCK=this.serviceLocator.obtain(s.ACQUIRE_SESSION_LOCK),this.RELEASE_SESSION_LOCK=this.serviceLocator.obtain(s.RELEASE_SESSION_LOCK);var u=null;e.on("change",(function(e,s){return n(r,void 0,void 0,(function(){var e,r=this;return i(this,(function(n){switch(n.label){case 0:return e=function(t){t.ownedSetter.setOwned(!1),t.onRemoveLock()},s!==o.InternalSessionState.DISCONNECTED?[3,2]:(Object.values(this.locks).filter((function(t){return t.lock.getScope()===f.SessionLockScope.UNLOCK_ON_CONNECTION_LOSS})).forEach(e),[4,t.getConversationSet().newConversation({onOpen:function(){},onResponse:function(){return!0},onDiscard:function(){Object.values(r.locks).forEach(e),r.locks={}}})]);case 1:return u=n.sent(),[3,3];case 2:s===o.InternalSessionState.CONNECTED?null!==u&&(t.getConversationSet().respondIfPresent(u,null),u=null):s===o.InternalSessionState.CLOSED&&(Object.values(this.locks).forEach(e),this.locks={}),n.label=3;case 3:return[2]}}))}))}))}return t.prototype.handleAcquisistion=function(t,e,r){var n,i=this.locks[t];return void 0!==i?i.lock.getSequence().equals(e.sequence)?n=i.lock:(i.ownedSetter.setOwned(!1),n=this.createLock(t,e,r)):n=this.createLock(t,e,r),n},t.prototype.createLock=function(t,e,r){var n={setOwned:function(){throw Error("Session lock ownedSetter must be implemented")}},i=new h(e,n,this.unlock.bind(this)),o=r?{lock:i,ownedSetter:{setOwned:function(t){n.setOwned(t),r.onOwned(t)}},onRemoveLock:function(){r.onRemoveLock()}}:{lock:i,ownedSetter:n,onRemoveLock:function(){}};return this.locks[t]=o,i},t.prototype.unlock=function(t){var e=this;return new Promise((function(r,n){e.RELEASE_SESSION_LOCK.send(t,(function(i,o){i?(c.debug("Release session lock failed"),n(i)):(void 0!==e.locks[t.lockName]&&e.locks[t.lockName].lock.getSequence().toString(10)===t.sequence.toString(10)&&delete e.locks[t.lockName],r(o))}))}))},t.prototype.lock=function(t,e,r){var n=this;return void 0===e&&(e=f.SessionLockScope.UNLOCK_ON_SESSION_LOSS),new Promise((function(i,o){if(void 0!==n.locks[t]&&n.locks[t].lock.isOwned())r?o(new Error("Cannot register the same lock in different shared sessions")):i(n.locks[t].lock);else{var s=n.nextRequestId++;n.ACQUIRE_SESSION_LOCK.send({lockName:t,requestId:s,scope:e},(function(e,s){if(a.responseSuccess(e,s)){var u=n.handleAcquisistion(t,s,r);i(u)}else c.debug("Acquire session lock failed"),o(e)}))}}))},t}();e.InternalSessionLocks=l},771:function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.readOptional=e.writeOptional=e.writeBoolean=e.readBoolean=e.writeMap=e.readMap=e.readObject=e.writeObject=e.writeDictionary=e.readDictionary=e.readCollection=e.writeCollection=e.writeString=e.readString=e.writeBytes=e.readBytes=e.writeByte=e.writeInt32=e.readInt32=e.writeInt64=e.readInt64=e.readByte=void 0;var i=r(191),o=r(570),s=r(224),u=o.fromNumber(128),a=o.fromNumber(127),f=a.not();function c(t){var e=t.read();if(-1===e)throw new i.IOError("End of stream");return e}function h(t){for(var e=0,r=0;e<32;){var n=c(t);if(r|=(127&n)<<e,!(128&n))return r;e+=7}throw new i.IOError("Malformed int32")}function l(t,e){for(;-128&e;)t.write(127&e|128),e>>>=7;t.write(e)}function p(t,e){t.write(e)}function g(t){var e=h(t);return t.readMany(e)}function y(t,e){l(t,e.length),t.writeMany(e)}function d(t){var e=g(t);return e?s.uint8toUtf8(e):""}function v(t,e){y(t,s.uint8FromUtf8(e))}function w(t,e,r,i){var o,s;l(t,Object.keys(e).length);try{for(var u=n(Object.getOwnPropertyNames(e)),a=u.next();!a.done;a=u.next()){var f=a.value;r(t,f),i(t,e[f])}}catch(t){o={error:t}}finally{try{a&&!a.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}}function b(t,e,r){for(var n=h(t),i={},o=0;o<n;++o)i[e(t)]=r(t);return i}e.readByte=c,e.readInt64=function(t){for(var e=o.fromNumber(0),r=0;r<64;){var n=c(t),s=o.fromNumber(n);if(e=e.or(s.and(a).shiftLeft(r)),s.and(u).equals(0))return e;r+=7}throw new i.IOError("Malformed int64")},e.writeInt64=function(t,e){for(var r=o.isLong(e)?e:o.fromNumber(e,!1);!r.and(f).equals(0);)t.write(r.and(a).or(u).toInt()),r=r.shiftRightUnsigned(7);t.write(r.toInt())},e.readInt32=h,e.writeInt32=l,e.writeByte=p,e.readBytes=g,e.writeBytes=y,e.readString=d,e.writeString=v,e.writeCollection=function(t,e,r){var i,o;l(t,e.length);try{for(var s=n(e),u=s.next();!u.done;u=s.next())r(t,u.value)}catch(t){i={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}},e.readCollection=function(t,e){for(var r=h(t),n=[],i=0;i<r;++i)n.push(e(t));return n},e.readDictionary=function(t,e){return b(t,d,e)},e.writeDictionary=function(t,e,r){w(t,e,v,r)},e.writeObject=w,e.readObject=b,e.readMap=function(t,e,r){for(var n=h(t),i=new Map,o=0;o<n;++o){var s=e(t);i.set(s,r(t))}return i},e.writeMap=function(t,e,r,n){l(t,e.size),e.forEach((function(e,i){r(t,i),n(t,e)}))},e.readBoolean=function(t){return 0!==t.readInt8()},e.writeBoolean=function(t,e){t.writeInt8(e?1:0)},e.writeOptional=function(t,e,r,n){void 0===n&&(n=function(t){return null!=t}),n(e)?(p(t,1),r(t,e)):p(t,0)},e.readOptional=function(t,e,r){return void 0===r&&(r=void 0),c(t)?e(t):r}},923:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanSerialiser=e.BooleanSerialiserClass=void 0;var n=r(771),i=function(){function t(){}return t.prototype.read=function(t){return n.readBoolean(t)},t.prototype.write=function(t,e){n.writeBoolean(t,e)},t}();e.BooleanSerialiserClass=i,e.BooleanSerialiser=new i},152:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.write=e.read=void 0;var n=r(191),i=r(771);e.read=function(t,e){var r=i.readByte(t);if(void 0===e[r])throw new n.IllegalArgumentError("Unable to decode enum value "+r);return e[e[r]]},e.write=function(t,e){"number"==typeof e?i.writeByte(t,e):i.writeByte(t,e.id)}},348:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSerialiser=void 0;var n=r(191),i=function(){function t(){}return t.prototype.read=function(t){throw new n.InternalError("AbstractSerialiser#read is not implemented")},t.prototype.write=function(t,e){throw new n.InternalError("AbstractSerialiser#write is not implemented")},t}();e.AbstractSerialiser=i},102:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RELEASE_SESSION_LOCK=e.ACQUIRE_SESSION_LOCK=void 0;var n=r(923),i=r(728),o=r(306);e.ACQUIRE_SESSION_LOCK={id:114,request:o.SessionLockRequestSerialiser,response:i.SessionLockAcquisitionSerialiser},e.RELEASE_SESSION_LOCK={id:116,request:i.SessionLockAcquisitionSerialiser,response:n.BooleanSerialiser}},728:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.SessionLockAcquisitionSerialiser=e.SessionLockAcquisitionSerialiserClass=void 0;var o=r(771),s=r(152),u=r(348),a=r(203),f=r(118),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.read=function(t){var e=o.readString(t),r=o.readInt64(t),n=s.read(t,a.SessionLockScope);return new f.SessionLockAcquisition(e,r,n)},e.prototype.write=function(t,e){o.writeString(t,e.lockName),o.writeInt64(t,e.sequence),s.write(t,e.scope)},e}(u.AbstractSerialiser);e.SessionLockAcquisitionSerialiserClass=c,e.SessionLockAcquisitionSerialiser=new c},118:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionLockAcquisition=void 0;e.SessionLockAcquisition=function(t,e,r){this.lockName=t,this.sequence=e,this.scope=r}},306:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.SessionLockRequestSerialiser=e.SessionLockRequestSerialiserClass=void 0;var o=r(771),s=r(152),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.write=function(t,e){o.writeString(t,e.lockName),o.writeInt64(t,e.requestId),s.write(t,e.scope)},e}(r(348).AbstractSerialiser);e.SessionLockRequestSerialiserClass=u,e.SessionLockRequestSe