Comparing version 1.8.5 to 1.9.0
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msgpackr={})}(this,(function(e){"use strict";var t,r,n;try{t=new TextDecoder}catch(e){}var i,s,o,a,u,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w,b=!1,m=2;try{new w("")}catch(e){m=1/0}class S{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return q((()=>(J(),this?this.unpack(e,t):S.prototype.unpack.call(p,e,t))));"object"==typeof t?(n=t.end||e.length,l=t.start||0):(l=0,n=t>-1?t:e.length),h=0,s=null,o=null,r=e;try{u=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(r=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof S){if(c=this,this.structures)return i=this.structures,U(t);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return U(t)}unpackMultiple(e,t){let r,n=0;try{b=!0;let i=e.length,s=this?this.unpack(e,i):H.unpack(e,i);if(!t){for(r=[s];l<i;)n=l,r.push(U());return r}if(!1===t(s))return;for(;l<i;)if(n=l,!1===t(U()))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{b=!1,J()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function U(e){try{if(!c.trusted&&!b){let e=i.sharedLength||0;e<i.length&&(i.length=e)}let e;if(c.randomAccessStructure&&r[l]<64&&r[l],e=k(),o&&(l=o.postBundlePosition,o=null),l==n)i&&i.restoreStructures&&A(),i=null,r=null,a&&(a=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!b)throw new Error("Data read, but end of buffer not reached "+JSON.stringify(e).slice(0,100))}return e}catch(e){throw i&&i.restoreStructures&&A(),J(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>n)&&(e.incomplete=!0),e}}function A(){for(let e in i.restoreStructures)i[e]=i.restoreStructures[e];i.restoreStructures=null}function k(){let e=r[l++];if(e<160){if(e<128){if(e<64)return e;{let t=i[63&e]||c.getStructures&&E()[63&e];return t?(t.read||(t.read=v(t,63&e)),t.read()):e}}if(e<144){if(e-=128,c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=N();"__proto__"===e&&(e="__proto_"),t[e]=k()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(k(),k());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=k();return c.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(h>=l)return s.slice(l-f,(l+=t)-f);if(0==h&&n<140){let e=t<16?V(t):F(t);if(null!=e)return e}return O(t)}{let t;switch(e){case 192:return null;case 193:return o?(t=k(),t>0?o[1].slice(o.position1,o.position1+=t):o[0].slice(o.position0,o.position0-=t)):y;case 194:return!1;case 195:return!0;case 196:if(t=r[l++],void 0===t)throw new Error("Unexpected end of buffer");return P(t);case 197:return t=u.getUint16(l),l+=2,P(t);case 198:return t=u.getUint32(l),l+=4,P(t);case 199:return C(r[l++]);case 200:return t=u.getUint16(l),l+=2,C(t);case 201:return t=u.getUint32(l),l+=4,C(t);case 202:if(t=u.getFloat32(l),c.useFloat32>2){let e=Z[(127&r[l])<<1|r[l+1]>>7];return l+=4,(e*t+(t>0?.5:-.5)>>0)/e}return l+=4,t;case 203:return t=u.getFloat64(l),l+=8,t;case 204:return r[l++];case 205:return t=u.getUint16(l),l+=2,t;case 206:return t=u.getUint32(l),l+=4,t;case 207:return"number"===c.int64AsType?(t=4294967296*u.getUint32(l),t+=u.getUint32(l+4)):t="string"===c.int64AsType?u.getBigUint64(l).toString():u.getBigUint64(l),l+=8,t;case 208:return u.getInt8(l++);case 209:return t=u.getInt16(l),l+=2,t;case 210:return t=u.getInt32(l),l+=4,t;case 211:return"number"===c.int64AsType?(t=4294967296*u.getInt32(l),t+=u.getUint32(l+4)):t="string"===c.int64AsType?u.getBigInt64(l).toString():u.getBigInt64(l),l+=8,t;case 212:if(t=r[l++],114==t)return W(63&r[l++]);{let e=g[t];if(e)return e.read?(l++,e.read(k())):e.noBuffer?(l++,e()):e(r.subarray(l,++l));throw new Error("Unknown extension "+t)}case 213:return t=r[l],114==t?(l++,W(63&r[l++],r[l++])):C(2);case 214:return C(4);case 215:return C(8);case 216:return C(16);case 217:return t=r[l++],h>=l?s.slice(l-f,(l+=t)-f):x(t);case 218:return t=u.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=t)-f):B(t);case 219:return t=u.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=t)-f):M(t);case 220:return t=u.getUint16(l),l+=2,j(t);case 221:return t=u.getUint32(l),l+=4,j(t);case 222:return t=u.getUint16(l),l+=2,D(t);case 223:return t=u.getUint32(l),l+=4,D(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const I=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function v(e,t){function r(){if(r.count++>m){let r=e.read=new w("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":I.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(k);return 0===e.highByte&&(e.read=_(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=k()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?_(t,r):r}const _=(e,t)=>function(){let n=r[l++];if(0===n)return t();let s=e<32?-(e+(n<<5)):e+(n<<5),o=i[s]||E()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=v(o,e)),o.read()};function E(){let e=q((()=>(r=null,c.getStructures())));return i=c._mergeStructures(e,i)}var O=T,x=T,B=T,M=T;function T(e){let n;if(e<16&&(n=V(e)))return n;if(e>64&&t)return t.decode(r.subarray(l,l+=e));const i=l+e,s=[];for(n="";l<i;){const e=r[l++];if(0==(128&e))s.push(e);else if(192==(224&e)){const t=63&r[l++];s.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&r[l++],n=63&r[l++];s.push((31&e)<<12|t<<6|n)}else if(240==(248&e)){let t=(7&e)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];t>65535&&(t-=65536,s.push(t>>>10&1023|55296),t=56320|1023&t),s.push(t)}else s.push(e);s.length>=4096&&(n+=L.apply(String,s),s.length=0)}return s.length>0&&(n+=L.apply(String,s)),n}function j(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=k();return c.freezeData?Object.freeze(t):t}function D(e){if(c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=N();"__proto__"===e&&(e="__proto_"),t[e]=k()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(k(),k());return t}}var L=String.fromCharCode;function F(e){let t=l,n=new Array(e);for(let i=0;i<e;i++){const e=r[l++];if((128&e)>0)return void(l=t);n[i]=e}return L.apply(String,n)}function V(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[l++];return(128&e)>1?void(l-=1):L(e)}}{let t=r[l++],n=r[l++];if((128&t)>0||(128&n)>0)return void(l-=2);if(e<3)return L(t,n);let i=r[l++];return(128&i)>0?void(l-=3):L(t,n,i)}}{let t=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(e<6){if(4===e)return L(t,n,i,s);{let e=r[l++];return(128&e)>0?void(l-=5):L(t,n,i,s,e)}}if(e<8){let o=r[l++],a=r[l++];if((128&o)>0||(128&a)>0)return void(l-=6);if(e<7)return L(t,n,i,s,o,a);let u=r[l++];return(128&u)>0?void(l-=7):L(t,n,i,s,o,a,u)}{let o=r[l++],a=r[l++],u=r[l++],c=r[l++];if((128&o)>0||(128&a)>0||(128&u)>0||(128&c)>0)return void(l-=8);if(e<10){if(8===e)return L(t,n,i,s,o,a,u,c);{let e=r[l++];return(128&e)>0?void(l-=9):L(t,n,i,s,o,a,u,c,e)}}if(e<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(e<11)return L(t,n,i,s,o,a,u,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):L(t,n,i,s,o,a,u,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(e<14){if(12===e)return L(t,n,i,s,o,a,u,c,f,h,g,p);{let e=r[l++];return(128&e)>0?void(l-=13):L(t,n,i,s,o,a,u,c,f,h,g,p,e)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(e<15)return L(t,n,i,s,o,a,u,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):L(t,n,i,s,o,a,u,c,f,h,g,p,d,y,w)}}}}}function R(){let e,t=r[l++];if(t<192)e=t-160;else switch(t){case 217:e=r[l++];break;case 218:e=u.getUint16(l),l+=2;break;case 219:e=u.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return T(e)}function P(e){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=e):r.subarray(l,l+=e)}function C(e){let t=r[l++];if(g[t]){let n;return g[t](r.subarray(l,n=l+=e),(e=>{l=e;try{return k()}finally{l=n}}))}throw new Error("Unknown extension type "+t)}var z=new Array(4096);function N(){let e=r[l++];if(!(e>=160&&e<192))return l--,k().toString();if(e-=160,h>=l)return s.slice(l-f,(l+=e)-f);if(!(0==h&&n<180))return O(e);let t,i=4095&(e<<5^(e>1?u.getUint16(l):e>0?r[l]:0)),o=z[i],a=l,c=l+e-3,g=0;if(o&&o.bytes==e){for(;a<c;){if(t=u.getUint32(a),t!=o[g++]){a=1879048192;break}a+=4}for(c+=3;a<c;)if(t=r[a++],t!=o[g++]){a=1879048192;break}if(a===c)return l=a,o.string;c-=3,a=l}for(o=[],z[i]=o,o.bytes=e;a<c;)t=u.getUint32(a),o.push(t),a+=4;for(c+=3;a<c;)t=r[a++],o.push(t);let p=e<16?V(e):F(e);return o.string=null!=p?p:O(e)}const W=(e,t)=>{let r=k().map((e=>e.toString())),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let s=i[e];return s&&s.isShared&&((i.restoreStructures||(i.restoreStructures=[]))[e]=s),i[e]=r,r.read=v(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[101]=()=>{let e=k();return(globalThis[e[0]]||Error)(e[1])},g[105]=e=>{let t=u.getUint32(l-4);a||(a=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};a.set(t,s);let o=k();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=e=>{let t=u.getUint32(l-4),r=a.get(t);return r.used=!0,r.target},g[115]=()=>new Set(k());const Y=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));g[116]=e=>{let t=e[0],r=Y[t];if(!r)throw new Error("Could not find typed array for code "+t);return new globalThis[r](Uint8Array.prototype.slice.call(e,1).buffer)},g[120]=()=>{let e=k();return new RegExp(e[0],e[1])};const $=[];function q(e){let t=n,g=l,p=f,d=h,y=s,w=a,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),k=c,I=b,v=e();return n=t,l=g,f=p,h=d,s=y,a=w,o=m,r=S,b=I,(i=U).splice(0,i.length,...A),c=k,u=new DataView(r.buffer,r.byteOffset,r.byteLength),v}function J(){r=null,a=null,i=null}g[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=l;return l+=t-e.length,o=$,(o=[R(),R()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,k()},g[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const Z=new Array(147);for(let e=0;e<256;e++)Z[e]=+("1e"+Math.floor(45.15-.30103*e));const G=S;var H=new S({useRecords:!1});const K=H.unpack,Q=H.unpackMultiple,X=H.unpack,ee={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let te,re,ne,ie=new Float32Array(1),se=new Uint8Array(ie.buffer,0,4);try{te=new TextEncoder}catch(e){}const oe="undefined"!=typeof Buffer,ae=oe?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,ue=oe?Buffer:Uint8Array,le=oe?4294967296:2144337920;let ce,fe,he,ge,pe=0,de=null;const ye=/[\u0080-\uFFFF]/,we=Symbol("record-id");class be extends S{constructor(e){let t,r,n,i;super(e),this.offset=0;let s=ue.prototype.utf8Write?function(e,t){return ce.utf8Write(e,t,4294967295)}:!(!te||!te.encodeInto)&&function(e,t){return te.encodeInto(e,ce.subarray(t)).written},o=this;e||(e={});let a=e&&e.sequential,u=e.structures||e.saveStructures,l=e.maxSharedStructures;if(null==l&&(l=u?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=u?32:64),this.structures||0==e.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(e,s){if(ce||(ce=new ae(8192),he=ce.dataView||(ce.dataView=new DataView(ce.buffer,0,8192)),pe=0),ge=ce.length-10,ge-pe<2048?(ce=new ae(ce.length),he=ce.dataView||(ce.dataView=new DataView(ce.buffer,0,ce.length)),ge=ce.length-10,pe=0):pe=pe+7&2147483640,t=pe,i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof e?(de=[],de.size=1/0):de=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let e=n.sharedLength||0;if(e>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[we]=t+64}this.lastNamedStructuresLength=e}a||(n.nextId=e+64)}r&&(r=!1);try{o.randomAccessStructure&&e.constructor&&e.constructor===Object?k(e):b(e);let u=de;if(de&&Ae(t,b,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),r=e.length,n=-1;for(;u&&r>0;){let i=e[--r].offset+t;i<u.stringsPosition+t&&-1===n&&(n=0),i>u.position+t?n>=0&&(n+=6):(n>=0&&(he.setUint32(u.position+t,he.getUint32(u.position+t)+n),n=-1),u=u.previous,r++)}n>=0&&u&&he.setUint32(u.position+t,he.getUint32(u.position+t)+n),pe+=6*e.length,pe>ge&&S(pe),o.offset=pe;let s=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,s=r.id;e.copyWithin(t+n,t,i),n-=6;let o=t+n;e[o++]=214,e[o++]=105,e[o++]=s>>24,e[o++]=s>>16&255,e[o++]=s>>8&255,e[o++]=255&s,i=t}return e}(ce.subarray(t,pe),e);return i=null,s}return o.offset=pe,s&Me?(ce.start=t,ce.end=pe,ce):ce.subarray(t,pe)}finally{if(n){y<10&&y++;let i=n.sharedLength||0;if(n.length>i&&(n.length=i),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!a){for(let e=0,t=p.length;e<t;e++)p[e][we]=0;p=[]}if(r&&o.saveStructures){let r=ce.subarray(t,pe),s=function(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}(n,o);return!1===o.saveStructures(s,s.isCompatible)?o.pack(e):(o.lastNamedStructuresLength=i,r)}}s&Te&&(pe=t)}};const w=e=>{var t=e.length;t<16?ce[pe++]=144|t:t<65536?(ce[pe++]=220,ce[pe++]=t>>8,ce[pe++]=255&t):(ce[pe++]=221,he.setUint32(pe,t),pe+=4);for(let r=0;r<t;r++)b(e[r])},b=e=>{pe>ge&&(ce=S(pe));var r,n=typeof e;if("string"===n){let n,i=e.length;if(de&&i>=4&&i<4096){if((de.size+=i)>21760){let e,r,n=(de[0]?3*de[0].length+de[1].length:0)+10;pe+n>ge&&(ce=S(pe+n)),de.position?(r=de,ce[pe]=200,pe+=3,ce[pe++]=98,e=pe-t,pe+=4,Ae(t,b,0),he.setUint16(e+t-3,pe-t-e)):(ce[pe++]=214,ce[pe++]=98,e=pe-t,pe+=4),de=["",""],de.previous=r,de.size=0,de.position=e}let r=ye.test(e);return de[r?0:1]+=e,ce[pe++]=193,void b(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(pe+o>ge&&(ce=S(pe+o)),i<64||!s){let t,s,o,a=pe+n;for(t=0;t<i;t++)s=e.charCodeAt(t),s<128?ce[a++]=s:s<2048?(ce[a++]=s>>6|192,ce[a++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=e.charCodeAt(t+1)))?(s=65536+((1023&s)<<10)+(1023&o),t++,ce[a++]=s>>18|240,ce[a++]=s>>12&63|128,ce[a++]=s>>6&63|128,ce[a++]=63&s|128):(ce[a++]=s>>12|224,ce[a++]=s>>6&63|128,ce[a++]=63&s|128);r=a-pe-n}else r=s(e,pe+n);r<32?ce[pe++]=160|r:r<256?(n<2&&ce.copyWithin(pe+2,pe+1,pe+1+r),ce[pe++]=217,ce[pe++]=r):r<65536?(n<3&&ce.copyWithin(pe+3,pe+2,pe+2+r),ce[pe++]=218,ce[pe++]=r>>8,ce[pe++]=255&r):(n<5&&ce.copyWithin(pe+5,pe+3,pe+3+r),ce[pe++]=219,he.setUint32(pe,r),pe+=4),pe+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?ce[pe++]=e:e<256?(ce[pe++]=204,ce[pe++]=e):e<65536?(ce[pe++]=205,ce[pe++]=e>>8,ce[pe++]=255&e):(ce[pe++]=206,he.setUint32(pe,e),pe+=4);else if(e>>0===e)e>=-32?ce[pe++]=256+e:e>=-128?(ce[pe++]=208,ce[pe++]=e+256):e>=-32768?(ce[pe++]=209,he.setInt16(pe,e),pe+=2):(ce[pe++]=210,he.setInt32(pe,e),pe+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(ce[pe++]=202,he.setFloat32(pe,e),t<4||(r=e*Z[(127&ce[pe])<<1|ce[pe+1]>>7])>>0===r)return void(pe+=4);pe--}ce[pe++]=203,he.setFloat64(pe,e),pe+=8}else if("object"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return ce[pe++]=214,ce[pe++]=112,he.setUint32(pe,r.id),void(pe+=4)}i.set(e,{offset:pe-t})}let n=e.constructor;if(n===Object)m(e,!0);else if(n===Array)w(e);else if(n===Map){(r=e.size)<16?ce[pe++]=128|r:r<65536?(ce[pe++]=222,ce[pe++]=r>>8,ce[pe++]=255&r):(ce[pe++]=223,he.setUint32(pe,r),pe+=4);for(let[t,r]of e)b(t),b(r)}else{for(let t=0,r=re.length;t<r;t++){if(e instanceof ne[t]){let r=re[t];if(r.write){r.type&&(ce[pe++]=212,ce[pe++]=r.type,ce[pe++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?w(e):m(e):b(t))}let n,i=ce,s=he,o=pe;ce=null;try{n=r.pack.call(this,e,(e=>(ce=i,i=null,pe+=e,pe>ge&&S(pe),{target:ce,targetView:he,position:pe-e})),b)}finally{i&&(ce=i,he=s,pe=o,ge=ce.length-10)}return void(n&&(n.length+pe>ge&&S(n.length+pe),pe=Ue(n,ce,pe,r.type)))}}Array.isArray(e)?w(e):m(e,!e.hasOwnProperty)}}else ce[pe++]=192;else if("boolean"===n)ce[pe++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))ce[pe++]=211,he.setBigInt64(pe,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)ce[pe++]=207,he.setBigUint64(pe,e);else{if(!this.largeBigIntToFloat)throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");ce[pe++]=203,he.setFloat64(pe,Number(e))}pe+=8}else if("undefined"===n)this.encodeUndefinedAsNil?ce[pe++]=192:(ce[pe++]=212,ce[pe++]=0,ce[pe++]=0);else{if("function"!==n)throw new Error("Unknown type: "+n);b(this.writeFunction&&this.writeFunction())}},m=!1===this.useRecords?this.variableMapSize?e=>{let t,r=Object.keys(e),n=r.length;n<16?ce[pe++]=128|n:n<65536?(ce[pe++]=222,ce[pe++]=n>>8,ce[pe++]=255&n):(ce[pe++]=223,he.setUint32(pe,n),pe+=4);for(let i=0;i<n;i++)b(t=r[i]),b(e[t])}:(e,r)=>{ce[pe++]=222;let n=pe-t;pe+=2;let i=0;for(let t in e)(r||e.hasOwnProperty(t))&&(b(t),b(e[t]),i++);ce[n+++t]=i>>8,ce[n+t]=255&i}:e.progressiveRecords&&!f?(e,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),a=pe++-t;for(let u in e)if(r||e.hasOwnProperty(u)){if(i=o[u],i)o=i;else{let r=Object.keys(e),l=o;o=n.transitions;let c=0;for(let e=0,t=r.length;e<t;e++){let t=r[e];i=o[t],i||(i=o[t]=Object.create(null),c++),o=i}a+t+1==pe?(pe--,U(o,r,c)):A(o,r,a,c),s=!0,o=l[u]}b(e[u])}if(!s){let r=o[we];r?ce[a+t]=r:A(o,Object.keys(e),a,0)}}:(e,t)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in e)(t||e.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[we];o?o>=96&&f?(ce[pe++]=96+(31&(o-=96)),ce[pe++]=o>>5):ce[pe++]=o:U(i,i.__keys__||Object.keys(e),s);for(let r in e)(t||e.hasOwnProperty(r))&&b(e[r])},S=e=>{let r;if(e>16777216){if(e-t>le)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(le,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,ce.length-1)>>12)<<12;let n=new ae(r);return he=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,ce.length),ce.copy?ce.copy(n,0,t,e):n.set(ce.slice(t,e)),pe-=t,t=0,ge=n.length-10,ce=n},U=(e,t,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=t.highByte=s>=96&&f?s-96>>5:-1;e[we]=s,e.__keys__=t,n[s-64]=t,s<h?(t.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(ce[pe++]=96+(31&s),ce[pe++]=o):ce[pe++]=s):(o>=0?(ce[pe++]=213,ce[pe++]=114,ce[pe++]=96+(31&s),ce[pe++]=o):(ce[pe++]=212,ce[pe++]=114,ce[pe++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[we]=0),p.push(e),b(t))},A=(e,r,n,i)=>{let s=ce,o=pe,a=ge,u=t;ce=fe,pe=0,t=0,ce||(fe=ce=new ae(8192)),ge=ce.length-10,U(e,r,i),fe=ce;let l=pe;if(ce=s,pe=o,ge=a,t=u,l>1){let e=pe+l-1;e>ge&&S(e);let r=n+t;ce.copyWithin(r+l,r+1,pe),ce.set(fe.slice(0,l),r),pe=e}else ce[n+t]=fe[0]},k=(e,t)=>{let i=undefined(e,ce,pe,n,S,((e,t,n)=>{if(n)return r=!0;pe=t;let i=ce;return b(e),i!==ce?{position:pe,targetView:he,target:ce}:pe}),this);if(0===i)return m(e,!0);pe=i}}useBuffer(e){ce=e,he=new DataView(ce.buffer,ce.byteOffset,ce.byteLength),pe=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function me(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:a}=r(7+i);s[o++]=201,a.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=t,s.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Se(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=t(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(e,i)}function Ue(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function Ae(e,t,r){if(de.length>0){he.setUint32(de.position+e,pe+r-de.position-e),de.stringsPosition=pe-e;let n=de;de=null,t(n[0]),t(n[1])}}ne=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],re=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=t(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:s}=t(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*e.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){let n=Array.from(e),{target:i,position:s}=t(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?me(e,16,t):Se(oe?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==ue&&this.moreTypes?me(e,Y.indexOf(r.name),t):Se(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let ke=new be({useRecords:!1});const Ie=ke.pack,ve=ke.pack,_e=be,{NEVER:Ee,ALWAYS:Oe,DECIMAL_ROUND:xe,DECIMAL_FIT:Be}=ee,Me=512,Te=1024;const je=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new S(t);let n;const i=e=>{let t;n&&(e=Buffer.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},De=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new be(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new be(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};e.ALWAYS=Oe,e.C1=y,e.DECIMAL_FIT=Be,e.DECIMAL_ROUND=xe,e.Decoder=G,e.Encoder=_e,e.FLOAT32_OPTIONS=ee,e.NEVER=Ee,e.Packr=be,e.REUSE_BUFFER_MODE=Me,e.Unpackr=S,e.addExtension=function(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");ne.unshift(e.Class),re.unshift(e)}!function(e){e.unpack?g[e.type]=e.unpack:g[e.type]=e}(e)},e.clearSource=J,e.decode=X,e.decodeIter=je,e.encode=ve,e.encodeIter=De,e.isNativeAccelerationEnabled=!1,e.mapsAsObjects=!0,e.pack=Ie,e.roundFloat32=function(e){ie[0]=e;let t=Z[(127&se[3])<<1|se[2]>>7];return(t*e+(e>0?.5:-.5)>>0)/t},e.unpack=K,e.unpackMultiple=Q,e.useRecords=!1})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).msgpackr={})}(this,(function(t){"use strict";var e,r,n;try{e=new TextDecoder}catch(t){}var i,s,o,a,u,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w,b=!1,m=2;try{new w("")}catch(t){m=1/0}class S{constructor(t){t&&(!1===t.useRecords&&void 0===t.mapsAsObjects&&(t.mapsAsObjects=!0),t.sequential&&!1!==t.trusted&&(t.trusted=!0,t.structures||0==t.useRecords||(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,e){if(r)return q((()=>(Z(),this?this.unpack(t,e):S.prototype.unpack.call(p,t,e))));t.buffer||t.constructor!==ArrayBuffer||(t="undefined"!=typeof Buffer?Buffer.from(t):new Uint8Array(t)),"object"==typeof e?(n=e.end||t.length,l=e.start||0):(l=0,n=e>-1?e:t.length),h=0,s=null,o=null,r=t;try{u=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(e){if(r=null,t instanceof Uint8Array)throw e;throw new Error("Source must be a Uint8Array or Buffer but was a "+(t&&"object"==typeof t?t.constructor.name:typeof t))}if(this instanceof S){if(c=this,this.structures)return i=this.structures,U(e);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return U(e)}unpackMultiple(t,e){let r,n=0;try{b=!0;let i=t.length,s=this?this.unpack(t,i):K.unpack(t,i);if(!e){for(r=[s];l<i;)n=l,r.push(U());return r}if(!1===e(s))return;for(;l<i;)if(n=l,!1===e(U()))return}catch(t){throw t.lastPosition=n,t.values=r,t}finally{b=!1,Z()}}_mergeStructures(t,e){t=t||[],Object.isFrozen(t)&&(t=t.map((t=>t.slice(0))));for(let e=0,r=t.length;e<r;e++){let r=t[e];r&&(r.isShared=!0,e>=32&&(r.highByte=e-32>>5))}t.sharedLength=t.length;for(let r in e||[])if(r>=0){let n=t[r],i=e[r];i&&(n&&((t.restoreStructures||(t.restoreStructures=[]))[r]=n),t[r]=i)}return this.structures=t}decode(t,e){return this.unpack(t,e)}}function U(t){try{if(!c.trusted&&!b){let t=i.sharedLength||0;t<i.length&&(i.length=t)}let t;if(c.randomAccessStructure&&r[l]<64&&r[l],t=I(),o&&(l=o.postBundlePosition,o=null),l==n)i&&i.restoreStructures&&A(),i=null,r=null,a&&(a=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!b){let e;try{e=JSON.stringify(t,((t,e)=>"bigint"==typeof e?`${e}n`:e)).slice(0,100)}catch(t){e="(JSON view not available "+t+")"}throw new Error("Data read, but end of buffer not reached "+e)}}return t}catch(t){throw i&&i.restoreStructures&&A(),Z(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||l>n)&&(t.incomplete=!0),t}}function A(){for(let t in i.restoreStructures)i[t]=i.restoreStructures[t];i.restoreStructures=null}function I(){let t=r[l++];if(t<160){if(t<128){if(t<64)return t;{let e=i[63&t]||c.getStructures&&E()[63&t];return e?(e.read||(e.read=v(e,63&t)),e.read()):t}}if(t<144){if(t-=128,c.mapsAsObjects){let e={};for(let r=0;r<t;r++){let t=z();"__proto__"===t&&(t="__proto_"),e[t]=I()}return e}{let e=new Map;for(let r=0;r<t;r++)e.set(I(),I());return e}}{t-=144;let e=new Array(t);for(let r=0;r<t;r++)e[r]=I();return c.freezeData?Object.freeze(e):e}}if(t<192){let e=t-160;if(h>=l)return s.slice(l-f,(l+=e)-f);if(0==h&&n<140){let t=e<16?V(e):F(e);if(null!=t)return t}return _(e)}{let e;switch(t){case 192:return null;case 193:return o?(e=I(),e>0?o[1].slice(o.position1,o.position1+=e):o[0].slice(o.position0,o.position0-=e)):y;case 194:return!1;case 195:return!0;case 196:if(e=r[l++],void 0===e)throw new Error("Unexpected end of buffer");return R(e);case 197:return e=u.getUint16(l),l+=2,R(e);case 198:return e=u.getUint32(l),l+=4,R(e);case 199:return P(r[l++]);case 200:return e=u.getUint16(l),l+=2,P(e);case 201:return e=u.getUint32(l),l+=4,P(e);case 202:if(e=u.getFloat32(l),c.useFloat32>2){let t=G[(127&r[l])<<1|r[l+1]>>7];return l+=4,(t*e+(e>0?.5:-.5)>>0)/t}return l+=4,e;case 203:return e=u.getFloat64(l),l+=8,e;case 204:return r[l++];case 205:return e=u.getUint16(l),l+=2,e;case 206:return e=u.getUint32(l),l+=4,e;case 207:return"number"===c.int64AsType?(e=4294967296*u.getUint32(l),e+=u.getUint32(l+4)):"string"===c.int64AsType?e=u.getBigUint64(l).toString():"auto"===c.int64AsType?(e=u.getBigUint64(l),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=u.getBigUint64(l),l+=8,e;case 208:return u.getInt8(l++);case 209:return e=u.getInt16(l),l+=2,e;case 210:return e=u.getInt32(l),l+=4,e;case 211:return"number"===c.int64AsType?(e=4294967296*u.getInt32(l),e+=u.getUint32(l+4)):"string"===c.int64AsType?e=u.getBigInt64(l).toString():"auto"===c.int64AsType?(e=u.getBigInt64(l),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=u.getBigInt64(l),l+=8,e;case 212:if(e=r[l++],114==e)return W(63&r[l++]);{let t=g[e];if(t)return t.read?(l++,t.read(I())):t.noBuffer?(l++,t()):t(r.subarray(l,++l));throw new Error("Unknown extension "+e)}case 213:return e=r[l],114==e?(l++,W(63&r[l++],r[l++])):P(2);case 214:return P(4);case 215:return P(8);case 216:return P(16);case 217:return e=r[l++],h>=l?s.slice(l-f,(l+=e)-f):B(e);case 218:return e=u.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=e)-f):x(e);case 219:return e=u.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=e)-f):j(e);case 220:return e=u.getUint16(l),l+=2,M(e);case 221:return e=u.getUint32(l),l+=4,M(e);case 222:return e=u.getUint16(l),l+=2,D(e);case 223:return e=u.getUint32(l),l+=4,D(e);default:if(t>=224)return t-256;if(void 0===t){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+t)}}}const k=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function v(t,e){function r(){if(r.count++>m){let r=t.read=new w("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+t.map((t=>"__proto__"===t?"__proto_:r()":k.test(t)?t+":r()":"["+JSON.stringify(t)+"]:r()")).join(",")+"})}")(I);return 0===t.highByte&&(t.read=O(e,t.read)),r()}let n={};for(let e=0,r=t.length;e<r;e++){let r=t[e];"__proto__"===r&&(r="__proto_"),n[r]=I()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===t.highByte?O(e,r):r}const O=(t,e)=>function(){let n=r[l++];if(0===n)return e();let s=t<32?-(t+(n<<5)):t+(n<<5),o=i[s]||E()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=v(o,t)),o.read()};function E(){let t=q((()=>(r=null,c.getStructures())));return i=c._mergeStructures(t,i)}var _=T,B=T,x=T,j=T;function T(t){let n;if(t<16&&(n=V(t)))return n;if(t>64&&e)return e.decode(r.subarray(l,l+=t));const i=l+t,s=[];for(n="";l<i;){const t=r[l++];if(0==(128&t))s.push(t);else if(192==(224&t)){const e=63&r[l++];s.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&r[l++],n=63&r[l++];s.push((31&t)<<12|e<<6|n)}else if(240==(248&t)){let e=(7&t)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];e>65535&&(e-=65536,s.push(e>>>10&1023|55296),e=56320|1023&e),s.push(e)}else s.push(t);s.length>=4096&&(n+=L.apply(String,s),s.length=0)}return s.length>0&&(n+=L.apply(String,s)),n}function M(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=I();return c.freezeData?Object.freeze(e):e}function D(t){if(c.mapsAsObjects){let e={};for(let r=0;r<t;r++){let t=z();"__proto__"===t&&(t="__proto_"),e[t]=I()}return e}{let e=new Map;for(let r=0;r<t;r++)e.set(I(),I());return e}}var L=String.fromCharCode;function F(t){let e=l,n=new Array(t);for(let i=0;i<t;i++){const t=r[l++];if((128&t)>0)return void(l=e);n[i]=t}return L.apply(String,n)}function V(t){if(t<4){if(t<2){if(0===t)return"";{let t=r[l++];return(128&t)>1?void(l-=1):L(t)}}{let e=r[l++],n=r[l++];if((128&e)>0||(128&n)>0)return void(l-=2);if(t<3)return L(e,n);let i=r[l++];return(128&i)>0?void(l-=3):L(e,n,i)}}{let e=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&e)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(t<6){if(4===t)return L(e,n,i,s);{let t=r[l++];return(128&t)>0?void(l-=5):L(e,n,i,s,t)}}if(t<8){let o=r[l++],a=r[l++];if((128&o)>0||(128&a)>0)return void(l-=6);if(t<7)return L(e,n,i,s,o,a);let u=r[l++];return(128&u)>0?void(l-=7):L(e,n,i,s,o,a,u)}{let o=r[l++],a=r[l++],u=r[l++],c=r[l++];if((128&o)>0||(128&a)>0||(128&u)>0||(128&c)>0)return void(l-=8);if(t<10){if(8===t)return L(e,n,i,s,o,a,u,c);{let t=r[l++];return(128&t)>0?void(l-=9):L(e,n,i,s,o,a,u,c,t)}}if(t<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(t<11)return L(e,n,i,s,o,a,u,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):L(e,n,i,s,o,a,u,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(t<14){if(12===t)return L(e,n,i,s,o,a,u,c,f,h,g,p);{let t=r[l++];return(128&t)>0?void(l-=13):L(e,n,i,s,o,a,u,c,f,h,g,p,t)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(t<15)return L(e,n,i,s,o,a,u,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):L(e,n,i,s,o,a,u,c,f,h,g,p,d,y,w)}}}}}function N(){let t,e=r[l++];if(e<192)t=e-160;else switch(e){case 217:t=r[l++];break;case 218:t=u.getUint16(l),l+=2;break;case 219:t=u.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return T(t)}function R(t){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=t):r.subarray(l,l+=t)}function P(t){let e=r[l++];if(g[e]){let n;return g[e](r.subarray(l,n=l+=t),(t=>{l=t;try{return I()}finally{l=n}}))}throw new Error("Unknown extension type "+e)}var C=new Array(4096);function z(){let t=r[l++];if(!(t>=160&&t<192))return l--,I().toString();if(t-=160,h>=l)return s.slice(l-f,(l+=t)-f);if(!(0==h&&n<180))return _(t);let e,i=4095&(t<<5^(t>1?u.getUint16(l):t>0?r[l]:0)),o=C[i],a=l,c=l+t-3,g=0;if(o&&o.bytes==t){for(;a<c;){if(e=u.getUint32(a),e!=o[g++]){a=1879048192;break}a+=4}for(c+=3;a<c;)if(e=r[a++],e!=o[g++]){a=1879048192;break}if(a===c)return l=a,o.string;c-=3,a=l}for(o=[],C[i]=o,o.bytes=t;a<c;)e=u.getUint32(a),o.push(e),a+=4;for(c+=3;a<c;)e=r[a++],o.push(e);let p=t<16?V(t):F(t);return o.string=null!=p?p:_(t)}const W=(t,e)=>{let r=I().map((t=>t.toString())),n=t;void 0!==e&&(t=t<32?-((e<<5)+t):(e<<5)+t,r.highByte=e);let s=i[t];return s&&s.isShared&&((i.restoreStructures||(i.restoreStructures=[]))[t]=s),i[t]=r,r.read=v(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0;let J="object"==typeof globalThis?globalThis:window;g[101]=()=>{let t=I();return(J[t[0]]||Error)(t[1])},g[105]=t=>{let e=u.getUint32(l-4);a||(a=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};a.set(e,s);let o=I();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=t=>{let e=u.getUint32(l-4),r=a.get(e);return r.used=!0,r.target},g[115]=()=>new Set(I());const $=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((t=>t+"Array"));g[116]=t=>{let e=t[0],r=$[e];if(!r)throw new Error("Could not find typed array for code "+e);return new J[r](Uint8Array.prototype.slice.call(t,1).buffer)},g[120]=()=>{let t=I();return new RegExp(t[0],t[1])};const Y=[];function q(t){let e=n,g=l,p=f,d=h,y=s,w=a,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),I=c,k=b,v=t();return n=e,l=g,f=p,h=d,s=y,a=w,o=m,r=S,b=k,(i=U).splice(0,i.length,...A),c=I,u=new DataView(r.buffer,r.byteOffset,r.byteLength),v}function Z(){r=null,a=null,i=null}g[98]=t=>{let e=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],r=l;return l+=e-t.length,o=Y,(o=[N(),N()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,I()},g[255]=t=>4==t.length?new Date(1e3*(16777216*t[0]+(t[1]<<16)+(t[2]<<8)+t[3])):8==t.length?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+1e3*(4294967296*(3&t[3])+16777216*t[4]+(t[5]<<16)+(t[6]<<8)+t[7])):12==t.length?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+1e3*((128&t[4]?-281474976710656:0)+1099511627776*t[6]+4294967296*t[7]+16777216*t[8]+(t[9]<<16)+(t[10]<<8)+t[11])):new Date("invalid");const G=new Array(147);for(let t=0;t<256;t++)G[t]=+("1e"+Math.floor(45.15-.30103*t));const H=S;var K=new S({useRecords:!1});const Q=K.unpack,X=K.unpackMultiple,tt=K.unpack,et={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let rt,nt,it,st=new Float32Array(1),ot=new Uint8Array(st.buffer,0,4);try{rt=new TextEncoder}catch(t){}const at="undefined"!=typeof Buffer,ut=at?function(t){return Buffer.allocUnsafeSlow(t)}:Uint8Array,lt=at?Buffer:Uint8Array,ct=at?4294967296:2144337920;let ft,ht,gt,pt,dt=0,yt=null;const wt=/[\u0080-\uFFFF]/,bt=Symbol("record-id");class mt extends S{constructor(t){let e,r,n,i;super(t),this.offset=0;let s=lt.prototype.utf8Write?function(t,e){return ft.utf8Write(t,e,4294967295)}:!(!rt||!rt.encodeInto)&&function(t,e){return rt.encodeInto(t,ft.subarray(e)).written},o=this;t||(t={});let a=t&&t.sequential,u=t.structures||t.saveStructures,l=t.maxSharedStructures;if(null==l&&(l=u?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&null==t.moreTypes&&(this.moreTypes=!0);let c=t.maxOwnStructures;null==c&&(c=u?32:64),this.structures||0==t.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(t,s){if(ft||(ft=new ut(8192),gt=ft.dataView||(ft.dataView=new DataView(ft.buffer,0,8192)),dt=0),pt=ft.length-10,pt-dt<2048?(ft=new ut(ft.length),gt=ft.dataView||(ft.dataView=new DataView(ft.buffer,0,ft.length)),pt=ft.length-10,dt=0):dt=dt+7&2147483640,e=dt,i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof t?(yt=[],yt.size=1/0):yt=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let t=n.sharedLength||0;if(t>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let e=0;e<t;e++){let t=n[e];if(!t)continue;let r,i=n.transitions;for(let e=0,n=t.length;e<n;e++){let n=t[e];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[bt]=e+64}this.lastNamedStructuresLength=t}a||(n.nextId=t+64)}r&&(r=!1);try{o.randomAccessStructure&&t&&t.constructor&&t.constructor===Object?I(t):b(t);let u=yt;if(yt&&It(e,b,0),i&&i.idsToInsert){let t=i.idsToInsert.sort(((t,e)=>t.offset>e.offset?1:-1)),r=t.length,n=-1;for(;u&&r>0;){let i=t[--r].offset+e;i<u.stringsPosition+e&&-1===n&&(n=0),i>u.position+e?n>=0&&(n+=6):(n>=0&&(gt.setUint32(u.position+e,gt.getUint32(u.position+e)+n),n=-1),u=u.previous,r++)}n>=0&&u&>.setUint32(u.position+e,gt.getUint32(u.position+e)+n),dt+=6*t.length,dt>pt&&S(dt),o.offset=dt;let s=function(t,e){let r,n=6*e.length,i=t.length-n;for(;r=e.pop();){let e=r.offset,s=r.id;t.copyWithin(e+n,e,i),n-=6;let o=e+n;t[o++]=214,t[o++]=105,t[o++]=s>>24,t[o++]=s>>16&255,t[o++]=s>>8&255,t[o++]=255&s,i=e}return t}(ft.subarray(e,dt),t);return i=null,s}return o.offset=dt,s&Tt?(ft.start=e,ft.end=dt,ft):ft.subarray(e,dt)}finally{if(n){y<10&&y++;let i=n.sharedLength||0;if(n.length>i&&(n.length=i),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!a){for(let t=0,e=p.length;t<e;t++)p[t][bt]=0;p=[]}if(r&&o.saveStructures){let r=ft.subarray(e,dt),s=function(t,e){return t.isCompatible=t=>{let r=!t||(e.lastNamedStructuresLength||0)===t.length;return r||e._mergeStructures(t),r},t}(n,o);return!1===o.saveStructures(s,s.isCompatible)?o.pack(t):(o.lastNamedStructuresLength=i,r)}}s&Mt&&(dt=e)}};const w=t=>{var e=t.length;e<16?ft[dt++]=144|e:e<65536?(ft[dt++]=220,ft[dt++]=e>>8,ft[dt++]=255&e):(ft[dt++]=221,gt.setUint32(dt,e),dt+=4);for(let r=0;r<e;r++)b(t[r])},b=t=>{dt>pt&&(ft=S(dt));var r,n=typeof t;if("string"===n){let n,i=t.length;if(yt&&i>=4&&i<4096){if((yt.size+=i)>21760){let t,r,n=(yt[0]?3*yt[0].length+yt[1].length:0)+10;dt+n>pt&&(ft=S(dt+n)),yt.position?(r=yt,ft[dt]=200,dt+=3,ft[dt++]=98,t=dt-e,dt+=4,It(e,b,0),gt.setUint16(t+e-3,dt-e-t)):(ft[dt++]=214,ft[dt++]=98,t=dt-e,dt+=4),yt=["",""],yt.previous=r,yt.size=0,yt.position=t}let r=wt.test(t);return yt[r?0:1]+=t,ft[dt++]=193,void b(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(dt+o>pt&&(ft=S(dt+o)),i<64||!s){let e,s,o,a=dt+n;for(e=0;e<i;e++)s=t.charCodeAt(e),s<128?ft[a++]=s:s<2048?(ft[a++]=s>>6|192,ft[a++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=t.charCodeAt(e+1)))?(s=65536+((1023&s)<<10)+(1023&o),e++,ft[a++]=s>>18|240,ft[a++]=s>>12&63|128,ft[a++]=s>>6&63|128,ft[a++]=63&s|128):(ft[a++]=s>>12|224,ft[a++]=s>>6&63|128,ft[a++]=63&s|128);r=a-dt-n}else r=s(t,dt+n);r<32?ft[dt++]=160|r:r<256?(n<2&&ft.copyWithin(dt+2,dt+1,dt+1+r),ft[dt++]=217,ft[dt++]=r):r<65536?(n<3&&ft.copyWithin(dt+3,dt+2,dt+2+r),ft[dt++]=218,ft[dt++]=r>>8,ft[dt++]=255&r):(n<5&&ft.copyWithin(dt+5,dt+3,dt+3+r),ft[dt++]=219,gt.setUint32(dt,r),dt+=4),dt+=r}else if("number"===n)if(t>>>0===t)t<32||t<128&&!1===this.useRecords||t<64&&!this.randomAccessStructure?ft[dt++]=t:t<256?(ft[dt++]=204,ft[dt++]=t):t<65536?(ft[dt++]=205,ft[dt++]=t>>8,ft[dt++]=255&t):(ft[dt++]=206,gt.setUint32(dt,t),dt+=4);else if(t>>0===t)t>=-32?ft[dt++]=256+t:t>=-128?(ft[dt++]=208,ft[dt++]=t+256):t>=-32768?(ft[dt++]=209,gt.setInt16(dt,t),dt+=2):(ft[dt++]=210,gt.setInt32(dt,t),dt+=4);else{let e;if((e=this.useFloat32)>0&&t<4294967296&&t>=-2147483648){let r;if(ft[dt++]=202,gt.setFloat32(dt,t),e<4||(r=t*G[(127&ft[dt])<<1|ft[dt+1]>>7])>>0===r)return void(dt+=4);dt--}ft[dt++]=203,gt.setFloat64(dt,t),dt+=8}else if("object"===n)if(t){if(i){let r=i.get(t);if(r){if(!r.id){let t=i.idsToInsert||(i.idsToInsert=[]);r.id=t.push(r)}return ft[dt++]=214,ft[dt++]=112,gt.setUint32(dt,r.id),void(dt+=4)}i.set(t,{offset:dt-e})}let n=t.constructor;if(n===Object)m(t,!0);else if(n===Array)w(t);else if(n===Map)if(this.mapAsEmptyObject)ft[dt++]=128;else{(r=t.size)<16?ft[dt++]=128|r:r<65536?(ft[dt++]=222,ft[dt++]=r>>8,ft[dt++]=255&r):(ft[dt++]=223,gt.setUint32(dt,r),dt+=4);for(let[e,r]of t)b(e),b(r)}else{for(let e=0,r=nt.length;e<r;e++){if(t instanceof it[e]){let r=nt[e];if(r.write){r.type&&(ft[dt++]=212,ft[dt++]=r.type,ft[dt++]=0);let e=r.write.call(this,t);return void(e===t?Array.isArray(t)?w(t):m(t):b(e))}let n,i=ft,s=gt,o=dt;ft=null;try{n=r.pack.call(this,t,(t=>(ft=i,i=null,dt+=t,dt>pt&&S(dt),{target:ft,targetView:gt,position:dt-t})),b)}finally{i&&(ft=i,gt=s,dt=o,pt=ft.length-10)}return void(n&&(n.length+dt>pt&&S(n.length+dt),dt=At(n,ft,dt,r.type)))}}if(Array.isArray(t))w(t);else{if(t.toJSON)return b(t.toJSON());m(t,!t.hasOwnProperty)}}}else ft[dt++]=192;else if("boolean"===n)ft[dt++]=t?195:194;else if("bigint"===n){if(t<BigInt(1)<<BigInt(63)&&t>=-(BigInt(1)<<BigInt(63)))ft[dt++]=211,gt.setBigInt64(dt,t);else if(t<BigInt(1)<<BigInt(64)&&t>0)ft[dt++]=207,gt.setBigUint64(dt,t);else{if(!this.largeBigIntToFloat)throw new RangeError(t+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");ft[dt++]=203,gt.setFloat64(dt,Number(t))}dt+=8}else if("undefined"===n)this.encodeUndefinedAsNil?ft[dt++]=192:(ft[dt++]=212,ft[dt++]=0,ft[dt++]=0);else{if("function"!==n)throw new Error("Unknown type: "+n);b(this.writeFunction&&this.writeFunction())}},m=!1===this.useRecords?this.variableMapSize?t=>{let e,r=Object.keys(t),n=r.length;n<16?ft[dt++]=128|n:n<65536?(ft[dt++]=222,ft[dt++]=n>>8,ft[dt++]=255&n):(ft[dt++]=223,gt.setUint32(dt,n),dt+=4);for(let i=0;i<n;i++)b(e=r[i]),b(t[e])}:(t,r)=>{ft[dt++]=222;let n=dt-e;dt+=2;let i=0;for(let e in t)(r||t.hasOwnProperty(e))&&(b(e),b(t[e]),i++);ft[n+++e]=i>>8,ft[n+e]=255&i}:t.progressiveRecords&&!f?(t,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),a=dt++-e;for(let u in t)if(r||t.hasOwnProperty(u)){if(i=o[u],i)o=i;else{let r=Object.keys(t),l=o;o=n.transitions;let c=0;for(let t=0,e=r.length;t<e;t++){let e=r[t];i=o[e],i||(i=o[e]=Object.create(null),c++),o=i}a+e+1==dt?(dt--,U(o,r,c)):A(o,r,a,c),s=!0,o=l[u]}b(t[u])}if(!s){let r=o[bt];r?ft[a+e]=r:A(o,Object.keys(t),a,0)}}:(t,e)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in t)(e||t.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[bt];o?o>=96&&f?(ft[dt++]=96+(31&(o-=96)),ft[dt++]=o>>5):ft[dt++]=o:U(i,i.__keys__||Object.keys(t),s);for(let r in t)(e||t.hasOwnProperty(r))&&b(t[r])},S=t=>{let r;if(t>16777216){if(t-e>ct)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(ct,4096*Math.round(Math.max((t-e)*(t>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(t-e<<2,ft.length-1)>>12)<<12;let n=new ut(r);return gt=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),t=Math.min(t,ft.length),ft.copy?ft.copy(n,0,e,t):n.set(ft.slice(e,t)),dt-=e,e=0,pt=n.length-10,ft=n},U=(t,e,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(e)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=e.highByte=s>=96&&f?s-96>>5:-1;t[bt]=s,t.__keys__=e,n[s-64]=e,s<h?(e.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(ft[dt++]=96+(31&s),ft[dt++]=o):ft[dt++]=s):(o>=0?(ft[dt++]=213,ft[dt++]=114,ft[dt++]=96+(31&s),ft[dt++]=o):(ft[dt++]=212,ft[dt++]=114,ft[dt++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[bt]=0),p.push(t),b(e))},A=(t,r,n,i)=>{let s=ft,o=dt,a=pt,u=e;ft=ht,dt=0,e=0,ft||(ht=ft=new ut(8192)),pt=ft.length-10,U(t,r,i),ht=ft;let l=dt;if(ft=s,dt=o,pt=a,e=u,l>1){let t=dt+l-1;t>pt&&S(t);let r=n+e;ft.copyWithin(r+l,r+1,dt),ft.set(ht.slice(0,l),r),dt=t}else ft[n+e]=ht[0]},I=(t,e)=>{let i=undefined(t,ft,dt,n,S,((t,e,n)=>{if(n)return r=!0;dt=e;let i=ft;return b(t),i!==ft?{position:dt,targetView:gt,target:ft}:dt}),this);if(0===i)return m(t,!0);dt=i}}useBuffer(t){ft=t,gt=new DataView(ft.buffer,ft.byteOffset,ft.byteLength),dt=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function St(t,e,r,n){let i=t.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:a}=r(7+i);s[o++]=201,a.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=e,s.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o)}function Ut(t,e){let r=t.byteLength;var n,i;if(r<256){var{target:n,position:i}=e(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=e(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=e(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(t,i)}function At(t,e,r,n){let i=t.length;switch(i){case 1:e[r++]=212;break;case 2:e[r++]=213;break;case 4:e[r++]=214;break;case 8:e[r++]=215;break;case 16:e[r++]=216;break;default:i<256?(e[r++]=199,e[r++]=i):i<65536?(e[r++]=200,e[r++]=i>>8,e[r++]=255&i):(e[r++]=201,e[r++]=i>>24,e[r++]=i>>16&255,e[r++]=i>>8&255,e[r++]=255&i)}return e[r++]=n,e.set(t,r),r+=i}function It(t,e,r){if(yt.length>0){gt.setUint32(yt.position+t,dt+r-yt.position-t),yt.stringsPosition=dt-t;let n=yt;yt=null,e(n[0]),e(n[1])}}it=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],nt=[{pack(t,e,r){let n=t.getTime()/1e3;if((this.useTimestamp32||0===t.getMilliseconds())&&n>=0&&n<4294967296){let{target:t,targetView:r,position:i}=e(6);t[i++]=214,t[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=e(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*t.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),r(this.onInvalidDate());let{target:t,targetView:n,position:i}=e(3);t[i++]=212,t[i++]=255,t[i++]=255}else{let{target:r,targetView:i,position:s}=e(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*t.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(t,e,r){if(this.setAsEmptyObject)return r({});let n=Array.from(t),{target:i,position:s}=e(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([t.name,t.message])}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([t.source,t.flags])}},{pack(t,e){this.moreTypes?St(t,16,e):Ut(at?Buffer.from(t):new Uint8Array(t),e)}},{pack(t,e){let r=t.constructor;r!==lt&&this.moreTypes?St(t,$.indexOf(r.name),e):Ut(t,e)}},{pack(t,e){let{target:r,position:n}=e(1);r[n]=193}}];let kt=new mt({useRecords:!1});const vt=kt.pack,Ot=kt.pack,Et=mt,{NEVER:_t,ALWAYS:Bt,DECIMAL_ROUND:xt,DECIMAL_FIT:jt}=et,Tt=512,Mt=1024;const Dt=function(t,e={}){if(!t||"object"!=typeof t)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new S(e);let n;const i=t=>{let e;n&&(t=Buffer.concat([n,t]),n=void 0);try{e=r.unpackMultiple(t)}catch(r){if(!r.incomplete)throw r;n=t.slice(r.lastPosition),e=r.values}return e};return"function"==typeof t[Symbol.iterator]?function*(){for(const e of t)yield*i(e)}():"function"==typeof t[Symbol.asyncIterator]?async function*(){for await(const e of t)yield*i(e)}():void 0},Lt=function(t,e={}){if(t&&"object"==typeof t){if("function"==typeof t[Symbol.iterator])return function*(t,e){const r=new mt(e);for(const e of t)yield r.pack(e)}(t,e);if("function"==typeof t.then||"function"==typeof t[Symbol.asyncIterator])return async function*(t,e){const r=new mt(e);for await(const e of t)yield r.pack(e)}(t,e);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};t.ALWAYS=Bt,t.C1=y,t.DECIMAL_FIT=jt,t.DECIMAL_ROUND=xt,t.Decoder=H,t.Encoder=Et,t.FLOAT32_OPTIONS=et,t.NEVER=_t,t.Packr=mt,t.REUSE_BUFFER_MODE=Tt,t.Unpackr=S,t.addExtension=function(t){if(t.Class){if(!t.pack&&!t.write)throw new Error("Extension has no pack or write function");if(t.pack&&!t.type)throw new Error("Extension has no type (numeric code to identify the extension)");it.unshift(t.Class),nt.unshift(t)}!function(t){t.unpack?g[t.type]=t.unpack:g[t.type]=t}(t)},t.clearSource=Z,t.decode=tt,t.decodeIter=Dt,t.encode=Ot,t.encodeIter=Lt,t.isNativeAccelerationEnabled=!1,t.mapsAsObjects=!0,t.pack=vt,t.roundFloat32=function(t){st[0]=t;let e=G[(127&ot[3])<<1|ot[2]>>7];return(e*t+(t>0?.5:-.5)>>0)/e},t.unpack=Q,t.unpackMultiple=X,t.useRecords=!1})); | ||
//# sourceMappingURL=index-no-eval.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msgpackr={})}(this,(function(e){"use strict";var t,r,n;try{t=new TextDecoder}catch(e){}var i,s,o,a,u,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w=!1,b=2;try{new Function("")}catch(e){b=1/0}class m{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return $((()=>(q(),this?this.unpack(e,t):m.prototype.unpack.call(p,e,t))));"object"==typeof t?(n=t.end||e.length,l=t.start||0):(l=0,n=t>-1?t:e.length),h=0,s=null,o=null,r=e;try{u=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(r=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof m){if(c=this,this.structures)return i=this.structures,S(t);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return S(t)}unpackMultiple(e,t){let r,n=0;try{w=!0;let i=e.length,s=this?this.unpack(e,i):G.unpack(e,i);if(!t){for(r=[s];l<i;)n=l,r.push(S());return r}if(!1===t(s))return;for(;l<i;)if(n=l,!1===t(S()))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{w=!1,q()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function S(e){try{if(!c.trusted&&!w){let e=i.sharedLength||0;e<i.length&&(i.length=e)}let e;if(c.randomAccessStructure&&r[l]<64&&r[l],e=A(),o&&(l=o.postBundlePosition,o=null),l==n)i&&i.restoreStructures&&U(),i=null,r=null,a&&(a=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!w)throw new Error("Data read, but end of buffer not reached "+JSON.stringify(e).slice(0,100))}return e}catch(e){throw i&&i.restoreStructures&&U(),q(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>n)&&(e.incomplete=!0),e}}function U(){for(let e in i.restoreStructures)i[e]=i.restoreStructures[e];i.restoreStructures=null}function A(){let e=r[l++];if(e<160){if(e<128){if(e<64)return e;{let t=i[63&e]||c.getStructures&&_()[63&e];return t?(t.read||(t.read=I(t,63&e)),t.read()):e}}if(e<144){if(e-=128,c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=z();"__proto__"===e&&(e="__proto_"),t[e]=A()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(A(),A());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=A();return c.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(h>=l)return s.slice(l-f,(l+=t)-f);if(0==h&&n<140){let e=t<16?L(t):F(t);if(null!=e)return e}return E(t)}{let t;switch(e){case 192:return null;case 193:return o?(t=A(),t>0?o[1].slice(o.position1,o.position1+=t):o[0].slice(o.position0,o.position0-=t)):y;case 194:return!1;case 195:return!0;case 196:if(t=r[l++],void 0===t)throw new Error("Unexpected end of buffer");return R(t);case 197:return t=u.getUint16(l),l+=2,R(t);case 198:return t=u.getUint32(l),l+=4,R(t);case 199:return P(r[l++]);case 200:return t=u.getUint16(l),l+=2,P(t);case 201:return t=u.getUint32(l),l+=4,P(t);case 202:if(t=u.getFloat32(l),c.useFloat32>2){let e=J[(127&r[l])<<1|r[l+1]>>7];return l+=4,(e*t+(t>0?.5:-.5)>>0)/e}return l+=4,t;case 203:return t=u.getFloat64(l),l+=8,t;case 204:return r[l++];case 205:return t=u.getUint16(l),l+=2,t;case 206:return t=u.getUint32(l),l+=4,t;case 207:return"number"===c.int64AsType?(t=4294967296*u.getUint32(l),t+=u.getUint32(l+4)):t="string"===c.int64AsType?u.getBigUint64(l).toString():u.getBigUint64(l),l+=8,t;case 208:return u.getInt8(l++);case 209:return t=u.getInt16(l),l+=2,t;case 210:return t=u.getInt32(l),l+=4,t;case 211:return"number"===c.int64AsType?(t=4294967296*u.getInt32(l),t+=u.getUint32(l+4)):t="string"===c.int64AsType?u.getBigInt64(l).toString():u.getBigInt64(l),l+=8,t;case 212:if(t=r[l++],114==t)return N(63&r[l++]);{let e=g[t];if(e)return e.read?(l++,e.read(A())):e.noBuffer?(l++,e()):e(r.subarray(l,++l));throw new Error("Unknown extension "+t)}case 213:return t=r[l],114==t?(l++,N(63&r[l++],r[l++])):P(2);case 214:return P(4);case 215:return P(8);case 216:return P(16);case 217:return t=r[l++],h>=l?s.slice(l-f,(l+=t)-f):O(t);case 218:return t=u.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=t)-f):x(t);case 219:return t=u.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=t)-f):B(t);case 220:return t=u.getUint16(l),l+=2,T(t);case 221:return t=u.getUint32(l),l+=4,T(t);case 222:return t=u.getUint16(l),l+=2,j(t);case 223:return t=u.getUint32(l),l+=4,j(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const k=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function I(e,t){function r(){if(r.count++>b){let r=e.read=new Function("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":k.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(A);return 0===e.highByte&&(e.read=v(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=A()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?v(t,r):r}const v=(e,t)=>function(){let n=r[l++];if(0===n)return t();let s=e<32?-(e+(n<<5)):e+(n<<5),o=i[s]||_()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=I(o,e)),o.read()};function _(){let e=$((()=>(r=null,c.getStructures())));return i=c._mergeStructures(e,i)}var E=M,O=M,x=M,B=M;function M(e){let n;if(e<16&&(n=L(e)))return n;if(e>64&&t)return t.decode(r.subarray(l,l+=e));const i=l+e,s=[];for(n="";l<i;){const e=r[l++];if(0==(128&e))s.push(e);else if(192==(224&e)){const t=63&r[l++];s.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&r[l++],n=63&r[l++];s.push((31&e)<<12|t<<6|n)}else if(240==(248&e)){let t=(7&e)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];t>65535&&(t-=65536,s.push(t>>>10&1023|55296),t=56320|1023&t),s.push(t)}else s.push(e);s.length>=4096&&(n+=D.apply(String,s),s.length=0)}return s.length>0&&(n+=D.apply(String,s)),n}function T(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=A();return c.freezeData?Object.freeze(t):t}function j(e){if(c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=z();"__proto__"===e&&(e="__proto_"),t[e]=A()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(A(),A());return t}}var D=String.fromCharCode;function F(e){let t=l,n=new Array(e);for(let i=0;i<e;i++){const e=r[l++];if((128&e)>0)return void(l=t);n[i]=e}return D.apply(String,n)}function L(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[l++];return(128&e)>1?void(l-=1):D(e)}}{let t=r[l++],n=r[l++];if((128&t)>0||(128&n)>0)return void(l-=2);if(e<3)return D(t,n);let i=r[l++];return(128&i)>0?void(l-=3):D(t,n,i)}}{let t=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(e<6){if(4===e)return D(t,n,i,s);{let e=r[l++];return(128&e)>0?void(l-=5):D(t,n,i,s,e)}}if(e<8){let o=r[l++],a=r[l++];if((128&o)>0||(128&a)>0)return void(l-=6);if(e<7)return D(t,n,i,s,o,a);let u=r[l++];return(128&u)>0?void(l-=7):D(t,n,i,s,o,a,u)}{let o=r[l++],a=r[l++],u=r[l++],c=r[l++];if((128&o)>0||(128&a)>0||(128&u)>0||(128&c)>0)return void(l-=8);if(e<10){if(8===e)return D(t,n,i,s,o,a,u,c);{let e=r[l++];return(128&e)>0?void(l-=9):D(t,n,i,s,o,a,u,c,e)}}if(e<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(e<11)return D(t,n,i,s,o,a,u,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):D(t,n,i,s,o,a,u,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(e<14){if(12===e)return D(t,n,i,s,o,a,u,c,f,h,g,p);{let e=r[l++];return(128&e)>0?void(l-=13):D(t,n,i,s,o,a,u,c,f,h,g,p,e)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(e<15)return D(t,n,i,s,o,a,u,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):D(t,n,i,s,o,a,u,c,f,h,g,p,d,y,w)}}}}}function V(){let e,t=r[l++];if(t<192)e=t-160;else switch(t){case 217:e=r[l++];break;case 218:e=u.getUint16(l),l+=2;break;case 219:e=u.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return M(e)}function R(e){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=e):r.subarray(l,l+=e)}function P(e){let t=r[l++];if(g[t]){let n;return g[t](r.subarray(l,n=l+=e),(e=>{l=e;try{return A()}finally{l=n}}))}throw new Error("Unknown extension type "+t)}var C=new Array(4096);function z(){let e=r[l++];if(!(e>=160&&e<192))return l--,A().toString();if(e-=160,h>=l)return s.slice(l-f,(l+=e)-f);if(!(0==h&&n<180))return E(e);let t,i=4095&(e<<5^(e>1?u.getUint16(l):e>0?r[l]:0)),o=C[i],a=l,c=l+e-3,g=0;if(o&&o.bytes==e){for(;a<c;){if(t=u.getUint32(a),t!=o[g++]){a=1879048192;break}a+=4}for(c+=3;a<c;)if(t=r[a++],t!=o[g++]){a=1879048192;break}if(a===c)return l=a,o.string;c-=3,a=l}for(o=[],C[i]=o,o.bytes=e;a<c;)t=u.getUint32(a),o.push(t),a+=4;for(c+=3;a<c;)t=r[a++],o.push(t);let p=e<16?L(e):F(e);return o.string=null!=p?p:E(e)}const N=(e,t)=>{let r=A().map((e=>e.toString())),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let s=i[e];return s&&s.isShared&&((i.restoreStructures||(i.restoreStructures=[]))[e]=s),i[e]=r,r.read=I(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[101]=()=>{let e=A();return(globalThis[e[0]]||Error)(e[1])},g[105]=e=>{let t=u.getUint32(l-4);a||(a=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};a.set(t,s);let o=A();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=e=>{let t=u.getUint32(l-4),r=a.get(t);return r.used=!0,r.target},g[115]=()=>new Set(A());const W=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));g[116]=e=>{let t=e[0],r=W[t];if(!r)throw new Error("Could not find typed array for code "+t);return new globalThis[r](Uint8Array.prototype.slice.call(e,1).buffer)},g[120]=()=>{let e=A();return new RegExp(e[0],e[1])};const Y=[];function $(e){let t=n,g=l,p=f,d=h,y=s,b=a,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),k=c,I=w,v=e();return n=t,l=g,f=p,h=d,s=y,a=b,o=m,r=S,w=I,(i=U).splice(0,i.length,...A),c=k,u=new DataView(r.buffer,r.byteOffset,r.byteLength),v}function q(){r=null,a=null,i=null}g[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=l;return l+=t-e.length,o=Y,(o=[V(),V()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,A()},g[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const J=new Array(147);for(let e=0;e<256;e++)J[e]=+("1e"+Math.floor(45.15-.30103*e));const Z=m;var G=new m({useRecords:!1});const H=G.unpack,K=G.unpackMultiple,Q=G.unpack,X={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let ee,te,re,ne=new Float32Array(1),ie=new Uint8Array(ne.buffer,0,4);try{ee=new TextEncoder}catch(e){}const se="undefined"!=typeof Buffer,oe=se?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,ae=se?Buffer:Uint8Array,ue=se?4294967296:2144337920;let le,ce,fe,he,ge=0,pe=null;const de=/[\u0080-\uFFFF]/,ye=Symbol("record-id");class we extends m{constructor(e){let t,r,n,i;super(e),this.offset=0;let s=ae.prototype.utf8Write?function(e,t){return le.utf8Write(e,t,4294967295)}:!(!ee||!ee.encodeInto)&&function(e,t){return ee.encodeInto(e,le.subarray(t)).written},o=this;e||(e={});let a=e&&e.sequential,u=e.structures||e.saveStructures,l=e.maxSharedStructures;if(null==l&&(l=u?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=u?32:64),this.structures||0==e.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(e,s){if(le||(le=new oe(8192),fe=le.dataView||(le.dataView=new DataView(le.buffer,0,8192)),ge=0),he=le.length-10,he-ge<2048?(le=new oe(le.length),fe=le.dataView||(le.dataView=new DataView(le.buffer,0,le.length)),he=le.length-10,ge=0):ge=ge+7&2147483640,t=ge,i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof e?(pe=[],pe.size=1/0):pe=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let e=n.sharedLength||0;if(e>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[ye]=t+64}this.lastNamedStructuresLength=e}a||(n.nextId=e+64)}r&&(r=!1);try{o.randomAccessStructure&&e.constructor&&e.constructor===Object?k(e):b(e);let u=pe;if(pe&&Ue(t,b,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),r=e.length,n=-1;for(;u&&r>0;){let i=e[--r].offset+t;i<u.stringsPosition+t&&-1===n&&(n=0),i>u.position+t?n>=0&&(n+=6):(n>=0&&(fe.setUint32(u.position+t,fe.getUint32(u.position+t)+n),n=-1),u=u.previous,r++)}n>=0&&u&&fe.setUint32(u.position+t,fe.getUint32(u.position+t)+n),ge+=6*e.length,ge>he&&S(ge),o.offset=ge;let s=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,s=r.id;e.copyWithin(t+n,t,i),n-=6;let o=t+n;e[o++]=214,e[o++]=105,e[o++]=s>>24,e[o++]=s>>16&255,e[o++]=s>>8&255,e[o++]=255&s,i=t}return e}(le.subarray(t,ge),e);return i=null,s}return o.offset=ge,s&Be?(le.start=t,le.end=ge,le):le.subarray(t,ge)}finally{if(n){y<10&&y++;let i=n.sharedLength||0;if(n.length>i&&(n.length=i),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!a){for(let e=0,t=p.length;e<t;e++)p[e][ye]=0;p=[]}if(r&&o.saveStructures){let r=le.subarray(t,ge),s=function(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}(n,o);return!1===o.saveStructures(s,s.isCompatible)?o.pack(e):(o.lastNamedStructuresLength=i,r)}}s&Me&&(ge=t)}};const w=e=>{var t=e.length;t<16?le[ge++]=144|t:t<65536?(le[ge++]=220,le[ge++]=t>>8,le[ge++]=255&t):(le[ge++]=221,fe.setUint32(ge,t),ge+=4);for(let r=0;r<t;r++)b(e[r])},b=e=>{ge>he&&(le=S(ge));var r,n=typeof e;if("string"===n){let n,i=e.length;if(pe&&i>=4&&i<4096){if((pe.size+=i)>21760){let e,r,n=(pe[0]?3*pe[0].length+pe[1].length:0)+10;ge+n>he&&(le=S(ge+n)),pe.position?(r=pe,le[ge]=200,ge+=3,le[ge++]=98,e=ge-t,ge+=4,Ue(t,b,0),fe.setUint16(e+t-3,ge-t-e)):(le[ge++]=214,le[ge++]=98,e=ge-t,ge+=4),pe=["",""],pe.previous=r,pe.size=0,pe.position=e}let r=de.test(e);return pe[r?0:1]+=e,le[ge++]=193,void b(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(ge+o>he&&(le=S(ge+o)),i<64||!s){let t,s,o,a=ge+n;for(t=0;t<i;t++)s=e.charCodeAt(t),s<128?le[a++]=s:s<2048?(le[a++]=s>>6|192,le[a++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=e.charCodeAt(t+1)))?(s=65536+((1023&s)<<10)+(1023&o),t++,le[a++]=s>>18|240,le[a++]=s>>12&63|128,le[a++]=s>>6&63|128,le[a++]=63&s|128):(le[a++]=s>>12|224,le[a++]=s>>6&63|128,le[a++]=63&s|128);r=a-ge-n}else r=s(e,ge+n);r<32?le[ge++]=160|r:r<256?(n<2&&le.copyWithin(ge+2,ge+1,ge+1+r),le[ge++]=217,le[ge++]=r):r<65536?(n<3&&le.copyWithin(ge+3,ge+2,ge+2+r),le[ge++]=218,le[ge++]=r>>8,le[ge++]=255&r):(n<5&&le.copyWithin(ge+5,ge+3,ge+3+r),le[ge++]=219,fe.setUint32(ge,r),ge+=4),ge+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?le[ge++]=e:e<256?(le[ge++]=204,le[ge++]=e):e<65536?(le[ge++]=205,le[ge++]=e>>8,le[ge++]=255&e):(le[ge++]=206,fe.setUint32(ge,e),ge+=4);else if(e>>0===e)e>=-32?le[ge++]=256+e:e>=-128?(le[ge++]=208,le[ge++]=e+256):e>=-32768?(le[ge++]=209,fe.setInt16(ge,e),ge+=2):(le[ge++]=210,fe.setInt32(ge,e),ge+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(le[ge++]=202,fe.setFloat32(ge,e),t<4||(r=e*J[(127&le[ge])<<1|le[ge+1]>>7])>>0===r)return void(ge+=4);ge--}le[ge++]=203,fe.setFloat64(ge,e),ge+=8}else if("object"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return le[ge++]=214,le[ge++]=112,fe.setUint32(ge,r.id),void(ge+=4)}i.set(e,{offset:ge-t})}let n=e.constructor;if(n===Object)m(e,!0);else if(n===Array)w(e);else if(n===Map){(r=e.size)<16?le[ge++]=128|r:r<65536?(le[ge++]=222,le[ge++]=r>>8,le[ge++]=255&r):(le[ge++]=223,fe.setUint32(ge,r),ge+=4);for(let[t,r]of e)b(t),b(r)}else{for(let t=0,r=te.length;t<r;t++){if(e instanceof re[t]){let r=te[t];if(r.write){r.type&&(le[ge++]=212,le[ge++]=r.type,le[ge++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?w(e):m(e):b(t))}let n,i=le,s=fe,o=ge;le=null;try{n=r.pack.call(this,e,(e=>(le=i,i=null,ge+=e,ge>he&&S(ge),{target:le,targetView:fe,position:ge-e})),b)}finally{i&&(le=i,fe=s,ge=o,he=le.length-10)}return void(n&&(n.length+ge>he&&S(n.length+ge),ge=Se(n,le,ge,r.type)))}}Array.isArray(e)?w(e):m(e,!e.hasOwnProperty)}}else le[ge++]=192;else if("boolean"===n)le[ge++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))le[ge++]=211,fe.setBigInt64(ge,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)le[ge++]=207,fe.setBigUint64(ge,e);else{if(!this.largeBigIntToFloat)throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");le[ge++]=203,fe.setFloat64(ge,Number(e))}ge+=8}else if("undefined"===n)this.encodeUndefinedAsNil?le[ge++]=192:(le[ge++]=212,le[ge++]=0,le[ge++]=0);else{if("function"!==n)throw new Error("Unknown type: "+n);b(this.writeFunction&&this.writeFunction())}},m=!1===this.useRecords?this.variableMapSize?e=>{let t,r=Object.keys(e),n=r.length;n<16?le[ge++]=128|n:n<65536?(le[ge++]=222,le[ge++]=n>>8,le[ge++]=255&n):(le[ge++]=223,fe.setUint32(ge,n),ge+=4);for(let i=0;i<n;i++)b(t=r[i]),b(e[t])}:(e,r)=>{le[ge++]=222;let n=ge-t;ge+=2;let i=0;for(let t in e)(r||e.hasOwnProperty(t))&&(b(t),b(e[t]),i++);le[n+++t]=i>>8,le[n+t]=255&i}:e.progressiveRecords&&!f?(e,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),a=ge++-t;for(let u in e)if(r||e.hasOwnProperty(u)){if(i=o[u],i)o=i;else{let r=Object.keys(e),l=o;o=n.transitions;let c=0;for(let e=0,t=r.length;e<t;e++){let t=r[e];i=o[t],i||(i=o[t]=Object.create(null),c++),o=i}a+t+1==ge?(ge--,U(o,r,c)):A(o,r,a,c),s=!0,o=l[u]}b(e[u])}if(!s){let r=o[ye];r?le[a+t]=r:A(o,Object.keys(e),a,0)}}:(e,t)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in e)(t||e.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[ye];o?o>=96&&f?(le[ge++]=96+(31&(o-=96)),le[ge++]=o>>5):le[ge++]=o:U(i,i.__keys__||Object.keys(e),s);for(let r in e)(t||e.hasOwnProperty(r))&&b(e[r])},S=e=>{let r;if(e>16777216){if(e-t>ue)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(ue,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,le.length-1)>>12)<<12;let n=new oe(r);return fe=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,le.length),le.copy?le.copy(n,0,t,e):n.set(le.slice(t,e)),ge-=t,t=0,he=n.length-10,le=n},U=(e,t,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=t.highByte=s>=96&&f?s-96>>5:-1;e[ye]=s,e.__keys__=t,n[s-64]=t,s<h?(t.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(le[ge++]=96+(31&s),le[ge++]=o):le[ge++]=s):(o>=0?(le[ge++]=213,le[ge++]=114,le[ge++]=96+(31&s),le[ge++]=o):(le[ge++]=212,le[ge++]=114,le[ge++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[ye]=0),p.push(e),b(t))},A=(e,r,n,i)=>{let s=le,o=ge,a=he,u=t;le=ce,ge=0,t=0,le||(ce=le=new oe(8192)),he=le.length-10,U(e,r,i),ce=le;let l=ge;if(le=s,ge=o,he=a,t=u,l>1){let e=ge+l-1;e>he&&S(e);let r=n+t;le.copyWithin(r+l,r+1,ge),le.set(ce.slice(0,l),r),ge=e}else le[n+t]=ce[0]},k=(e,t)=>{let i=undefined(e,le,ge,n,S,((e,t,n)=>{if(n)return r=!0;ge=t;let i=le;return b(e),i!==le?{position:ge,targetView:fe,target:le}:ge}),this);if(0===i)return m(e,!0);ge=i}}useBuffer(e){le=e,fe=new DataView(le.buffer,le.byteOffset,le.byteLength),ge=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function be(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:a}=r(7+i);s[o++]=201,a.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=t,s.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function me(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=t(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(e,i)}function Se(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function Ue(e,t,r){if(pe.length>0){fe.setUint32(pe.position+e,ge+r-pe.position-e),pe.stringsPosition=ge-e;let n=pe;pe=null,t(n[0]),t(n[1])}}re=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],te=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=t(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:s}=t(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*e.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){let n=Array.from(e),{target:i,position:s}=t(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?be(e,16,t):me(se?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==ae&&this.moreTypes?be(e,W.indexOf(r.name),t):me(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let Ae=new we({useRecords:!1});const ke=Ae.pack,Ie=Ae.pack,ve=we,{NEVER:_e,ALWAYS:Ee,DECIMAL_ROUND:Oe,DECIMAL_FIT:xe}=X,Be=512,Me=1024;const Te=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new m(t);let n;const i=e=>{let t;n&&(e=Buffer.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},je=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new we(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new we(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};e.ALWAYS=Ee,e.C1=y,e.DECIMAL_FIT=xe,e.DECIMAL_ROUND=Oe,e.Decoder=Z,e.Encoder=ve,e.FLOAT32_OPTIONS=X,e.NEVER=_e,e.Packr=we,e.REUSE_BUFFER_MODE=Be,e.Unpackr=m,e.addExtension=function(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");re.unshift(e.Class),te.unshift(e)}!function(e){e.unpack?g[e.type]=e.unpack:g[e.type]=e}(e)},e.clearSource=q,e.decode=Q,e.decodeIter=Te,e.encode=Ie,e.encodeIter=je,e.isNativeAccelerationEnabled=!1,e.mapsAsObjects=!0,e.pack=ke,e.roundFloat32=function(e){ne[0]=e;let t=J[(127&ie[3])<<1|ie[2]>>7];return(t*e+(e>0?.5:-.5)>>0)/t},e.unpack=H,e.unpackMultiple=K,e.useRecords=!1})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).msgpackr={})}(this,(function(t){"use strict";var e,r,n;try{e=new TextDecoder}catch(t){}var i,s,o,a,u,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w=!1,b=2;try{new Function("")}catch(t){b=1/0}class m{constructor(t){t&&(!1===t.useRecords&&void 0===t.mapsAsObjects&&(t.mapsAsObjects=!0),t.sequential&&!1!==t.trusted&&(t.trusted=!0,t.structures||0==t.useRecords||(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,e){if(r)return Y((()=>(q(),this?this.unpack(t,e):m.prototype.unpack.call(p,t,e))));t.buffer||t.constructor!==ArrayBuffer||(t="undefined"!=typeof Buffer?Buffer.from(t):new Uint8Array(t)),"object"==typeof e?(n=e.end||t.length,l=e.start||0):(l=0,n=e>-1?e:t.length),h=0,s=null,o=null,r=t;try{u=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(e){if(r=null,t instanceof Uint8Array)throw e;throw new Error("Source must be a Uint8Array or Buffer but was a "+(t&&"object"==typeof t?t.constructor.name:typeof t))}if(this instanceof m){if(c=this,this.structures)return i=this.structures,S(e);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return S(e)}unpackMultiple(t,e){let r,n=0;try{w=!0;let i=t.length,s=this?this.unpack(t,i):H.unpack(t,i);if(!e){for(r=[s];l<i;)n=l,r.push(S());return r}if(!1===e(s))return;for(;l<i;)if(n=l,!1===e(S()))return}catch(t){throw t.lastPosition=n,t.values=r,t}finally{w=!1,q()}}_mergeStructures(t,e){t=t||[],Object.isFrozen(t)&&(t=t.map((t=>t.slice(0))));for(let e=0,r=t.length;e<r;e++){let r=t[e];r&&(r.isShared=!0,e>=32&&(r.highByte=e-32>>5))}t.sharedLength=t.length;for(let r in e||[])if(r>=0){let n=t[r],i=e[r];i&&(n&&((t.restoreStructures||(t.restoreStructures=[]))[r]=n),t[r]=i)}return this.structures=t}decode(t,e){return this.unpack(t,e)}}function S(t){try{if(!c.trusted&&!w){let t=i.sharedLength||0;t<i.length&&(i.length=t)}let t;if(c.randomAccessStructure&&r[l]<64&&r[l],t=A(),o&&(l=o.postBundlePosition,o=null),l==n)i&&i.restoreStructures&&U(),i=null,r=null,a&&(a=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!w){let e;try{e=JSON.stringify(t,((t,e)=>"bigint"==typeof e?`${e}n`:e)).slice(0,100)}catch(t){e="(JSON view not available "+t+")"}throw new Error("Data read, but end of buffer not reached "+e)}}return t}catch(t){throw i&&i.restoreStructures&&U(),q(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||l>n)&&(t.incomplete=!0),t}}function U(){for(let t in i.restoreStructures)i[t]=i.restoreStructures[t];i.restoreStructures=null}function A(){let t=r[l++];if(t<160){if(t<128){if(t<64)return t;{let e=i[63&t]||c.getStructures&&O()[63&t];return e?(e.read||(e.read=k(e,63&t)),e.read()):t}}if(t<144){if(t-=128,c.mapsAsObjects){let e={};for(let r=0;r<t;r++){let t=C();"__proto__"===t&&(t="__proto_"),e[t]=A()}return e}{let e=new Map;for(let r=0;r<t;r++)e.set(A(),A());return e}}{t-=144;let e=new Array(t);for(let r=0;r<t;r++)e[r]=A();return c.freezeData?Object.freeze(e):e}}if(t<192){let e=t-160;if(h>=l)return s.slice(l-f,(l+=e)-f);if(0==h&&n<140){let t=e<16?L(e):F(e);if(null!=t)return t}return E(e)}{let e;switch(t){case 192:return null;case 193:return o?(e=A(),e>0?o[1].slice(o.position1,o.position1+=e):o[0].slice(o.position0,o.position0-=e)):y;case 194:return!1;case 195:return!0;case 196:if(e=r[l++],void 0===e)throw new Error("Unexpected end of buffer");return N(e);case 197:return e=u.getUint16(l),l+=2,N(e);case 198:return e=u.getUint32(l),l+=4,N(e);case 199:return R(r[l++]);case 200:return e=u.getUint16(l),l+=2,R(e);case 201:return e=u.getUint32(l),l+=4,R(e);case 202:if(e=u.getFloat32(l),c.useFloat32>2){let t=Z[(127&r[l])<<1|r[l+1]>>7];return l+=4,(t*e+(e>0?.5:-.5)>>0)/t}return l+=4,e;case 203:return e=u.getFloat64(l),l+=8,e;case 204:return r[l++];case 205:return e=u.getUint16(l),l+=2,e;case 206:return e=u.getUint32(l),l+=4,e;case 207:return"number"===c.int64AsType?(e=4294967296*u.getUint32(l),e+=u.getUint32(l+4)):"string"===c.int64AsType?e=u.getBigUint64(l).toString():"auto"===c.int64AsType?(e=u.getBigUint64(l),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=u.getBigUint64(l),l+=8,e;case 208:return u.getInt8(l++);case 209:return e=u.getInt16(l),l+=2,e;case 210:return e=u.getInt32(l),l+=4,e;case 211:return"number"===c.int64AsType?(e=4294967296*u.getInt32(l),e+=u.getUint32(l+4)):"string"===c.int64AsType?e=u.getBigInt64(l).toString():"auto"===c.int64AsType?(e=u.getBigInt64(l),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=u.getBigInt64(l),l+=8,e;case 212:if(e=r[l++],114==e)return z(63&r[l++]);{let t=g[e];if(t)return t.read?(l++,t.read(A())):t.noBuffer?(l++,t()):t(r.subarray(l,++l));throw new Error("Unknown extension "+e)}case 213:return e=r[l],114==e?(l++,z(63&r[l++],r[l++])):R(2);case 214:return R(4);case 215:return R(8);case 216:return R(16);case 217:return e=r[l++],h>=l?s.slice(l-f,(l+=e)-f):_(e);case 218:return e=u.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=e)-f):B(e);case 219:return e=u.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=e)-f):x(e);case 220:return e=u.getUint16(l),l+=2,T(e);case 221:return e=u.getUint32(l),l+=4,T(e);case 222:return e=u.getUint16(l),l+=2,M(e);case 223:return e=u.getUint32(l),l+=4,M(e);default:if(t>=224)return t-256;if(void 0===t){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+t)}}}const I=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function k(t,e){function r(){if(r.count++>b){let r=t.read=new Function("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+t.map((t=>"__proto__"===t?"__proto_:r()":I.test(t)?t+":r()":"["+JSON.stringify(t)+"]:r()")).join(",")+"})}")(A);return 0===t.highByte&&(t.read=v(e,t.read)),r()}let n={};for(let e=0,r=t.length;e<r;e++){let r=t[e];"__proto__"===r&&(r="__proto_"),n[r]=A()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===t.highByte?v(e,r):r}const v=(t,e)=>function(){let n=r[l++];if(0===n)return e();let s=t<32?-(t+(n<<5)):t+(n<<5),o=i[s]||O()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=k(o,t)),o.read()};function O(){let t=Y((()=>(r=null,c.getStructures())));return i=c._mergeStructures(t,i)}var E=j,_=j,B=j,x=j;function j(t){let n;if(t<16&&(n=L(t)))return n;if(t>64&&e)return e.decode(r.subarray(l,l+=t));const i=l+t,s=[];for(n="";l<i;){const t=r[l++];if(0==(128&t))s.push(t);else if(192==(224&t)){const e=63&r[l++];s.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&r[l++],n=63&r[l++];s.push((31&t)<<12|e<<6|n)}else if(240==(248&t)){let e=(7&t)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];e>65535&&(e-=65536,s.push(e>>>10&1023|55296),e=56320|1023&e),s.push(e)}else s.push(t);s.length>=4096&&(n+=D.apply(String,s),s.length=0)}return s.length>0&&(n+=D.apply(String,s)),n}function T(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=A();return c.freezeData?Object.freeze(e):e}function M(t){if(c.mapsAsObjects){let e={};for(let r=0;r<t;r++){let t=C();"__proto__"===t&&(t="__proto_"),e[t]=A()}return e}{let e=new Map;for(let r=0;r<t;r++)e.set(A(),A());return e}}var D=String.fromCharCode;function F(t){let e=l,n=new Array(t);for(let i=0;i<t;i++){const t=r[l++];if((128&t)>0)return void(l=e);n[i]=t}return D.apply(String,n)}function L(t){if(t<4){if(t<2){if(0===t)return"";{let t=r[l++];return(128&t)>1?void(l-=1):D(t)}}{let e=r[l++],n=r[l++];if((128&e)>0||(128&n)>0)return void(l-=2);if(t<3)return D(e,n);let i=r[l++];return(128&i)>0?void(l-=3):D(e,n,i)}}{let e=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&e)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(t<6){if(4===t)return D(e,n,i,s);{let t=r[l++];return(128&t)>0?void(l-=5):D(e,n,i,s,t)}}if(t<8){let o=r[l++],a=r[l++];if((128&o)>0||(128&a)>0)return void(l-=6);if(t<7)return D(e,n,i,s,o,a);let u=r[l++];return(128&u)>0?void(l-=7):D(e,n,i,s,o,a,u)}{let o=r[l++],a=r[l++],u=r[l++],c=r[l++];if((128&o)>0||(128&a)>0||(128&u)>0||(128&c)>0)return void(l-=8);if(t<10){if(8===t)return D(e,n,i,s,o,a,u,c);{let t=r[l++];return(128&t)>0?void(l-=9):D(e,n,i,s,o,a,u,c,t)}}if(t<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(t<11)return D(e,n,i,s,o,a,u,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):D(e,n,i,s,o,a,u,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(t<14){if(12===t)return D(e,n,i,s,o,a,u,c,f,h,g,p);{let t=r[l++];return(128&t)>0?void(l-=13):D(e,n,i,s,o,a,u,c,f,h,g,p,t)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(t<15)return D(e,n,i,s,o,a,u,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):D(e,n,i,s,o,a,u,c,f,h,g,p,d,y,w)}}}}}function V(){let t,e=r[l++];if(e<192)t=e-160;else switch(e){case 217:t=r[l++];break;case 218:t=u.getUint16(l),l+=2;break;case 219:t=u.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return j(t)}function N(t){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=t):r.subarray(l,l+=t)}function R(t){let e=r[l++];if(g[e]){let n;return g[e](r.subarray(l,n=l+=t),(t=>{l=t;try{return A()}finally{l=n}}))}throw new Error("Unknown extension type "+e)}var P=new Array(4096);function C(){let t=r[l++];if(!(t>=160&&t<192))return l--,A().toString();if(t-=160,h>=l)return s.slice(l-f,(l+=t)-f);if(!(0==h&&n<180))return E(t);let e,i=4095&(t<<5^(t>1?u.getUint16(l):t>0?r[l]:0)),o=P[i],a=l,c=l+t-3,g=0;if(o&&o.bytes==t){for(;a<c;){if(e=u.getUint32(a),e!=o[g++]){a=1879048192;break}a+=4}for(c+=3;a<c;)if(e=r[a++],e!=o[g++]){a=1879048192;break}if(a===c)return l=a,o.string;c-=3,a=l}for(o=[],P[i]=o,o.bytes=t;a<c;)e=u.getUint32(a),o.push(e),a+=4;for(c+=3;a<c;)e=r[a++],o.push(e);let p=t<16?L(t):F(t);return o.string=null!=p?p:E(t)}const z=(t,e)=>{let r=A().map((t=>t.toString())),n=t;void 0!==e&&(t=t<32?-((e<<5)+t):(e<<5)+t,r.highByte=e);let s=i[t];return s&&s.isShared&&((i.restoreStructures||(i.restoreStructures=[]))[t]=s),i[t]=r,r.read=k(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0;let W="object"==typeof globalThis?globalThis:window;g[101]=()=>{let t=A();return(W[t[0]]||Error)(t[1])},g[105]=t=>{let e=u.getUint32(l-4);a||(a=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};a.set(e,s);let o=A();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=t=>{let e=u.getUint32(l-4),r=a.get(e);return r.used=!0,r.target},g[115]=()=>new Set(A());const J=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((t=>t+"Array"));g[116]=t=>{let e=t[0],r=J[e];if(!r)throw new Error("Could not find typed array for code "+e);return new W[r](Uint8Array.prototype.slice.call(t,1).buffer)},g[120]=()=>{let t=A();return new RegExp(t[0],t[1])};const $=[];function Y(t){let e=n,g=l,p=f,d=h,y=s,b=a,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),I=c,k=w,v=t();return n=e,l=g,f=p,h=d,s=y,a=b,o=m,r=S,w=k,(i=U).splice(0,i.length,...A),c=I,u=new DataView(r.buffer,r.byteOffset,r.byteLength),v}function q(){r=null,a=null,i=null}g[98]=t=>{let e=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],r=l;return l+=e-t.length,o=$,(o=[V(),V()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,A()},g[255]=t=>4==t.length?new Date(1e3*(16777216*t[0]+(t[1]<<16)+(t[2]<<8)+t[3])):8==t.length?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+1e3*(4294967296*(3&t[3])+16777216*t[4]+(t[5]<<16)+(t[6]<<8)+t[7])):12==t.length?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+1e3*((128&t[4]?-281474976710656:0)+1099511627776*t[6]+4294967296*t[7]+16777216*t[8]+(t[9]<<16)+(t[10]<<8)+t[11])):new Date("invalid");const Z=new Array(147);for(let t=0;t<256;t++)Z[t]=+("1e"+Math.floor(45.15-.30103*t));const G=m;var H=new m({useRecords:!1});const K=H.unpack,Q=H.unpackMultiple,X=H.unpack,tt={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let et,rt,nt,it=new Float32Array(1),st=new Uint8Array(it.buffer,0,4);try{et=new TextEncoder}catch(t){}const ot="undefined"!=typeof Buffer,at=ot?function(t){return Buffer.allocUnsafeSlow(t)}:Uint8Array,ut=ot?Buffer:Uint8Array,lt=ot?4294967296:2144337920;let ct,ft,ht,gt,pt=0,dt=null;const yt=/[\u0080-\uFFFF]/,wt=Symbol("record-id");class bt extends m{constructor(t){let e,r,n,i;super(t),this.offset=0;let s=ut.prototype.utf8Write?function(t,e){return ct.utf8Write(t,e,4294967295)}:!(!et||!et.encodeInto)&&function(t,e){return et.encodeInto(t,ct.subarray(e)).written},o=this;t||(t={});let a=t&&t.sequential,u=t.structures||t.saveStructures,l=t.maxSharedStructures;if(null==l&&(l=u?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&null==t.moreTypes&&(this.moreTypes=!0);let c=t.maxOwnStructures;null==c&&(c=u?32:64),this.structures||0==t.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(t,s){if(ct||(ct=new at(8192),ht=ct.dataView||(ct.dataView=new DataView(ct.buffer,0,8192)),pt=0),gt=ct.length-10,gt-pt<2048?(ct=new at(ct.length),ht=ct.dataView||(ct.dataView=new DataView(ct.buffer,0,ct.length)),gt=ct.length-10,pt=0):pt=pt+7&2147483640,e=pt,i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof t?(dt=[],dt.size=1/0):dt=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let t=n.sharedLength||0;if(t>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let e=0;e<t;e++){let t=n[e];if(!t)continue;let r,i=n.transitions;for(let e=0,n=t.length;e<n;e++){let n=t[e];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[wt]=e+64}this.lastNamedStructuresLength=t}a||(n.nextId=t+64)}r&&(r=!1);try{o.randomAccessStructure&&t&&t.constructor&&t.constructor===Object?I(t):b(t);let u=dt;if(dt&&At(e,b,0),i&&i.idsToInsert){let t=i.idsToInsert.sort(((t,e)=>t.offset>e.offset?1:-1)),r=t.length,n=-1;for(;u&&r>0;){let i=t[--r].offset+e;i<u.stringsPosition+e&&-1===n&&(n=0),i>u.position+e?n>=0&&(n+=6):(n>=0&&(ht.setUint32(u.position+e,ht.getUint32(u.position+e)+n),n=-1),u=u.previous,r++)}n>=0&&u&&ht.setUint32(u.position+e,ht.getUint32(u.position+e)+n),pt+=6*t.length,pt>gt&&S(pt),o.offset=pt;let s=function(t,e){let r,n=6*e.length,i=t.length-n;for(;r=e.pop();){let e=r.offset,s=r.id;t.copyWithin(e+n,e,i),n-=6;let o=e+n;t[o++]=214,t[o++]=105,t[o++]=s>>24,t[o++]=s>>16&255,t[o++]=s>>8&255,t[o++]=255&s,i=e}return t}(ct.subarray(e,pt),t);return i=null,s}return o.offset=pt,s&jt?(ct.start=e,ct.end=pt,ct):ct.subarray(e,pt)}finally{if(n){y<10&&y++;let i=n.sharedLength||0;if(n.length>i&&(n.length=i),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!a){for(let t=0,e=p.length;t<e;t++)p[t][wt]=0;p=[]}if(r&&o.saveStructures){let r=ct.subarray(e,pt),s=function(t,e){return t.isCompatible=t=>{let r=!t||(e.lastNamedStructuresLength||0)===t.length;return r||e._mergeStructures(t),r},t}(n,o);return!1===o.saveStructures(s,s.isCompatible)?o.pack(t):(o.lastNamedStructuresLength=i,r)}}s&Tt&&(pt=e)}};const w=t=>{var e=t.length;e<16?ct[pt++]=144|e:e<65536?(ct[pt++]=220,ct[pt++]=e>>8,ct[pt++]=255&e):(ct[pt++]=221,ht.setUint32(pt,e),pt+=4);for(let r=0;r<e;r++)b(t[r])},b=t=>{pt>gt&&(ct=S(pt));var r,n=typeof t;if("string"===n){let n,i=t.length;if(dt&&i>=4&&i<4096){if((dt.size+=i)>21760){let t,r,n=(dt[0]?3*dt[0].length+dt[1].length:0)+10;pt+n>gt&&(ct=S(pt+n)),dt.position?(r=dt,ct[pt]=200,pt+=3,ct[pt++]=98,t=pt-e,pt+=4,At(e,b,0),ht.setUint16(t+e-3,pt-e-t)):(ct[pt++]=214,ct[pt++]=98,t=pt-e,pt+=4),dt=["",""],dt.previous=r,dt.size=0,dt.position=t}let r=yt.test(t);return dt[r?0:1]+=t,ct[pt++]=193,void b(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(pt+o>gt&&(ct=S(pt+o)),i<64||!s){let e,s,o,a=pt+n;for(e=0;e<i;e++)s=t.charCodeAt(e),s<128?ct[a++]=s:s<2048?(ct[a++]=s>>6|192,ct[a++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=t.charCodeAt(e+1)))?(s=65536+((1023&s)<<10)+(1023&o),e++,ct[a++]=s>>18|240,ct[a++]=s>>12&63|128,ct[a++]=s>>6&63|128,ct[a++]=63&s|128):(ct[a++]=s>>12|224,ct[a++]=s>>6&63|128,ct[a++]=63&s|128);r=a-pt-n}else r=s(t,pt+n);r<32?ct[pt++]=160|r:r<256?(n<2&&ct.copyWithin(pt+2,pt+1,pt+1+r),ct[pt++]=217,ct[pt++]=r):r<65536?(n<3&&ct.copyWithin(pt+3,pt+2,pt+2+r),ct[pt++]=218,ct[pt++]=r>>8,ct[pt++]=255&r):(n<5&&ct.copyWithin(pt+5,pt+3,pt+3+r),ct[pt++]=219,ht.setUint32(pt,r),pt+=4),pt+=r}else if("number"===n)if(t>>>0===t)t<32||t<128&&!1===this.useRecords||t<64&&!this.randomAccessStructure?ct[pt++]=t:t<256?(ct[pt++]=204,ct[pt++]=t):t<65536?(ct[pt++]=205,ct[pt++]=t>>8,ct[pt++]=255&t):(ct[pt++]=206,ht.setUint32(pt,t),pt+=4);else if(t>>0===t)t>=-32?ct[pt++]=256+t:t>=-128?(ct[pt++]=208,ct[pt++]=t+256):t>=-32768?(ct[pt++]=209,ht.setInt16(pt,t),pt+=2):(ct[pt++]=210,ht.setInt32(pt,t),pt+=4);else{let e;if((e=this.useFloat32)>0&&t<4294967296&&t>=-2147483648){let r;if(ct[pt++]=202,ht.setFloat32(pt,t),e<4||(r=t*Z[(127&ct[pt])<<1|ct[pt+1]>>7])>>0===r)return void(pt+=4);pt--}ct[pt++]=203,ht.setFloat64(pt,t),pt+=8}else if("object"===n)if(t){if(i){let r=i.get(t);if(r){if(!r.id){let t=i.idsToInsert||(i.idsToInsert=[]);r.id=t.push(r)}return ct[pt++]=214,ct[pt++]=112,ht.setUint32(pt,r.id),void(pt+=4)}i.set(t,{offset:pt-e})}let n=t.constructor;if(n===Object)m(t,!0);else if(n===Array)w(t);else if(n===Map)if(this.mapAsEmptyObject)ct[pt++]=128;else{(r=t.size)<16?ct[pt++]=128|r:r<65536?(ct[pt++]=222,ct[pt++]=r>>8,ct[pt++]=255&r):(ct[pt++]=223,ht.setUint32(pt,r),pt+=4);for(let[e,r]of t)b(e),b(r)}else{for(let e=0,r=rt.length;e<r;e++){if(t instanceof nt[e]){let r=rt[e];if(r.write){r.type&&(ct[pt++]=212,ct[pt++]=r.type,ct[pt++]=0);let e=r.write.call(this,t);return void(e===t?Array.isArray(t)?w(t):m(t):b(e))}let n,i=ct,s=ht,o=pt;ct=null;try{n=r.pack.call(this,t,(t=>(ct=i,i=null,pt+=t,pt>gt&&S(pt),{target:ct,targetView:ht,position:pt-t})),b)}finally{i&&(ct=i,ht=s,pt=o,gt=ct.length-10)}return void(n&&(n.length+pt>gt&&S(n.length+pt),pt=Ut(n,ct,pt,r.type)))}}if(Array.isArray(t))w(t);else{if(t.toJSON)return b(t.toJSON());m(t,!t.hasOwnProperty)}}}else ct[pt++]=192;else if("boolean"===n)ct[pt++]=t?195:194;else if("bigint"===n){if(t<BigInt(1)<<BigInt(63)&&t>=-(BigInt(1)<<BigInt(63)))ct[pt++]=211,ht.setBigInt64(pt,t);else if(t<BigInt(1)<<BigInt(64)&&t>0)ct[pt++]=207,ht.setBigUint64(pt,t);else{if(!this.largeBigIntToFloat)throw new RangeError(t+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");ct[pt++]=203,ht.setFloat64(pt,Number(t))}pt+=8}else if("undefined"===n)this.encodeUndefinedAsNil?ct[pt++]=192:(ct[pt++]=212,ct[pt++]=0,ct[pt++]=0);else{if("function"!==n)throw new Error("Unknown type: "+n);b(this.writeFunction&&this.writeFunction())}},m=!1===this.useRecords?this.variableMapSize?t=>{let e,r=Object.keys(t),n=r.length;n<16?ct[pt++]=128|n:n<65536?(ct[pt++]=222,ct[pt++]=n>>8,ct[pt++]=255&n):(ct[pt++]=223,ht.setUint32(pt,n),pt+=4);for(let i=0;i<n;i++)b(e=r[i]),b(t[e])}:(t,r)=>{ct[pt++]=222;let n=pt-e;pt+=2;let i=0;for(let e in t)(r||t.hasOwnProperty(e))&&(b(e),b(t[e]),i++);ct[n+++e]=i>>8,ct[n+e]=255&i}:t.progressiveRecords&&!f?(t,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),a=pt++-e;for(let u in t)if(r||t.hasOwnProperty(u)){if(i=o[u],i)o=i;else{let r=Object.keys(t),l=o;o=n.transitions;let c=0;for(let t=0,e=r.length;t<e;t++){let e=r[t];i=o[e],i||(i=o[e]=Object.create(null),c++),o=i}a+e+1==pt?(pt--,U(o,r,c)):A(o,r,a,c),s=!0,o=l[u]}b(t[u])}if(!s){let r=o[wt];r?ct[a+e]=r:A(o,Object.keys(t),a,0)}}:(t,e)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in t)(e||t.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[wt];o?o>=96&&f?(ct[pt++]=96+(31&(o-=96)),ct[pt++]=o>>5):ct[pt++]=o:U(i,i.__keys__||Object.keys(t),s);for(let r in t)(e||t.hasOwnProperty(r))&&b(t[r])},S=t=>{let r;if(t>16777216){if(t-e>lt)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(lt,4096*Math.round(Math.max((t-e)*(t>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(t-e<<2,ct.length-1)>>12)<<12;let n=new at(r);return ht=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),t=Math.min(t,ct.length),ct.copy?ct.copy(n,0,e,t):n.set(ct.slice(e,t)),pt-=e,e=0,gt=n.length-10,ct=n},U=(t,e,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(e)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=e.highByte=s>=96&&f?s-96>>5:-1;t[wt]=s,t.__keys__=e,n[s-64]=e,s<h?(e.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(ct[pt++]=96+(31&s),ct[pt++]=o):ct[pt++]=s):(o>=0?(ct[pt++]=213,ct[pt++]=114,ct[pt++]=96+(31&s),ct[pt++]=o):(ct[pt++]=212,ct[pt++]=114,ct[pt++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[wt]=0),p.push(t),b(e))},A=(t,r,n,i)=>{let s=ct,o=pt,a=gt,u=e;ct=ft,pt=0,e=0,ct||(ft=ct=new at(8192)),gt=ct.length-10,U(t,r,i),ft=ct;let l=pt;if(ct=s,pt=o,gt=a,e=u,l>1){let t=pt+l-1;t>gt&&S(t);let r=n+e;ct.copyWithin(r+l,r+1,pt),ct.set(ft.slice(0,l),r),pt=t}else ct[n+e]=ft[0]},I=(t,e)=>{let i=undefined(t,ct,pt,n,S,((t,e,n)=>{if(n)return r=!0;pt=e;let i=ct;return b(t),i!==ct?{position:pt,targetView:ht,target:ct}:pt}),this);if(0===i)return m(t,!0);pt=i}}useBuffer(t){ct=t,ht=new DataView(ct.buffer,ct.byteOffset,ct.byteLength),pt=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function mt(t,e,r,n){let i=t.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:a}=r(7+i);s[o++]=201,a.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=e,s.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o)}function St(t,e){let r=t.byteLength;var n,i;if(r<256){var{target:n,position:i}=e(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=e(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=e(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(t,i)}function Ut(t,e,r,n){let i=t.length;switch(i){case 1:e[r++]=212;break;case 2:e[r++]=213;break;case 4:e[r++]=214;break;case 8:e[r++]=215;break;case 16:e[r++]=216;break;default:i<256?(e[r++]=199,e[r++]=i):i<65536?(e[r++]=200,e[r++]=i>>8,e[r++]=255&i):(e[r++]=201,e[r++]=i>>24,e[r++]=i>>16&255,e[r++]=i>>8&255,e[r++]=255&i)}return e[r++]=n,e.set(t,r),r+=i}function At(t,e,r){if(dt.length>0){ht.setUint32(dt.position+t,pt+r-dt.position-t),dt.stringsPosition=pt-t;let n=dt;dt=null,e(n[0]),e(n[1])}}nt=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],rt=[{pack(t,e,r){let n=t.getTime()/1e3;if((this.useTimestamp32||0===t.getMilliseconds())&&n>=0&&n<4294967296){let{target:t,targetView:r,position:i}=e(6);t[i++]=214,t[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=e(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*t.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),r(this.onInvalidDate());let{target:t,targetView:n,position:i}=e(3);t[i++]=212,t[i++]=255,t[i++]=255}else{let{target:r,targetView:i,position:s}=e(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*t.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(t,e,r){if(this.setAsEmptyObject)return r({});let n=Array.from(t),{target:i,position:s}=e(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([t.name,t.message])}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([t.source,t.flags])}},{pack(t,e){this.moreTypes?mt(t,16,e):St(ot?Buffer.from(t):new Uint8Array(t),e)}},{pack(t,e){let r=t.constructor;r!==ut&&this.moreTypes?mt(t,J.indexOf(r.name),e):St(t,e)}},{pack(t,e){let{target:r,position:n}=e(1);r[n]=193}}];let It=new bt({useRecords:!1});const kt=It.pack,vt=It.pack,Ot=bt,{NEVER:Et,ALWAYS:_t,DECIMAL_ROUND:Bt,DECIMAL_FIT:xt}=tt,jt=512,Tt=1024;const Mt=function(t,e={}){if(!t||"object"!=typeof t)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new m(e);let n;const i=t=>{let e;n&&(t=Buffer.concat([n,t]),n=void 0);try{e=r.unpackMultiple(t)}catch(r){if(!r.incomplete)throw r;n=t.slice(r.lastPosition),e=r.values}return e};return"function"==typeof t[Symbol.iterator]?function*(){for(const e of t)yield*i(e)}():"function"==typeof t[Symbol.asyncIterator]?async function*(){for await(const e of t)yield*i(e)}():void 0},Dt=function(t,e={}){if(t&&"object"==typeof t){if("function"==typeof t[Symbol.iterator])return function*(t,e){const r=new bt(e);for(const e of t)yield r.pack(e)}(t,e);if("function"==typeof t.then||"function"==typeof t[Symbol.asyncIterator])return async function*(t,e){const r=new bt(e);for await(const e of t)yield r.pack(e)}(t,e);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};t.ALWAYS=_t,t.C1=y,t.DECIMAL_FIT=xt,t.DECIMAL_ROUND=Bt,t.Decoder=G,t.Encoder=Ot,t.FLOAT32_OPTIONS=tt,t.NEVER=Et,t.Packr=bt,t.REUSE_BUFFER_MODE=jt,t.Unpackr=m,t.addExtension=function(t){if(t.Class){if(!t.pack&&!t.write)throw new Error("Extension has no pack or write function");if(t.pack&&!t.type)throw new Error("Extension has no type (numeric code to identify the extension)");nt.unshift(t.Class),rt.unshift(t)}!function(t){t.unpack?g[t.type]=t.unpack:g[t.type]=t}(t)},t.clearSource=q,t.decode=X,t.decodeIter=Mt,t.encode=vt,t.encodeIter=Dt,t.isNativeAccelerationEnabled=!1,t.mapsAsObjects=!0,t.pack=kt,t.roundFloat32=function(t){it[0]=t;let e=Z[(127&st[3])<<1|st[2]>>7];return(e*t+(t>0?.5:-.5)>>0)/e},t.unpack=K,t.unpackMultiple=Q,t.useRecords=!1})); | ||
//# sourceMappingURL=index.min.js.map |
@@ -24,2 +24,4 @@ export enum FLOAT32_OPTIONS { | ||
maxOwnStructures?: number | ||
mapAsEmptyObject?: boolean | ||
setAsEmptyObject?: boolean | ||
/** @deprecated use int64AsType: 'number' */ | ||
@@ -26,0 +28,0 @@ int64AsNumber?: boolean |
38
pack.js
@@ -124,3 +124,3 @@ import { Unpackr, mult10, C1Type, typedArrays, addExtension as unpackAddExtension } from './unpack.js' | ||
try { | ||
if (packr.randomAccessStructure && value.constructor && value.constructor === Object) | ||
if (packr.randomAccessStructure && value && value.constructor && value.constructor === Object) | ||
writeStruct(value); | ||
@@ -412,18 +412,21 @@ else | ||
} else if (constructor === Map) { | ||
length = value.size | ||
if (length < 0x10) { | ||
target[position++] = 0x80 | length | ||
} else if (length < 0x10000) { | ||
target[position++] = 0xde | ||
target[position++] = length >> 8 | ||
target[position++] = length & 0xff | ||
} else { | ||
target[position++] = 0xdf | ||
targetView.setUint32(position, length) | ||
position += 4 | ||
if (this.mapAsEmptyObject) target[position++] = 0x80 | ||
else { | ||
length = value.size | ||
if (length < 0x10) { | ||
target[position++] = 0x80 | length | ||
} else if (length < 0x10000) { | ||
target[position++] = 0xde | ||
target[position++] = length >> 8 | ||
target[position++] = length & 0xff | ||
} else { | ||
target[position++] = 0xdf | ||
targetView.setUint32(position, length) | ||
position += 4 | ||
} | ||
for (let [key, entryValue] of value) { | ||
pack(key) | ||
pack(entryValue) | ||
} | ||
} | ||
for (let [ key, entryValue ] of value) { | ||
pack(key) | ||
pack(entryValue) | ||
} | ||
} else { | ||
@@ -490,2 +493,4 @@ for (let i = 0, l = extensions.length; i < l; i++) { | ||
} else { | ||
if (value.toJSON) // use this as an alternate mechanism for expressing how to serialize | ||
return pack(value.toJSON()); | ||
// no extension found, write as object | ||
@@ -817,2 +822,3 @@ writeObject(value, !value.hasOwnProperty) // if it doesn't have hasOwnProperty, don't do hasOwnProperty checks | ||
pack(set, allocateForWrite, pack) { | ||
if (this.setAsEmptyObject) return pack({}) | ||
let array = Array.from(set) | ||
@@ -819,0 +825,0 @@ let { target, position} = allocateForWrite(this.moreTypes ? 3 : 0) |
{ | ||
"name": "msgpackr", | ||
"author": "Kris Zyp", | ||
"version": "1.8.5", | ||
"version": "1.9.0", | ||
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning", | ||
@@ -78,3 +78,3 @@ "license": "MIT", | ||
"optionalDependencies": { | ||
"msgpackr-extract": "^3.0.1" | ||
"msgpackr-extract": "^3.0.2" | ||
}, | ||
@@ -81,0 +81,0 @@ "devDependencies": { |
@@ -176,4 +176,6 @@ # msgpackr | ||
* `encodeUndefinedAsNil` - Encodes a value of `undefined` as a MessagePack `nil`, the same as a `null`. | ||
* `int64AsType` - This will decode uint64 and int64 numbers as the specified type. The type can be `bigint` (default), `number`, or `string`. | ||
* `int64AsType` - This will decode uint64 and int64 numbers as the specified type. The type can be `bigint` (default), `number`, `string`, or `auto` (where range [-2^53...2^53] is represented by number and everything else by a bigint). | ||
* `onInvalidDate` - This can be provided as function that will be called when an invalid date is provided. The function can throw an error, or return a value that will be encoded in place of the invalid date. If not provided, an invalid date will be encoded as an invalid timestamp (which decodes with msgpackr back to an invalid date). | ||
* `mapAsEmptyObject` - Encodes JS `Map`s as empty objects (for back-compat with older libraries). | ||
* `setAsEmptyObject` - Encodes JS `Set`s as empty objects (for back-compat with older libraries). | ||
@@ -180,0 +182,0 @@ ### 32-bit Float Options |
@@ -73,2 +73,4 @@ var decoder | ||
} | ||
if (!source.buffer && source.constructor === ArrayBuffer) | ||
source = typeof Buffer !== 'undefined' ? Buffer.from(source) : new Uint8Array(source); | ||
if (typeof options === 'object') { | ||
@@ -214,3 +216,9 @@ srcEnd = options.end || source.length | ||
} else if (!sequentialMode) { | ||
throw new Error('Data read, but end of buffer not reached ' + JSON.stringify(result).slice(0, 100)) | ||
let jsonView; | ||
try { | ||
jsonView = JSON.stringify(result, (_, value) => typeof value === "bigint" ? `${value}n` : value).slice(0, 100) | ||
} catch(error) { | ||
jsonView = '(JSON view not available ' + error + ')' | ||
} | ||
throw new Error('Data read, but end of buffer not reached ' + jsonView) | ||
} | ||
@@ -371,2 +379,5 @@ // else more to read, but we are reading sequentially, so don't clear source yet | ||
value = dataView.getBigUint64(position).toString() | ||
} else if (currentUnpackr.int64AsType === 'auto') { | ||
value = dataView.getBigUint64(position) | ||
if (value<=BigInt(2)<<BigInt(52)) value=Number(value) | ||
} else | ||
@@ -394,2 +405,5 @@ value = dataView.getBigUint64(position) | ||
value = dataView.getBigInt64(position).toString() | ||
} else if (currentUnpackr.int64AsType === 'auto') { | ||
value = dataView.getBigInt64(position) | ||
if (value>=BigInt(-2)<<BigInt(52)&&value<=BigInt(2)<<BigInt(52)) value=Number(value) | ||
} else | ||
@@ -974,5 +988,6 @@ value = dataView.getBigInt64(position) | ||
let global = typeof globalThis === 'object' ? globalThis : window; | ||
currentExtensions[0x65] = () => { | ||
let data = read() | ||
return (globalThis[data[0]] || Error)(data[1]) | ||
return (global[data[0]] || Error)(data[1]) | ||
} | ||
@@ -1021,3 +1036,3 @@ | ||
// we have to always slice/copy here to get a new ArrayBuffer that is word/byte aligned | ||
return new globalThis[typedArrayName](Uint8Array.prototype.slice.call(data, 1).buffer) | ||
return new global[typedArrayName](Uint8Array.prototype.slice.call(data, 1).buffer) | ||
} | ||
@@ -1024,0 +1039,0 @@ currentExtensions[0x78] = () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1804726
15734
356