genosdb 0.26.2 → 0.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gdb.min.js +1 -1
- package/dist/gdb.min.js.gz +0 -0
- package/dist/genossrv.min.js +1 -1
- package/dist/genossrv.min.js.gz +0 -0
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/dist/sm.min.js +1 -1
- package/dist/sm.min.js.gz +0 -0
- package/package.json +1 -1
package/dist/genossrv.min.js
CHANGED
|
@@ -144,7 +144,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
144
144
|
this.index += bytes;
|
|
145
145
|
return value;
|
|
146
146
|
}
|
|
147
|
-
`),Zq.prototype[W]=Y.toFunction({assertSize:Rj})});ZE.exports=Zq;function Rj(W,Y){if(W>Y)throw new fp(W,Y)}});var j8=U1((aN0,IE)=>{var Pj=wV(),cp=hB(),pp=cB(),lp=lB(),dp=oB(),op=rB(),UE=sB(),np=eB(),ip=GE(),{encode:qE}=KV(),{decode:AE}=IX(),{encodingLength:rp}=OV(),ap=VE(),HE=HX(),zE={array:cp,bool:lp,buffer:pp,reserved:dp,string:op,when:np,select:ip};for(let W of Object.keys(UE))zE[W]=UE[W];var Vq=Symbol("schema");function QE(W){let Y=new Pj({readableObjectMode:!1,writableObjectMode:!0,transform:sp});return Y[Vq]=W,Y}function NE(W){let Y=null,G=Buffer.isBuffer(W);if(!G)Y=W;let X=new Pj({transform:tp,readableObjectMode:!0,writableObjectMode:!1});if(X[Vq]=Y,G)X.append(W);return X}function sp(W,Y,G){try{qE(W,this[Vq],this);let X=this.slice();this.consume(X.length),G(null,X)}catch(X){G(X)}}function tp(W,Y,G){this.append(W);try{while(this.length>0){let X=new ap(this),J=AE(X,this[Vq]);X.commit(),this.push(J)}G()}catch(X){if(X instanceof HE)G();else G(X)}}IE.exports={createEncodeStream:QE,createDecodeStream:NE,encode:qE,decode:AE,encodingLength:rp,createEncode:QE,createDecode:NE,types:zE,BinaryStream:Pj,NotEnoughDataError:HE}});var z$=U1((A$)=>{Object.defineProperty(A$,"__esModule",{value:!0});A$.LEB128=A$.SignedLEB128=A$.UnsignedLEB128=void 0;var TX;(function(W){W[W.LOWER_7=127]="LOWER_7",W[W.UPPER_1=128]="UPPER_1"})(TX||(TX={}));var q$=(W)=>Number.isSafeInteger(W);class MX{static decode(W,Y=0){let G=this.$scanForNullBytes(W,Y),X=0,J=0;for(let Z=0;Z<=G-Y;Z++){let V=W[Y+Z]&TX.LOWER_7;X|=V<<J,J+=7}return X}static encode(W){if(this.check(W),W<0)throw Error(`An unsigned number must NOT be negative, ${W} is!`);let Y=[],G=W;do{let X=G&TX.LOWER_7;if(G>>=7,G)X=X|TX.UPPER_1;Y.push(X)}while(G);return Uint8Array.from(Y)}static check(W){if(!q$(W))throw Error(`${W} is not a safe integer!`)}static $scanForNullBytes(W,Y=0){let G=Y,X=0;do{if(G>=W.byteLength)throw Error("This is not a LEB128-encoded Uint8Array, no ending found!");X=W.slice(G,G+1)[0],G++}while(X&TX.UPPER_1);return G-1}static getLength(W,Y=0){return this.$scanForNullBytes(W,Y)-Y}}A$.UnsignedLEB128=MX;class Cq{static $ceil7mul(W){let Y=W;while(Y%7)Y++;return Y}static check(W){if(!q$(W))throw Error(`${W} is not a safe integer!`)}static encode(W){if(this.check(W),W>=0)throw Error(`A signed number must be negative, ${W} isn't!`);let Y=Math.ceil(Math.log2(-W));return MX.encode((1<<this.$ceil7mul(Y))+W)}static decode(W,Y=0){let G=MX.decode(W,Y);return-((1<<Math.ceil(Math.log2(G)))-G)}}A$.SignedLEB128=Cq;class Tq{}A$.LEB128=Tq;Tq.encode=(W)=>(W>=0?MX:Cq).encode(W);Tq.decode=(W,Y=0,G=!1)=>(G?Cq:MX).decode(W,Y)});var w$=U1((dj,I$)=>{/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */(function(W){function Y(E){return parseInt(E)===E}function G(E){if(!Y(E.length))return!1;for(var $=0;$<E.length;$++)if(!Y(E[$])||E[$]<0||E[$]>255)return!1;return!0}function X(E,$){if(E.buffer&&E.name==="Uint8Array"){if($)if(E.slice)E=E.slice();else E=Array.prototype.slice.call(E);return E}if(Array.isArray(E)){if(!G(E))throw Error("Array contains invalid value: "+E);return new Uint8Array(E)}if(Y(E.length)&&G(E))return new Uint8Array(E);throw Error("unsupported array-like object")}function J(E){return new Uint8Array(E)}function Z(E,$,_,x,R){if(x!=null||R!=null)if(E.slice)E=E.slice(x,R);else E=Array.prototype.slice.call(E,x,R);$.set(E,_)}var V=function(){function E(_){var x=[],R=0;_=encodeURI(_);while(R<_.length){var v=_.charCodeAt(R++);if(v===37)x.push(parseInt(_.substr(R,2),16)),R+=2;else x.push(v)}return X(x)}function $(_){var x=[],R=0;while(R<_.length){var v=_[R];if(v<128)x.push(String.fromCharCode(v)),R++;else if(v>191&&v<224)x.push(String.fromCharCode((v&31)<<6|_[R+1]&63)),R+=2;else x.push(String.fromCharCode((v&15)<<12|(_[R+1]&63)<<6|_[R+2]&63)),R+=3}return x.join("")}return{toBytes:E,fromBytes:$}}(),U=function(){function E(x){var R=[];for(var v=0;v<x.length;v+=2)R.push(parseInt(x.substr(v,2),16));return R}var $="0123456789abcdef";function _(x){var R=[];for(var v=0;v<x.length;v++){var X0=x[v];R.push($[(X0&240)>>4]+$[X0&15])}return R.join("")}return{toBytes:E,fromBytes:_}}(),Q={16:10,24:12,32:14},N=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],q=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],H=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],A=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],I=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],w=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],O=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],M=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],S=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],g=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239000,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],c=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998000,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],u=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],p=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],h=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239000,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],f=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998000,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function t(E){var $=[];for(var _=0;_<E.length;_+=4)$.push(E[_]<<24|E[_+1]<<16|E[_+2]<<8|E[_+3]);return $}var b=function(E){if(!(this instanceof b))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:X(E,!0)}),this._prepare()};b.prototype._prepare=function(){var E=Q[this.key.length];if(E==null)throw Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var $=0;$<=E;$++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var _=(E+1)*4,x=this.key.length/4,R=t(this.key),v;for(var $=0;$<x;$++)v=$>>2,this._Ke[v][$%4]=R[$],this._Kd[E-v][$%4]=R[$];var X0=0,V0=x,Q0;while(V0<_){if(Q0=R[x-1],R[0]^=q[Q0>>16&255]<<24^q[Q0>>8&255]<<16^q[Q0&255]<<8^q[Q0>>24&255]^N[X0]<<24,X0+=1,x!=8)for(var $=1;$<x;$++)R[$]^=R[$-1];else{for(var $=1;$<x/2;$++)R[$]^=R[$-1];Q0=R[x/2-1],R[x/2]^=q[Q0&255]^q[Q0>>8&255]<<8^q[Q0>>16&255]<<16^q[Q0>>24&255]<<24;for(var $=x/2+1;$<x;$++)R[$]^=R[$-1]}var $=0,F0,y0;while($<x&&V0<_)F0=V0>>2,y0=V0%4,this._Ke[F0][y0]=R[$],this._Kd[E-F0][y0]=R[$++],V0++}for(var F0=1;F0<E;F0++)for(var y0=0;y0<4;y0++)Q0=this._Kd[F0][y0],this._Kd[F0][y0]=u[Q0>>24&255]^p[Q0>>16&255]^h[Q0>>8&255]^f[Q0&255]},b.prototype.encrypt=function(E){if(E.length!=16)throw Error("invalid plaintext size (must be 16 bytes)");var $=this._Ke.length-1,_=[0,0,0,0],x=t(E);for(var R=0;R<4;R++)x[R]^=this._Ke[0][R];for(var v=1;v<$;v++){for(var R=0;R<4;R++)_[R]=A[x[R]>>24&255]^I[x[(R+1)%4]>>16&255]^w[x[(R+2)%4]>>8&255]^O[x[(R+3)%4]&255]^this._Ke[v][R];x=_.slice()}var X0=J(16),V0;for(var R=0;R<4;R++)V0=this._Ke[$][R],X0[4*R]=(q[x[R]>>24&255]^V0>>24)&255,X0[4*R+1]=(q[x[(R+1)%4]>>16&255]^V0>>16)&255,X0[4*R+2]=(q[x[(R+2)%4]>>8&255]^V0>>8)&255,X0[4*R+3]=(q[x[(R+3)%4]&255]^V0)&255;return X0},b.prototype.decrypt=function(E){if(E.length!=16)throw Error("invalid ciphertext size (must be 16 bytes)");var $=this._Kd.length-1,_=[0,0,0,0],x=t(E);for(var R=0;R<4;R++)x[R]^=this._Kd[0][R];for(var v=1;v<$;v++){for(var R=0;R<4;R++)_[R]=M[x[R]>>24&255]^S[x[(R+3)%4]>>16&255]^g[x[(R+2)%4]>>8&255]^c[x[(R+1)%4]&255]^this._Kd[v][R];x=_.slice()}var X0=J(16),V0;for(var R=0;R<4;R++)V0=this._Kd[$][R],X0[4*R]=(H[x[R]>>24&255]^V0>>24)&255,X0[4*R+1]=(H[x[(R+3)%4]>>16&255]^V0>>16)&255,X0[4*R+2]=(H[x[(R+2)%4]>>8&255]^V0>>8)&255,X0[4*R+3]=(H[x[(R+1)%4]&255]^V0)&255;return X0};var J0=function(E){if(!(this instanceof J0))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new b(E)};J0.prototype.encrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16)Z(E,_,0,x,x+16),_=this._aes.encrypt(_),Z(_,$,x);return $},J0.prototype.decrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid ciphertext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16)Z(E,_,0,x,x+16),_=this._aes.decrypt(_),Z(_,$,x);return $};var I0=function(E,$){if(!(this instanceof I0))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!$)$=J(16);else if($.length!=16)throw Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=X($,!0),this._aes=new b(E)};I0.prototype.encrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16){Z(E,_,0,x,x+16);for(var R=0;R<16;R++)_[R]^=this._lastCipherblock[R];this._lastCipherblock=this._aes.encrypt(_),Z(this._lastCipherblock,$,x)}return $},I0.prototype.decrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid ciphertext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16){Z(E,_,0,x,x+16),_=this._aes.decrypt(_);for(var R=0;R<16;R++)$[x+R]=_[R]^this._lastCipherblock[R];Z(E,this._lastCipherblock,0,x,x+16)}return $};var k=function(E,$,_){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!$)$=J(16);else if($.length!=16)throw Error("invalid initialation vector size (must be 16 size)");if(!_)_=1;this.segmentSize=_,this._shiftRegister=X($,!0),this._aes=new b(E)};k.prototype.encrypt=function(E){if(E.length%this.segmentSize!=0)throw Error("invalid plaintext size (must be segmentSize bytes)");var $=X(E,!0),_;for(var x=0;x<$.length;x+=this.segmentSize){_=this._aes.encrypt(this._shiftRegister);for(var R=0;R<this.segmentSize;R++)$[x+R]^=_[R];Z(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Z($,this._shiftRegister,16-this.segmentSize,x,x+this.segmentSize)}return $},k.prototype.decrypt=function(E){if(E.length%this.segmentSize!=0)throw Error("invalid ciphertext size (must be segmentSize bytes)");var $=X(E,!0),_;for(var x=0;x<$.length;x+=this.segmentSize){_=this._aes.encrypt(this._shiftRegister);for(var R=0;R<this.segmentSize;R++)$[x+R]^=_[R];Z(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Z(E,this._shiftRegister,16-this.segmentSize,x,x+this.segmentSize)}return $};var l=function(E,$){if(!(this instanceof l))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!$)$=J(16);else if($.length!=16)throw Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=X($,!0),this._lastPrecipherIndex=16,this._aes=new b(E)};l.prototype.encrypt=function(E){var $=X(E,!0);for(var _=0;_<$.length;_++){if(this._lastPrecipherIndex===16)this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0;$[_]^=this._lastPrecipher[this._lastPrecipherIndex++]}return $},l.prototype.decrypt=l.prototype.encrypt;var P=function(E){if(!(this instanceof P))throw Error("Counter must be instanitated with `new`");if(E!==0&&!E)E=1;if(typeof E==="number")this._counter=J(16),this.setValue(E);else this.setBytes(E)};P.prototype.setValue=function(E){if(typeof E!=="number"||parseInt(E)!=E)throw Error("invalid counter value (must be an integer)");if(E>Number.MAX_SAFE_INTEGER)throw Error("integer value out of safe range");for(var $=15;$>=0;--$)this._counter[$]=E%256,E=parseInt(E/256)},P.prototype.setBytes=function(E){if(E=X(E,!0),E.length!=16)throw Error("invalid counter bytes size (must be 16 bytes)");this._counter=E},P.prototype.increment=function(){for(var E=15;E>=0;E--)if(this._counter[E]===255)this._counter[E]=0;else{this._counter[E]++;break}};var B=function(E,$){if(!(this instanceof B))throw Error("AES must be instanitated with `new`");if(this.description="Counter",this.name="ctr",!($ instanceof P))$=new P($);this._counter=$,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new b(E)};B.prototype.encrypt=function(E){var $=X(E,!0);for(var _=0;_<$.length;_++){if(this._remainingCounterIndex===16)this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment();$[_]^=this._remainingCounter[this._remainingCounterIndex++]}return $},B.prototype.decrypt=B.prototype.encrypt;function m(E){E=X(E,!0);var $=16-E.length%16,_=J(E.length+$);Z(E,_);for(var x=E.length;x<_.length;x++)_[x]=$;return _}function a(E){if(E=X(E,!0),E.length<16)throw Error("PKCS#7 invalid length");var $=E[E.length-1];if($>16)throw Error("PKCS#7 padding byte out of range");var _=E.length-$;for(var x=0;x<$;x++)if(E[_+x]!==$)throw Error("PKCS#7 invalid padding byte");var R=J(_);return Z(E,R,0,0,_),R}var n={AES:b,Counter:P,ModeOfOperation:{ecb:J0,cbc:I0,cfb:k,ofb:l,ctr:B},utils:{hex:U,utf8:V},padding:{pkcs7:{pad:m,strip:a}},_arrayTest:{coerceArray:X,createArray:J,copyArray:Z}};if(typeof dj<"u")I$.exports=n;else if(typeof define==="function"&&define.amd)define([],function(){return n});else{if(W.aesjs)n._aesjs=W.aesjs;W.aesjs=n}})(dj)});var rj=U1((T$)=>{var X1=T$,{Buffer:Lq}=x8("buffer"),ul=x8("os");X1.toBuffer=function(W,Y,G){G=~~G;let X;if(this.isV4Format(W))X=Y||Lq.alloc(G+4),W.split(/\./g).map((J)=>{X[G++]=parseInt(J,10)&255});else if(this.isV6Format(W)){let J=W.split(":",8),Z;for(Z=0;Z<J.length;Z++){let V=this.isV4Format(J[Z]),U;if(V)U=this.toBuffer(J[Z]),J[Z]=U.slice(0,2).toString("hex");if(U&&++Z<8)J.splice(Z,0,U.slice(2,4).toString("hex"))}if(J[0]==="")while(J.length<8)J.unshift("0");else if(J[J.length-1]==="")while(J.length<8)J.push("0");else if(J.length<8){for(Z=0;Z<J.length&&J[Z]!=="";Z++);let V=[Z,1];for(Z=9-J.length;Z>0;Z--)V.push("0");J.splice(...V)}X=Y||Lq.alloc(G+16);for(Z=0;Z<J.length;Z++){let V=parseInt(J[Z],16);X[G++]=V>>8&255,X[G++]=V&255}}if(!X)throw Error(`Invalid ip address: ${W}`);return X};X1.toString=function(W,Y,G){Y=~~Y,G=G||W.length-Y;let X=[];if(G===4){for(let J=0;J<G;J++)X.push(W[Y+J]);X=X.join(".")}else if(G===16){for(let J=0;J<G;J+=2)X.push(W.readUInt16BE(Y+J).toString(16));X=X.join(":"),X=X.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),X=X.replace(/:{3,4}/,"::")}return X};var hl=/^(\d{1,3}\.){3,3}\d{1,3}$/,bl=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;X1.isV4Format=function(W){return hl.test(W)};X1.isV6Format=function(W){return bl.test(W)};function FV(W){if(W===4)return"ipv4";if(W===6)return"ipv6";return W?W.toLowerCase():"ipv4"}X1.fromPrefixLen=function(W,Y){if(W>32)Y="ipv6";else Y=FV(Y);let G=4;if(Y==="ipv6")G=16;let X=Lq.alloc(G);for(let J=0,Z=X.length;J<Z;++J){let V=8;if(W<8)V=W;W-=V,X[J]=~(255>>V)&255}return X1.toString(X)};X1.mask=function(W,Y){W=X1.toBuffer(W),Y=X1.toBuffer(Y);let G=Lq.alloc(Math.max(W.length,Y.length)),X;if(W.length===Y.length)for(X=0;X<W.length;X++)G[X]=W[X]&Y[X];else if(Y.length===4)for(X=0;X<Y.length;X++)G[X]=W[W.length-4+X]&Y[X];else{for(X=0;X<G.length-6;X++)G[X]=0;G[10]=255,G[11]=255;for(X=0;X<W.length;X++)G[X+12]=W[X]&Y[X+12];X+=12}for(;X<G.length;X++)G[X]=0;return X1.toString(G)};X1.cidr=function(W){let Y=W.split("/"),G=Y[0];if(Y.length!==2)throw Error(`invalid CIDR subnet: ${G}`);let X=X1.fromPrefixLen(parseInt(Y[1],10));return X1.mask(G,X)};X1.subnet=function(W,Y){let G=X1.toLong(X1.mask(W,Y)),X=X1.toBuffer(Y),J=0;for(let V=0;V<X.length;V++)if(X[V]===255)J+=8;else{let U=X[V]&255;while(U)U=U<<1&255,J++}let Z=2**(32-J);return{networkAddress:X1.fromLong(G),firstAddress:Z<=2?X1.fromLong(G):X1.fromLong(G+1),lastAddress:Z<=2?X1.fromLong(G+Z-1):X1.fromLong(G+Z-2),broadcastAddress:X1.fromLong(G+Z-1),subnetMask:Y,subnetMaskLength:J,numHosts:Z<=2?Z:Z-2,length:Z,contains(V){return G===X1.toLong(X1.mask(V,Y))}}};X1.cidrSubnet=function(W){let Y=W.split("/"),G=Y[0];if(Y.length!==2)throw Error(`invalid CIDR subnet: ${G}`);let X=X1.fromPrefixLen(parseInt(Y[1],10));return X1.subnet(G,X)};X1.not=function(W){let Y=X1.toBuffer(W);for(let G=0;G<Y.length;G++)Y[G]=255^Y[G];return X1.toString(Y)};X1.or=function(W,Y){if(W=X1.toBuffer(W),Y=X1.toBuffer(Y),W.length===Y.length){for(let Z=0;Z<W.length;++Z)W[Z]|=Y[Z];return X1.toString(W)}let G=W,X=Y;if(Y.length>W.length)G=Y,X=W;let J=G.length-X.length;for(let Z=J;Z<G.length;++Z)G[Z]|=X[Z-J];return X1.toString(G)};X1.isEqual=function(W,Y){if(W=X1.toBuffer(W),Y=X1.toBuffer(Y),W.length===Y.length){for(let X=0;X<W.length;X++)if(W[X]!==Y[X])return!1;return!0}if(Y.length===4){let X=Y;Y=W,W=X}for(let X=0;X<10;X++)if(Y[X]!==0)return!1;let G=Y.readUInt16BE(10);if(G!==0&&G!==65535)return!1;for(let X=0;X<4;X++)if(W[X]!==Y[X+12])return!1;return!0};X1.isPrivate=function(W){if(X1.isLoopback(W))return!0;if(!X1.isV6Format(W)){let Y=X1.normalizeToLong(W);if(Y<0)throw Error("invalid ipv4 address");W=X1.fromLong(Y)}return/^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^f[cd][0-9a-f]{2}:/i.test(W)||/^fe80:/i.test(W)||/^::1$/.test(W)||/^::$/.test(W)};X1.isPublic=function(W){return!X1.isPrivate(W)};X1.isLoopback=function(W){if(!/\./.test(W)&&!/:/.test(W))W=X1.fromLong(Number(W));return/^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(W)||/^0177\./.test(W)||/^0x7f\./i.test(W)||/^fe80::1$/i.test(W)||/^::1$/.test(W)||/^::$/.test(W)};X1.loopback=function(W){if(W=FV(W),W!=="ipv4"&&W!=="ipv6")throw Error("family must be ipv4 or ipv6");return W==="ipv4"?"127.0.0.1":"fe80::1"};X1.address=function(W,Y){let G=ul.networkInterfaces();if(Y=FV(Y),W&&W!=="private"&&W!=="public"){let J=G[W].filter((Z)=>{return FV(Z.family)===Y});if(J.length===0)return;return J[0].address}let X=Object.keys(G).map((J)=>{let Z=G[J].filter((V)=>{if(V.family=FV(V.family),V.family!==Y||X1.isLoopback(V.address))return!1;if(!W)return!0;return W==="public"?X1.isPrivate(V.address):X1.isPublic(V.address)});return Z.length?Z[0].address:void 0}).filter(Boolean);return!X.length?X1.loopback(Y):X[0]};X1.toLong=function(W){let Y=0;return W.split(".").forEach((G)=>{Y<<=8,Y+=parseInt(G)}),Y>>>0};X1.fromLong=function(W){return`${W>>>24}.${W>>16&255}.${W>>8&255}.${W&255}`};X1.normalizeToLong=function(W){let Y=W.split(".").map((J)=>{if(J.startsWith("0x")||J.startsWith("0X"))return parseInt(J,16);else if(J.startsWith("0")&&J!=="0"&&/^[0-7]+$/.test(J))return parseInt(J,8);else if(/^[1-9]\d*$/.test(J)||J==="0")return parseInt(J,10);else return NaN});if(Y.some(isNaN))return-1;let G=0;switch(Y.length){case 1:G=Y[0];break;case 2:if(Y[0]>255||Y[1]>16777215)return-1;G=Y[0]<<24|Y[1]&16777215;break;case 3:if(Y[0]>255||Y[1]>255||Y[2]>65535)return-1;G=Y[0]<<24|Y[1]<<16|Y[2]&65535;break;case 4:if(Y.some((J)=>J>255))return-1;G=Y[0]<<24|Y[1]<<16|Y[2]<<8|Y[3];break;default:return-1}return G>>>0}});var R$=U1((uq0,M$)=>{M$.exports=function W(Y,G){if(Y===G)return!0;if(Y&&G&&typeof Y=="object"&&typeof G=="object"){if(Y.constructor!==G.constructor)return!1;var X,J,Z;if(Array.isArray(Y)){if(X=Y.length,X!=G.length)return!1;for(J=X;J--!==0;)if(!W(Y[J],G[J]))return!1;return!0}if(Y.constructor===RegExp)return Y.source===G.source&&Y.flags===G.flags;if(Y.valueOf!==Object.prototype.valueOf)return Y.valueOf()===G.valueOf();if(Y.toString!==Object.prototype.toString)return Y.toString()===G.toString();if(Z=Object.keys(Y),X=Z.length,X!==Object.keys(G).length)return!1;for(J=X;J--!==0;)if(!Object.prototype.hasOwnProperty.call(G,Z[J]))return!1;for(J=X;J--!==0;){var V=Z[J];if(!W(Y[V],G[V]))return!1}return!0}return Y!==Y&&G!==G}});var P$=U1((ml)=>{ml.toString=function(W){switch(W){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+W};ml.toType=function(W){switch(W.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}if(W.toUpperCase().startsWith("UNKNOWN_"))return parseInt(W.slice(8));return 0}});var L$=U1((pl)=>{pl.toString=function(W){switch(W){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+W};pl.toRcode=function(W){switch(W.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var B$=U1((ol)=>{ol.toString=function(W){switch(W){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+W};ol.toOpcode=function(W){switch(W.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var E$=U1((rl)=>{rl.toString=function(W){switch(W){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+W};rl.toClass=function(W){switch(W.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var $$=U1((tl)=>{tl.toString=function(W){switch(W){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}if(W<0)return null;return`OPTION_${W}`};tl.toCode=function(W){if(typeof W==="number")return W;if(!W)return-1;switch(W.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let Y=W.match(/_(\d+)$/);if(Y)return parseInt(Y[1],10);return-1}});var x$=U1((S$,aj)=>{var F$=function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.decode=H,W.encode=q,W.familyOf=N,W.name=void 0,W.sizeOf=Q,W.v6=W.v4=void 0;let Y=/^(\d{1,3}\.){3,3}\d{1,3}$/,G=4,X=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,J=16,Z={name:"v4",size:G,isFormat:(A)=>Y.test(A),encode(A,I,w){w=~~w,I=I||new Uint8Array(w+G);let O=A.length,M=0;for(let S=0;S<O;){let g=A.charCodeAt(S++);if(g===46)I[w++]=M,M=0;else M=M*10+(g-48)}return I[w]=M,I},decode(A,I){return I=~~I,`${A[I++]}.${A[I++]}.${A[I++]}.${A[I]}`}};W.v4=Z;let V={name:"v6",size:J,isFormat:(A)=>A.length>0&&X.test(A),encode(A,I,w){w=~~w;let O=w+J,M=-1,S=0,g=0,c=!0,u=!1;I=I||new Uint8Array(w+J);for(let p=0;p<A.length;p++){let h=A.charCodeAt(p);if(h===58){if(c){if(M!==-1){if(w<O)I[w]=0;if(w<O-1)I[w+1]=0;w+=2}else if(w<O)M=w}else{if(u===!0){if(w<O)I[w]=g;w++}else{if(w<O)I[w]=S>>8;if(w<O-1)I[w+1]=S&255;w+=2}S=0,g=0}c=!0,u=!1}else if(h===46){if(w<O)I[w]=g;w++,g=0,S=0,c=!1,u=!0}else{if(c=!1,h>=97)h-=87;else if(h>=65)h-=55;else h-=48,g=g*10+h;S=(S<<4)+h}}if(c===!1)if(u===!0){if(w<O)I[w]=g;w++}else{if(w<O)I[w]=S>>8;if(w<O-1)I[w+1]=S&255;w+=2}else if(M===0){if(w<O)I[w]=0;if(w<O-1)I[w+1]=0;w+=2}else if(M!==-1){w+=2;for(let p=Math.min(w-1,O-1);p>=M+2;p--)I[p]=I[p-2];I[M]=0,I[M+1]=0,M=w}if(M!==w&&M!==-1){if(w>O-2)w=O-2;while(O>M)I[--O]=w<O&&w>M?I[--w]:0}else while(w<O)I[w++]=0;return I},decode(A,I){I=~~I;let w="";for(let O=0;O<J;O+=2){if(O!==0)w+=":";w+=(A[I+O]<<8|A[I+O+1]).toString(16)}return w.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};W.v6=V;let U="ip";W.name=U;function Q(A){if(Z.isFormat(A))return Z.size;if(V.isFormat(A))return V.size;throw Error(`Invalid ip address: ${A}`)}function N(A){return Q(A)===Z.size?1:2}function q(A,I,w){w=~~w;let O=Q(A);if(typeof I==="function")I=I(w+O);if(O===Z.size)return Z.encode(A,I,w);return V.encode(A,I,w)}function H(A,I,w){if(I=~~I,w=w||A.length-I,w===Z.size)return Z.decode(A,I,w);if(w===V.size)return V.decode(A,I,w);throw Error(`Invalid buffer size needs to be ${Z.size} for v4 or ${V.size} for v6.`)}return"default"in W?W.default:W}({});if(typeof define==="function"&&define.amd)define([],function(){return F$});else if(typeof aj==="object"&&typeof S$==="object")aj.exports=F$});var k$=U1((Zd)=>{var V1=x8("buffer").Buffer,b4=P$(),Yd=L$(),Gd=B$(),Eq=E$(),ej=$$(),wY=x$(),g0=Zd.name={};g0.encode=function(W,Y,G,{mail:X=!1}={}){if(!Y)Y=V1.alloc(g0.encodingLength(W));if(!G)G=0;let J=G,Z=W.replace(/^\.|\.$/gm,"");if(Z.length){let V=[];if(X){let U="";Z.split(".").forEach((Q)=>{if(Q.endsWith("\\"))U+=(U.length?".":"")+Q.slice(0,-1);else if(V.length===0&&U.length)V.push(U+"."+Q);else V.push(Q)})}else V=Z.split(".");for(let U=0;U<V.length;U++){let Q=Y.write(V[U],G+1);Y[G]=Q,G+=Q+1}}return Y[G++]=0,g0.encode.bytes=G-J,Y};g0.encode.bytes=0;g0.decode=function(W,Y,{mail:G=!1}={}){if(!Y)Y=0;let X=[],J=Y,Z=0,V=0,U=!1;while(!0){if(Y>=W.length)throw Error("Cannot decode name (buffer overflow)");let Q=W[Y++];if(V+=U?0:1,Q===0)break;else if((Q&192)===0){if(Y+Q>W.length)throw Error("Cannot decode name (buffer overflow)");if(Z+=Q+1,Z>254)throw Error("Cannot decode name (name too long)");let N=W.toString("utf-8",Y,Y+Q);if(G)N=N.replace(/\./g,"\\.");X.push(N),Y+=Q,V+=U?0:Q}else if((Q&192)===192){if(Y+1>W.length)throw Error("Cannot decode name (buffer overflow)");let N=W.readUInt16BE(Y-1)-49152;if(N>=J)throw Error("Cannot decode name (bad pointer)");Y=N,J=N,V+=U?0:1,U=!0}else throw Error("Cannot decode name (bad label)")}return g0.decode.bytes=V,X.length===0?".":X.join(".")};g0.decode.bytes=0;g0.encodingLength=function(W){if(W==="."||W==="..")return 1;return V1.byteLength(W.replace(/^\.|\.$/gm,""))+2};var x1={};x1.encode=function(W,Y,G){if(!Y)Y=V1.alloc(x1.encodingLength(W));if(!G)G=0;let X=Y.write(W,G+1);return Y[G]=X,x1.encode.bytes=X+1,Y};x1.encode.bytes=0;x1.decode=function(W,Y){if(!Y)Y=0;let G=W[Y],X=W.toString("utf-8",Y+1,Y+1+G);return x1.decode.bytes=G+1,X};x1.decode.bytes=0;x1.encodingLength=function(W){return V1.byteLength(W)+1};var t5={};t5.encode=function(W,Y,G){if(!Y)Y=t5.encodingLength(W);if(!G)G=0;let X=(W.flags||0)&32767,J=W.type==="response"?32768:0;return Y.writeUInt16BE(W.id||0,G),Y.writeUInt16BE(X|J,G+2),Y.writeUInt16BE(W.questions.length,G+4),Y.writeUInt16BE(W.answers.length,G+6),Y.writeUInt16BE(W.authorities.length,G+8),Y.writeUInt16BE(W.additionals.length,G+10),Y};t5.encode.bytes=12;t5.decode=function(W,Y){if(!Y)Y=0;if(W.length<12)throw Error("Header must be 12 bytes");let G=W.readUInt16BE(Y+2);return{id:W.readUInt16BE(Y),type:G&32768?"response":"query",flags:G&32767,flag_qr:(G>>15&1)===1,opcode:Gd.toString(G>>11&15),flag_aa:(G>>10&1)===1,flag_tc:(G>>9&1)===1,flag_rd:(G>>8&1)===1,flag_ra:(G>>7&1)===1,flag_z:(G>>6&1)===1,flag_ad:(G>>5&1)===1,flag_cd:(G>>4&1)===1,rcode:Yd.toString(G&15),questions:Array(W.readUInt16BE(Y+4)),answers:Array(W.readUInt16BE(Y+6)),authorities:Array(W.readUInt16BE(Y+8)),additionals:Array(W.readUInt16BE(Y+10))}};t5.decode.bytes=12;t5.encodingLength=function(){return 12};var S4=Zd.unknown={};S4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(S4.encodingLength(W));if(!G)G=0;return Y.writeUInt16BE(W.length,G),W.copy(Y,G+2),S4.encode.bytes=W.length+2,Y};S4.encode.bytes=0;S4.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y),X=W.slice(Y+2,Y+2+G);return S4.decode.bytes=G+2,X};S4.decode.bytes=0;S4.encodingLength=function(W){return W.length+2};var x4=Zd.ns={};x4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(x4.encodingLength(W));if(!G)G=0;return g0.encode(W,Y,G+2),Y.writeUInt16BE(g0.encode.bytes,G),x4.encode.bytes=g0.encode.bytes+2,Y};x4.encode.bytes=0;x4.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y),X=g0.decode(W,Y+2);return x4.decode.bytes=G+2,X};x4.decode.bytes=0;x4.encodingLength=function(W){return g0.encodingLength(W)+2};var k4=Zd.soa={};k4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(k4.encodingLength(W));if(!G)G=0;let X=G;return G+=2,g0.encode(W.mname,Y,G),G+=g0.encode.bytes,g0.encode(W.rname,Y,G,{mail:!0}),G+=g0.encode.bytes,Y.writeUInt32BE(W.serial||0,G),G+=4,Y.writeUInt32BE(W.refresh||0,G),G+=4,Y.writeUInt32BE(W.retry||0,G),G+=4,Y.writeUInt32BE(W.expire||0,G),G+=4,Y.writeUInt32BE(W.minimum||0,G),G+=4,Y.writeUInt16BE(G-X-2,X),k4.encode.bytes=G-X,Y};k4.encode.bytes=0;k4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.mname=g0.decode(W,Y),Y+=g0.decode.bytes,X.rname=g0.decode(W,Y,{mail:!0}),Y+=g0.decode.bytes,X.serial=W.readUInt32BE(Y),Y+=4,X.refresh=W.readUInt32BE(Y),Y+=4,X.retry=W.readUInt32BE(Y),Y+=4,X.expire=W.readUInt32BE(Y),Y+=4,X.minimum=W.readUInt32BE(Y),Y+=4,k4.decode.bytes=Y-G,X};k4.decode.bytes=0;k4.encodingLength=function(W){return 22+g0.encodingLength(W.mname)+g0.encodingLength(W.rname)};var _4=Zd.txt={};_4.encode=function(W,Y,G){if(!Array.isArray(W))W=[W];for(let J=0;J<W.length;J++){if(typeof W[J]==="string")W[J]=V1.from(W[J]);if(!V1.isBuffer(W[J]))throw Error("Must be a Buffer")}if(!Y)Y=V1.alloc(_4.encodingLength(W));if(!G)G=0;let X=G;return G+=2,W.forEach(function(J){Y[G++]=J.length,J.copy(Y,G,0,J.length),G+=J.length}),Y.writeUInt16BE(G-X-2,X),_4.encode.bytes=G-X,Y};_4.encode.bytes=0;_4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=W.readUInt16BE(Y);Y+=2;let J=[];while(X>0){let Z=W[Y++];if(--X,X<Z)throw Error("Buffer overflow");J.push(W.slice(Y,Y+Z)),Y+=Z,X-=Z}return _4.decode.bytes=Y-G,J};_4.decode.bytes=0;_4.encodingLength=function(W){if(!Array.isArray(W))W=[W];let Y=2;return W.forEach(function(G){if(typeof G==="string")Y+=V1.byteLength(G)+1;else Y+=G.length+1}),Y};var y4=Zd.null={};y4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(y4.encodingLength(W));if(!G)G=0;if(typeof W==="string")W=V1.from(W);if(!W)W=V1.alloc(0);let X=G;G+=2;let J=W.length;return W.copy(Y,G,0,J),G+=J,Y.writeUInt16BE(G-X-2,X),y4.encode.bytes=G-X,Y};y4.encode.bytes=0;y4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=W.readUInt16BE(Y);Y+=2;let J=W.slice(Y,Y+X);return Y+=X,y4.decode.bytes=Y-G,J};y4.decode.bytes=0;y4.encodingLength=function(W){if(!W)return 2;return(V1.isBuffer(W)?W.length:V1.byteLength(W))+2};var v4=Zd.hinfo={};v4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(v4.encodingLength(W));if(!G)G=0;let X=G;return G+=2,x1.encode(W.cpu,Y,G),G+=x1.encode.bytes,x1.encode(W.os,Y,G),G+=x1.encode.bytes,Y.writeUInt16BE(G-X-2,X),v4.encode.bytes=G-X,Y};v4.encode.bytes=0;v4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.cpu=x1.decode(W,Y),Y+=x1.decode.bytes,X.os=x1.decode(W,Y),Y+=x1.decode.bytes,v4.decode.bytes=Y-G,X};v4.decode.bytes=0;v4.encodingLength=function(W){return x1.encodingLength(W.cpu)+x1.encodingLength(W.os)+2};var a5=Zd.ptr={},Xd=Zd.cname=a5,Jd=Zd.dname=a5;a5.encode=function(W,Y,G){if(!Y)Y=V1.alloc(a5.encodingLength(W));if(!G)G=0;return g0.encode(W,Y,G+2),Y.writeUInt16BE(g0.encode.bytes,G),a5.encode.bytes=g0.encode.bytes+2,Y};a5.encode.bytes=0;a5.decode=function(W,Y){if(!Y)Y=0;let G=g0.decode(W,Y+2);return a5.decode.bytes=g0.decode.bytes+2,G};a5.decode.bytes=0;a5.encodingLength=function(W){return g0.encodingLength(W)+2};var g4=Zd.srv={};g4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(g4.encodingLength(W));if(!G)G=0;Y.writeUInt16BE(W.priority||0,G+2),Y.writeUInt16BE(W.weight||0,G+4),Y.writeUInt16BE(W.port||0,G+6),g0.encode(W.target,Y,G+8);let X=g0.encode.bytes+6;return Y.writeUInt16BE(X,G),g4.encode.bytes=X+2,Y};g4.encode.bytes=0;g4.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y),X={};return X.priority=W.readUInt16BE(Y+2),X.weight=W.readUInt16BE(Y+4),X.port=W.readUInt16BE(Y+6),X.target=g0.decode(W,Y+8),g4.decode.bytes=G+2,X};g4.decode.bytes=0;g4.encodingLength=function(W){return 8+g0.encodingLength(W.target)};var N5=Zd.caa={};N5.ISSUER_CRITICAL=128;N5.encode=function(W,Y,G){let X=N5.encodingLength(W);if(!Y)Y=V1.alloc(N5.encodingLength(W));if(!G)G=0;if(W.issuerCritical)W.flags=N5.ISSUER_CRITICAL;return Y.writeUInt16BE(X-2,G),G+=2,Y.writeUInt8(W.flags||0,G),G+=1,x1.encode(W.tag,Y,G),G+=x1.encode.bytes,Y.write(W.value,G),G+=V1.byteLength(W.value),N5.encode.bytes=X,Y};N5.encode.bytes=0;N5.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y);Y+=2;let X=Y,J={};return J.flags=W.readUInt8(Y),Y+=1,J.tag=x1.decode(W,Y),Y+=x1.decode.bytes,J.value=W.toString("utf-8",Y,X+G),J.issuerCritical=!!(J.flags&N5.ISSUER_CRITICAL),N5.decode.bytes=G+2,J};N5.decode.bytes=0;N5.encodingLength=function(W){return x1.encodingLength(W.tag)+x1.encodingLength(W.value)+2};var o6=Zd.mx={};o6.encode=function(W,Y,G){if(!Y)Y=V1.alloc(o6.encodingLength(W));if(!G)G=0;let X=G;return G+=2,Y.writeUInt16BE(W.preference||0,G),G+=2,g0.encode(W.exchange,Y,G),G+=g0.encode.bytes,Y.writeUInt16BE(G-X-2,X),o6.encode.bytes=G-X,Y};o6.encode.bytes=0;o6.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.preference=W.readUInt16BE(Y),Y+=2,X.exchange=g0.decode(W,Y),Y+=g0.decode.bytes,o6.decode.bytes=Y-G,X};o6.encodingLength=function(W){return 4+g0.encodingLength(W.exchange)};var u4=Zd.a={};u4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(u4.encodingLength(W));if(!G)G=0;return Y.writeUInt16BE(4,G),G+=2,wY.v4.encode(W,Y,G),u4.encode.bytes=6,Y};u4.encode.bytes=0;u4.decode=function(W,Y){if(!Y)Y=0;Y+=2;let G=wY.v4.decode(W,Y);return u4.decode.bytes=6,G};u4.decode.bytes=0;u4.encodingLength=function(){return 6};var h4=Zd.aaaa={};h4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(h4.encodingLength(W));if(!G)G=0;return Y.writeUInt16BE(16,G),G+=2,wY.v6.encode(W,Y,G),h4.encode.bytes=18,Y};h4.encode.bytes=0;h4.decode=function(W,Y){if(!Y)Y=0;Y+=2;let G=wY.v6.decode(W,Y);return h4.decode.bytes=18,G};h4.decode.bytes=0;h4.encodingLength=function(){return 18};var r9=Zd.option={};r9.encode=function(W,Y,G){if(!Y)Y=V1.alloc(r9.encodingLength(W));if(!G)G=0;let X=G,J=ej.toCode(W.code);if(Y.writeUInt16BE(J,G),G+=2,W.data)Y.writeUInt16BE(W.data.length,G),G+=2,W.data.copy(Y,G),G+=W.data.length;else switch(J){case 8:let Z=W.sourcePrefixLength||0,V=W.family||wY.familyOf(W.ip),U=wY.encode(W.ip,V1.alloc),Q=Math.ceil(Z/8);Y.writeUInt16BE(Q+4,G),G+=2,Y.writeUInt16BE(V,G),G+=2,Y.writeUInt8(Z,G++),Y.writeUInt8(W.scopePrefixLength||0,G++),U.copy(Y,G,0,Q),G+=Q;break;case 11:if(W.timeout)Y.writeUInt16BE(2,G),G+=2,Y.writeUInt16BE(W.timeout,G),G+=2;else Y.writeUInt16BE(0,G),G+=2;break;case 12:let N=W.length||0;Y.writeUInt16BE(N,G),G+=2,Y.fill(0,G,G+N),G+=N;break;case 14:let q=W.tags.length*2;Y.writeUInt16BE(q,G),G+=2;for(let H of W.tags)Y.writeUInt16BE(H,G),G+=2;break;default:throw Error(`Unknown roption code: ${W.code}`)}return r9.encode.bytes=G-X,Y};r9.encode.bytes=0;r9.decode=function(W,Y){if(!Y)Y=0;let G={};G.code=W.readUInt16BE(Y),G.type=ej.toString(G.code),Y+=2;let X=W.readUInt16BE(Y);switch(Y+=2,G.data=W.slice(Y,Y+X),G.code){case 8:G.family=W.readUInt16BE(Y),Y+=2,G.sourcePrefixLength=W.readUInt8(Y++),G.scopePrefixLength=W.readUInt8(Y++);let J=V1.alloc(G.family===1?4:16);W.copy(J,0,Y,Y+X-4),G.ip=wY.decode(J);break;case 11:if(X>0)G.timeout=W.readUInt16BE(Y),Y+=2;break;case 14:G.tags=[];for(let Z=0;Z<X;Z+=2)G.tags.push(W.readUInt16BE(Y)),Y+=2}return r9.decode.bytes=X+4,G};r9.decode.bytes=0;r9.encodingLength=function(W){if(W.data)return W.data.length+4;switch(ej.toCode(W.code)){case 8:let G=W.sourcePrefixLength||0;return Math.ceil(G/8)+8;case 11:return typeof W.timeout==="number"?6:4;case 12:return W.length+4;case 14:return 4+W.tags.length*2}throw Error(`Unknown roption code: ${W.code}`)};var A5=Zd.opt={};A5.encode=function(W,Y,G){if(!Y)Y=V1.alloc(A5.encodingLength(W));if(!G)G=0;let X=G,J=EX(W,r9);return Y.writeUInt16BE(J,G),G=SV(W,r9,Y,G+2),A5.encode.bytes=G-X,Y};A5.encode.bytes=0;A5.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=[],J=W.readUInt16BE(Y);Y+=2;let Z=0;while(J>0)X[Z++]=r9.decode(W,Y),Y+=r9.decode.bytes,J-=r9.decode.bytes;return A5.decode.bytes=Y-G,X};A5.decode.bytes=0;A5.encodingLength=function(W){return 2+EX(W||[],r9)};var g9=Zd.dnskey={};g9.PROTOCOL_DNSSEC=3;g9.ZONE_KEY=128;g9.SECURE_ENTRYPOINT=32768;g9.encode=function(W,Y,G){if(!Y)Y=V1.alloc(g9.encodingLength(W));if(!G)G=0;let X=G,J=W.key;if(!V1.isBuffer(J))throw Error("Key must be a Buffer");return G+=2,Y.writeUInt16BE(W.flags,G),G+=2,Y.writeUInt8(g9.PROTOCOL_DNSSEC,G),G+=1,Y.writeUInt8(W.algorithm,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,g9.encode.bytes=G-X,Y.writeUInt16BE(g9.encode.bytes-2,X),Y};g9.encode.bytes=0;g9.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);if(Y+=2,X.flags=W.readUInt16BE(Y),Y+=2,W.readUInt8(Y)!==g9.PROTOCOL_DNSSEC)throw Error("Protocol must be 3");return Y+=1,X.algorithm=W.readUInt8(Y),Y+=1,X.key=W.slice(Y,G+J+2),Y+=X.key.length,g9.decode.bytes=Y-G,X};g9.decode.bytes=0;g9.encodingLength=function(W){return 6+V1.byteLength(W.key)};var _7=Zd.rrsig={};_7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(_7.encodingLength(W));if(!G)G=0;let X=G,J=W.signature;if(!V1.isBuffer(J))throw Error("Signature must be a Buffer");return G+=2,Y.writeUInt16BE(b4.toType(W.typeCovered),G),G+=2,Y.writeUInt8(W.algorithm,G),G+=1,Y.writeUInt8(W.labels,G),G+=1,Y.writeUInt32BE(W.originalTTL,G),G+=4,Y.writeUInt32BE(W.expiration,G),G+=4,Y.writeUInt32BE(W.inception,G),G+=4,Y.writeUInt16BE(W.keyTag,G),G+=2,g0.encode(W.signersName,Y,G),G+=g0.encode.bytes,J.copy(Y,G,0,J.length),G+=J.length,_7.encode.bytes=G-X,Y.writeUInt16BE(_7.encode.bytes-2,X),Y};_7.encode.bytes=0;_7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);return Y+=2,X.typeCovered=b4.toString(W.readUInt16BE(Y)),Y+=2,X.algorithm=W.readUInt8(Y),Y+=1,X.labels=W.readUInt8(Y),Y+=1,X.originalTTL=W.readUInt32BE(Y),Y+=4,X.expiration=W.readUInt32BE(Y),Y+=4,X.inception=W.readUInt32BE(Y),Y+=4,X.keyTag=W.readUInt16BE(Y),Y+=2,X.signersName=g0.decode(W,Y),Y+=g0.decode.bytes,X.signature=W.slice(Y,G+J+2),Y+=X.signature.length,_7.decode.bytes=Y-G,X};_7.decode.bytes=0;_7.encodingLength=function(W){return 20+g0.encodingLength(W.signersName)+V1.byteLength(W.signature)};var y7=Zd.rp={};y7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(y7.encodingLength(W));if(!G)G=0;let X=G;return G+=2,g0.encode(W.mbox||".",Y,G,{mail:!0}),G+=g0.encode.bytes,g0.encode(W.txt||".",Y,G),G+=g0.encode.bytes,y7.encode.bytes=G-X,Y.writeUInt16BE(y7.encode.bytes-2,X),Y};y7.encode.bytes=0;y7.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.mbox=g0.decode(W,Y,{mail:!0})||".",Y+=g0.decode.bytes,X.txt=g0.decode(W,Y)||".",Y+=g0.decode.bytes,y7.decode.bytes=Y-G,X};y7.decode.bytes=0;y7.encodingLength=function(W){return 2+g0.encodingLength(W.mbox||".")+g0.encodingLength(W.txt||".")};var i8={};i8.encode=function(W,Y,G){if(!Y)Y=V1.alloc(i8.encodingLength(W));if(!G)G=0;let X=G;var J=[];for(var Z=0;Z<W.length;Z++){var V=b4.toType(W[Z]);if(J[V>>8]===void 0)J[V>>8]=[];J[V>>8][V>>3&31]|=1<<7-(V&7)}for(Z=0;Z<J.length;Z++)if(J[Z]!==void 0){var U=V1.from(J[Z]);Y.writeUInt8(Z,G),G+=1,Y.writeUInt8(U.length,G),G+=1,U.copy(Y,G),G+=U.length}return i8.encode.bytes=G-X,Y};i8.encode.bytes=0;i8.decode=function(W,Y,G){if(!Y)Y=0;let X=Y;var J=[];while(Y-X<G){var Z=W.readUInt8(Y);Y+=1;var V=W.readUInt8(Y);Y+=1;for(var U=0;U<V;U++){var Q=W.readUInt8(Y+U);for(var N=0;N<8;N++)if(Q&1<<7-N){var q=b4.toString(Z<<8|U<<3|N);J.push(q)}}Y+=V}return i8.decode.bytes=Y-X,J};i8.decode.bytes=0;i8.encodingLength=function(W){var Y=[];for(var G=0;G<W.length;G++){var X=b4.toType(W[G]);Y[X>>8]=Math.max(Y[X>>8]||0,X&255)}var J=0;for(G=0;G<Y.length;G++)if(Y[G]!==void 0)J+=2+Math.ceil((Y[G]+1)/8);return J};var v7=Zd.nsec={};v7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(v7.encodingLength(W));if(!G)G=0;let X=G;return G+=2,g0.encode(W.nextDomain,Y,G),G+=g0.encode.bytes,i8.encode(W.rrtypes,Y,G),G+=i8.encode.bytes,v7.encode.bytes=G-X,Y.writeUInt16BE(v7.encode.bytes-2,X),Y};v7.encode.bytes=0;v7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);return Y+=2,X.nextDomain=g0.decode(W,Y),Y+=g0.decode.bytes,X.rrtypes=i8.decode(W,Y,J-(Y-G)),Y+=i8.decode.bytes,v7.decode.bytes=Y-G,X};v7.decode.bytes=0;v7.encodingLength=function(W){return 2+g0.encodingLength(W.nextDomain)+i8.encodingLength(W.rrtypes)};var g7=Zd.nsec3={};g7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(g7.encodingLength(W));if(!G)G=0;let X=G,J=W.salt;if(!V1.isBuffer(J))throw Error("salt must be a Buffer");let Z=W.nextDomain;if(!V1.isBuffer(Z))throw Error("nextDomain must be a Buffer");return G+=2,Y.writeUInt8(W.algorithm,G),G+=1,Y.writeUInt8(W.flags,G),G+=1,Y.writeUInt16BE(W.iterations,G),G+=2,Y.writeUInt8(J.length,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,Y.writeUInt8(Z.length,G),G+=1,Z.copy(Y,G,0,Z.length),G+=Z.length,i8.encode(W.rrtypes,Y,G),G+=i8.encode.bytes,g7.encode.bytes=G-X,Y.writeUInt16BE(g7.encode.bytes-2,X),Y};g7.encode.bytes=0;g7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);Y+=2,X.algorithm=W.readUInt8(Y),Y+=1,X.flags=W.readUInt8(Y),Y+=1,X.iterations=W.readUInt16BE(Y),Y+=2;let Z=W.readUInt8(Y);Y+=1,X.salt=W.slice(Y,Y+Z),Y+=Z;let V=W.readUInt8(Y);return Y+=1,X.nextDomain=W.slice(Y,Y+V),Y+=V,X.rrtypes=i8.decode(W,Y,J-(Y-G)),Y+=i8.decode.bytes,g7.decode.bytes=Y-G,X};g7.decode.bytes=0;g7.encodingLength=function(W){return 8+W.salt.length+W.nextDomain.length+i8.encodingLength(W.rrtypes)};var u7=Zd.ds={};u7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(u7.encodingLength(W));if(!G)G=0;let X=G,J=W.digest;if(!V1.isBuffer(J))throw Error("Digest must be a Buffer");return G+=2,Y.writeUInt16BE(W.keyTag,G),G+=2,Y.writeUInt8(W.algorithm,G),G+=1,Y.writeUInt8(W.digestType,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,u7.encode.bytes=G-X,Y.writeUInt16BE(u7.encode.bytes-2,X),Y};u7.encode.bytes=0;u7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);return Y+=2,X.keyTag=W.readUInt16BE(Y),Y+=2,X.algorithm=W.readUInt8(Y),Y+=1,X.digestType=W.readUInt8(Y),Y+=1,X.digest=W.slice(Y,G+J+2),Y+=X.digest.length,u7.decode.bytes=Y-G,X};u7.decode.bytes=0;u7.encodingLength=function(W){return 6+V1.byteLength(W.digest)};var q5=Zd.sshfp={};q5.getFingerprintLengthForHashType=function(Y){switch(Y){case 1:return 20;case 2:return 32}};q5.encode=function(Y,G,X){if(!G)G=V1.alloc(q5.encodingLength(Y));if(!X)X=0;let J=X;X+=2,G[X]=Y.algorithm,X+=1,G[X]=Y.hash,X+=1;let Z=V1.from(Y.fingerprint.toUpperCase(),"hex");if(Z.length!==q5.getFingerprintLengthForHashType(Y.hash))throw Error("Invalid fingerprint length");return Z.copy(G,X),X+=Z.byteLength,q5.encode.bytes=X-J,G.writeUInt16BE(q5.encode.bytes-2,J),G};q5.encode.bytes=0;q5.decode=function(Y,G){if(!G)G=0;let X=G,J={};G+=2,J.algorithm=Y[G],G+=1,J.hash=Y[G],G+=1;let Z=q5.getFingerprintLengthForHashType(J.hash);return J.fingerprint=Y.slice(G,G+Z).toString("hex").toUpperCase(),G+=Z,q5.decode.bytes=G-X,J};q5.decode.bytes=0;q5.encodingLength=function(W){return 4+V1.from(W.fingerprint,"hex").byteLength};var h7=Zd.naptr={};h7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(h7.encodingLength(W));if(!G)G=0;let X=G;return G+=2,Y.writeUInt16BE(W.order||0,G),G+=2,Y.writeUInt16BE(W.preference||0,G),G+=2,x1.encode(W.flags,Y,G),G+=x1.encode.bytes,x1.encode(W.services,Y,G),G+=x1.encode.bytes,x1.encode(W.regexp,Y,G),G+=x1.encode.bytes,g0.encode(W.replacement,Y,G),G+=g0.encode.bytes,h7.encode.bytes=G-X,Y.writeUInt16BE(h7.encode.bytes-2,X),Y};h7.encode.bytes=0;h7.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.order=W.readUInt16BE(Y),Y+=2,X.preference=W.readUInt16BE(Y),Y+=2,X.flags=x1.decode(W,Y),Y+=x1.decode.bytes,X.services=x1.decode(W,Y),Y+=x1.decode.bytes,X.regexp=x1.decode(W,Y),Y+=x1.decode.bytes,X.replacement=g0.decode(W,Y),Y+=g0.decode.bytes,h7.decode.bytes=Y-G,X};h7.decode.bytes=0;h7.encodingLength=function(W){return x1.encodingLength(W.flags)+x1.encodingLength(W.services)+x1.encodingLength(W.regexp)+g0.encodingLength(W.replacement)+6};var b7=Zd.tlsa={};b7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(b7.encodingLength(W));if(!G)G=0;let X=G,J=W.certificate;if(!V1.isBuffer(J))throw Error("Certificate must be a Buffer");return G+=2,Y.writeUInt8(W.usage,G),G+=1,Y.writeUInt8(W.selector,G),G+=1,Y.writeUInt8(W.matchingType,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,b7.encode.bytes=G-X,Y.writeUInt16BE(b7.encode.bytes-2,X),Y};b7.encode.bytes=0;b7.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={},J=W.readUInt16BE(Y);return Y+=2,X.usage=W.readUInt8(Y),Y+=1,X.selector=W.readUInt8(Y),Y+=1,X.matchingType=W.readUInt8(Y),Y+=1,X.certificate=W.slice(Y,G+J+2),Y+=X.certificate.length,b7.decode.bytes=Y-G,X};b7.decode.bytes=0;b7.encodingLength=function(W){return 5+V1.byteLength(W.certificate)};var WK=Zd.record=function(W){switch(W.toUpperCase()){case"A":return u4;case"PTR":return a5;case"CNAME":return Xd;case"DNAME":return Jd;case"TXT":return _4;case"NULL":return y4;case"AAAA":return h4;case"SRV":return g4;case"HINFO":return v4;case"CAA":return N5;case"NS":return x4;case"SOA":return k4;case"MX":return o6;case"OPT":return A5;case"DNSKEY":return g9;case"RRSIG":return _7;case"RP":return y7;case"NSEC":return v7;case"NSEC3":return g7;case"SSHFP":return q5;case"DS":return u7;case"NAPTR":return h7;case"TLSA":return b7}return S4},Z9=Zd.answer={};Z9.encode=function(W,Y,G){if(!Y)Y=V1.alloc(Z9.encodingLength(W));if(!G)G=0;let X=G;if(g0.encode(W.name,Y,G),G+=g0.encode.bytes,Y.writeUInt16BE(b4.toType(W.type),G),W.type.toUpperCase()==="OPT"){if(W.name!==".")throw Error("OPT name must be root.");Y.writeUInt16BE(W.udpPayloadSize||4096,G+2),Y.writeUInt8(W.extendedRcode||0,G+4),Y.writeUInt8(W.ednsVersion||0,G+5),Y.writeUInt16BE(W.flags||0,G+6),G+=8,A5.encode(W.options||[],Y,G),G+=A5.encode.bytes}else{let J=Eq.toClass(W.class===void 0?"IN":W.class);if(W.flush)J|=32768;Y.writeUInt16BE(J,G+2),Y.writeUInt32BE(W.ttl||0,G+4),G+=8;let Z=WK(W.type);Z.encode(W.data,Y,G),G+=Z.encode.bytes}return Z9.encode.bytes=G-X,Y};Z9.encode.bytes=0;Z9.decode=function(W,Y){if(!Y)Y=0;let G={},X=Y;if(G.name=g0.decode(W,Y),Y+=g0.decode.bytes,G.type=b4.toString(W.readUInt16BE(Y)),G.type==="OPT")G.udpPayloadSize=W.readUInt16BE(Y+2),G.extendedRcode=W.readUInt8(Y+4),G.ednsVersion=W.readUInt8(Y+5),G.flags=W.readUInt16BE(Y+6),G.flag_do=(G.flags>>15&1)===1,G.options=A5.decode(W,Y+8),Y+=8+A5.decode.bytes;else{let J=W.readUInt16BE(Y+2);G.ttl=W.readUInt32BE(Y+4),G.class=Eq.toString(J&-32769),G.flush=!!(J&32768);let Z=WK(G.type);G.data=Z.decode(W,Y+8),Y+=8+Z.decode.bytes}return Z9.decode.bytes=Y-X,G};Z9.decode.bytes=0;Z9.encodingLength=function(W){let Y=W.data!==null&&W.data!==void 0?W.data:W.options;return g0.encodingLength(W.name)+8+WK(W.type).encodingLength(Y)};var s5=Zd.question={};s5.encode=function(W,Y,G){if(!Y)Y=V1.alloc(s5.encodingLength(W));if(!G)G=0;let X=G;return g0.encode(W.name,Y,G),G+=g0.encode.bytes,Y.writeUInt16BE(b4.toType(W.type),G),G+=2,Y.writeUInt16BE(Eq.toClass(W.class===void 0?"IN":W.class),G),G+=2,s5.encode.bytes=G-X,W};s5.encode.bytes=0;s5.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};if(X.name=g0.decode(W,Y),Y+=g0.decode.bytes,X.type=b4.toString(W.readUInt16BE(Y)),Y+=2,X.class=Eq.toString(W.readUInt16BE(Y)),Y+=2,!!(X.class&32768))X.class&=-32769;return s5.decode.bytes=Y-G,X};s5.decode.bytes=0;s5.encodingLength=function(W){return g0.encodingLength(W.name)+4};Zd.AUTHORITATIVE_ANSWER=1024;Zd.TRUNCATED_RESPONSE=512;Zd.RECURSION_DESIRED=256;Zd.RECURSION_AVAILABLE=128;Zd.AUTHENTIC_DATA=32;Zd.CHECKING_DISABLED=16;Zd.DNSSEC_OK=32768;Zd.encode=function(W,Y,G){let X=!Y;if(X)Y=V1.alloc(Zd.encodingLength(W));if(!G)G=0;let J=G;if(!W.questions)W.questions=[];if(!W.answers)W.answers=[];if(!W.authorities)W.authorities=[];if(!W.additionals)W.additionals=[];if(t5.encode(W,Y,G),G+=t5.encode.bytes,G=SV(W.questions,s5,Y,G),G=SV(W.answers,Z9,Y,G),G=SV(W.authorities,Z9,Y,G),G=SV(W.additionals,Z9,Y,G),Zd.encode.bytes=G-J,X&&Zd.encode.bytes!==Y.length)return Y.slice(0,Zd.encode.bytes);return Y};Zd.encode.bytes=0;Zd.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=t5.decode(W,Y);return Y+=t5.decode.bytes,Y=Bq(X.questions,s5,W,Y),Y=Bq(X.answers,Z9,W,Y),Y=Bq(X.authorities,Z9,W,Y),Y=Bq(X.additionals,Z9,W,Y),Zd.decode.bytes=Y-G,X};Zd.decode.bytes=0;Zd.encodingLength=function(W){return t5.encodingLength(W)+EX(W.questions||[],s5)+EX(W.answers||[],Z9)+EX(W.authorities||[],Z9)+EX(W.additionals||[],Z9)};Zd.streamEncode=function(W){let Y=Zd.encode(W),G=V1.alloc(2);G.writeUInt16BE(Y.byteLength);let X=V1.concat([G,Y]);return Zd.streamEncode.bytes=X.byteLength,X};Zd.streamEncode.bytes=0;Zd.streamDecode=function(W){let Y=W.readUInt16BE(0);if(W.byteLength<Y+2)return null;let G=Zd.decode(W.slice(2));return Zd.streamDecode.bytes=Zd.decode.bytes,G};Zd.streamDecode.bytes=0;function EX(W,Y){let G=0;for(let X=0;X<W.length;X++)G+=Y.encodingLength(W[X]);return G}function SV(W,Y,G,X){for(let J=0;J<W.length;J++)Y.encode(W[J],G,X),X+=Y.encode.bytes;return X}function Bq(W,Y,G,X){for(let J=0;J<W.length;J++)W[J]=Y.decode(G,X),X+=Y.decode.bytes;return X}});var v$=U1((DA0,y$)=>{var _$=Dd;process.nextTick(Od,42);y$.exports=Id;function Id(W){var Y=X;return G;function G(J){Y(J||jd)}function X(J){var Z=[J];Y=V,W(U);function V(Q){Z.push(Q)}function U(Q){var N=arguments;Y=wd(Q)?X:q;while(Z.length)q(Z.shift());function q(H){_$(Kd,H,N)}}}}function wd(W){return Object.prototype.toString.call(W)==="[object Error]"}function jd(){}function Kd(W,Y){W.apply(null,Y)}function Od(W){if(W===42)_$=process.nextTick}function Dd(W,Y,G){process.nextTick(function(){W(Y,G)})}});var h$=U1((CA0,u$)=>{var YK=k$(),Cd=x8("dgram"),Td=v$(),Md=x8("events"),XK=x8("os"),GK=function(){};u$.exports=function(W){if(!W)W={};var Y=new Md.EventEmitter,G=typeof W.port==="number"?W.port:5353,X=W.type||"udp4",J=W.ip||W.host||(X==="udp4"?"224.0.0.251":null),Z={address:J,port:G},V={},U=!1,Q=null;if(X==="udp6"&&(!J||!W.interface))throw Error("For IPv6 multicast you must specify `ip` and `interface`");var N=W.socket||Cd.createSocket({type:X,reuseAddr:W.reuseAddr!==!1,toString:function(){return X}});N.on("error",function(H){if(H.code==="EACCES"||H.code==="EADDRINUSE")Y.emit("error",H);else Y.emit("warning",H)}),N.on("message",function(H,A){try{H=YK.decode(H)}catch(I){Y.emit("warning",I);return}if(Y.emit("packet",H,A),H.type==="query")Y.emit("query",H,A);if(H.type==="response")Y.emit("response",H,A)}),N.on("listening",function(){if(!G)G=Z.port=N.address().port;if(W.multicast!==!1)Y.update(),Q=setInterval(Y.update,5000),N.setMulticastTTL(W.ttl||255),N.setMulticastLoopback(W.loopback!==!1)});var q=Td(function(H){if(!G||W.bind===!1)return H(null);N.once("error",H),N.bind(G,W.bind||W.interface,function(){N.removeListener("error",H),H(null)})});return q(function(H){if(H)return Y.emit("error",H);Y.emit("ready")}),Y.send=function(H,A,I){if(typeof A==="function")return Y.send(H,null,A);if(!I)I=GK;if(!A)A=Z;else if(!A.host&&!A.address)A.address=Z.address;q(w);function w(O){if(U)return I();if(O)return I(O);var M=YK.encode(H);N.send(M,0,M.length,A.port,A.address||A.host,I)}},Y.response=Y.respond=function(H,A,I){if(Array.isArray(H))H={answers:H};H.type="response",H.flags=(H.flags||0)|YK.AUTHORITATIVE_ANSWER,Y.send(H,A,I)},Y.query=function(H,A,I,w){if(typeof A==="function")return Y.query(H,null,null,A);if(typeof A==="object"&&A&&A.port)return Y.query(H,null,A,I);if(typeof I==="function")return Y.query(H,A,null,I);if(!w)w=GK;if(typeof H==="string")H=[{name:H,type:A||"ANY"}];if(Array.isArray(H))H={type:"query",questions:H};H.type="query",Y.send(H,I,w)},Y.destroy=function(H){if(!H)H=GK;if(U)return process.nextTick(H);U=!0,clearInterval(Q);for(var A in V)try{N.dropMembership(J,A)}catch(I){}V={},N.close(H)},Y.update=function(){var H=W.interface?[].concat(W.interface):Pd(),A=!1;for(var I=0;I<H.length;I++){var w=H[I];if(V[w])continue;try{N.addMembership(J,w),V[w]=!0,A=!0}catch(O){Y.emit("warning",O)}}if(A){if(N.setMulticastInterface)try{N.setMulticastInterface(W.interface||Rd())}catch(O){Y.emit("warning",O)}Y.emit("networkInterface")}},Y};function Rd(){var W=XK.networkInterfaces(),Y=Object.keys(W);for(var G=0;G<Y.length;G++){var X=W[Y[G]];for(var J=0;J<X.length;J++){var Z=X[J];if(g$(Z.family)&&!Z.internal){if(XK.platform()==="darwin"&&Y[G]==="en0")return Z.address;return"0.0.0.0"}}}return"127.0.0.1"}function Pd(){var W=XK.networkInterfaces(),Y=Object.keys(W),G=[];for(var X=0;X<Y.length;X++){var J=W[Y[X]];for(var Z=0;Z<J.length;Z++){var V=J[Z];if(g$(V.family)){G.push(V.address);break}}}return G}function g$(W){return W===4||W==="IPv4"}});import{Database as jt}from"bun:sqlite";import{mkdirSync as Kt}from"fs";import{dirname as Ot}from"path";function QD(W){let Y=W.length,G=0,X=0;while(X<Y){let J=W.charCodeAt(X++);if((J&4294967168)===0){G++;continue}else if((J&4294965248)===0)G+=2;else{if(J>=55296&&J<=56319){if(X<Y){let Z=W.charCodeAt(X);if((Z&64512)===56320)++X,J=((J&1023)<<10)+(Z&1023)+65536}}if((J&4294901760)===0)G+=3;else G+=4}}return G}function h_(W,Y,G){let X=W.length,J=G,Z=0;while(Z<X){let V=W.charCodeAt(Z++);if((V&4294967168)===0){Y[J++]=V;continue}else if((V&4294965248)===0)Y[J++]=V>>6&31|192;else{if(V>=55296&&V<=56319){if(Z<X){let U=W.charCodeAt(Z);if((U&64512)===56320)++Z,V=((V&1023)<<10)+(U&1023)+65536}}if((V&4294901760)===0)Y[J++]=V>>12&15|224,Y[J++]=V>>6&63|128;else Y[J++]=V>>18&7|240,Y[J++]=V>>12&63|128,Y[J++]=V>>6&63|128}Y[J++]=V&63|128}}var b_=new TextEncoder,m_=50;function f_(W,Y,G){b_.encodeInto(W,Y.subarray(G))}function ND(W,Y,G){if(W.length>m_)f_(W,Y,G);else h_(W,Y,G)}var c_=4096;function AH(W,Y,G){let X=Y,J=X+G,Z=[],V="";while(X<J){let U=W[X++];if((U&128)===0)Z.push(U);else if((U&224)===192){let Q=W[X++]&63;Z.push((U&31)<<6|Q)}else if((U&240)===224){let Q=W[X++]&63,N=W[X++]&63;Z.push((U&31)<<12|Q<<6|N)}else if((U&248)===240){let Q=W[X++]&63,N=W[X++]&63,q=W[X++]&63,H=(U&7)<<18|Q<<12|N<<6|q;if(H>65535)H-=65536,Z.push(H>>>10&1023|55296),H=56320|H&1023;Z.push(H)}else Z.push(U);if(Z.length>=c_)V+=String.fromCharCode(...Z),Z.length=0}if(Z.length>0)V+=String.fromCharCode(...Z);return V}var p_=new TextDecoder,l_=200;function d_(W,Y,G){let X=W.subarray(Y,Y+G);return p_.decode(X)}function qD(W,Y,G){if(G>l_)return d_(W,Y,G);else return AH(W,Y,G)}class pY{type;data;constructor(W,Y){this.type=W,this.data=Y}}class S9 extends Error{constructor(W){super(W);let Y=Object.create(S9.prototype);Object.setPrototypeOf(this,Y),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:S9.name})}}var lY=4294967295;function AD(W,Y,G){let X=G/4294967296,J=G;W.setUint32(Y,X),W.setUint32(Y+4,J)}function yU(W,Y,G){let X=Math.floor(G/4294967296),J=G;W.setUint32(Y,X),W.setUint32(Y+4,J)}function vU(W,Y){let G=W.getInt32(Y),X=W.getUint32(Y+4);return G*4294967296+X}function HD(W,Y){let G=W.getUint32(Y),X=W.getUint32(Y+4);return G*4294967296+X}var o_=-1,n_=4294967295,i_=17179869183;function r_({sec:W,nsec:Y}){if(W>=0&&Y>=0&&W<=i_)if(Y===0&&W<=n_){let G=new Uint8Array(4);return new DataView(G.buffer).setUint32(0,W),G}else{let G=W/4294967296,X=W&4294967295,J=new Uint8Array(8),Z=new DataView(J.buffer);return Z.setUint32(0,Y<<2|G&3),Z.setUint32(4,X),J}else{let G=new Uint8Array(12),X=new DataView(G.buffer);return X.setUint32(0,Y),yU(X,4,W),G}}function a_(W){let Y=W.getTime(),G=Math.floor(Y/1000),X=(Y-G*1000)*1e6,J=Math.floor(X/1e9);return{sec:G+J,nsec:X-J*1e9}}function s_(W){if(W instanceof Date){let Y=a_(W);return r_(Y)}else return null}function t_(W){let Y=new DataView(W.buffer,W.byteOffset,W.byteLength);switch(W.byteLength){case 4:{let G=Y.getUint32(0),X=0;return{sec:G,nsec:0}}case 8:{let G=Y.getUint32(0),X=Y.getUint32(4),J=(G&3)*4294967296+X,Z=G>>>2;return{sec:J,nsec:Z}}case 12:{let G=vU(Y,4),X=Y.getUint32(0);return{sec:G,nsec:X}}default:throw new S9(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${W.length}`)}}function e_(W){let Y=t_(W);return new Date(Y.sec*1000+Y.nsec/1e6)}var zD={type:o_,encode:s_,decode:e_};class dY{static defaultCodec=new dY;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(zD)}register({type:W,encode:Y,decode:G}){if(W>=0)this.encoders[W]=Y,this.decoders[W]=G;else{let X=-1-W;this.builtInEncoders[X]=Y,this.builtInDecoders[X]=G}}tryToEncode(W,Y){for(let G=0;G<this.builtInEncoders.length;G++){let X=this.builtInEncoders[G];if(X!=null){let J=X(W,Y);if(J!=null){let Z=-1-G;return new pY(Z,J)}}}for(let G=0;G<this.encoders.length;G++){let X=this.encoders[G];if(X!=null){let J=X(W,Y);if(J!=null)return new pY(G,J)}}if(W instanceof pY)return W;return null}decode(W,Y,G){let X=Y<0?this.builtInDecoders[-1-Y]:this.decoders[Y];if(X)return X(W,Y,G);else return new pY(Y,W)}}function Wy(W){return W instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&W instanceof SharedArrayBuffer}function UJ(W){if(W instanceof Uint8Array)return W;else if(ArrayBuffer.isView(W))return new Uint8Array(W.buffer,W.byteOffset,W.byteLength);else if(Wy(W))return new Uint8Array(W);else return Uint8Array.from(W)}var Yy=100,Gy=2048;class gU{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(W){this.extensionCodec=W?.extensionCodec??dY.defaultCodec,this.context=W?.context,this.useBigInt64=W?.useBigInt64??!1,this.maxDepth=W?.maxDepth??Yy,this.initialBufferSize=W?.initialBufferSize??Gy,this.sortKeys=W?.sortKeys??!1,this.forceFloat32=W?.forceFloat32??!1,this.ignoreUndefined=W?.ignoreUndefined??!1,this.forceIntegerToFloat=W?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new gU({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(W){if(this.entered)return this.clone().encodeSharedRef(W);try{return this.entered=!0,this.reinitializeState(),this.doEncode(W,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(W){if(this.entered)return this.clone().encode(W);try{return this.entered=!0,this.reinitializeState(),this.doEncode(W,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(W,Y){if(Y>this.maxDepth)throw Error(`Too deep objects in depth ${Y}`);if(W==null)this.encodeNil();else if(typeof W==="boolean")this.encodeBoolean(W);else if(typeof W==="number")if(!this.forceIntegerToFloat)this.encodeNumber(W);else this.encodeNumberAsFloat(W);else if(typeof W==="string")this.encodeString(W);else if(this.useBigInt64&&typeof W==="bigint")this.encodeBigInt64(W);else this.encodeObject(W,Y)}ensureBufferSizeToWrite(W){let Y=this.pos+W;if(this.view.byteLength<Y)this.resizeBuffer(Y*2)}resizeBuffer(W){let Y=new ArrayBuffer(W),G=new Uint8Array(Y),X=new DataView(Y);G.set(this.bytes),this.view=X,this.bytes=G}encodeNil(){this.writeU8(192)}encodeBoolean(W){if(W===!1)this.writeU8(194);else this.writeU8(195)}encodeNumber(W){if(!this.forceIntegerToFloat&&Number.isSafeInteger(W))if(W>=0)if(W<128)this.writeU8(W);else if(W<256)this.writeU8(204),this.writeU8(W);else if(W<65536)this.writeU8(205),this.writeU16(W);else if(W<4294967296)this.writeU8(206),this.writeU32(W);else if(!this.useBigInt64)this.writeU8(207),this.writeU64(W);else this.encodeNumberAsFloat(W);else if(W>=-32)this.writeU8(224|W+32);else if(W>=-128)this.writeU8(208),this.writeI8(W);else if(W>=-32768)this.writeU8(209),this.writeI16(W);else if(W>=-2147483648)this.writeU8(210),this.writeI32(W);else if(!this.useBigInt64)this.writeU8(211),this.writeI64(W);else this.encodeNumberAsFloat(W);else this.encodeNumberAsFloat(W)}encodeNumberAsFloat(W){if(this.forceFloat32)this.writeU8(202),this.writeF32(W);else this.writeU8(203),this.writeF64(W)}encodeBigInt64(W){if(W>=BigInt(0))this.writeU8(207),this.writeBigUint64(W);else this.writeU8(211),this.writeBigInt64(W)}writeStringHeader(W){if(W<32)this.writeU8(160+W);else if(W<256)this.writeU8(217),this.writeU8(W);else if(W<65536)this.writeU8(218),this.writeU16(W);else if(W<4294967296)this.writeU8(219),this.writeU32(W);else throw Error(`Too long string: ${W} bytes in UTF-8`)}encodeString(W){let G=QD(W);this.ensureBufferSizeToWrite(5+G),this.writeStringHeader(G),ND(W,this.bytes,this.pos),this.pos+=G}encodeObject(W,Y){let G=this.extensionCodec.tryToEncode(W,this.context);if(G!=null)this.encodeExtension(G);else if(Array.isArray(W))this.encodeArray(W,Y);else if(ArrayBuffer.isView(W))this.encodeBinary(W);else if(typeof W==="object")this.encodeMap(W,Y);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(W)}`)}encodeBinary(W){let Y=W.byteLength;if(Y<256)this.writeU8(196),this.writeU8(Y);else if(Y<65536)this.writeU8(197),this.writeU16(Y);else if(Y<4294967296)this.writeU8(198),this.writeU32(Y);else throw Error(`Too large binary: ${Y}`);let G=UJ(W);this.writeU8a(G)}encodeArray(W,Y){let G=W.length;if(G<16)this.writeU8(144+G);else if(G<65536)this.writeU8(220),this.writeU16(G);else if(G<4294967296)this.writeU8(221),this.writeU32(G);else throw Error(`Too large array: ${G}`);for(let X of W)this.doEncode(X,Y+1)}countWithoutUndefined(W,Y){let G=0;for(let X of Y)if(W[X]!==void 0)G++;return G}encodeMap(W,Y){let G=Object.keys(W);if(this.sortKeys)G.sort();let X=this.ignoreUndefined?this.countWithoutUndefined(W,G):G.length;if(X<16)this.writeU8(128+X);else if(X<65536)this.writeU8(222),this.writeU16(X);else if(X<4294967296)this.writeU8(223),this.writeU32(X);else throw Error(`Too large map object: ${X}`);for(let J of G){let Z=W[J];if(!(this.ignoreUndefined&&Z===void 0))this.encodeString(J),this.doEncode(Z,Y+1)}}encodeExtension(W){if(typeof W.data==="function"){let G=W.data(this.pos+6),X=G.length;if(X>=4294967296)throw Error(`Too large extension object: ${X}`);this.writeU8(201),this.writeU32(X),this.writeI8(W.type),this.writeU8a(G);return}let Y=W.data.length;if(Y===1)this.writeU8(212);else if(Y===2)this.writeU8(213);else if(Y===4)this.writeU8(214);else if(Y===8)this.writeU8(215);else if(Y===16)this.writeU8(216);else if(Y<256)this.writeU8(199),this.writeU8(Y);else if(Y<65536)this.writeU8(200),this.writeU16(Y);else if(Y<4294967296)this.writeU8(201),this.writeU32(Y);else throw Error(`Too large extension object: ${Y}`);this.writeI8(W.type),this.writeU8a(W.data)}writeU8(W){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,W),this.pos++}writeU8a(W){let Y=W.length;this.ensureBufferSizeToWrite(Y),this.bytes.set(W,this.pos),this.pos+=Y}writeI8(W){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,W),this.pos++}writeU16(W){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,W),this.pos+=2}writeI16(W){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,W),this.pos+=2}writeU32(W){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,W),this.pos+=4}writeI32(W){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,W),this.pos+=4}writeF32(W){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,W),this.pos+=4}writeF64(W){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,W),this.pos+=8}writeU64(W){this.ensureBufferSizeToWrite(8),AD(this.view,this.pos,W),this.pos+=8}writeI64(W){this.ensureBufferSizeToWrite(8),yU(this.view,this.pos,W),this.pos+=8}writeBigUint64(W){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,W),this.pos+=8}writeBigInt64(W){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,W),this.pos+=8}}function uU(W,Y){return new gU(Y).encodeSharedRef(W)}function hU(W){return`${W<0?"-":""}0x${Math.abs(W).toString(16).padStart(2,"0")}`}var Xy=16,Jy=16;class HH{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(W=Xy,Y=Jy){this.maxKeyLength=W,this.maxLengthPerKey=Y,this.caches=[];for(let G=0;G<this.maxKeyLength;G++)this.caches.push([])}canBeCached(W){return W>0&&W<=this.maxKeyLength}find(W,Y,G){let X=this.caches[G-1];W:for(let J of X){let Z=J.bytes;for(let V=0;V<G;V++)if(Z[V]!==W[Y+V])continue W;return J.str}return null}store(W,Y){let G=this.caches[W.length-1],X={bytes:W,str:Y};if(G.length>=this.maxLengthPerKey)G[Math.random()*G.length|0]=X;else G.push(X)}decode(W,Y,G){let X=this.find(W,Y,G);if(X!=null)return this.hit++,X;this.miss++;let J=AH(W,Y,G),Z=Uint8Array.prototype.slice.call(W,Y,Y+G);return this.store(Z,J),J}}var zH="array",NJ="map_key",wD="map_value",Zy=(W)=>{if(typeof W==="string"||typeof W==="number")return W;throw new S9("The type of key must be string or number but "+typeof W)};class jD{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(W){let Y=this.getUninitializedStateFromPool();Y.type=zH,Y.position=0,Y.size=W,Y.array=Array(W)}pushMapState(W){let Y=this.getUninitializedStateFromPool();Y.type=NJ,Y.readCount=0,Y.size=W,Y.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let W={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(W)}return this.stack[this.stackHeadPosition]}release(W){if(this.stack[this.stackHeadPosition]!==W)throw Error("Invalid stack state. Released state is not on top of the stack.");if(W.type===zH){let G=W;G.size=0,G.array=void 0,G.position=0,G.type=void 0}if(W.type===NJ||W.type===wD){let G=W;G.size=0,G.map=void 0,G.readCount=0,G.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}var QJ=-1,IH=new DataView(new ArrayBuffer(0)),Vy=new Uint8Array(IH.buffer);try{IH.getInt8(0)}catch(W){if(!(W instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ID=RangeError("Insufficient data"),Uy=new HH;class bU{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=IH;bytes=Vy;headByte=QJ;stack=new jD;entered=!1;constructor(W){this.extensionCodec=W?.extensionCodec??dY.defaultCodec,this.context=W?.context,this.useBigInt64=W?.useBigInt64??!1,this.rawStrings=W?.rawStrings??!1,this.maxStrLength=W?.maxStrLength??lY,this.maxBinLength=W?.maxBinLength??lY,this.maxArrayLength=W?.maxArrayLength??lY,this.maxMapLength=W?.maxMapLength??lY,this.maxExtLength=W?.maxExtLength??lY,this.keyDecoder=W?.keyDecoder!==void 0?W.keyDecoder:Uy,this.mapKeyConverter=W?.mapKeyConverter??Zy}clone(){return new bU({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=QJ,this.stack.reset()}setBuffer(W){let Y=UJ(W);this.bytes=Y,this.view=new DataView(Y.buffer,Y.byteOffset,Y.byteLength),this.pos=0}appendBuffer(W){if(this.headByte===QJ&&!this.hasRemaining(1))this.setBuffer(W);else{let Y=this.bytes.subarray(this.pos),G=UJ(W),X=new Uint8Array(Y.length+G.length);X.set(Y),X.set(G,Y.length),this.setBuffer(X)}}hasRemaining(W){return this.view.byteLength-this.pos>=W}createExtraByteError(W){let{view:Y,pos:G}=this;return RangeError(`Extra ${Y.byteLength-G} of ${Y.byteLength} byte(s) found at buffer[${W}]`)}decode(W){if(this.entered)return this.clone().decode(W);try{this.entered=!0,this.reinitializeState(),this.setBuffer(W);let Y=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return Y}finally{this.entered=!1}}*decodeMulti(W){if(this.entered){yield*this.clone().decodeMulti(W);return}try{this.entered=!0,this.reinitializeState(),this.setBuffer(W);while(this.hasRemaining(1))yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(W){if(this.entered)return this.clone().decodeAsync(W);try{this.entered=!0;let Y=!1,G;for await(let V of W){if(Y)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(V);try{G=this.doDecodeSync(),Y=!0}catch(U){if(!(U instanceof RangeError))throw U}this.totalPos+=this.pos}if(Y){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return G}let{headByte:X,pos:J,totalPos:Z}=this;throw RangeError(`Insufficient data in parsing ${hU(X)} at ${Z} (${J} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(W){return this.decodeMultiAsync(W,!0)}decodeStream(W){return this.decodeMultiAsync(W,!1)}async*decodeMultiAsync(W,Y){if(this.entered){yield*this.clone().decodeMultiAsync(W,Y);return}try{this.entered=!0;let G=Y,X=-1;for await(let J of W){if(Y&&X===0)throw this.createExtraByteError(this.totalPos);if(this.appendBuffer(J),G)X=this.readArraySize(),G=!1,this.complete();try{while(!0)if(yield this.doDecodeSync(),--X===0)break}catch(Z){if(!(Z instanceof RangeError))throw Z}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){W:while(!0){let W=this.readHeadByte(),Y;if(W>=224)Y=W-256;else if(W<192)if(W<128)Y=W;else if(W<144){let X=W-128;if(X!==0){this.pushMapState(X),this.complete();continue W}else Y={}}else if(W<160){let X=W-144;if(X!==0){this.pushArrayState(X),this.complete();continue W}else Y=[]}else{let X=W-160;Y=this.decodeString(X,0)}else if(W===192)Y=null;else if(W===194)Y=!1;else if(W===195)Y=!0;else if(W===202)Y=this.readF32();else if(W===203)Y=this.readF64();else if(W===204)Y=this.readU8();else if(W===205)Y=this.readU16();else if(W===206)Y=this.readU32();else if(W===207)if(this.useBigInt64)Y=this.readU64AsBigInt();else Y=this.readU64();else if(W===208)Y=this.readI8();else if(W===209)Y=this.readI16();else if(W===210)Y=this.readI32();else if(W===211)if(this.useBigInt64)Y=this.readI64AsBigInt();else Y=this.readI64();else if(W===217){let X=this.lookU8();Y=this.decodeString(X,1)}else if(W===218){let X=this.lookU16();Y=this.decodeString(X,2)}else if(W===219){let X=this.lookU32();Y=this.decodeString(X,4)}else if(W===220){let X=this.readU16();if(X!==0){this.pushArrayState(X),this.complete();continue W}else Y=[]}else if(W===221){let X=this.readU32();if(X!==0){this.pushArrayState(X),this.complete();continue W}else Y=[]}else if(W===222){let X=this.readU16();if(X!==0){this.pushMapState(X),this.complete();continue W}else Y={}}else if(W===223){let X=this.readU32();if(X!==0){this.pushMapState(X),this.complete();continue W}else Y={}}else if(W===196){let X=this.lookU8();Y=this.decodeBinary(X,1)}else if(W===197){let X=this.lookU16();Y=this.decodeBinary(X,2)}else if(W===198){let X=this.lookU32();Y=this.decodeBinary(X,4)}else if(W===212)Y=this.decodeExtension(1,0);else if(W===213)Y=this.decodeExtension(2,0);else if(W===214)Y=this.decodeExtension(4,0);else if(W===215)Y=this.decodeExtension(8,0);else if(W===216)Y=this.decodeExtension(16,0);else if(W===199){let X=this.lookU8();Y=this.decodeExtension(X,1)}else if(W===200){let X=this.lookU16();Y=this.decodeExtension(X,2)}else if(W===201){let X=this.lookU32();Y=this.decodeExtension(X,4)}else throw new S9(`Unrecognized type byte: ${hU(W)}`);this.complete();let G=this.stack;while(G.length>0){let X=G.top();if(X.type===zH)if(X.array[X.position]=Y,X.position++,X.position===X.size)Y=X.array,G.release(X);else continue W;else if(X.type===NJ){if(Y==="__proto__")throw new S9("The key __proto__ is not allowed");X.key=this.mapKeyConverter(Y),X.type=wD;continue W}else if(X.map[X.key]=Y,X.readCount++,X.readCount===X.size)Y=X.map,G.release(X);else{X.key=null,X.type=NJ;continue W}}return Y}}readHeadByte(){if(this.headByte===QJ)this.headByte=this.readU8();return this.headByte}complete(){this.headByte=QJ}readArraySize(){let W=this.readHeadByte();switch(W){case 220:return this.readU16();case 221:return this.readU32();default:if(W<160)return W-144;else throw new S9(`Unrecognized array type byte: ${hU(W)}`)}}pushMapState(W){if(W>this.maxMapLength)throw new S9(`Max length exceeded: map length (${W}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(W)}pushArrayState(W){if(W>this.maxArrayLength)throw new S9(`Max length exceeded: array length (${W}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(W)}decodeString(W,Y){if(!this.rawStrings||this.stateIsMapKey())return this.decodeUtf8String(W,Y);return this.decodeBinary(W,Y)}decodeUtf8String(W,Y){if(W>this.maxStrLength)throw new S9(`Max length exceeded: UTF-8 byte length (${W}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+Y+W)throw ID;let G=this.pos+Y,X;if(this.stateIsMapKey()&&this.keyDecoder?.canBeCached(W))X=this.keyDecoder.decode(this.bytes,G,W);else X=qD(this.bytes,G,W);return this.pos+=Y+W,X}stateIsMapKey(){if(this.stack.length>0)return this.stack.top().type===NJ;return!1}decodeBinary(W,Y){if(W>this.maxBinLength)throw new S9(`Max length exceeded: bin length (${W}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(W+Y))throw ID;let G=this.pos+Y,X=this.bytes.subarray(G,G+W);return this.pos+=Y+W,X}decodeExtension(W,Y){if(W>this.maxExtLength)throw new S9(`Max length exceeded: ext length (${W}) > maxExtLength (${this.maxExtLength})`);let G=this.view.getInt8(this.pos+Y),X=this.decodeBinary(W,Y+1);return this.extensionCodec.decode(X,G,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let W=this.view.getUint8(this.pos);return this.pos++,W}readI8(){let W=this.view.getInt8(this.pos);return this.pos++,W}readU16(){let W=this.view.getUint16(this.pos);return this.pos+=2,W}readI16(){let W=this.view.getInt16(this.pos);return this.pos+=2,W}readU32(){let W=this.view.getUint32(this.pos);return this.pos+=4,W}readI32(){let W=this.view.getInt32(this.pos);return this.pos+=4,W}readU64(){let W=HD(this.view,this.pos);return this.pos+=8,W}readI64(){let W=vU(this.view,this.pos);return this.pos+=8,W}readU64AsBigInt(){let W=this.view.getBigUint64(this.pos);return this.pos+=8,W}readI64AsBigInt(){let W=this.view.getBigInt64(this.pos);return this.pos+=8,W}readF32(){let W=this.view.getFloat32(this.pos);return this.pos+=4,W}readF64(){let W=this.view.getFloat64(this.pos);return this.pos+=8,W}}function AW(W,Y){return new bU(Y).decode(W)}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function sY(W){let Y=W.length;while(--Y>=0)W[Y]=0}var Qy=0,YC=1,Ny=2,qy=3,Ay=258,hH=29,PJ=256,jJ=PJ+1+hH,iY=30,bH=19,GC=2*jJ+1,HW=15,wH=16,Hy=7,mH=256,XC=16,JC=17,ZC=18,FH=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),dU=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),zy=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),VC=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Iy=512,t7=Array((jJ+2)*2);sY(t7);var zJ=Array(iY*2);sY(zJ);var KJ=Array(Iy);sY(KJ);var OJ=Array(Ay-qy+1);sY(OJ);var fH=Array(hH);sY(fH);var oU=Array(iY);sY(oU);function jH(W,Y,G,X,J){this.static_tree=W,this.extra_bits=Y,this.extra_base=G,this.elems=X,this.max_length=J,this.has_stree=W&&W.length}var UC,QC,NC;function KH(W,Y){this.dyn_tree=W,this.max_code=0,this.stat_desc=Y}var qC=(W)=>{return W<256?KJ[W]:KJ[256+(W>>>7)]},DJ=(W,Y)=>{W.pending_buf[W.pending++]=Y&255,W.pending_buf[W.pending++]=Y>>>8&255},h9=(W,Y,G)=>{if(W.bi_valid>wH-G)W.bi_buf|=Y<<W.bi_valid&65535,DJ(W,W.bi_buf),W.bi_buf=Y>>wH-W.bi_valid,W.bi_valid+=G-wH;else W.bi_buf|=Y<<W.bi_valid&65535,W.bi_valid+=G},q7=(W,Y,G)=>{h9(W,G[Y*2],G[Y*2+1])},AC=(W,Y)=>{let G=0;do G|=W&1,W>>>=1,G<<=1;while(--Y>0);return G>>>1},wy=(W)=>{if(W.bi_valid===16)DJ(W,W.bi_buf),W.bi_buf=0,W.bi_valid=0;else if(W.bi_valid>=8)W.pending_buf[W.pending++]=W.bi_buf&255,W.bi_buf>>=8,W.bi_valid-=8},jy=(W,Y)=>{let{dyn_tree:G,max_code:X}=Y,J=Y.stat_desc.static_tree,Z=Y.stat_desc.has_stree,V=Y.stat_desc.extra_bits,U=Y.stat_desc.extra_base,Q=Y.stat_desc.max_length,N,q,H,A,I,w,O=0;for(A=0;A<=HW;A++)W.bl_count[A]=0;G[W.heap[W.heap_max]*2+1]=0;for(N=W.heap_max+1;N<GC;N++){if(q=W.heap[N],A=G[G[q*2+1]*2+1]+1,A>Q)A=Q,O++;if(G[q*2+1]=A,q>X)continue;if(W.bl_count[A]++,I=0,q>=U)I=V[q-U];if(w=G[q*2],W.opt_len+=w*(A+I),Z)W.static_len+=w*(J[q*2+1]+I)}if(O===0)return;do{A=Q-1;while(W.bl_count[A]===0)A--;W.bl_count[A]--,W.bl_count[A+1]+=2,W.bl_count[Q]--,O-=2}while(O>0);for(A=Q;A!==0;A--){q=W.bl_count[A];while(q!==0){if(H=W.heap[--N],H>X)continue;if(G[H*2+1]!==A)W.opt_len+=(A-G[H*2+1])*G[H*2],G[H*2+1]=A;q--}}},HC=(W,Y,G)=>{let X=Array(HW+1),J=0,Z,V;for(Z=1;Z<=HW;Z++)J=J+G[Z-1]<<1,X[Z]=J;for(V=0;V<=Y;V++){let U=W[V*2+1];if(U===0)continue;W[V*2]=AC(X[U]++,U)}},Ky=()=>{let W,Y,G,X,J,Z=Array(HW+1);G=0;for(X=0;X<hH-1;X++){fH[X]=G;for(W=0;W<1<<FH[X];W++)OJ[G++]=X}OJ[G-1]=X,J=0;for(X=0;X<16;X++){oU[X]=J;for(W=0;W<1<<dU[X];W++)KJ[J++]=X}J>>=7;for(;X<iY;X++){oU[X]=J<<7;for(W=0;W<1<<dU[X]-7;W++)KJ[256+J++]=X}for(Y=0;Y<=HW;Y++)Z[Y]=0;W=0;while(W<=143)t7[W*2+1]=8,W++,Z[8]++;while(W<=255)t7[W*2+1]=9,W++,Z[9]++;while(W<=279)t7[W*2+1]=7,W++,Z[7]++;while(W<=287)t7[W*2+1]=8,W++,Z[8]++;HC(t7,jJ+1,Z);for(W=0;W<iY;W++)zJ[W*2+1]=5,zJ[W*2]=AC(W,5);UC=new jH(t7,FH,PJ+1,jJ,HW),QC=new jH(zJ,dU,0,iY,HW),NC=new jH([],zy,0,bH,Hy)},zC=(W)=>{let Y;for(Y=0;Y<jJ;Y++)W.dyn_ltree[Y*2]=0;for(Y=0;Y<iY;Y++)W.dyn_dtree[Y*2]=0;for(Y=0;Y<bH;Y++)W.bl_tree[Y*2]=0;W.dyn_ltree[mH*2]=1,W.opt_len=W.static_len=0,W.sym_next=W.matches=0},IC=(W)=>{if(W.bi_valid>8)DJ(W,W.bi_buf);else if(W.bi_valid>0)W.pending_buf[W.pending++]=W.bi_buf;W.bi_buf=0,W.bi_valid=0},KD=(W,Y,G,X)=>{let J=Y*2,Z=G*2;return W[J]<W[Z]||W[J]===W[Z]&&X[Y]<=X[G]},OH=(W,Y,G)=>{let X=W.heap[G],J=G<<1;while(J<=W.heap_len){if(J<W.heap_len&&KD(Y,W.heap[J+1],W.heap[J],W.depth))J++;if(KD(Y,X,W.heap[J],W.depth))break;W.heap[G]=W.heap[J],G=J,J<<=1}W.heap[G]=X},OD=(W,Y,G)=>{let X,J,Z=0,V,U;if(W.sym_next!==0)do if(X=W.pending_buf[W.sym_buf+Z++]&255,X+=(W.pending_buf[W.sym_buf+Z++]&255)<<8,J=W.pending_buf[W.sym_buf+Z++],X===0)q7(W,J,Y);else{if(V=OJ[J],q7(W,V+PJ+1,Y),U=FH[V],U!==0)J-=fH[V],h9(W,J,U);if(X--,V=qC(X),q7(W,V,G),U=dU[V],U!==0)X-=oU[V],h9(W,X,U)}while(Z<W.sym_next);q7(W,mH,Y)},SH=(W,Y)=>{let G=Y.dyn_tree,X=Y.stat_desc.static_tree,J=Y.stat_desc.has_stree,Z=Y.stat_desc.elems,V,U,Q=-1,N;W.heap_len=0,W.heap_max=GC;for(V=0;V<Z;V++)if(G[V*2]!==0)W.heap[++W.heap_len]=Q=V,W.depth[V]=0;else G[V*2+1]=0;while(W.heap_len<2)if(N=W.heap[++W.heap_len]=Q<2?++Q:0,G[N*2]=1,W.depth[N]=0,W.opt_len--,J)W.static_len-=X[N*2+1];Y.max_code=Q;for(V=W.heap_len>>1;V>=1;V--)OH(W,G,V);N=Z;do V=W.heap[1],W.heap[1]=W.heap[W.heap_len--],OH(W,G,1),U=W.heap[1],W.heap[--W.heap_max]=V,W.heap[--W.heap_max]=U,G[N*2]=G[V*2]+G[U*2],W.depth[N]=(W.depth[V]>=W.depth[U]?W.depth[V]:W.depth[U])+1,G[V*2+1]=G[U*2+1]=N,W.heap[1]=N++,OH(W,G,1);while(W.heap_len>=2);W.heap[--W.heap_max]=W.heap[1],jy(W,Y),HC(G,Q,W.bl_count)},DD=(W,Y,G)=>{let X,J=-1,Z,V=Y[1],U=0,Q=7,N=4;if(V===0)Q=138,N=3;Y[(G+1)*2+1]=65535;for(X=0;X<=G;X++){if(Z=V,V=Y[(X+1)*2+1],++U<Q&&Z===V)continue;else if(U<N)W.bl_tree[Z*2]+=U;else if(Z!==0){if(Z!==J)W.bl_tree[Z*2]++;W.bl_tree[XC*2]++}else if(U<=10)W.bl_tree[JC*2]++;else W.bl_tree[ZC*2]++;if(U=0,J=Z,V===0)Q=138,N=3;else if(Z===V)Q=6,N=3;else Q=7,N=4}},CD=(W,Y,G)=>{let X,J=-1,Z,V=Y[1],U=0,Q=7,N=4;if(V===0)Q=138,N=3;for(X=0;X<=G;X++){if(Z=V,V=Y[(X+1)*2+1],++U<Q&&Z===V)continue;else if(U<N)do q7(W,Z,W.bl_tree);while(--U!==0);else if(Z!==0){if(Z!==J)q7(W,Z,W.bl_tree),U--;q7(W,XC,W.bl_tree),h9(W,U-3,2)}else if(U<=10)q7(W,JC,W.bl_tree),h9(W,U-3,3);else q7(W,ZC,W.bl_tree),h9(W,U-11,7);if(U=0,J=Z,V===0)Q=138,N=3;else if(Z===V)Q=6,N=3;else Q=7,N=4}},Oy=(W)=>{let Y;DD(W,W.dyn_ltree,W.l_desc.max_code),DD(W,W.dyn_dtree,W.d_desc.max_code),SH(W,W.bl_desc);for(Y=bH-1;Y>=3;Y--)if(W.bl_tree[VC[Y]*2+1]!==0)break;return W.opt_len+=3*(Y+1)+5+5+4,Y},Dy=(W,Y,G,X)=>{let J;h9(W,Y-257,5),h9(W,G-1,5),h9(W,X-4,4);for(J=0;J<X;J++)h9(W,W.bl_tree[VC[J]*2+1],3);CD(W,W.dyn_ltree,Y-1),CD(W,W.dyn_dtree,G-1)},Cy=(W)=>{let Y=4093624447,G;for(G=0;G<=31;G++,Y>>>=1)if(Y&1&&W.dyn_ltree[G*2]!==0)return 0;if(W.dyn_ltree[18]!==0||W.dyn_ltree[20]!==0||W.dyn_ltree[26]!==0)return 1;for(G=32;G<PJ;G++)if(W.dyn_ltree[G*2]!==0)return 1;return 0},TD=!1,Ty=(W)=>{if(!TD)Ky(),TD=!0;W.l_desc=new KH(W.dyn_ltree,UC),W.d_desc=new KH(W.dyn_dtree,QC),W.bl_desc=new KH(W.bl_tree,NC),W.bi_buf=0,W.bi_valid=0,zC(W)},wC=(W,Y,G,X)=>{if(h9(W,(Qy<<1)+(X?1:0),3),IC(W),DJ(W,G),DJ(W,~G),G)W.pending_buf.set(W.window.subarray(Y,Y+G),W.pending);W.pending+=G},My=(W)=>{h9(W,YC<<1,3),q7(W,mH,t7),wy(W)},Ry=(W,Y,G,X)=>{let J,Z,V=0;if(W.level>0){if(W.strm.data_type===2)W.strm.data_type=Cy(W);if(SH(W,W.l_desc),SH(W,W.d_desc),V=Oy(W),J=W.opt_len+3+7>>>3,Z=W.static_len+3+7>>>3,Z<=J)J=Z}else J=Z=G+5;if(G+4<=J&&Y!==-1)wC(W,Y,G,X);else if(W.strategy===4||Z===J)h9(W,(YC<<1)+(X?1:0),3),OD(W,t7,zJ);else h9(W,(Ny<<1)+(X?1:0),3),Dy(W,W.l_desc.max_code+1,W.d_desc.max_code+1,V+1),OD(W,W.dyn_ltree,W.dyn_dtree);if(zC(W),X)IC(W)},Py=(W,Y,G)=>{if(W.pending_buf[W.sym_buf+W.sym_next++]=Y,W.pending_buf[W.sym_buf+W.sym_next++]=Y>>8,W.pending_buf[W.sym_buf+W.sym_next++]=G,Y===0)W.dyn_ltree[G*2]++;else W.matches++,Y--,W.dyn_ltree[(OJ[G]+PJ+1)*2]++,W.dyn_dtree[qC(Y)*2]++;return W.sym_next===W.sym_end},Ly=Ty,By=wC,Ey=Ry,$y=Py,Fy=My,Sy={_tr_init:Ly,_tr_stored_block:By,_tr_flush_block:Ey,_tr_tally:$y,_tr_align:Fy},xy=(W,Y,G,X)=>{let J=W&65535|0,Z=W>>>16&65535|0,V=0;while(G!==0){V=G>2000?2000:G,G-=V;do J=J+Y[X++]|0,Z=Z+J|0;while(--V);J%=65521,Z%=65521}return J|Z<<16|0},CJ=xy,ky=()=>{let W,Y=[];for(var G=0;G<256;G++){W=G;for(var X=0;X<8;X++)W=W&1?3988292384^W>>>1:W>>>1;Y[G]=W}return Y},_y=new Uint32Array(ky()),yy=(W,Y,G,X)=>{let J=_y,Z=X+G;W^=-1;for(let V=X;V<Z;V++)W=W>>>8^J[(W^Y[V])&255];return W^-1},n8=yy,wW={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},OW={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:vy,_tr_stored_block:xH,_tr_flush_block:gy,_tr_tally:V6,_tr_align:uy}=Sy,{Z_NO_FLUSH:U6,Z_PARTIAL_FLUSH:hy,Z_FULL_FLUSH:by,Z_FINISH:j5,Z_BLOCK:MD,Z_OK:e8,Z_STREAM_END:RD,Z_STREAM_ERROR:A7,Z_DATA_ERROR:my,Z_BUF_ERROR:DH,Z_DEFAULT_COMPRESSION:fy,Z_FILTERED:cy,Z_HUFFMAN_ONLY:mU,Z_RLE:py,Z_FIXED:ly,Z_DEFAULT_STRATEGY:dy,Z_UNKNOWN:oy,Z_DEFLATED:rU}=OW,ny=9,iy=15,ry=8,ay=29,sy=256,kH=sy+1+ay,ty=30,ey=19,Wv=2*kH+1,Yv=15,g1=3,Z6=258,H7=Z6+g1+1,Gv=32,rY=42,cH=57,_H=69,yH=73,vH=91,gH=103,zW=113,AJ=666,x9=1,tY=2,jW=3,eY=4,Xv=3,IW=(W,Y)=>{return W.msg=wW[Y],Y},PD=(W)=>{return W*2-(W>4?9:0)},J6=(W)=>{let Y=W.length;while(--Y>=0)W[Y]=0},Jv=(W)=>{let Y,G,X,J=W.w_size;Y=W.hash_size,X=Y;do G=W.head[--X],W.head[X]=G>=J?G-J:0;while(--Y);Y=J,X=Y;do G=W.prev[--X],W.prev[X]=G>=J?G-J:0;while(--Y)},Zv=(W,Y,G)=>(Y<<W.hash_shift^G)&W.hash_mask,Q6=Zv,W5=(W)=>{let Y=W.state,G=Y.pending;if(G>W.avail_out)G=W.avail_out;if(G===0)return;if(W.output.set(Y.pending_buf.subarray(Y.pending_out,Y.pending_out+G),W.next_out),W.next_out+=G,Y.pending_out+=G,W.total_out+=G,W.avail_out-=G,Y.pending-=G,Y.pending===0)Y.pending_out=0},Y5=(W,Y)=>{gy(W,W.block_start>=0?W.block_start:-1,W.strstart-W.block_start,Y),W.block_start=W.strstart,W5(W.strm)},i1=(W,Y)=>{W.pending_buf[W.pending++]=Y},qJ=(W,Y)=>{W.pending_buf[W.pending++]=Y>>>8&255,W.pending_buf[W.pending++]=Y&255},uH=(W,Y,G,X)=>{let J=W.avail_in;if(J>X)J=X;if(J===0)return 0;if(W.avail_in-=J,Y.set(W.input.subarray(W.next_in,W.next_in+J),G),W.state.wrap===1)W.adler=CJ(W.adler,Y,J,G);else if(W.state.wrap===2)W.adler=n8(W.adler,Y,J,G);return W.next_in+=J,W.total_in+=J,J},jC=(W,Y)=>{let{max_chain_length:G,strstart:X}=W,J,Z,V=W.prev_length,U=W.nice_match,Q=W.strstart>W.w_size-H7?W.strstart-(W.w_size-H7):0,N=W.window,q=W.w_mask,H=W.prev,A=W.strstart+Z6,I=N[X+V-1],w=N[X+V];if(W.prev_length>=W.good_match)G>>=2;if(U>W.lookahead)U=W.lookahead;do{if(J=Y,N[J+V]!==w||N[J+V-1]!==I||N[J]!==N[X]||N[++J]!==N[X+1])continue;X+=2,J++;do;while(N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&X<A);if(Z=Z6-(A-X),X=A-Z6,Z>V){if(W.match_start=Y,V=Z,Z>=U)break;I=N[X+V-1],w=N[X+V]}}while((Y=H[Y&q])>Q&&--G!==0);if(V<=W.lookahead)return V;return W.lookahead},aY=(W)=>{let Y=W.w_size,G,X,J;do{if(X=W.window_size-W.lookahead-W.strstart,W.strstart>=Y+(Y-H7)){if(W.window.set(W.window.subarray(Y,Y+Y-X),0),W.match_start-=Y,W.strstart-=Y,W.block_start-=Y,W.insert>W.strstart)W.insert=W.strstart;Jv(W),X+=Y}if(W.strm.avail_in===0)break;if(G=uH(W.strm,W.window,W.strstart+W.lookahead,X),W.lookahead+=G,W.lookahead+W.insert>=g1){J=W.strstart-W.insert,W.ins_h=W.window[J],W.ins_h=Q6(W,W.ins_h,W.window[J+1]);while(W.insert)if(W.ins_h=Q6(W,W.ins_h,W.window[J+g1-1]),W.prev[J&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=J,J++,W.insert--,W.lookahead+W.insert<g1)break}}while(W.lookahead<H7&&W.strm.avail_in!==0)},KC=(W,Y)=>{let G=W.pending_buf_size-5>W.w_size?W.w_size:W.pending_buf_size-5,X,J,Z,V=0,U=W.strm.avail_in;do{if(X=65535,Z=W.bi_valid+42>>3,W.strm.avail_out<Z)break;if(Z=W.strm.avail_out-Z,J=W.strstart-W.block_start,X>J+W.strm.avail_in)X=J+W.strm.avail_in;if(X>Z)X=Z;if(X<G&&(X===0&&Y!==j5||Y===U6||X!==J+W.strm.avail_in))break;if(V=Y===j5&&X===J+W.strm.avail_in?1:0,xH(W,0,0,V),W.pending_buf[W.pending-4]=X,W.pending_buf[W.pending-3]=X>>8,W.pending_buf[W.pending-2]=~X,W.pending_buf[W.pending-1]=~X>>8,W5(W.strm),J){if(J>X)J=X;W.strm.output.set(W.window.subarray(W.block_start,W.block_start+J),W.strm.next_out),W.strm.next_out+=J,W.strm.avail_out-=J,W.strm.total_out+=J,W.block_start+=J,X-=J}if(X)uH(W.strm,W.strm.output,W.strm.next_out,X),W.strm.next_out+=X,W.strm.avail_out-=X,W.strm.total_out+=X}while(V===0);if(U-=W.strm.avail_in,U){if(U>=W.w_size)W.matches=2,W.window.set(W.strm.input.subarray(W.strm.next_in-W.w_size,W.strm.next_in),0),W.strstart=W.w_size,W.insert=W.strstart;else{if(W.window_size-W.strstart<=U){if(W.strstart-=W.w_size,W.window.set(W.window.subarray(W.w_size,W.w_size+W.strstart),0),W.matches<2)W.matches++;if(W.insert>W.strstart)W.insert=W.strstart}W.window.set(W.strm.input.subarray(W.strm.next_in-U,W.strm.next_in),W.strstart),W.strstart+=U,W.insert+=U>W.w_size-W.insert?W.w_size-W.insert:U}W.block_start=W.strstart}if(W.high_water<W.strstart)W.high_water=W.strstart;if(V)return eY;if(Y!==U6&&Y!==j5&&W.strm.avail_in===0&&W.strstart===W.block_start)return tY;if(Z=W.window_size-W.strstart,W.strm.avail_in>Z&&W.block_start>=W.w_size){if(W.block_start-=W.w_size,W.strstart-=W.w_size,W.window.set(W.window.subarray(W.w_size,W.w_size+W.strstart),0),W.matches<2)W.matches++;if(Z+=W.w_size,W.insert>W.strstart)W.insert=W.strstart}if(Z>W.strm.avail_in)Z=W.strm.avail_in;if(Z)uH(W.strm,W.window,W.strstart,Z),W.strstart+=Z,W.insert+=Z>W.w_size-W.insert?W.w_size-W.insert:Z;if(W.high_water<W.strstart)W.high_water=W.strstart;if(Z=W.bi_valid+42>>3,Z=W.pending_buf_size-Z>65535?65535:W.pending_buf_size-Z,G=Z>W.w_size?W.w_size:Z,J=W.strstart-W.block_start,J>=G||(J||Y===j5)&&Y!==U6&&W.strm.avail_in===0&&J<=Z)X=J>Z?Z:J,V=Y===j5&&W.strm.avail_in===0&&X===J?1:0,xH(W,W.block_start,X,V),W.block_start+=X,W5(W.strm);return V?jW:x9},CH=(W,Y)=>{let G,X;for(;;){if(W.lookahead<H7){if(aY(W),W.lookahead<H7&&Y===U6)return x9;if(W.lookahead===0)break}if(G=0,W.lookahead>=g1)W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;if(G!==0&&W.strstart-G<=W.w_size-H7)W.match_length=jC(W,G);if(W.match_length>=g1)if(X=V6(W,W.strstart-W.match_start,W.match_length-g1),W.lookahead-=W.match_length,W.match_length<=W.max_lazy_match&&W.lookahead>=g1){W.match_length--;do W.strstart++,W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;while(--W.match_length!==0);W.strstart++}else W.strstart+=W.match_length,W.match_length=0,W.ins_h=W.window[W.strstart],W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+1]);else X=V6(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++;if(X){if(Y5(W,!1),W.strm.avail_out===0)return x9}}if(W.insert=W.strstart<g1-1?W.strstart:g1-1,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY},oY=(W,Y)=>{let G,X,J;for(;;){if(W.lookahead<H7){if(aY(W),W.lookahead<H7&&Y===U6)return x9;if(W.lookahead===0)break}if(G=0,W.lookahead>=g1)W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;if(W.prev_length=W.match_length,W.prev_match=W.match_start,W.match_length=g1-1,G!==0&&W.prev_length<W.max_lazy_match&&W.strstart-G<=W.w_size-H7){if(W.match_length=jC(W,G),W.match_length<=5&&(W.strategy===cy||W.match_length===g1&&W.strstart-W.match_start>4096))W.match_length=g1-1}if(W.prev_length>=g1&&W.match_length<=W.prev_length){J=W.strstart+W.lookahead-g1,X=V6(W,W.strstart-1-W.prev_match,W.prev_length-g1),W.lookahead-=W.prev_length-1,W.prev_length-=2;do if(++W.strstart<=J)W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;while(--W.prev_length!==0);if(W.match_available=0,W.match_length=g1-1,W.strstart++,X){if(Y5(W,!1),W.strm.avail_out===0)return x9}}else if(W.match_available){if(X=V6(W,0,W.window[W.strstart-1]),X)Y5(W,!1);if(W.strstart++,W.lookahead--,W.strm.avail_out===0)return x9}else W.match_available=1,W.strstart++,W.lookahead--}if(W.match_available)X=V6(W,0,W.window[W.strstart-1]),W.match_available=0;if(W.insert=W.strstart<g1-1?W.strstart:g1-1,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY},Vv=(W,Y)=>{let G,X,J,Z,V=W.window;for(;;){if(W.lookahead<=Z6){if(aY(W),W.lookahead<=Z6&&Y===U6)return x9;if(W.lookahead===0)break}if(W.match_length=0,W.lookahead>=g1&&W.strstart>0){if(J=W.strstart-1,X=V[J],X===V[++J]&&X===V[++J]&&X===V[++J]){Z=W.strstart+Z6;do;while(X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&J<Z);if(W.match_length=Z6-(Z-J),W.match_length>W.lookahead)W.match_length=W.lookahead}}if(W.match_length>=g1)G=V6(W,1,W.match_length-g1),W.lookahead-=W.match_length,W.strstart+=W.match_length,W.match_length=0;else G=V6(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++;if(G){if(Y5(W,!1),W.strm.avail_out===0)return x9}}if(W.insert=0,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY},Uv=(W,Y)=>{let G;for(;;){if(W.lookahead===0){if(aY(W),W.lookahead===0){if(Y===U6)return x9;break}}if(W.match_length=0,G=V6(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++,G){if(Y5(W,!1),W.strm.avail_out===0)return x9}}if(W.insert=0,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY};function N7(W,Y,G,X,J){this.good_length=W,this.max_lazy=Y,this.nice_length=G,this.max_chain=X,this.func=J}var HJ=[new N7(0,0,0,0,KC),new N7(4,4,8,4,CH),new N7(4,5,16,8,CH),new N7(4,6,32,32,CH),new N7(4,4,16,16,oY),new N7(8,16,32,32,oY),new N7(8,16,128,128,oY),new N7(8,32,128,256,oY),new N7(32,128,258,1024,oY),new N7(32,258,258,4096,oY)],Qv=(W)=>{W.window_size=2*W.w_size,J6(W.head),W.max_lazy_match=HJ[W.level].max_lazy,W.good_match=HJ[W.level].good_length,W.nice_match=HJ[W.level].nice_length,W.max_chain_length=HJ[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=g1-1,W.match_available=0,W.ins_h=0};function Nv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rU,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Wv*2),this.dyn_dtree=new Uint16Array((2*ty+1)*2),this.bl_tree=new Uint16Array((2*ey+1)*2),J6(this.dyn_ltree),J6(this.dyn_dtree),J6(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Yv+1),this.heap=new Uint16Array(2*kH+1),J6(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*kH+1),J6(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var LJ=(W)=>{if(!W)return 1;let Y=W.state;if(!Y||Y.strm!==W||Y.status!==rY&&Y.status!==cH&&Y.status!==_H&&Y.status!==yH&&Y.status!==vH&&Y.status!==gH&&Y.status!==zW&&Y.status!==AJ)return 1;return 0},OC=(W)=>{if(LJ(W))return IW(W,A7);W.total_in=W.total_out=0,W.data_type=oy;let Y=W.state;if(Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap===2?cH:Y.wrap?rY:zW,W.adler=Y.wrap===2?0:1,Y.last_flush=-2,vy(Y),e8},DC=(W)=>{let Y=OC(W);if(Y===e8)Qv(W.state);return Y},qv=(W,Y)=>{if(LJ(W)||W.state.wrap!==2)return A7;return W.state.gzhead=Y,e8},CC=(W,Y,G,X,J,Z)=>{if(!W)return A7;let V=1;if(Y===fy)Y=6;if(X<0)V=0,X=-X;else if(X>15)V=2,X-=16;if(J<1||J>ny||G!==rU||X<8||X>15||Y<0||Y>9||Z<0||Z>ly||X===8&&V!==1)return IW(W,A7);if(X===8)X=9;let U=new Nv;return W.state=U,U.strm=W,U.status=rY,U.wrap=V,U.gzhead=null,U.w_bits=X,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=J+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+g1-1)/g1),U.window=new Uint8Array(U.w_size*2),U.head=new Uint16Array(U.hash_size),U.prev=new Uint16Array(U.w_size),U.lit_bufsize=1<<J+6,U.pending_buf_size=U.lit_bufsize*4,U.pending_buf=new Uint8Array(U.pending_buf_size),U.sym_buf=U.lit_bufsize,U.sym_end=(U.lit_bufsize-1)*3,U.level=Y,U.strategy=Z,U.method=G,DC(W)},Av=(W,Y)=>{return CC(W,Y,rU,iy,ry,dy)},Hv=(W,Y)=>{if(LJ(W)||Y>MD||Y<0)return W?IW(W,A7):A7;let G=W.state;if(!W.output||W.avail_in!==0&&!W.input||G.status===AJ&&Y!==j5)return IW(W,W.avail_out===0?DH:A7);let X=G.last_flush;if(G.last_flush=Y,G.pending!==0){if(W5(W),W.avail_out===0)return G.last_flush=-1,e8}else if(W.avail_in===0&&PD(Y)<=PD(X)&&Y!==j5)return IW(W,DH);if(G.status===AJ&&W.avail_in!==0)return IW(W,DH);if(G.status===rY&&G.wrap===0)G.status=zW;if(G.status===rY){let J=rU+(G.w_bits-8<<4)<<8,Z=-1;if(G.strategy>=mU||G.level<2)Z=0;else if(G.level<6)Z=1;else if(G.level===6)Z=2;else Z=3;if(J|=Z<<6,G.strstart!==0)J|=Gv;if(J+=31-J%31,qJ(G,J),G.strstart!==0)qJ(G,W.adler>>>16),qJ(G,W.adler&65535);if(W.adler=1,G.status=zW,W5(W),G.pending!==0)return G.last_flush=-1,e8}if(G.status===cH)if(W.adler=0,i1(G,31),i1(G,139),i1(G,8),!G.gzhead){if(i1(G,0),i1(G,0),i1(G,0),i1(G,0),i1(G,0),i1(G,G.level===9?2:G.strategy>=mU||G.level<2?4:0),i1(G,Xv),G.status=zW,W5(W),G.pending!==0)return G.last_flush=-1,e8}else{if(i1(G,(G.gzhead.text?1:0)+(G.gzhead.hcrc?2:0)+(!G.gzhead.extra?0:4)+(!G.gzhead.name?0:8)+(!G.gzhead.comment?0:16)),i1(G,G.gzhead.time&255),i1(G,G.gzhead.time>>8&255),i1(G,G.gzhead.time>>16&255),i1(G,G.gzhead.time>>24&255),i1(G,G.level===9?2:G.strategy>=mU||G.level<2?4:0),i1(G,G.gzhead.os&255),G.gzhead.extra&&G.gzhead.extra.length)i1(G,G.gzhead.extra.length&255),i1(G,G.gzhead.extra.length>>8&255);if(G.gzhead.hcrc)W.adler=n8(W.adler,G.pending_buf,G.pending,0);G.gzindex=0,G.status=_H}if(G.status===_H){if(G.gzhead.extra){let J=G.pending,Z=(G.gzhead.extra.length&65535)-G.gzindex;while(G.pending+Z>G.pending_buf_size){let U=G.pending_buf_size-G.pending;if(G.pending_buf.set(G.gzhead.extra.subarray(G.gzindex,G.gzindex+U),G.pending),G.pending=G.pending_buf_size,G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);if(G.gzindex+=U,W5(W),G.pending!==0)return G.last_flush=-1,e8;J=0,Z-=U}let V=new Uint8Array(G.gzhead.extra);if(G.pending_buf.set(V.subarray(G.gzindex,G.gzindex+Z),G.pending),G.pending+=Z,G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);G.gzindex=0}G.status=yH}if(G.status===yH){if(G.gzhead.name){let J=G.pending,Z;do{if(G.pending===G.pending_buf_size){if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);if(W5(W),G.pending!==0)return G.last_flush=-1,e8;J=0}if(G.gzindex<G.gzhead.name.length)Z=G.gzhead.name.charCodeAt(G.gzindex++)&255;else Z=0;i1(G,Z)}while(Z!==0);if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);G.gzindex=0}G.status=vH}if(G.status===vH){if(G.gzhead.comment){let J=G.pending,Z;do{if(G.pending===G.pending_buf_size){if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);if(W5(W),G.pending!==0)return G.last_flush=-1,e8;J=0}if(G.gzindex<G.gzhead.comment.length)Z=G.gzhead.comment.charCodeAt(G.gzindex++)&255;else Z=0;i1(G,Z)}while(Z!==0);if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J)}G.status=gH}if(G.status===gH){if(G.gzhead.hcrc){if(G.pending+2>G.pending_buf_size){if(W5(W),G.pending!==0)return G.last_flush=-1,e8}i1(G,W.adler&255),i1(G,W.adler>>8&255),W.adler=0}if(G.status=zW,W5(W),G.pending!==0)return G.last_flush=-1,e8}if(W.avail_in!==0||G.lookahead!==0||Y!==U6&&G.status!==AJ){let J=G.level===0?KC(G,Y):G.strategy===mU?Uv(G,Y):G.strategy===py?Vv(G,Y):HJ[G.level].func(G,Y);if(J===jW||J===eY)G.status=AJ;if(J===x9||J===jW){if(W.avail_out===0)G.last_flush=-1;return e8}if(J===tY){if(Y===hy)uy(G);else if(Y!==MD){if(xH(G,0,0,!1),Y===by){if(J6(G.head),G.lookahead===0)G.strstart=0,G.block_start=0,G.insert=0}}if(W5(W),W.avail_out===0)return G.last_flush=-1,e8}}if(Y!==j5)return e8;if(G.wrap<=0)return RD;if(G.wrap===2)i1(G,W.adler&255),i1(G,W.adler>>8&255),i1(G,W.adler>>16&255),i1(G,W.adler>>24&255),i1(G,W.total_in&255),i1(G,W.total_in>>8&255),i1(G,W.total_in>>16&255),i1(G,W.total_in>>24&255);else qJ(G,W.adler>>>16),qJ(G,W.adler&65535);if(W5(W),G.wrap>0)G.wrap=-G.wrap;return G.pending!==0?e8:RD},zv=(W)=>{if(LJ(W))return A7;let Y=W.state.status;return W.state=null,Y===zW?IW(W,my):e8},Iv=(W,Y)=>{let G=Y.length;if(LJ(W))return A7;let X=W.state,J=X.wrap;if(J===2||J===1&&X.status!==rY||X.lookahead)return A7;if(J===1)W.adler=CJ(W.adler,Y,G,0);if(X.wrap=0,G>=X.w_size){if(J===0)J6(X.head),X.strstart=0,X.block_start=0,X.insert=0;let Q=new Uint8Array(X.w_size);Q.set(Y.subarray(G-X.w_size,G),0),Y=Q,G=X.w_size}let{avail_in:Z,next_in:V,input:U}=W;W.avail_in=G,W.next_in=0,W.input=Y,aY(X);while(X.lookahead>=g1){let Q=X.strstart,N=X.lookahead-(g1-1);do X.ins_h=Q6(X,X.ins_h,X.window[Q+g1-1]),X.prev[Q&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=Q,Q++;while(--N);X.strstart=Q,X.lookahead=g1-1,aY(X)}return X.strstart+=X.lookahead,X.block_start=X.strstart,X.insert=X.lookahead,X.lookahead=0,X.match_length=X.prev_length=g1-1,X.match_available=0,W.next_in=V,W.input=U,W.avail_in=Z,X.wrap=J,e8},wv=Av,jv=CC,Kv=DC,Ov=OC,Dv=qv,Cv=Hv,Tv=zv,Mv=Iv,Rv="pako deflate (from Nodeca project)",IJ={deflateInit:wv,deflateInit2:jv,deflateReset:Kv,deflateResetKeep:Ov,deflateSetHeader:Dv,deflate:Cv,deflateEnd:Tv,deflateSetDictionary:Mv,deflateInfo:Rv},Pv=(W,Y)=>{return Object.prototype.hasOwnProperty.call(W,Y)},Lv=function(W){let Y=Array.prototype.slice.call(arguments,1);while(Y.length){let G=Y.shift();if(!G)continue;if(typeof G!=="object")throw TypeError(G+"must be non-object");for(let X in G)if(Pv(G,X))W[X]=G[X]}return W},Bv=(W)=>{let Y=0;for(let X=0,J=W.length;X<J;X++)Y+=W[X].length;let G=new Uint8Array(Y);for(let X=0,J=0,Z=W.length;X<Z;X++){let V=W[X];G.set(V,J),J+=V.length}return G},aU={assign:Lv,flattenChunks:Bv},TC=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(W){TC=!1}var TJ=new Uint8Array(256);for(let W=0;W<256;W++)TJ[W]=W>=252?6:W>=248?5:W>=240?4:W>=224?3:W>=192?2:1;TJ[254]=TJ[254]=1;var Ev=(W)=>{if(typeof TextEncoder==="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(W);let Y,G,X,J,Z,V=W.length,U=0;for(J=0;J<V;J++){if(G=W.charCodeAt(J),(G&64512)===55296&&J+1<V){if(X=W.charCodeAt(J+1),(X&64512)===56320)G=65536+(G-55296<<10)+(X-56320),J++}U+=G<128?1:G<2048?2:G<65536?3:4}Y=new Uint8Array(U);for(Z=0,J=0;Z<U;J++){if(G=W.charCodeAt(J),(G&64512)===55296&&J+1<V){if(X=W.charCodeAt(J+1),(X&64512)===56320)G=65536+(G-55296<<10)+(X-56320),J++}if(G<128)Y[Z++]=G;else if(G<2048)Y[Z++]=192|G>>>6,Y[Z++]=128|G&63;else if(G<65536)Y[Z++]=224|G>>>12,Y[Z++]=128|G>>>6&63,Y[Z++]=128|G&63;else Y[Z++]=240|G>>>18,Y[Z++]=128|G>>>12&63,Y[Z++]=128|G>>>6&63,Y[Z++]=128|G&63}return Y},$v=(W,Y)=>{if(Y<65534){if(W.subarray&&TC)return String.fromCharCode.apply(null,W.length===Y?W:W.subarray(0,Y))}let G="";for(let X=0;X<Y;X++)G+=String.fromCharCode(W[X]);return G},Fv=(W,Y)=>{let G=Y||W.length;if(typeof TextDecoder==="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(W.subarray(0,Y));let X,J,Z=Array(G*2);for(J=0,X=0;X<G;){let V=W[X++];if(V<128){Z[J++]=V;continue}let U=TJ[V];if(U>4){Z[J++]=65533,X+=U-1;continue}V&=U===2?31:U===3?15:7;while(U>1&&X<G)V=V<<6|W[X++]&63,U--;if(U>1){Z[J++]=65533;continue}if(V<65536)Z[J++]=V;else V-=65536,Z[J++]=55296|V>>10&1023,Z[J++]=56320|V&1023}return $v(Z,J)},Sv=(W,Y)=>{if(Y=Y||W.length,Y>W.length)Y=W.length;let G=Y-1;while(G>=0&&(W[G]&192)===128)G--;if(G<0)return Y;if(G===0)return Y;return G+TJ[W[G]]>Y?G:Y},MJ={string2buf:Ev,buf2string:Fv,utf8border:Sv};function xv(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var MC=xv,RC=Object.prototype.toString,{Z_NO_FLUSH:kv,Z_SYNC_FLUSH:_v,Z_FULL_FLUSH:yv,Z_FINISH:vv,Z_OK:nU,Z_STREAM_END:gv,Z_DEFAULT_COMPRESSION:uv,Z_DEFAULT_STRATEGY:hv,Z_DEFLATED:bv}=OW;function BJ(W){this.options=aU.assign({level:uv,method:bv,chunkSize:16384,windowBits:15,memLevel:8,strategy:hv},W||{});let Y=this.options;if(Y.raw&&Y.windowBits>0)Y.windowBits=-Y.windowBits;else if(Y.gzip&&Y.windowBits>0&&Y.windowBits<16)Y.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new MC,this.strm.avail_out=0;let G=IJ.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(G!==nU)throw Error(wW[G]);if(Y.header)IJ.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){let X;if(typeof Y.dictionary==="string")X=MJ.string2buf(Y.dictionary);else if(RC.call(Y.dictionary)==="[object ArrayBuffer]")X=new Uint8Array(Y.dictionary);else X=Y.dictionary;if(G=IJ.deflateSetDictionary(this.strm,X),G!==nU)throw Error(wW[G]);this._dict_set=!0}}BJ.prototype.push=function(W,Y){let G=this.strm,X=this.options.chunkSize,J,Z;if(this.ended)return!1;if(Y===~~Y)Z=Y;else Z=Y===!0?vv:kv;if(typeof W==="string")G.input=MJ.string2buf(W);else if(RC.call(W)==="[object ArrayBuffer]")G.input=new Uint8Array(W);else G.input=W;G.next_in=0,G.avail_in=G.input.length;for(;;){if(G.avail_out===0)G.output=new Uint8Array(X),G.next_out=0,G.avail_out=X;if((Z===_v||Z===yv)&&G.avail_out<=6){this.onData(G.output.subarray(0,G.next_out)),G.avail_out=0;continue}if(J=IJ.deflate(G,Z),J===gv){if(G.next_out>0)this.onData(G.output.subarray(0,G.next_out));return J=IJ.deflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===nU}if(G.avail_out===0){this.onData(G.output);continue}if(Z>0&&G.next_out>0){this.onData(G.output.subarray(0,G.next_out)),G.avail_out=0;continue}if(G.avail_in===0)break}return!0};BJ.prototype.onData=function(W){this.chunks.push(W)};BJ.prototype.onEnd=function(W){if(W===nU)this.result=aU.flattenChunks(this.chunks);this.chunks=[],this.err=W,this.msg=this.strm.msg};function pH(W,Y){let G=new BJ(Y);if(G.push(W,!0),G.err)throw G.msg||wW[G.err];return G.result}function mv(W,Y){return Y=Y||{},Y.raw=!0,pH(W,Y)}function fv(W,Y){return Y=Y||{},Y.gzip=!0,pH(W,Y)}var cv=BJ,pv=pH,lv=mv,dv=fv,ov=OW,nv={Deflate:cv,deflate:pv,deflateRaw:lv,gzip:dv,constants:ov},fU=16209,iv=16191,rv=function(Y,G){let X,J,Z,V,U,Q,N,q,H,A,I,w,O,M,S,g,c,u,p,h,f,t,b,J0,I0=Y.state;X=Y.next_in,b=Y.input,J=X+(Y.avail_in-5),Z=Y.next_out,J0=Y.output,V=Z-(G-Y.avail_out),U=Z+(Y.avail_out-257),Q=I0.dmax,N=I0.wsize,q=I0.whave,H=I0.wnext,A=I0.window,I=I0.hold,w=I0.bits,O=I0.lencode,M=I0.distcode,S=(1<<I0.lenbits)-1,g=(1<<I0.distbits)-1;W:do{if(w<15)I+=b[X++]<<w,w+=8,I+=b[X++]<<w,w+=8;c=O[I&S];Y:for(;;){if(u=c>>>24,I>>>=u,w-=u,u=c>>>16&255,u===0)J0[Z++]=c&65535;else if(u&16){if(p=c&65535,u&=15,u){if(w<u)I+=b[X++]<<w,w+=8;p+=I&(1<<u)-1,I>>>=u,w-=u}if(w<15)I+=b[X++]<<w,w+=8,I+=b[X++]<<w,w+=8;c=M[I&g];G:for(;;){if(u=c>>>24,I>>>=u,w-=u,u=c>>>16&255,u&16){if(h=c&65535,u&=15,w<u){if(I+=b[X++]<<w,w+=8,w<u)I+=b[X++]<<w,w+=8}if(h+=I&(1<<u)-1,h>Q){Y.msg="invalid distance too far back",I0.mode=fU;break W}if(I>>>=u,w-=u,u=Z-V,h>u){if(u=h-u,u>q){if(I0.sane){Y.msg="invalid distance too far back",I0.mode=fU;break W}}if(f=0,t=A,H===0){if(f+=N-u,u<p){p-=u;do J0[Z++]=A[f++];while(--u);f=Z-h,t=J0}}else if(H<u){if(f+=N+H-u,u-=H,u<p){p-=u;do J0[Z++]=A[f++];while(--u);if(f=0,H<p){u=H,p-=u;do J0[Z++]=A[f++];while(--u);f=Z-h,t=J0}}}else if(f+=H-u,u<p){p-=u;do J0[Z++]=A[f++];while(--u);f=Z-h,t=J0}while(p>2)J0[Z++]=t[f++],J0[Z++]=t[f++],J0[Z++]=t[f++],p-=3;if(p){if(J0[Z++]=t[f++],p>1)J0[Z++]=t[f++]}}else{f=Z-h;do J0[Z++]=J0[f++],J0[Z++]=J0[f++],J0[Z++]=J0[f++],p-=3;while(p>2);if(p){if(J0[Z++]=J0[f++],p>1)J0[Z++]=J0[f++]}}}else if((u&64)===0){c=M[(c&65535)+(I&(1<<u)-1)];continue G}else{Y.msg="invalid distance code",I0.mode=fU;break W}break}}else if((u&64)===0){c=O[(c&65535)+(I&(1<<u)-1)];continue Y}else if(u&32){I0.mode=iv;break W}else{Y.msg="invalid literal/length code",I0.mode=fU;break W}break}}while(X<J&&Z<U);p=w>>3,X-=p,w-=p<<3,I&=(1<<w)-1,Y.next_in=X,Y.next_out=Z,Y.avail_in=X<J?5+(J-X):5-(X-J),Y.avail_out=Z<U?257+(U-Z):257-(Z-U),I0.hold=I,I0.bits=w;return},nY=15,LD=852,BD=592,ED=0,TH=1,$D=2,av=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),sv=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tv=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ev=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Wg=(W,Y,G,X,J,Z,V,U)=>{let Q=U.bits,N=0,q=0,H=0,A=0,I=0,w=0,O=0,M=0,S=0,g=0,c,u,p,h,f,t=null,b,J0=new Uint16Array(nY+1),I0=new Uint16Array(nY+1),k=null,l,P,B;for(N=0;N<=nY;N++)J0[N]=0;for(q=0;q<X;q++)J0[Y[G+q]]++;I=Q;for(A=nY;A>=1;A--)if(J0[A]!==0)break;if(I>A)I=A;if(A===0)return J[Z++]=20971520,J[Z++]=20971520,U.bits=1,0;for(H=1;H<A;H++)if(J0[H]!==0)break;if(I<H)I=H;M=1;for(N=1;N<=nY;N++)if(M<<=1,M-=J0[N],M<0)return-1;if(M>0&&(W===ED||A!==1))return-1;I0[1]=0;for(N=1;N<nY;N++)I0[N+1]=I0[N]+J0[N];for(q=0;q<X;q++)if(Y[G+q]!==0)V[I0[Y[G+q]]++]=q;if(W===ED)t=k=V,b=20;else if(W===TH)t=av,k=sv,b=257;else t=tv,k=ev,b=0;if(g=0,q=0,N=H,f=Z,w=I,O=0,p=-1,S=1<<I,h=S-1,W===TH&&S>LD||W===$D&&S>BD)return 1;for(;;){if(l=N-O,V[q]+1<b)P=0,B=V[q];else if(V[q]>=b)P=k[V[q]-b],B=t[V[q]-b];else P=96,B=0;c=1<<N-O,u=1<<w,H=u;do u-=c,J[f+(g>>O)+u]=l<<24|P<<16|B|0;while(u!==0);c=1<<N-1;while(g&c)c>>=1;if(c!==0)g&=c-1,g+=c;else g=0;if(q++,--J0[N]===0){if(N===A)break;N=Y[G+V[q]]}if(N>I&&(g&h)!==p){if(O===0)O=I;f+=H,w=N-O,M=1<<w;while(w+O<A){if(M-=J0[w+O],M<=0)break;w++,M<<=1}if(S+=1<<w,W===TH&&S>LD||W===$D&&S>BD)return 1;p=g&h,J[p]=I<<24|w<<16|f-Z|0}}if(g!==0)J[f+g]=N-O<<24|4194304|0;return U.bits=I,0},wJ=Wg,Yg=0,PC=1,LC=2,{Z_FINISH:FD,Z_BLOCK:Gg,Z_TREES:cU,Z_OK:KW,Z_STREAM_END:Xg,Z_NEED_DICT:Jg,Z_STREAM_ERROR:K5,Z_DATA_ERROR:BC,Z_MEM_ERROR:EC,Z_BUF_ERROR:Zg,Z_DEFLATED:SD}=OW,sU=16180,xD=16181,kD=16182,_D=16183,yD=16184,vD=16185,gD=16186,uD=16187,hD=16188,bD=16189,iU=16190,s7=16191,MH=16192,mD=16193,RH=16194,fD=16195,cD=16196,pD=16197,lD=16198,pU=16199,lU=16200,dD=16201,oD=16202,nD=16203,iD=16204,rD=16205,PH=16206,aD=16207,sD=16208,w8=16209,$C=16210,FC=16211,Vg=852,Ug=592,Qg=15,Ng=Qg,tD=(W)=>{return(W>>>24&255)+(W>>>8&65280)+((W&65280)<<8)+((W&255)<<24)};function qg(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var DW=(W)=>{if(!W)return 1;let Y=W.state;if(!Y||Y.strm!==W||Y.mode<sU||Y.mode>FC)return 1;return 0},SC=(W)=>{if(DW(W))return K5;let Y=W.state;if(W.total_in=W.total_out=Y.total=0,W.msg="",Y.wrap)W.adler=Y.wrap&1;return Y.mode=sU,Y.last=0,Y.havedict=0,Y.flags=-1,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new Int32Array(Vg),Y.distcode=Y.distdyn=new Int32Array(Ug),Y.sane=1,Y.back=-1,KW},xC=(W)=>{if(DW(W))return K5;let Y=W.state;return Y.wsize=0,Y.whave=0,Y.wnext=0,SC(W)},kC=(W,Y)=>{let G;if(DW(W))return K5;let X=W.state;if(Y<0)G=0,Y=-Y;else if(G=(Y>>4)+5,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return K5;if(X.window!==null&&X.wbits!==Y)X.window=null;return X.wrap=G,X.wbits=Y,xC(W)},_C=(W,Y)=>{if(!W)return K5;let G=new qg;W.state=G,G.strm=W,G.window=null,G.mode=sU;let X=kC(W,Y);if(X!==KW)W.state=null;return X},Ag=(W)=>{return _C(W,Ng)},eD=!0,LH,BH,Hg=(W)=>{if(eD){LH=new Int32Array(512),BH=new Int32Array(32);let Y=0;while(Y<144)W.lens[Y++]=8;while(Y<256)W.lens[Y++]=9;while(Y<280)W.lens[Y++]=7;while(Y<288)W.lens[Y++]=8;wJ(PC,W.lens,0,288,LH,0,W.work,{bits:9}),Y=0;while(Y<32)W.lens[Y++]=5;wJ(LC,W.lens,0,32,BH,0,W.work,{bits:5}),eD=!1}W.lencode=LH,W.lenbits=9,W.distcode=BH,W.distbits=5},yC=(W,Y,G,X)=>{let J,Z=W.state;if(Z.window===null)Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new Uint8Array(Z.wsize);if(X>=Z.wsize)Z.window.set(Y.subarray(G-Z.wsize,G),0),Z.wnext=0,Z.whave=Z.wsize;else{if(J=Z.wsize-Z.wnext,J>X)J=X;if(Z.window.set(Y.subarray(G-X,G-X+J),Z.wnext),X-=J,X)Z.window.set(Y.subarray(G-X,G),0),Z.wnext=X,Z.whave=Z.wsize;else{if(Z.wnext+=J,Z.wnext===Z.wsize)Z.wnext=0;if(Z.whave<Z.wsize)Z.whave+=J}}return 0},zg=(W,Y)=>{let G,X,J,Z,V,U,Q,N,q,H,A,I,w,O,M=0,S,g,c,u,p,h,f,t,b=new Uint8Array(4),J0,I0,k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(DW(W)||!W.output||!W.input&&W.avail_in!==0)return K5;if(G=W.state,G.mode===s7)G.mode=MH;V=W.next_out,J=W.output,Q=W.avail_out,Z=W.next_in,X=W.input,U=W.avail_in,N=G.hold,q=G.bits,H=U,A=Q,t=KW;W:for(;;)switch(G.mode){case sU:if(G.wrap===0){G.mode=MH;break}while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.wrap&2&&N===35615){if(G.wbits===0)G.wbits=15;G.check=0,b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0),N=0,q=0,G.mode=xD;break}if(G.head)G.head.done=!1;if(!(G.wrap&1)||(((N&255)<<8)+(N>>8))%31){W.msg="incorrect header check",G.mode=w8;break}if((N&15)!==SD){W.msg="unknown compression method",G.mode=w8;break}if(N>>>=4,q-=4,f=(N&15)+8,G.wbits===0)G.wbits=f;if(f>15||f>G.wbits){W.msg="invalid window size",G.mode=w8;break}G.dmax=1<<G.wbits,G.flags=0,W.adler=G.check=1,G.mode=N&512?bD:s7,N=0,q=0;break;case xD:while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.flags=N,(G.flags&255)!==SD){W.msg="unknown compression method",G.mode=w8;break}if(G.flags&57344){W.msg="unknown header flags set",G.mode=w8;break}if(G.head)G.head.text=N>>8&1;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0);N=0,q=0,G.mode=kD;case kD:while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.head)G.head.time=N;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,b[2]=N>>>16&255,b[3]=N>>>24&255,G.check=n8(G.check,b,4,0);N=0,q=0,G.mode=_D;case _D:while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.head)G.head.xflags=N&255,G.head.os=N>>8;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0);N=0,q=0,G.mode=yD;case yD:if(G.flags&1024){while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.length=N,G.head)G.head.extra_len=N;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0);N=0,q=0}else if(G.head)G.head.extra=null;G.mode=vD;case vD:if(G.flags&1024){if(I=G.length,I>U)I=U;if(I){if(G.head){if(f=G.head.extra_len-G.length,!G.head.extra)G.head.extra=new Uint8Array(G.head.extra_len);G.head.extra.set(X.subarray(Z,Z+I),f)}if(G.flags&512&&G.wrap&4)G.check=n8(G.check,X,I,Z);U-=I,Z+=I,G.length-=I}if(G.length)break W}G.length=0,G.mode=gD;case gD:if(G.flags&2048){if(U===0)break W;I=0;do if(f=X[Z+I++],G.head&&f&&G.length<65536)G.head.name+=String.fromCharCode(f);while(f&&I<U);if(G.flags&512&&G.wrap&4)G.check=n8(G.check,X,I,Z);if(U-=I,Z+=I,f)break W}else if(G.head)G.head.name=null;G.length=0,G.mode=uD;case uD:if(G.flags&4096){if(U===0)break W;I=0;do if(f=X[Z+I++],G.head&&f&&G.length<65536)G.head.comment+=String.fromCharCode(f);while(f&&I<U);if(G.flags&512&&G.wrap&4)G.check=n8(G.check,X,I,Z);if(U-=I,Z+=I,f)break W}else if(G.head)G.head.comment=null;G.mode=hD;case hD:if(G.flags&512){while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.wrap&4&&N!==(G.check&65535)){W.msg="header crc mismatch",G.mode=w8;break}N=0,q=0}if(G.head)G.head.hcrc=G.flags>>9&1,G.head.done=!0;W.adler=G.check=0,G.mode=s7;break;case bD:while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}W.adler=G.check=tD(N),N=0,q=0,G.mode=iU;case iU:if(G.havedict===0)return W.next_out=V,W.avail_out=Q,W.next_in=Z,W.avail_in=U,G.hold=N,G.bits=q,Jg;W.adler=G.check=1,G.mode=s7;case s7:if(Y===Gg||Y===cU)break W;case MH:if(G.last){N>>>=q&7,q-=q&7,G.mode=PH;break}while(q<3){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}switch(G.last=N&1,N>>>=1,q-=1,N&3){case 0:G.mode=mD;break;case 1:if(Hg(G),G.mode=pU,Y===cU){N>>>=2,q-=2;break W}break;case 2:G.mode=cD;break;case 3:W.msg="invalid block type",G.mode=w8}N>>>=2,q-=2;break;case mD:N>>>=q&7,q-=q&7;while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if((N&65535)!==(N>>>16^65535)){W.msg="invalid stored block lengths",G.mode=w8;break}if(G.length=N&65535,N=0,q=0,G.mode=RH,Y===cU)break W;case RH:G.mode=fD;case fD:if(I=G.length,I){if(I>U)I=U;if(I>Q)I=Q;if(I===0)break W;J.set(X.subarray(Z,Z+I),V),U-=I,Z+=I,Q-=I,V+=I,G.length-=I;break}G.mode=s7;break;case cD:while(q<14){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.nlen=(N&31)+257,N>>>=5,q-=5,G.ndist=(N&31)+1,N>>>=5,q-=5,G.ncode=(N&15)+4,N>>>=4,q-=4,G.nlen>286||G.ndist>30){W.msg="too many length or distance symbols",G.mode=w8;break}G.have=0,G.mode=pD;case pD:while(G.have<G.ncode){while(q<3){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}G.lens[k[G.have++]]=N&7,N>>>=3,q-=3}while(G.have<19)G.lens[k[G.have++]]=0;if(G.lencode=G.lendyn,G.lenbits=7,J0={bits:G.lenbits},t=wJ(Yg,G.lens,0,19,G.lencode,0,G.work,J0),G.lenbits=J0.bits,t){W.msg="invalid code lengths set",G.mode=w8;break}G.have=0,G.mode=lD;case lD:while(G.have<G.nlen+G.ndist){for(;;){if(M=G.lencode[N&(1<<G.lenbits)-1],S=M>>>24,g=M>>>16&255,c=M&65535,S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(c<16)N>>>=S,q-=S,G.lens[G.have++]=c;else{if(c===16){I0=S+2;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(N>>>=S,q-=S,G.have===0){W.msg="invalid bit length repeat",G.mode=w8;break}f=G.lens[G.have-1],I=3+(N&3),N>>>=2,q-=2}else if(c===17){I0=S+3;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=S,q-=S,f=0,I=3+(N&7),N>>>=3,q-=3}else{I0=S+7;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=S,q-=S,f=0,I=11+(N&127),N>>>=7,q-=7}if(G.have+I>G.nlen+G.ndist){W.msg="invalid bit length repeat",G.mode=w8;break}while(I--)G.lens[G.have++]=f}}if(G.mode===w8)break;if(G.lens[256]===0){W.msg="invalid code -- missing end-of-block",G.mode=w8;break}if(G.lenbits=9,J0={bits:G.lenbits},t=wJ(PC,G.lens,0,G.nlen,G.lencode,0,G.work,J0),G.lenbits=J0.bits,t){W.msg="invalid literal/lengths set",G.mode=w8;break}if(G.distbits=6,G.distcode=G.distdyn,J0={bits:G.distbits},t=wJ(LC,G.lens,G.nlen,G.ndist,G.distcode,0,G.work,J0),G.distbits=J0.bits,t){W.msg="invalid distances set",G.mode=w8;break}if(G.mode=pU,Y===cU)break W;case pU:G.mode=lU;case lU:if(U>=6&&Q>=258){if(W.next_out=V,W.avail_out=Q,W.next_in=Z,W.avail_in=U,G.hold=N,G.bits=q,rv(W,A),V=W.next_out,J=W.output,Q=W.avail_out,Z=W.next_in,X=W.input,U=W.avail_in,N=G.hold,q=G.bits,G.mode===s7)G.back=-1;break}G.back=0;for(;;){if(M=G.lencode[N&(1<<G.lenbits)-1],S=M>>>24,g=M>>>16&255,c=M&65535,S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(g&&(g&240)===0){u=S,p=g,h=c;for(;;){if(M=G.lencode[h+((N&(1<<u+p)-1)>>u)],S=M>>>24,g=M>>>16&255,c=M&65535,u+S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=u,q-=u,G.back+=u}if(N>>>=S,q-=S,G.back+=S,G.length=c,g===0){G.mode=rD;break}if(g&32){G.back=-1,G.mode=s7;break}if(g&64){W.msg="invalid literal/length code",G.mode=w8;break}G.extra=g&15,G.mode=dD;case dD:if(G.extra){I0=G.extra;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}G.length+=N&(1<<G.extra)-1,N>>>=G.extra,q-=G.extra,G.back+=G.extra}G.was=G.length,G.mode=oD;case oD:for(;;){if(M=G.distcode[N&(1<<G.distbits)-1],S=M>>>24,g=M>>>16&255,c=M&65535,S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if((g&240)===0){u=S,p=g,h=c;for(;;){if(M=G.distcode[h+((N&(1<<u+p)-1)>>u)],S=M>>>24,g=M>>>16&255,c=M&65535,u+S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=u,q-=u,G.back+=u}if(N>>>=S,q-=S,G.back+=S,g&64){W.msg="invalid distance code",G.mode=w8;break}G.offset=c,G.extra=g&15,G.mode=nD;case nD:if(G.extra){I0=G.extra;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}G.offset+=N&(1<<G.extra)-1,N>>>=G.extra,q-=G.extra,G.back+=G.extra}if(G.offset>G.dmax){W.msg="invalid distance too far back",G.mode=w8;break}G.mode=iD;case iD:if(Q===0)break W;if(I=A-Q,G.offset>I){if(I=G.offset-I,I>G.whave){if(G.sane){W.msg="invalid distance too far back",G.mode=w8;break}}if(I>G.wnext)I-=G.wnext,w=G.wsize-I;else w=G.wnext-I;if(I>G.length)I=G.length;O=G.window}else O=J,w=V-G.offset,I=G.length;if(I>Q)I=Q;Q-=I,G.length-=I;do J[V++]=O[w++];while(--I);if(G.length===0)G.mode=lU;break;case rD:if(Q===0)break W;J[V++]=G.length,Q--,G.mode=lU;break;case PH:if(G.wrap){while(q<32){if(U===0)break W;U--,N|=X[Z++]<<q,q+=8}if(A-=Q,W.total_out+=A,G.total+=A,G.wrap&4&&A)W.adler=G.check=G.flags?n8(G.check,J,A,V-A):CJ(G.check,J,A,V-A);if(A=Q,G.wrap&4&&(G.flags?N:tD(N))!==G.check){W.msg="incorrect data check",G.mode=w8;break}N=0,q=0}G.mode=aD;case aD:if(G.wrap&&G.flags){while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.wrap&4&&N!==(G.total&4294967295)){W.msg="incorrect length check",G.mode=w8;break}N=0,q=0}G.mode=sD;case sD:t=Xg;break W;case w8:t=BC;break W;case $C:return EC;case FC:default:return K5}if(W.next_out=V,W.avail_out=Q,W.next_in=Z,W.avail_in=U,G.hold=N,G.bits=q,G.wsize||A!==W.avail_out&&G.mode<w8&&(G.mode<PH||Y!==FD)){if(yC(W,W.output,W.next_out,A-W.avail_out));}if(H-=W.avail_in,A-=W.avail_out,W.total_in+=H,W.total_out+=A,G.total+=A,G.wrap&4&&A)W.adler=G.check=G.flags?n8(G.check,J,A,W.next_out-A):CJ(G.check,J,A,W.next_out-A);if(W.data_type=G.bits+(G.last?64:0)+(G.mode===s7?128:0)+(G.mode===pU||G.mode===RH?256:0),(H===0&&A===0||Y===FD)&&t===KW)t=Zg;return t},Ig=(W)=>{if(DW(W))return K5;let Y=W.state;if(Y.window)Y.window=null;return W.state=null,KW},wg=(W,Y)=>{if(DW(W))return K5;let G=W.state;if((G.wrap&2)===0)return K5;return G.head=Y,Y.done=!1,KW},jg=(W,Y)=>{let G=Y.length,X,J,Z;if(DW(W))return K5;if(X=W.state,X.wrap!==0&&X.mode!==iU)return K5;if(X.mode===iU){if(J=1,J=CJ(J,Y,G,0),J!==X.check)return BC}if(Z=yC(W,Y,G,G),Z)return X.mode=$C,EC;return X.havedict=1,KW},Kg=xC,Og=kC,Dg=SC,Cg=Ag,Tg=_C,Mg=zg,Rg=Ig,Pg=wg,Lg=jg,Bg="pako inflate (from Nodeca project)",e7={inflateReset:Kg,inflateReset2:Og,inflateResetKeep:Dg,inflateInit:Cg,inflateInit2:Tg,inflate:Mg,inflateEnd:Rg,inflateGetHeader:Pg,inflateSetDictionary:Lg,inflateInfo:Bg};function Eg(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var $g=Eg,vC=Object.prototype.toString,{Z_NO_FLUSH:Fg,Z_FINISH:Sg,Z_OK:RJ,Z_STREAM_END:EH,Z_NEED_DICT:$H,Z_STREAM_ERROR:xg,Z_DATA_ERROR:WC,Z_MEM_ERROR:kg}=OW;function EJ(W){this.options=aU.assign({chunkSize:65536,windowBits:15,to:""},W||{});let Y=this.options;if(Y.raw&&Y.windowBits>=0&&Y.windowBits<16){if(Y.windowBits=-Y.windowBits,Y.windowBits===0)Y.windowBits=-15}if(Y.windowBits>=0&&Y.windowBits<16&&!(W&&W.windowBits))Y.windowBits+=32;if(Y.windowBits>15&&Y.windowBits<48){if((Y.windowBits&15)===0)Y.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new MC,this.strm.avail_out=0;let G=e7.inflateInit2(this.strm,Y.windowBits);if(G!==RJ)throw Error(wW[G]);if(this.header=new $g,e7.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=MJ.string2buf(Y.dictionary);else if(vC.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(G=e7.inflateSetDictionary(this.strm,Y.dictionary),G!==RJ)throw Error(wW[G])}}}EJ.prototype.push=function(W,Y){let G=this.strm,X=this.options.chunkSize,J=this.options.dictionary,Z,V,U;if(this.ended)return!1;if(Y===~~Y)V=Y;else V=Y===!0?Sg:Fg;if(vC.call(W)==="[object ArrayBuffer]")G.input=new Uint8Array(W);else G.input=W;G.next_in=0,G.avail_in=G.input.length;for(;;){if(G.avail_out===0)G.output=new Uint8Array(X),G.next_out=0,G.avail_out=X;if(Z=e7.inflate(G,V),Z===$H&&J){if(Z=e7.inflateSetDictionary(G,J),Z===RJ)Z=e7.inflate(G,V);else if(Z===WC)Z=$H}while(G.avail_in>0&&Z===EH&&G.state.wrap>0&&W[G.next_in]!==0)e7.inflateReset(G),Z=e7.inflate(G,V);switch(Z){case xg:case WC:case $H:case kg:return this.onEnd(Z),this.ended=!0,!1}if(U=G.avail_out,G.next_out){if(G.avail_out===0||Z===EH)if(this.options.to==="string"){let Q=MJ.utf8border(G.output,G.next_out),N=G.next_out-Q,q=MJ.buf2string(G.output,Q);if(G.next_out=N,G.avail_out=X-N,N)G.output.set(G.output.subarray(Q,Q+N),0);this.onData(q)}else this.onData(G.output.length===G.next_out?G.output:G.output.subarray(0,G.next_out))}if(Z===RJ&&U===0)continue;if(Z===EH)return Z=e7.inflateEnd(this.strm),this.onEnd(Z),this.ended=!0,!0;if(G.avail_in===0)break}return!0};EJ.prototype.onData=function(W){this.chunks.push(W)};EJ.prototype.onEnd=function(W){if(W===RJ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=aU.flattenChunks(this.chunks);this.chunks=[],this.err=W,this.msg=this.strm.msg};function lH(W,Y){let G=new EJ(Y);if(G.push(W),G.err)throw G.msg||wW[G.err];return G.result}function _g(W,Y){return Y=Y||{},Y.raw=!0,lH(W,Y)}var yg=EJ,vg=lH,gg=_g,ug=lH,hg=OW,bg={Inflate:yg,inflate:vg,inflateRaw:gg,ungzip:ug,constants:hg},{Deflate:mg,deflate:fg,deflateRaw:cg,gzip:pg}=nv,{Inflate:lg,inflate:dg,inflateRaw:og,ungzip:ng}=bg,ig=mg,rg=fg,ag=cg,sg=pg,tg=lg,eg=dg,Wu=og,Yu=ng,Gu=OW,WG={Deflate:ig,deflate:rg,deflateRaw:ag,gzip:sg,Inflate:tg,inflate:eg,inflateRaw:Wu,ungzip:Yu,constants:Gu};function gC(){let W=Date.now(),Y=0;return{now(){return W=Math.max(W,Date.now()),Y++,{physical:W,logical:Y}},update(G){if(!G||typeof G.physical!=="number"||typeof G.logical!=="number")return;W=Math.max(W,G.physical),Y=Math.max(Y,G.logical)+1},compare(G,X){if(!G&&!X)return 0;if(!G)return-1;if(!X)return 1;if(G.physical!==X.physical)return G.physical>X.physical?1:-1;if(G.logical!==X.logical)return G.logical>X.logical?1:-1;return 0}}}function uC(W,Y,G){let X=Y.timestamp;if(X?.physical>Date.now()+7200000)X={physical:Date.now()+7200000,logical:X.logical};if(Y?.value?.priority===!0&&typeof Y.id==="string"&&Y.id.startsWith("user:")&&"role"in Y.value){let{priority:J,...Z}=Y.value;return{resolved:!0,value:Z,timestamp:X}}if(Y?.value?.priority!==void 0){let{priority:J,...Z}=Y.value;Y={...Y,value:Z}}if(!W?.timestamp)return{resolved:!0,value:Y.value,timestamp:X};if(G.compare(X,W.timestamp)<=0)return{resolved:!1};return{resolved:!0,value:Y.value,timestamp:X}}var $J={$eq:(W,Y)=>W===Y,$ne:(W,Y)=>W!==Y,$gt:(W,Y)=>W>Y,$gte:(W,Y)=>W>=Y,$lt:(W,Y)=>W<Y,$lte:(W,Y)=>W<=Y,$in:(W,Y)=>Array.isArray(Y)&&(Array.isArray(W)?W.some((G)=>Y.includes(G)):Y.includes(W)),$between:(W,[Y,G])=>W>=Y&&W<=G,$exists:(W,Y)=>Y?W!==void 0:W===void 0,$startsWith:(W,Y)=>typeof W==="string"&&W.startsWith(Y),$endsWith:(W,Y)=>typeof W==="string"&&W.endsWith(Y),$contains:(W,Y)=>typeof W==="string"&&W.includes(Y),$text:{global:(W,Y)=>{let G=(J)=>String(J).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^\w\s]/g,""),X=G(Y);return Object.values(W).some((J)=>typeof J==="object"?null.fieldSearch(J,X):G(J).includes(X))},field:(W,Y)=>{let G=(J)=>String(J).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^\w\s]/g,""),X=G(Y);return Array.isArray(W)?W.some((J)=>G(J).includes(X)):G(W).includes(X)}},$like:(W,Y)=>typeof W==="string"&&typeof Y==="string"&&new RegExp(`^${Y.replace(/%/g,".*").replace(/_/g,".")}$`,"i").test(W),$regex:(W,Y)=>typeof W==="string"&&new RegExp(Y.$regex||Y,"i").test(W),$and:(W,Y,G)=>Y.every((X)=>G.createFilter(X,G.allNodes)(W)),$or:(W,Y,G)=>Y.some((X)=>G.createFilter(X,G.allNodes)(W)),$not:(W,Y,G)=>!G.createFilter(Y,G.allNodes)(W),$edge:(W,Y,G)=>{if(!W.edges?.length||typeof Y!=="object"||Y===null)return!1;let X=G.createFilter(Y,G.allNodes),J=[...W.edges],Z=new Set(J).add(W.id),V=[];while(J.length){let U=J.shift(),Q=G.allNodes[U];if(!Q)continue;if(X(Q))V.push(Q);Q.edges?.forEach((N)=>!Z.has(N)&&Z.add(N)&&J.push(N))}if(V.length)W._edgeResult=V;return V.length>0}},tU=(W,Y)=>Y.split(".").reduce((G,X)=>G&&typeof G==="object"&&(X in G)?G[X]:void 0,W),eU=(W,Y)=>{if(Object.keys(W).length===0)return()=>!0;return(G)=>Object.entries(W).every(([X,J])=>{if(X.startsWith("$"))return $J[X](G,J,{createFilter:eU,allNodes:Y});let Z=tU(G.value,X);if(Z===void 0)Z=tU(G,X);if(typeof J!=="object"||J===null)return $J.$eq(Z,J);return Object.entries(J).every(([V,U])=>{if(V==="$text")return $J.$text.field(Z,U);if(V==="$between"&&U.every((Q)=>Q instanceof Date))return $J.$between(new Date(Z),U);return $J[V]?.(Z,U,{createFilter:eU,allNodes:Y})??!1})})},dH=(W,Y)=>{let{$edge:G,...X}=Y.query||{},J=eU(X,W),Z=Object.values(W).filter(J),U=[...G?(()=>{let Q=eU({$edge:G},W);Z.forEach((q)=>Q(q));let N=new Map;return Z.forEach((q)=>{if(q._edgeResult)q._edgeResult.forEach((H)=>N.set(H.id,H)),delete q._edgeResult}),Array.from(N.values())})():Z];if(Y.field){let Q=Y.order==="asc"?1:-1;U.sort((N,q)=>{let H=tU(N.value,Y.field),A=tU(q.value,Y.field);if(typeof H==="string"&&typeof A==="string")return H.localeCompare(A)*Q;return((H??0)-(A??0))*Q})}if(Y.$after){let Q=U.findIndex((N)=>N.id===Y.$after);U=Q>=0?U.slice(Q+1):[]}if(Y.$before){let Q=U.findIndex((N)=>N.id===Y.$before);U=Q>=0?U.slice(0,Q):[]}if(Y.$limit)U=U.slice(0,Y.$limit);return U};var vJ=(()=>{let W=()=>{};return new Proxy(console,{get:(Y,G)=>globalThis.__gdbDebug?Y[G].bind(Y):W})})(),YG=typeof globalThis==="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function TQ(W){return W instanceof Uint8Array||ArrayBuffer.isView(W)&&W.constructor.name==="Uint8Array"}function Xz(W){if(!Number.isSafeInteger(W)||W<0)throw Error("positive integer expected, got "+W)}function LW(W,...Y){if(!TQ(W))throw Error("Uint8Array expected");if(Y.length>0&&!Y.includes(W.length))throw Error("Uint8Array expected of length "+Y+", got length="+W.length)}function JT(W){if(typeof W!=="function"||typeof W.create!=="function")throw Error("Hash should be wrapped by utils.createHasher");Xz(W.outputLen),Xz(W.blockLen)}function AQ(W,Y=!0){if(W.destroyed)throw Error("Hash instance has been destroyed");if(Y&&W.finished)throw Error("Hash#digest() has already been called")}function Xu(W,Y){LW(W);let G=Y.outputLen;if(W.length<G)throw Error("digestInto() expects output buffer of length at least "+G)}function HQ(...W){for(let Y=0;Y<W.length;Y++)W[Y].fill(0)}function oH(W){return new DataView(W.buffer,W.byteOffset,W.byteLength)}function z7(W,Y){return W<<32-Y|W>>>Y}var ZT=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),Ju=Array.from({length:256},(W,Y)=>Y.toString(16).padStart(2,"0"));function JG(W){if(LW(W),ZT)return W.toHex();let Y="";for(let G=0;G<W.length;G++)Y+=Ju[W[G]];return Y}var W4={_0:48,_9:57,A:65,F:70,a:97,f:102};function hC(W){if(W>=W4._0&&W<=W4._9)return W-W4._0;if(W>=W4.A&&W<=W4.F)return W-(W4.A-10);if(W>=W4.a&&W<=W4.f)return W-(W4.a-10);return}function zQ(W){if(typeof W!=="string")throw Error("hex string expected, got "+typeof W);if(ZT)return Uint8Array.fromHex(W);let Y=W.length,G=Y/2;if(Y%2)throw Error("hex string expected, got unpadded hex of length "+Y);let X=new Uint8Array(G);for(let J=0,Z=0;J<G;J++,Z+=2){let V=hC(W.charCodeAt(Z)),U=hC(W.charCodeAt(Z+1));if(V===void 0||U===void 0){let Q=W[Z]+W[Z+1];throw Error('hex string expected, got non-hex character "'+Q+'" at index '+Z)}X[J]=V*16+U}return X}function VT(W){if(typeof W!=="string")throw Error("string expected");return new Uint8Array(new TextEncoder().encode(W))}function Az(W){if(typeof W==="string")W=VT(W);return LW(W),W}function I7(...W){let Y=0;for(let X=0;X<W.length;X++){let J=W[X];LW(J),Y+=J.length}let G=new Uint8Array(Y);for(let X=0,J=0;X<W.length;X++){let Z=W[X];G.set(Z,J),J+=Z.length}return G}class Hz{}function Zu(W){let Y=(X)=>W().update(Az(X)).digest(),G=W();return Y.outputLen=G.outputLen,Y.blockLen=G.blockLen,Y.create=()=>W(),Y}function MQ(W=32){if(YG&&typeof YG.getRandomValues==="function")return YG.getRandomValues(new Uint8Array(W));if(YG&&typeof YG.randomBytes==="function")return Uint8Array.from(YG.randomBytes(W));throw Error("crypto.getRandomValues must be defined")}function Vu(W,Y,G,X){if(typeof W.setBigUint64==="function")return W.setBigUint64(Y,G,X);let J=BigInt(32),Z=BigInt(4294967295),V=Number(G>>J&Z),U=Number(G&Z),Q=X?4:0,N=X?0:4;W.setUint32(Y+Q,V,X),W.setUint32(Y+N,U,X)}function Uu(W,Y,G){return W&Y^~W&G}function Qu(W,Y,G){return W&Y^W&G^Y&G}class UT extends Hz{constructor(W,Y,G,X){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=W,this.outputLen=Y,this.padOffset=G,this.isLE=X,this.buffer=new Uint8Array(W),this.view=oH(this.buffer)}update(W){AQ(this),W=Az(W),LW(W);let{view:Y,buffer:G,blockLen:X}=this,J=W.length;for(let Z=0;Z<J;){let V=Math.min(X-this.pos,J-Z);if(V===X){let U=oH(W);for(;X<=J-Z;Z+=X)this.process(U,Z);continue}if(G.set(W.subarray(Z,Z+V),this.pos),this.pos+=V,Z+=V,this.pos===X)this.process(Y,0),this.pos=0}return this.length+=W.length,this.roundClean(),this}digestInto(W){AQ(this),Xu(W,this),this.finished=!0;let{buffer:Y,view:G,blockLen:X,isLE:J}=this,{pos:Z}=this;if(Y[Z++]=128,HQ(this.buffer.subarray(Z)),this.padOffset>X-Z)this.process(G,0),Z=0;for(let q=Z;q<X;q++)Y[q]=0;Vu(G,X-8,BigInt(this.length*8),J),this.process(G,0);let V=oH(W),U=this.outputLen;if(U%4)throw Error("_sha2: outputLen should be aligned to 32bit");let Q=U/4,N=this.get();if(Q>N.length)throw Error("_sha2: outputLen bigger than state");for(let q=0;q<Q;q++)V.setUint32(4*q,N[q],J)}digest(){let{buffer:W,outputLen:Y}=this;this.digestInto(W);let G=W.slice(0,Y);return this.destroy(),G}_cloneInto(W){W||(W=new this.constructor),W.set(...this.get());let{blockLen:Y,buffer:G,length:X,finished:J,destroyed:Z,pos:V}=this;if(W.destroyed=Z,W.finished=J,W.length=X,W.pos=V,X%Y)W.buffer.set(G);return W}clone(){return this._cloneInto()}}var N6=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Nu=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),q6=new Uint32Array(64);class QT extends UT{constructor(W=32){super(64,W,8,!1);this.A=N6[0]|0,this.B=N6[1]|0,this.C=N6[2]|0,this.D=N6[3]|0,this.E=N6[4]|0,this.F=N6[5]|0,this.G=N6[6]|0,this.H=N6[7]|0}get(){let{A:W,B:Y,C:G,D:X,E:J,F:Z,G:V,H:U}=this;return[W,Y,G,X,J,Z,V,U]}set(W,Y,G,X,J,Z,V,U){this.A=W|0,this.B=Y|0,this.C=G|0,this.D=X|0,this.E=J|0,this.F=Z|0,this.G=V|0,this.H=U|0}process(W,Y){for(let q=0;q<16;q++,Y+=4)q6[q]=W.getUint32(Y,!1);for(let q=16;q<64;q++){let H=q6[q-15],A=q6[q-2],I=z7(H,7)^z7(H,18)^H>>>3,w=z7(A,17)^z7(A,19)^A>>>10;q6[q]=w+q6[q-7]+I+q6[q-16]|0}let{A:G,B:X,C:J,D:Z,E:V,F:U,G:Q,H:N}=this;for(let q=0;q<64;q++){let H=z7(V,6)^z7(V,11)^z7(V,25),A=N+H+Uu(V,U,Q)+Nu[q]+q6[q]|0,I=(z7(G,2)^z7(G,13)^z7(G,22))+Qu(G,X,J)|0;N=Q,Q=U,U=V,V=Z+A|0,Z=J,J=X,X=G,G=A+I|0}G=G+this.A|0,X=X+this.B|0,J=J+this.C|0,Z=Z+this.D|0,V=V+this.E|0,U=U+this.F|0,Q=Q+this.G|0,N=N+this.H|0,this.set(G,X,J,Z,V,U,Q,N)}roundClean(){HQ(q6)}destroy(){this.set(0,0,0,0,0,0,0,0),HQ(this.buffer)}}var Jz=Zu(()=>new QT);class zz extends Hz{constructor(W,Y){super();this.finished=!1,this.destroyed=!1,JT(W);let G=Az(Y);if(this.iHash=W.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let X=this.blockLen,J=new Uint8Array(X);J.set(G.length>X?W.create().update(G).digest():G);for(let Z=0;Z<J.length;Z++)J[Z]^=54;this.iHash.update(J),this.oHash=W.create();for(let Z=0;Z<J.length;Z++)J[Z]^=106;this.oHash.update(J),HQ(J)}update(W){return AQ(this),this.iHash.update(W),this}digestInto(W){AQ(this),LW(W,this.outputLen),this.finished=!0,this.iHash.digestInto(W),this.oHash.update(W),this.oHash.digestInto(W),this.destroy()}digest(){let W=new Uint8Array(this.oHash.outputLen);return this.digestInto(W),W}_cloneInto(W){W||(W=Object.create(Object.getPrototypeOf(this),{}));let{oHash:Y,iHash:G,finished:X,destroyed:J,blockLen:Z,outputLen:V}=this;return W=W,W.finished=X,W.destroyed=J,W.blockLen=Z,W.outputLen=V,W.oHash=Y._cloneInto(W.oHash),W.iHash=G._cloneInto(W.iHash),W}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}var NT=(W,Y,G)=>new zz(W,Y).update(G).digest();NT.create=(W,Y)=>new zz(W,Y);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var Iz=BigInt(0),Zz=BigInt(1);function IQ(W,Y=""){if(typeof W!=="boolean"){let G=Y&&`"${Y}"`;throw Error(G+"expected boolean, got type="+typeof W)}return W}function CW(W,Y,G=""){let X=TQ(W),J=W?.length,Z=Y!==void 0;if(!X||Z&&J!==Y){let V=G&&`"${G}" `,U=Z?` of length ${Y}`:"",Q=X?`length=${J}`:`type=${typeof W}`;throw Error(V+"expected Uint8Array"+U+", got "+Q)}return W}function WQ(W){let Y=W.toString(16);return Y.length&1?"0"+Y:Y}function qT(W){if(typeof W!=="string")throw Error("hex string expected, got "+typeof W);return W===""?Iz:BigInt("0x"+W)}function NG(W){return qT(JG(W))}function AT(W){return LW(W),qT(JG(Uint8Array.from(W).reverse()))}function RQ(W,Y){return zQ(W.toString(16).padStart(Y*2,"0"))}function HT(W,Y){return RQ(W,Y).reverse()}function b8(W,Y,G){let X;if(typeof Y==="string")try{X=zQ(Y)}catch(Z){throw Error(W+" must be hex string or Uint8Array, cause: "+Z)}else if(TQ(Y))X=Uint8Array.from(Y);else throw Error(W+" must be hex string or Uint8Array");let J=X.length;if(typeof G==="number"&&J!==G)throw Error(W+" of length "+G+" expected, got "+J);return X}var nH=(W)=>typeof W==="bigint"&&Iz<=W;function Vz(W,Y,G){return nH(W)&&nH(Y)&&nH(G)&&Y<=W&&W<G}function qu(W,Y,G,X){if(!Vz(Y,G,X))throw Error("expected valid "+W+": "+G+" <= n < "+X+", got "+Y)}function zT(W){let Y;for(Y=0;W>Iz;W>>=Zz,Y+=1);return Y}var hJ=(W)=>(Zz<<BigInt(W))-Zz;function Au(W,Y,G){if(typeof W!=="number"||W<2)throw Error("hashLen must be a number");if(typeof Y!=="number"||Y<2)throw Error("qByteLen must be a number");if(typeof G!=="function")throw Error("hmacFn must be a function");let X=(A)=>new Uint8Array(A),J=(A)=>Uint8Array.of(A),Z=X(W),V=X(W),U=0,Q=()=>{Z.fill(1),V.fill(0),U=0},N=(...A)=>G(V,Z,...A),q=(A=X(0))=>{if(V=N(J(0),A),Z=N(),A.length===0)return;V=N(J(1),A),Z=N()},H=()=>{if(U++>=1000)throw Error("drbg: tried 1000 values");let A=0,I=[];while(A<Y){Z=N();let w=Z.slice();I.push(w),A+=Z.length}return I7(...I)};return(A,I)=>{Q(),q(A);let w=void 0;while(!(w=I(H())))q();return Q(),w}}function wz(W,Y,G={}){if(!W||typeof W!=="object")throw Error("expected valid options object");function X(J,Z,V){let U=W[J];if(V&&U===void 0)return;let Q=typeof U;if(Q!==Z||U===null)throw Error(`param "${J}" is invalid: expected ${Z}, got ${Q}`)}Object.entries(Y).forEach(([J,Z])=>X(J,Z,!1)),Object.entries(G).forEach(([J,Z])=>X(J,Z,!0))}function bC(W){let Y=new WeakMap;return(G,...X)=>{let J=Y.get(G);if(J!==void 0)return J;let Z=W(G,...X);return Y.set(G,Z),Z}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var k9=BigInt(0),H9=BigInt(1),TW=BigInt(2),IT=BigInt(3),wT=BigInt(4),jT=BigInt(5),Hu=BigInt(7),KT=BigInt(8),zu=BigInt(9),OT=BigInt(16);function C5(W,Y){let G=W%Y;return G>=k9?G:Y+G}function O5(W,Y,G){let X=W;while(Y-- >k9)X*=X,X%=G;return X}function mC(W,Y){if(W===k9)throw Error("invert: expected non-zero number");if(Y<=k9)throw Error("invert: expected positive modulus, got "+Y);let G=C5(W,Y),X=Y,J=k9,Z=H9,V=H9,U=k9;while(G!==k9){let Q=X/G,N=X%G,q=J-V*Q,H=Z-U*Q;X=G,G=N,J=V,Z=U,V=q,U=H}if(X!==H9)throw Error("invert: does not exist");return C5(J,Y)}function jz(W,Y,G){if(!W.eql(W.sqr(Y),G))throw Error("Cannot find square root")}function DT(W,Y){let G=(W.ORDER+H9)/wT,X=W.pow(Y,G);return jz(W,X,Y),X}function Iu(W,Y){let G=(W.ORDER-jT)/KT,X=W.mul(Y,TW),J=W.pow(X,G),Z=W.mul(Y,J),V=W.mul(W.mul(Z,TW),J),U=W.mul(Z,W.sub(V,W.ONE));return jz(W,U,Y),U}function wu(W){let Y=bJ(W),G=CT(W),X=G(Y,Y.neg(Y.ONE)),J=G(Y,X),Z=G(Y,Y.neg(X)),V=(W+Hu)/OT;return(U,Q)=>{let N=U.pow(Q,V),q=U.mul(N,X),H=U.mul(N,J),A=U.mul(N,Z),I=U.eql(U.sqr(q),Q),w=U.eql(U.sqr(H),Q);N=U.cmov(N,q,I),q=U.cmov(A,H,w);let O=U.eql(U.sqr(q),Q),M=U.cmov(N,q,O);return jz(U,M,Q),M}}function CT(W){if(W<IT)throw Error("sqrt is not defined for small field");let Y=W-H9,G=0;while(Y%TW===k9)Y/=TW,G++;let X=TW,J=bJ(W);while(fC(J,X)===1)if(X++>1000)throw Error("Cannot find square root: probably non-prime P");if(G===1)return DT;let Z=J.pow(X,Y),V=(Y+H9)/TW;return function(U,Q){if(U.is0(Q))return Q;if(fC(U,Q)!==1)throw Error("Cannot find square root");let N=G,q=U.mul(U.ONE,Z),H=U.pow(Q,Y),A=U.pow(Q,V);while(!U.eql(H,U.ONE)){if(U.is0(H))return U.ZERO;let I=1,w=U.sqr(H);while(!U.eql(w,U.ONE))if(I++,w=U.sqr(w),I===N)throw Error("Cannot find square root");let O=H9<<BigInt(N-I-1),M=U.pow(q,O);N=I,q=U.sqr(M),H=U.mul(H,q),A=U.mul(A,M)}return A}}function ju(W){if(W%wT===IT)return DT;if(W%KT===jT)return Iu;if(W%OT===zu)return wu(W);return CT(W)}var Ku=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ou(W){let Y={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},G=Ku.reduce((X,J)=>{return X[J]="function",X},Y);return wz(W,G),W}function Du(W,Y,G){if(G<k9)throw Error("invalid exponent, negatives unsupported");if(G===k9)return W.ONE;if(G===H9)return Y;let X=W.ONE,J=Y;while(G>k9){if(G&H9)X=W.mul(X,J);J=W.sqr(J),G>>=H9}return X}function TT(W,Y,G=!1){let X=Array(Y.length).fill(G?W.ZERO:void 0),J=Y.reduce((V,U,Q)=>{if(W.is0(U))return V;return X[Q]=V,W.mul(V,U)},W.ONE),Z=W.inv(J);return Y.reduceRight((V,U,Q)=>{if(W.is0(U))return V;return X[Q]=W.mul(V,X[Q]),W.mul(V,U)},Z),X}function fC(W,Y){let G=(W.ORDER-H9)/TW,X=W.pow(Y,G),J=W.eql(X,W.ONE),Z=W.eql(X,W.ZERO),V=W.eql(X,W.neg(W.ONE));if(!J&&!Z&&!V)throw Error("invalid Legendre symbol result");return J?1:Z?0:-1}function MT(W,Y){if(Y!==void 0)Xz(Y);let G=Y!==void 0?Y:W.toString(2).length,X=Math.ceil(G/8);return{nBitLength:G,nByteLength:X}}function bJ(W,Y,G=!1,X={}){if(W<=k9)throw Error("invalid field: expected ORDER > 0, got "+W);let J=void 0,Z=void 0,V=!1,U=void 0;if(typeof Y==="object"&&Y!=null){if(X.sqrt||G)throw Error("cannot specify opts in two arguments");let A=Y;if(A.BITS)J=A.BITS;if(A.sqrt)Z=A.sqrt;if(typeof A.isLE==="boolean")G=A.isLE;if(typeof A.modFromBytes==="boolean")V=A.modFromBytes;U=A.allowedLengths}else{if(typeof Y==="number")J=Y;if(X.sqrt)Z=X.sqrt}let{nBitLength:Q,nByteLength:N}=MT(W,J);if(N>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let q,H=Object.freeze({ORDER:W,isLE:G,BITS:Q,BYTES:N,MASK:hJ(Q),ZERO:k9,ONE:H9,allowedLengths:U,create:(A)=>C5(A,W),isValid:(A)=>{if(typeof A!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof A);return k9<=A&&A<W},is0:(A)=>A===k9,isValidNot0:(A)=>!H.is0(A)&&H.isValid(A),isOdd:(A)=>(A&H9)===H9,neg:(A)=>C5(-A,W),eql:(A,I)=>A===I,sqr:(A)=>C5(A*A,W),add:(A,I)=>C5(A+I,W),sub:(A,I)=>C5(A-I,W),mul:(A,I)=>C5(A*I,W),pow:(A,I)=>Du(H,A,I),div:(A,I)=>C5(A*mC(I,W),W),sqrN:(A)=>A*A,addN:(A,I)=>A+I,subN:(A,I)=>A-I,mulN:(A,I)=>A*I,inv:(A)=>mC(A,W),sqrt:Z||((A)=>{if(!q)q=ju(W);return q(H,A)}),toBytes:(A)=>G?HT(A,N):RQ(A,N),fromBytes:(A,I=!0)=>{if(U){if(!U.includes(A.length)||A.length>N)throw Error("Field.fromBytes: expected "+U+" bytes, got "+A.length);let O=new Uint8Array(N);O.set(A,G?0:O.length-A.length),A=O}if(A.length!==N)throw Error("Field.fromBytes: expected "+N+" bytes, got "+A.length);let w=G?AT(A):NG(A);if(V)w=C5(w,W);if(!I){if(!H.isValid(w))throw Error("invalid field element: outside of range 0..ORDER")}return w},invertBatch:(A)=>TT(H,A),cmov:(A,I,w)=>w?I:A});return Object.freeze(H)}function RT(W){if(typeof W!=="bigint")throw Error("field order must be bigint");let Y=W.toString(2).length;return Math.ceil(Y/8)}function PT(W){let Y=RT(W);return Y+Math.ceil(Y/2)}function LT(W,Y,G=!1){let X=W.length,J=RT(Y),Z=PT(Y);if(X<16||X<Z||X>1024)throw Error("expected "+Z+"-1024 bytes of input, got "+X);let V=G?AT(W):NG(W),U=C5(V,Y-H9)+H9;return G?HT(U,J):RQ(U,J)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var UG=BigInt(0),MW=BigInt(1);function wQ(W,Y){let G=Y.negate();return W?G:Y}function iH(W,Y){let G=TT(W.Fp,Y.map((X)=>X.Z));return Y.map((X,J)=>W.fromAffine(X.toAffine(G[J])))}function BT(W,Y){if(!Number.isSafeInteger(W)||W<=0||W>Y)throw Error("invalid window size, expected [1.."+Y+"], got W="+W)}function rH(W,Y){BT(W,Y);let G=Math.ceil(Y/W)+1,X=2**(W-1),J=2**W,Z=hJ(W),V=BigInt(W);return{windows:G,windowSize:X,mask:Z,maxNumber:J,shiftBy:V}}function cC(W,Y,G){let{windowSize:X,mask:J,maxNumber:Z,shiftBy:V}=G,U=Number(W&J),Q=W>>V;if(U>X)U-=Z,Q+=MW;let N=Y*X,q=N+Math.abs(U)-1,H=U===0,A=U<0,I=Y%2!==0;return{nextN:Q,offset:q,isZero:H,isNeg:A,isNegF:I,offsetF:N}}function Cu(W,Y){if(!Array.isArray(W))throw Error("array expected");W.forEach((G,X)=>{if(!(G instanceof Y))throw Error("invalid point at index "+X)})}function Tu(W,Y){if(!Array.isArray(W))throw Error("array of scalars expected");W.forEach((G,X)=>{if(!Y.isValid(G))throw Error("invalid scalar at index "+X)})}var aH=new WeakMap,ET=new WeakMap;function sH(W){return ET.get(W)||1}function pC(W){if(W!==UG)throw Error("invalid wNAF")}class $T{constructor(W,Y){this.BASE=W.BASE,this.ZERO=W.ZERO,this.Fn=W.Fn,this.bits=Y}_unsafeLadder(W,Y,G=this.ZERO){let X=W;while(Y>UG){if(Y&MW)G=G.add(X);X=X.double(),Y>>=MW}return G}precomputeWindow(W,Y){let{windows:G,windowSize:X}=rH(Y,this.bits),J=[],Z=W,V=Z;for(let U=0;U<G;U++){V=Z,J.push(V);for(let Q=1;Q<X;Q++)V=V.add(Z),J.push(V);Z=V.double()}return J}wNAF(W,Y,G){if(!this.Fn.isValid(G))throw Error("invalid scalar");let X=this.ZERO,J=this.BASE,Z=rH(W,this.bits);for(let V=0;V<Z.windows;V++){let{nextN:U,offset:Q,isZero:N,isNeg:q,isNegF:H,offsetF:A}=cC(G,V,Z);if(G=U,N)J=J.add(wQ(H,Y[A]));else X=X.add(wQ(q,Y[Q]))}return pC(G),{p:X,f:J}}wNAFUnsafe(W,Y,G,X=this.ZERO){let J=rH(W,this.bits);for(let Z=0;Z<J.windows;Z++){if(G===UG)break;let{nextN:V,offset:U,isZero:Q,isNeg:N}=cC(G,Z,J);if(G=V,Q)continue;else{let q=Y[U];X=X.add(N?q.negate():q)}}return pC(G),X}getPrecomputes(W,Y,G){let X=aH.get(Y);if(!X){if(X=this.precomputeWindow(Y,W),W!==1){if(typeof G==="function")X=G(X);aH.set(Y,X)}}return X}cached(W,Y,G){let X=sH(W);return this.wNAF(X,this.getPrecomputes(X,W,G),Y)}unsafe(W,Y,G,X){let J=sH(W);if(J===1)return this._unsafeLadder(W,Y,X);return this.wNAFUnsafe(J,this.getPrecomputes(J,W,G),Y,X)}createCache(W,Y){BT(Y,this.bits),ET.set(W,Y),aH.delete(W)}hasCache(W){return sH(W)!==1}}function Mu(W,Y,G,X){let J=Y,Z=W.ZERO,V=W.ZERO;while(G>UG||X>UG){if(G&MW)Z=Z.add(J);if(X&MW)V=V.add(J);J=J.double(),G>>=MW,X>>=MW}return{p1:Z,p2:V}}function Ru(W,Y,G,X){Cu(G,W),Tu(X,Y);let J=G.length,Z=X.length;if(J!==Z)throw Error("arrays of points and scalars must have equal length");let V=W.ZERO,U=zT(BigInt(J)),Q=1;if(U>12)Q=U-3;else if(U>4)Q=U-2;else if(U>0)Q=2;let N=hJ(Q),q=Array(Number(N)+1).fill(V),H=Math.floor((Y.BITS-1)/Q)*Q,A=V;for(let I=H;I>=0;I-=Q){q.fill(V);for(let O=0;O<Z;O++){let M=X[O],S=Number(M>>BigInt(I)&N);q[S]=q[S].add(G[O])}let w=V;for(let O=q.length-1,M=V;O>0;O--)M=M.add(q[O]),w=w.add(M);if(A=A.add(w),I!==0)for(let O=0;O<Q;O++)A=A.double()}return A}function lC(W,Y,G){if(Y){if(Y.ORDER!==W)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return Ou(Y),Y}else return bJ(W,{isLE:G})}function Pu(W,Y,G={},X){if(X===void 0)X=W==="edwards";if(!Y||typeof Y!=="object")throw Error(`expected valid ${W} CURVE object`);for(let U of["p","n","h"]){let Q=Y[U];if(!(typeof Q==="bigint"&&Q>UG))throw Error(`CURVE.${U} must be positive bigint`)}let J=lC(Y.p,G.Fp,X),Z=lC(Y.n,G.Fn,X),V=["Gx","Gy","a",W==="weierstrass"?"b":"d"];for(let U of V)if(!J.isValid(Y[U]))throw Error(`CURVE.${U} must be valid field element of CURVE.Fp`);return Y=Object.freeze(Object.assign({},Y)),{CURVE:Y,Fp:J,Fn:Z}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var dC=(W,Y)=>(W+(W>=0?Y:-Y)/ST)/Y;function Lu(W,Y,G){let[[X,J],[Z,V]]=Y,U=dC(V*W,G),Q=dC(-J*W,G),N=W-U*X-Q*Z,q=-U*J-Q*V,H=N<X4,A=q<X4;if(H)N=-N;if(A)q=-q;let I=hJ(Math.ceil(zT(G)/2))+ZG;if(N<X4||N>=I||q<X4||q>=I)throw Error("splitScalar (endomorphism): failed, k="+W);return{k1neg:H,k1:N,k2neg:A,k2:q}}function Uz(W){if(!["compact","recovered","der"].includes(W))throw Error('Signature format must be "compact", "recovered", or "der"');return W}function tH(W,Y){let G={};for(let X of Object.keys(Y))G[X]=W[X]===void 0?Y[X]:W[X];if(IQ(G.lowS,"lowS"),IQ(G.prehash,"prehash"),G.format!==void 0)Uz(G.format);return G}class FT extends Error{constructor(W=""){super(W)}}var G4={Err:FT,_tlv:{encode:(W,Y)=>{let{Err:G}=G4;if(W<0||W>256)throw new G("tlv.encode: wrong tag");if(Y.length&1)throw new G("tlv.encode: unpadded data");let X=Y.length/2,J=WQ(X);if(J.length/2&128)throw new G("tlv.encode: long form length too big");let Z=X>127?WQ(J.length/2|128):"";return WQ(W)+Z+J+Y},decode(W,Y){let{Err:G}=G4,X=0;if(W<0||W>256)throw new G("tlv.encode: wrong tag");if(Y.length<2||Y[X++]!==W)throw new G("tlv.decode: wrong tlv");let J=Y[X++],Z=!!(J&128),V=0;if(!Z)V=J;else{let Q=J&127;if(!Q)throw new G("tlv.decode(long): indefinite length not supported");if(Q>4)throw new G("tlv.decode(long): byte length is too big");let N=Y.subarray(X,X+Q);if(N.length!==Q)throw new G("tlv.decode: length bytes not complete");if(N[0]===0)throw new G("tlv.decode(long): zero leftmost byte");for(let q of N)V=V<<8|q;if(X+=Q,V<128)throw new G("tlv.decode(long): not minimal encoding")}let U=Y.subarray(X,X+V);if(U.length!==V)throw new G("tlv.decode: wrong value length");return{v:U,l:Y.subarray(X+V)}}},_int:{encode(W){let{Err:Y}=G4;if(W<X4)throw new Y("integer: negative integers are not allowed");let G=WQ(W);if(Number.parseInt(G[0],16)&8)G="00"+G;if(G.length&1)throw new Y("unexpected DER parsing assertion: unpadded hex");return G},decode(W){let{Err:Y}=G4;if(W[0]&128)throw new Y("invalid signature integer: negative");if(W[0]===0&&!(W[1]&128))throw new Y("invalid signature integer: unnecessary leading zero");return NG(W)}},toSig(W){let{Err:Y,_int:G,_tlv:X}=G4,J=b8("signature",W),{v:Z,l:V}=X.decode(48,J);if(V.length)throw new Y("invalid signature: left bytes after parsing");let{v:U,l:Q}=X.decode(2,Z),{v:N,l:q}=X.decode(2,Q);if(q.length)throw new Y("invalid signature: left bytes after parsing");return{r:G.decode(U),s:G.decode(N)}},hexFromSig(W){let{_tlv:Y,_int:G}=G4,X=Y.encode(2,G.encode(W.r)),J=Y.encode(2,G.encode(W.s)),Z=X+J;return Y.encode(48,Z)}},X4=BigInt(0),ZG=BigInt(1),ST=BigInt(2),YQ=BigInt(3),Bu=BigInt(4);function RW(W,Y){let{BYTES:G}=W,X;if(typeof Y==="bigint")X=Y;else{let J=b8("private key",Y);try{X=W.fromBytes(J)}catch(Z){throw Error(`invalid private key: expected ui8a of size ${G}, got ${typeof Y}`)}}if(!W.isValidNot0(X))throw Error("invalid private key: out of range [1..N-1]");return X}function Eu(W,Y={}){let G=Pu("weierstrass",W,Y),{Fp:X,Fn:J}=G,Z=G.CURVE,{h:V,n:U}=Z;wz(Y,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:Q}=Y;if(Q){if(!X.is0(Z.a)||typeof Q.beta!=="bigint"||!Array.isArray(Q.basises))throw Error('invalid endo: expected "beta": bigint and "basises": array')}let N=kT(X,J);function q(){if(!X.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}function H(k,l,P){let{x:B,y:m}=l.toAffine(),a=X.toBytes(B);if(IQ(P,"isCompressed"),P){q();let n=!X.isOdd(m);return I7(xT(n),a)}else return I7(Uint8Array.of(4),a,X.toBytes(m))}function A(k){CW(k,void 0,"Point");let{publicKey:l,publicKeyUncompressed:P}=N,B=k.length,m=k[0],a=k.subarray(1);if(B===l&&(m===2||m===3)){let n=X.fromBytes(a);if(!X.isValid(n))throw Error("bad point: is not on curve, wrong x");let E=O(n),$;try{$=X.sqrt(E)}catch(x){let R=x instanceof Error?": "+x.message:"";throw Error("bad point: is not on curve, sqrt error"+R)}q();let _=X.isOdd($);if((m&1)===1!==_)$=X.neg($);return{x:n,y:$}}else if(B===P&&m===4){let n=X.BYTES,E=X.fromBytes(a.subarray(0,n)),$=X.fromBytes(a.subarray(n,n*2));if(!M(E,$))throw Error("bad point: is not on curve");return{x:E,y:$}}else throw Error(`bad point: got length ${B}, expected compressed=${l} or uncompressed=${P}`)}let I=Y.toBytes||H,w=Y.fromBytes||A;function O(k){let l=X.sqr(k),P=X.mul(l,k);return X.add(X.add(P,X.mul(k,Z.a)),Z.b)}function M(k,l){let P=X.sqr(l),B=O(k);return X.eql(P,B)}if(!M(Z.Gx,Z.Gy))throw Error("bad curve params: generator point");let S=X.mul(X.pow(Z.a,YQ),Bu),g=X.mul(X.sqr(Z.b),BigInt(27));if(X.is0(X.add(S,g)))throw Error("bad curve params: a or b");function c(k,l,P=!1){if(!X.isValid(l)||P&&X.is0(l))throw Error(`bad point coordinate ${k}`);return l}function u(k){if(!(k instanceof b))throw Error("ProjectivePoint expected")}function p(k){if(!Q||!Q.basises)throw Error("no endo");return Lu(k,Q.basises,J.ORDER)}let h=bC((k,l)=>{let{X:P,Y:B,Z:m}=k;if(X.eql(m,X.ONE))return{x:P,y:B};let a=k.is0();if(l==null)l=a?X.ONE:X.inv(m);let n=X.mul(P,l),E=X.mul(B,l),$=X.mul(m,l);if(a)return{x:X.ZERO,y:X.ZERO};if(!X.eql($,X.ONE))throw Error("invZ was invalid");return{x:n,y:E}}),f=bC((k)=>{if(k.is0()){if(Y.allowInfinityPoint&&!X.is0(k.Y))return;throw Error("bad point: ZERO")}let{x:l,y:P}=k.toAffine();if(!X.isValid(l)||!X.isValid(P))throw Error("bad point: x or y not field elements");if(!M(l,P))throw Error("bad point: equation left != right");if(!k.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function t(k,l,P,B,m){return P=new b(X.mul(P.X,k),P.Y,P.Z),l=wQ(B,l),P=wQ(m,P),l.add(P)}class b{constructor(k,l,P){this.X=c("x",k),this.Y=c("y",l,!0),this.Z=c("z",P),Object.freeze(this)}static CURVE(){return Z}static fromAffine(k){let{x:l,y:P}=k||{};if(!k||!X.isValid(l)||!X.isValid(P))throw Error("invalid affine point");if(k instanceof b)throw Error("projective point not allowed");if(X.is0(l)&&X.is0(P))return b.ZERO;return new b(l,P,X.ONE)}static fromBytes(k){let l=b.fromAffine(w(CW(k,void 0,"point")));return l.assertValidity(),l}static fromHex(k){return b.fromBytes(b8("pointHex",k))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(k=8,l=!0){if(I0.createCache(this,k),!l)this.multiply(YQ);return this}assertValidity(){f(this)}hasEvenY(){let{y:k}=this.toAffine();if(!X.isOdd)throw Error("Field doesn't support isOdd");return!X.isOdd(k)}equals(k){u(k);let{X:l,Y:P,Z:B}=this,{X:m,Y:a,Z:n}=k,E=X.eql(X.mul(l,n),X.mul(m,B)),$=X.eql(X.mul(P,n),X.mul(a,B));return E&&$}negate(){return new b(this.X,X.neg(this.Y),this.Z)}double(){let{a:k,b:l}=Z,P=X.mul(l,YQ),{X:B,Y:m,Z:a}=this,n=X.ZERO,E=X.ZERO,$=X.ZERO,_=X.mul(B,B),x=X.mul(m,m),R=X.mul(a,a),v=X.mul(B,m);return v=X.add(v,v),$=X.mul(B,a),$=X.add($,$),n=X.mul(k,$),E=X.mul(P,R),E=X.add(n,E),n=X.sub(x,E),E=X.add(x,E),E=X.mul(n,E),n=X.mul(v,n),$=X.mul(P,$),R=X.mul(k,R),v=X.sub(_,R),v=X.mul(k,v),v=X.add(v,$),$=X.add(_,_),_=X.add($,_),_=X.add(_,R),_=X.mul(_,v),E=X.add(E,_),R=X.mul(m,a),R=X.add(R,R),_=X.mul(R,v),n=X.sub(n,_),$=X.mul(R,x),$=X.add($,$),$=X.add($,$),new b(n,E,$)}add(k){u(k);let{X:l,Y:P,Z:B}=this,{X:m,Y:a,Z:n}=k,E=X.ZERO,$=X.ZERO,_=X.ZERO,x=Z.a,R=X.mul(Z.b,YQ),v=X.mul(l,m),X0=X.mul(P,a),V0=X.mul(B,n),Q0=X.add(l,P),F0=X.add(m,a);Q0=X.mul(Q0,F0),F0=X.add(v,X0),Q0=X.sub(Q0,F0),F0=X.add(l,B);let y0=X.add(m,n);return F0=X.mul(F0,y0),y0=X.add(v,V0),F0=X.sub(F0,y0),y0=X.add(P,B),E=X.add(a,n),y0=X.mul(y0,E),E=X.add(X0,V0),y0=X.sub(y0,E),_=X.mul(x,F0),E=X.mul(R,V0),_=X.add(E,_),E=X.sub(X0,_),_=X.add(X0,_),$=X.mul(E,_),X0=X.add(v,v),X0=X.add(X0,v),V0=X.mul(x,V0),F0=X.mul(R,F0),X0=X.add(X0,V0),V0=X.sub(v,V0),V0=X.mul(x,V0),F0=X.add(F0,V0),v=X.mul(X0,F0),$=X.add($,v),v=X.mul(y0,F0),E=X.mul(Q0,E),E=X.sub(E,v),v=X.mul(Q0,X0),_=X.mul(y0,_),_=X.add(_,v),new b(E,$,_)}subtract(k){return this.add(k.negate())}is0(){return this.equals(b.ZERO)}multiply(k){let{endo:l}=Y;if(!J.isValidNot0(k))throw Error("invalid scalar: out of range");let P,B,m=(a)=>I0.cached(this,a,(n)=>iH(b,n));if(l){let{k1neg:a,k1:n,k2neg:E,k2:$}=p(k),{p:_,f:x}=m(n),{p:R,f:v}=m($);B=x.add(v),P=t(l.beta,_,R,a,E)}else{let{p:a,f:n}=m(k);P=a,B=n}return iH(b,[P,B])[0]}multiplyUnsafe(k){let{endo:l}=Y,P=this;if(!J.isValid(k))throw Error("invalid scalar: out of range");if(k===X4||P.is0())return b.ZERO;if(k===ZG)return P;if(I0.hasCache(this))return this.multiply(k);if(l){let{k1neg:B,k1:m,k2neg:a,k2:n}=p(k),{p1:E,p2:$}=Mu(b,P,m,n);return t(l.beta,E,$,B,a)}else return I0.unsafe(P,k)}multiplyAndAddUnsafe(k,l,P){let B=this.multiplyUnsafe(l).add(k.multiplyUnsafe(P));return B.is0()?void 0:B}toAffine(k){return h(this,k)}isTorsionFree(){let{isTorsionFree:k}=Y;if(V===ZG)return!0;if(k)return k(b,this);return I0.unsafe(this,U).is0()}clearCofactor(){let{clearCofactor:k}=Y;if(V===ZG)return this;if(k)return k(b,this);return this.multiplyUnsafe(V)}isSmallOrder(){return this.multiplyUnsafe(V).is0()}toBytes(k=!0){return IQ(k,"isCompressed"),this.assertValidity(),I(b,this,k)}toHex(k=!0){return JG(this.toBytes(k))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(k=!0){return this.toBytes(k)}_setWindowSize(k){this.precompute(k)}static normalizeZ(k){return iH(b,k)}static msm(k,l){return Ru(b,J,k,l)}static fromPrivateKey(k){return b.BASE.multiply(RW(J,k))}}b.BASE=new b(Z.Gx,Z.Gy,X.ONE),b.ZERO=new b(X.ZERO,X.ONE,X.ZERO),b.Fp=X,b.Fn=J;let J0=J.BITS,I0=new $T(b,Y.endo?Math.ceil(J0/2):J0);return b.BASE.precompute(8),b}function xT(W){return Uint8Array.of(W?2:3)}function kT(W,Y){return{secretKey:Y.BYTES,publicKey:1+W.BYTES,publicKeyUncompressed:1+2*W.BYTES,publicKeyHasPrefix:!0,signature:2*Y.BYTES}}function $u(W,Y={}){let{Fn:G}=W,X=Y.randomBytes||MQ,J=Object.assign(kT(W.Fp,G),{seed:PT(G.ORDER)});function Z(A){try{return!!RW(G,A)}catch(I){return!1}}function V(A,I){let{publicKey:w,publicKeyUncompressed:O}=J;try{let M=A.length;if(I===!0&&M!==w)return!1;if(I===!1&&M!==O)return!1;return!!W.fromBytes(A)}catch(M){return!1}}function U(A=X(J.seed)){return LT(CW(A,J.seed,"seed"),G.ORDER)}function Q(A,I=!0){return W.BASE.multiply(RW(G,A)).toBytes(I)}function N(A){let I=U(A);return{secretKey:I,publicKey:Q(I)}}function q(A){if(typeof A==="bigint")return!1;if(A instanceof W)return!0;let{secretKey:I,publicKey:w,publicKeyUncompressed:O}=J;if(G.allowedLengths||I===w)return;let M=b8("key",A).length;return M===w||M===O}function H(A,I,w=!0){if(q(A)===!0)throw Error("first arg must be private key");if(q(I)===!1)throw Error("second arg must be public key");let O=RW(G,A);return W.fromHex(I).multiply(O).toBytes(w)}return Object.freeze({getPublicKey:Q,getSharedSecret:H,keygen:N,Point:W,utils:{isValidSecretKey:Z,isValidPublicKey:V,randomSecretKey:U,isValidPrivateKey:Z,randomPrivateKey:U,normPrivateKeyToScalar:(A)=>RW(G,A),precompute(A=8,I=W.BASE){return I.precompute(A,!1)}},lengths:J})}function Fu(W,Y,G={}){JT(Y),wz(G,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let X=G.randomBytes||MQ,J=G.hmac||((P,...B)=>NT(Y,P,I7(...B))),{Fp:Z,Fn:V}=W,{ORDER:U,BITS:Q}=V,{keygen:N,getPublicKey:q,getSharedSecret:H,utils:A,lengths:I}=$u(W,G),w={prehash:!1,lowS:typeof G.lowS==="boolean"?G.lowS:!1,format:void 0,extraEntropy:!1},O="compact";function M(P){let B=U>>ZG;return P>B}function S(P,B){if(!V.isValidNot0(B))throw Error(`invalid signature ${P}: out of range 1..Point.Fn.ORDER`);return B}function g(P,B){Uz(B);let m=I.signature,a=B==="compact"?m:B==="recovered"?m+1:void 0;return CW(P,a,`${B} signature`)}class c{constructor(P,B,m){if(this.r=S("r",P),this.s=S("s",B),m!=null)this.recovery=m;Object.freeze(this)}static fromBytes(P,B=O){g(P,B);let m;if(B==="der"){let{r:$,s:_}=G4.toSig(CW(P));return new c($,_)}if(B==="recovered")m=P[0],B="compact",P=P.subarray(1);let a=V.BYTES,n=P.subarray(0,a),E=P.subarray(a,a*2);return new c(V.fromBytes(n),V.fromBytes(E),m)}static fromHex(P,B){return this.fromBytes(zQ(P),B)}addRecoveryBit(P){return new c(this.r,this.s,P)}recoverPublicKey(P){let B=Z.ORDER,{r:m,s:a,recovery:n}=this;if(n==null||![0,1,2,3].includes(n))throw Error("recovery id invalid");if(U*ST<B&&n>1)throw Error("recovery id is ambiguous for h>1 curve");let E=n===2||n===3?m+U:m;if(!Z.isValid(E))throw Error("recovery id 2 or 3 invalid");let $=Z.toBytes(E),_=W.fromBytes(I7(xT((n&1)===0),$)),x=V.inv(E),R=p(b8("msgHash",P)),v=V.create(-R*x),X0=V.create(a*x),V0=W.BASE.multiplyUnsafe(v).add(_.multiplyUnsafe(X0));if(V0.is0())throw Error("point at infinify");return V0.assertValidity(),V0}hasHighS(){return M(this.s)}toBytes(P=O){if(Uz(P),P==="der")return zQ(G4.hexFromSig(this));let B=V.toBytes(this.r),m=V.toBytes(this.s);if(P==="recovered"){if(this.recovery==null)throw Error("recovery bit must be present");return I7(Uint8Array.of(this.recovery),B,m)}return I7(B,m)}toHex(P){return JG(this.toBytes(P))}assertValidity(){}static fromCompact(P){return c.fromBytes(b8("sig",P),"compact")}static fromDER(P){return c.fromBytes(b8("sig",P),"der")}normalizeS(){return this.hasHighS()?new c(this.r,V.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return JG(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return JG(this.toBytes("compact"))}}let u=G.bits2int||function(P){if(P.length>8192)throw Error("input is too large");let B=NG(P),m=P.length*8-Q;return m>0?B>>BigInt(m):B},p=G.bits2int_modN||function(P){return V.create(u(P))},h=hJ(Q);function f(P){return qu("num < 2^"+Q,P,X4,h),V.toBytes(P)}function t(P,B){return CW(P,void 0,"message"),B?CW(Y(P),void 0,"prehashed message"):P}function b(P,B,m){if(["recovered","canonical"].some((V0)=>(V0 in m)))throw Error("sign() legacy options not supported");let{lowS:a,prehash:n,extraEntropy:E}=tH(m,w);P=t(P,n);let $=p(P),_=RW(V,B),x=[f(_),f($)];if(E!=null&&E!==!1){let V0=E===!0?X(I.secretKey):E;x.push(b8("extraEntropy",V0))}let R=I7(...x),v=$;function X0(V0){let Q0=u(V0);if(!V.isValidNot0(Q0))return;let F0=V.inv(Q0),y0=W.BASE.multiply(Q0).toAffine(),A1=V.create(y0.x);if(A1===X4)return;let v1=V.create(F0*V.create(v+A1*_));if(v1===X4)return;let G0=(y0.x===A1?0:2)|Number(y0.y&ZG),C0=v1;if(a&&M(v1))C0=V.neg(v1),G0^=1;return new c(A1,C0,G0)}return{seed:R,k2sig:X0}}function J0(P,B,m={}){P=b8("message",P);let{seed:a,k2sig:n}=b(P,B,m);return Au(Y.outputLen,V.BYTES,J)(a,n)}function I0(P){let B=void 0,m=typeof P==="string"||TQ(P),a=!m&&P!==null&&typeof P==="object"&&typeof P.r==="bigint"&&typeof P.s==="bigint";if(!m&&!a)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(a)B=new c(P.r,P.s);else if(m){try{B=c.fromBytes(b8("sig",P),"der")}catch(n){if(!(n instanceof G4.Err))throw n}if(!B)try{B=c.fromBytes(b8("sig",P),"compact")}catch(n){return!1}}if(!B)return!1;return B}function k(P,B,m,a={}){let{lowS:n,prehash:E,format:$}=tH(a,w);if(m=b8("publicKey",m),B=t(b8("message",B),E),"strict"in a)throw Error("options.strict was renamed to lowS");let _=$===void 0?I0(P):c.fromBytes(b8("sig",P),$);if(_===!1)return!1;try{let x=W.fromBytes(m);if(n&&_.hasHighS())return!1;let{r:R,s:v}=_,X0=p(B),V0=V.inv(v),Q0=V.create(X0*V0),F0=V.create(R*V0),y0=W.BASE.multiplyUnsafe(Q0).add(x.multiplyUnsafe(F0));if(y0.is0())return!1;return V.create(y0.x)===R}catch(x){return!1}}function l(P,B,m={}){let{prehash:a}=tH(m,w);return B=t(B,a),c.fromBytes(P,"recovered").recoverPublicKey(B).toBytes()}return Object.freeze({keygen:N,getPublicKey:q,getSharedSecret:H,utils:A,lengths:I,Point:W,sign:J0,verify:k,recoverPublicKey:l,Signature:c,hash:Y})}function Su(W){let Y={a:W.a,b:W.b,p:W.Fp.ORDER,n:W.n,h:W.h,Gx:W.Gx,Gy:W.Gy},G=W.Fp,X=W.allowedPrivateKeyLengths?Array.from(new Set(W.allowedPrivateKeyLengths.map((V)=>Math.ceil(V/2)))):void 0,J=bJ(Y.n,{BITS:W.nBitLength,allowedLengths:X,modFromBytes:W.wrapPrivateKey}),Z={Fp:G,Fn:J,allowInfinityPoint:W.allowInfinityPoint,endo:W.endo,isTorsionFree:W.isTorsionFree,clearCofactor:W.clearCofactor,fromBytes:W.fromBytes,toBytes:W.toBytes};return{CURVE:Y,curveOpts:Z}}function xu(W){let{CURVE:Y,curveOpts:G}=Su(W),X={hmac:W.hmac,randomBytes:W.randomBytes,lowS:W.lowS,bits2int:W.bits2int,bits2int_modN:W.bits2int_modN};return{CURVE:Y,curveOpts:G,hash:W.hash,ecdsaOpts:X}}function ku(W,Y){let G=Y.Point;return Object.assign({},Y,{ProjectivePoint:G,CURVE:Object.assign({},W,MT(G.Fn.ORDER,G.Fn.BITS))})}function _u(W){let{CURVE:Y,curveOpts:G,hash:X,ecdsaOpts:J}=xu(W),Z=Eu(Y,G),V=Fu(Z,X,J);return ku(W,V)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yu(W,Y){let G=(X)=>_u({...W,hash:X});return{...G(Y),create:G}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var QG={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},vu={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},gu=BigInt(0),oC=BigInt(1),Qz=BigInt(2);function uu(W){let Y=QG.p,G=BigInt(3),X=BigInt(6),J=BigInt(11),Z=BigInt(22),V=BigInt(23),U=BigInt(44),Q=BigInt(88),N=W*W*W%Y,q=N*N*W%Y,H=O5(q,G,Y)*q%Y,A=O5(H,G,Y)*q%Y,I=O5(A,Qz,Y)*N%Y,w=O5(I,J,Y)*I%Y,O=O5(w,Z,Y)*w%Y,M=O5(O,U,Y)*O%Y,S=O5(M,Q,Y)*M%Y,g=O5(S,U,Y)*O%Y,c=O5(g,G,Y)*q%Y,u=O5(c,V,Y)*w%Y,p=O5(u,X,Y)*N%Y,h=O5(p,Qz,Y);if(!jQ.eql(jQ.sqr(h),W))throw Error("Cannot find square root");return h}var jQ=bJ(QG.p,{sqrt:uu}),_T=yu({...QG,Fp:jQ,lowS:!0,endo:vu},Jz),nC={};function KQ(W,...Y){let G=nC[W];if(G===void 0){let X=Jz(VT(W));G=I7(X,X),nC[W]=G}return Jz(I7(G,...Y))}var Kz=(W)=>W.toBytes(!0).slice(1),qG=(()=>_T.Point)(),Oz=(W)=>W%Qz===gu;function Nz(W){let{Fn:Y,BASE:G}=qG,X=RW(Y,W),J=G.multiply(X);return{scalar:Oz(J.y)?X:Y.neg(X),bytes:Kz(J)}}function yT(W){let Y=jQ;if(!Y.isValidNot0(W))throw Error("invalid x: Fail if x \u2265 p");let G=Y.create(W*W),X=Y.create(G*W+BigInt(7)),J=Y.sqrt(X);if(!Oz(J))J=Y.neg(J);let Z=qG.fromAffine({x:W,y:J});return Z.assertValidity(),Z}var gJ=NG;function vT(...W){return qG.Fn.create(gJ(KQ("BIP0340/challenge",...W)))}function iC(W){return Nz(W).bytes}function hu(W,Y,G=MQ(32)){let{Fn:X}=qG,J=b8("message",W),{bytes:Z,scalar:V}=Nz(Y),U=b8("auxRand",G,32),Q=X.toBytes(V^gJ(KQ("BIP0340/aux",U))),N=KQ("BIP0340/nonce",Q,Z,J),{bytes:q,scalar:H}=Nz(N),A=vT(q,Z,J),I=new Uint8Array(64);if(I.set(q,0),I.set(X.toBytes(X.create(H+A*V)),32),!gT(I,J,Z))throw Error("sign: Invalid signature produced");return I}function gT(W,Y,G){let{Fn:X,BASE:J}=qG,Z=b8("signature",W,64),V=b8("message",Y),U=b8("publicKey",G,32);try{let Q=yT(gJ(U)),N=gJ(Z.subarray(0,32));if(!Vz(N,oC,QG.p))return!1;let q=gJ(Z.subarray(32,64));if(!Vz(q,oC,QG.n))return!1;let H=vT(X.toBytes(N),Kz(Q),V),A=J.multiplyUnsafe(q).add(Q.multiplyUnsafe(X.neg(H))),{x:I,y:w}=A.toAffine();if(A.is0()||!Oz(w)||I!==N)return!1;return!0}catch(Q){return!1}}var Dz=(()=>{let W=(G=MQ(48))=>{return LT(G,QG.n)};_T.utils.randomSecretKey;function Y(G){let X=W(G);return{secretKey:X,publicKey:iC(X)}}return{keygen:Y,getPublicKey:iC,sign:hu,verify:gT,Point:qG,utils:{randomSecretKey:W,randomPrivateKey:W,taggedHash:KQ,lift_x:yT,pointToBytes:Kz,numberToBytesBE:RQ,bytesToNumberBE:NG,mod:C5},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})(),bu=new TextEncoder,mu=new TextDecoder,PW=(W)=>bu.encode(W),xJ=(W)=>mu.decode(W),qz=(W)=>Array.from(W,(Y)=>Y.toString(16).padStart(2,"0")).join(""),w7=JSON.stringify,OQ=JSON.parse,uT=(W,Y=Number.MAX_SAFE_INTEGER)=>W.split("").reduce((G,X)=>G+X.charCodeAt(0),0)%Y,Cz="AES-GCM",fu={},hT="$",bT=",",cu=(W)=>{let Y=new Uint8Array(W),G=32768,X="";for(let J=0;J<Y.length;J+=32768)X+=String.fromCharCode(...Y.subarray(J,J+32768));return btoa(X)},pu=(W)=>Uint8Array.from(atob(W),(Y)=>Y.charCodeAt(0)).buffer,GQ=(W)=>fu[W]??=crypto.subtle.digest("SHA-1",PW(W)).then((Y)=>{let G=new Uint8Array(Y),X="";for(let J of G)X+=J.toString(36);return X}),lu=async(W,Y,G)=>{let X=await crypto.subtle.digest("SHA-256",PW(`${W}:${Y}:${G}`));return crypto.subtle.importKey("raw",X,{name:Cz},!1,["encrypt","decrypt"])},du=async(W,Y)=>{let G=crypto.getRandomValues(new Uint8Array(12)),X=await W,J=await crypto.subtle.encrypt({name:Cz,iv:G},X,PW(Y));return`${G.join(bT)}${hT}${cu(J)}`},ou=async(W,Y)=>{let[G,X]=Y.split(hT);if(!G||!X)throw Error("Invalid encrypted payload format");let J=Uint8Array.from(G.split(bT),Number),Z=await W,V=await crypto.subtle.decrypt({name:Cz,iv:J},Z,pu(X));return xJ(V)},D5="GenosRTC",Tz=(W,Y)=>Array.from({length:W},Y),DQ=(W)=>Array.from(crypto.getRandomValues(new Uint8Array(W)),(Y)=>"0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"[Y%62]).join(""),H8=typeof sessionStorage<"u"?sessionStorage.__genosrtcId??=DQ(20):DQ(20),XG=Promise.all.bind(Promise),nu=typeof window<"u",{entries:iu,fromEntries:mT,keys:xe}=Object,rC=()=>{},Y4=(W)=>Error(`GenosRTC: ${W}`),XQ=(...W)=>W.join("@"),ru=(W,Y)=>{let G=[...W],X=G.length,J=()=>{let Z=Math.sin(Y++)*1e4;return Z-Math.floor(Z)};while(X){let Z=Math.floor(J()*X--);[G[X],G[Z]]=[G[Z],G[X]]}return G},au=5000,aC="icegatheringstatechange",sC="offer",su="answer",tu=[...Tz(3,(W,Y)=>`stun:stun${Y||""}.l.google.com:19302`),"stun:stun.cloudflare.com:3478"].map((W)=>({urls:W})),tC=(W,{rtcConfig:Y,rtcPolyfill:G,turnConfig:X})=>{let J=new(G||RTCPeerConnection)({iceServers:[...tu,...X||[]],...Y}),Z={},V=!1,U=!1,Q,N=(A)=>Object.assign(A,{binaryType:"arraybuffer",bufferedAmountLowThreshold:65535,onmessage:(I)=>Z.data?.(I.data),onopen:()=>Z.connect?.(),onclose:()=>Z.close?.(),onerror:(I)=>!I?.error?.message?.includes("User-Initiated Abort")&&Z.error?.(I)}),q=()=>Promise.race([new Promise((A)=>{let I=()=>{if(J.iceGatheringState==="complete")J.removeEventListener(aC,I),A()};J.addEventListener(aC,I),I()}),new Promise((A)=>setTimeout(A,au))]).then(()=>({type:J.localDescription.type,sdp:J.localDescription.sdp.replace(/a=ice-options:trickle\s\n/g,"")}));if(W?N(Q=J.createDataChannel("data")):J.ondatachannel=({channel:A})=>N(Q=A),J.onnegotiationneeded=async()=>{try{V=!0,await J.setLocalDescription(),Z.signal?.(await q())}catch(A){Z.error?.(A)}finally{V=!1}},J.onconnectionstatechange=()=>{if(["disconnected","failed","closed"].includes(J.connectionState))Z.close?.()},J.ontrack=(A)=>{Z.track?.(A.track,A.streams[0]),Z.stream?.(A.streams[0])},J.onremovestream=(A)=>Z.stream?.(A.stream),W&&!J.canTrickleIceCandidates)J.onnegotiationneeded();let H=()=>J.getSenders();return{created:Date.now(),connection:J,get channel(){return Q},get isDead(){return J.connectionState==="closed"},async signal(A){if(Q?.readyState==="open"&&!A.sdp?.includes("a=rtpmap"))return;try{if(A.type===sC){if(V||J.signalingState!=="stable"&&!U){if(W)return;await XG([J.setLocalDescription({type:"rollback"}),J.setRemoteDescription(A)])}else await J.setRemoteDescription(A);await J.setLocalDescription();let I=await q();return Z.signal?.(I),I}if(A.type===su){U=!0;try{await J.setRemoteDescription(A)}finally{U=!1}}}catch(I){Z.error?.(I)}},sendData:(A)=>{if(Q?.readyState==="open")Q.send(A)},destroy:()=>{Q?.close(),J.close(),V=U=!1},setHandlers:(A)=>Object.assign(Z,A),offerPromise:W?new Promise((A)=>Z.signal=(I)=>I.type===sC&&A(I)):Promise.resolve(),addStream:(A)=>A.getTracks().forEach((I)=>J.addTrack(I,A)),removeStream:(A)=>H().filter((I)=>A.getTracks().includes(I.track)).forEach((I)=>J.removeTrack(I)),addTrack:(A,I)=>J.addTrack(A,I),removeTrack:(A)=>{let I=H().find((w)=>w.track===A);if(I)J.removeTrack(I)},replaceTrack:(A,I)=>H().find((w)=>w.track===A)?.replaceTrack(I)}},eu=Object.getPrototypeOf(Uint8Array),UQ=12,fT=0,QQ=fT+UQ,NQ=QQ+1,kJ=NQ+1,_J=kJ+1,FJ=16384-_J,JQ=255,eH="bufferedamountlow",GG=(W)=>`@_${W}`,eC=GG("ping"),Wz=100,Wh=3,Yh=200,Gh=512,WT=(W,Y)=>new Response(new Blob([W]).stream().pipeThrough(new Y("deflate"))).arrayBuffer().then((G)=>new Uint8Array(G)),Xh=(W,Y,G,X,J)=>{let Z=new Map,V=new Map,U=new Map,Q={},N={},q={},H={},A=new Map,I=new Map,w=Promise.resolve(),O=(R,v)=>{if(!A.has(R))A.set(R,new Set);A.get(R).add(v)},M=(R,v)=>A.get(R)?.delete(v),S=(R,...v)=>A.get(R)?.forEach((X0)=>X0(...v)),g=(R,v)=>{let X0=R?Array.isArray(R)?R:[R]:Z.keys();return Array.from(X0,(V0)=>{let Q0=Z.get(V0);if(!Q0)return console.warn(`${D5}: no peer with id ${V0}`),null;return v(V0,Q0)}).filter(Boolean)},c=(R)=>{if(!Z.has(R))return;Z.delete(R),I.delete(R),_.delete(R),delete Q[R],delete N[R],delete q[R],delete H[R],S("peer:leave",R),Y(R)},u=(R)=>new Promise((v,X0)=>{let V0=setTimeout(()=>{R.removeEventListener(eH,Q0),X0(Error(`${D5}: bufferLow timeout`))},5000);function Q0(){clearTimeout(V0),R.removeEventListener(eH,Q0),v()}R.addEventListener(eH,Q0)}),p=(R)=>{if(U.has(R))return U.get(R);if(!R)throw Y4("action type is required");let v=PW(R);if(v.byteLength>UQ)throw Y4(`\u274C "${R}" exceeds ${UQ} bytes. Use a shorter name.`);let X0=new Uint8Array(UQ).map((G0,C0)=>v[C0]||0),V0=0,Q0=new Map([["message",new Set],["progress",new Set]]),F0=(G0,C0)=>Q0.get(G0)?.add(C0),y0=(G0,C0)=>Q0.get(G0)?.delete(C0),A1=async(G0,C0,B0,e)=>{if(B0&&typeof B0!=="object")throw Y4("meta must be object");if(G0===void 0)throw Y4("data cannot be undefined");let T0=G0 instanceof Blob,M0=T0||G0 instanceof ArrayBuffer||G0 instanceof eu,q0=typeof G0!=="string";if(B0&&!M0)throw Y4("meta only allowed with binary");let _0=M0?new Uint8Array(T0?await G0.arrayBuffer():G0):PW(q0?w7(G0):G0),Y1=0;if(!M0&&_0.byteLength>=Gh){let e0=await WT(_0,CompressionStream);if(e0.byteLength<_0.byteLength)_0=e0,Y1=1}let t0=B0?PW(w7(B0)):null,$1=Math.ceil(_0.byteLength/FJ)+(B0?1:0)||1;if($1>Wz)throw Y4(`Message too large, exceeds max chunks ${Wz}`);let Y8=Tz($1,(e0,D1)=>{let r0=D1===$1-1,t1=B0&&D1===0,t8=t1?t0:_0.subarray(B0?(D1-1)*FJ:D1*FJ,B0?D1*FJ:(D1+1)*FJ),C8=new Uint8Array(_J+t8.byteLength);return C8.set(X0),C8.set([V0],QQ),C8.set([r0|t1<<1|M0<<2|q0<<3|Y1<<4],NQ),C8.set([Math.round((D1+1)/$1*JQ)],kJ),C8.set(t8,_J),C8});return V0=V0+1&JQ,XG(g(C0,async(e0,D1)=>{let{channel:r0}=D1;for(let t1=0;t1<$1;t1++){let t8=0;while(r0.bufferedAmount>r0.bufferedAmountLowThreshold){if(t8++>Wh)throw Y4(`${D5}: send buffer full, max retries reached for peer ${e0}`);try{await u(r0)}catch(C8){console.warn(C8.message),await new Promise((w5)=>setTimeout(w5,Yh))}}if(!Z.has(e0))break;D1.sendData(Y8[t1]),e?.(Y8[t1][kJ]/JQ,e0,B0)}}))};V.set(R,{listeners:Q0,send:A1});let v1={send:A1,on:F0,off:y0};return U.set(R,v1),v1},h=(R,v)=>{try{I.set(R,Date.now()),_.delete(R);let X0=new Uint8Array(v),V0=xJ(X0.subarray(fT,QQ)).replace(/\x00/g,"");if(!V.has(V0))return console.warn(`${D5}: unregistered type (${V0})`);if(V0===eC){b("",R).catch(()=>{});return}let[Q0]=X0.subarray(QQ,NQ),[F0]=X0.subarray(NQ,kJ),[y0]=X0.subarray(kJ,_J),A1=X0.subarray(_J),v1=Boolean(F0&1),G0=Boolean(F0&2),C0=Boolean(F0&4),B0=Boolean(F0&8),e=Boolean(F0&16),T0=V.get(V0),M0=(Q[R]||={})[V0]||={};if(M0[Q0]?.chunks?.length>Wz){console.warn(`${D5}: peer ${R} sent too many chunks for nonce ${Q0}, ignoring.`);return}let q0=M0[Q0]||={chunks:[]};if(G0)try{q0.meta=OQ(xJ(A1))}catch{console.warn(`${D5}: failed to parse meta from peer ${R} for type ${V0}`);return}else q0.chunks.push(A1);if(T0.listeners.get("progress").forEach((Y1)=>{try{Y1(y0/JQ,R,q0.meta)}catch(t0){console.error(t0)}}),!v1)return;let _0=new Uint8Array(q0.chunks.reduce((Y1,t0)=>Y1+t0.byteLength,0));q0.chunks.reduce((Y1,t0)=>(_0.set(t0,Y1),Y1+t0.byteLength),0),delete M0[Q0],w=w.then(async()=>{let Y1=e?await WT(_0,DecompressionStream):_0,t0;if(C0)t0=Y1;else if(B0)try{t0=OQ(xJ(Y1))}catch{console.warn(`${D5}: failed to parse JSON message data from peer ${R} for type ${V0}`);return}else t0=xJ(Y1);T0.listeners.get("message").forEach(($1)=>{try{$1(t0,R,q0.meta)}catch(Y8){console.error(Y8)}})}).catch((Y1)=>console.error(`${D5}: dispatch error from peer ${R}:`,Y1))}catch(X0){console.error(`${D5}: error handling data from peer ${R}:`,X0)}},f=async()=>{try{await a(""),await new Promise((R)=>setTimeout(R,99))}catch(R){console.warn(`${D5}: error sending leave`,R)}for(let[R,v]of Z){try{v.destroy()}catch{}Z.delete(R)}clearInterval(x),G()},{send:t}=p(eC),{send:b,on:J0}=p(GG("pong")),{send:I0,on:k}=p(GG("signal")),{send:l,on:P}=p(GG("stream")),{send:B,on:m}=p(GG("track")),{send:a,on:n}=p(GG("leave"));W((R,v)=>{let X0=Z.get(v);if(X0===R)return;if(X0){let V0=()=>{};X0.setHandlers({data:V0,stream:V0,track:V0,signal:V0,close:V0,error:V0})}Z.set(v,R),I.set(v,Date.now()),_.delete(v),R.setHandlers({data:(V0)=>h(v,V0),stream:(V0)=>{S("stream:add",V0,v,q[v]),delete q[v]},track:(V0,Q0)=>{S("track:add",V0,Q0,v,H[v]),delete H[v]},signal:(V0)=>I0(V0,v),close:()=>c(v),error:(V0)=>{console.error(`${D5}: peer error for ${v}`,V0),c(v)}}),S("peer:join",v,X?.(v))}),J?.((R,v,X0)=>S(X0?"peer:seen":"peer:lost",R,v)),J0("message",(R,v)=>{N[v]?.(),delete N[v]}),k("message",(R,v)=>Z.get(v)?.signal(R)),P("message",(R,v)=>q[v]=R),m("message",(R,v)=>H[v]=R),n("message",(R,v)=>c(v));let E=1e4,$=20000,_=new Map,x=setInterval(()=>{let R=Date.now();for(let[v,X0]of Z){if(R-(I.get(v)??R)<=E)continue;let V0=_.get(v);if(V0===void 0)_.set(v,R),t("",v).catch(()=>{});else if(R-V0>$){_.delete(v);try{X0.destroy()}catch{}c(v)}}},5000);if(nu)addEventListener("beforeunload",f);return{on:O,off:M,channel:p,leave:f,ping:async(R)=>{if(!R)throw Y4("ping() requires target peer ID");let v=Date.now();return t("",R),await new Promise((X0)=>N[R]=X0),Date.now()-v},getPeers:()=>mT(Array.from(Z,([R,v])=>[R,v.connection])),addStream:(R,v,X0)=>g(v,async(V0,Q0)=>{if(X0)await l(X0,V0);Q0.addStream(R)}),removeStream:(R,v)=>g(v,(X0,V0)=>V0.removeStream(R)),addTrack:(R,v,X0,V0)=>g(X0,async(Q0,F0)=>{if(V0)await B(V0,Q0);F0.addTrack(R,v)}),removeTrack:(R,v)=>g(v,(X0,V0)=>V0.removeTrack(R)),replaceTrack:(R,v,X0,V0)=>g(X0,async(Q0,F0)=>{if(V0)await B(V0,Q0);F0.replaceTrack(R,v)})}},Jh=5,Zh=10,Vh=2500,ZQ=57333,Uh=({init:W,subscribe:Y,announce:G,bye:X})=>{let J={},Z=!1,V,U;return(Q,N,q)=>{let{appId:H}=Q;if(J[H]?.[N])return J[H][N];if(!Q||!N||!H&&!Q.firebaseApp)throw Y4(!Q?"config required":!N?"roomId required":"appId missing");let A=rC,I=rC;if(!Z){let _=W(Q);U=Tz(Jh,()=>{try{return tC(!0,Q)}catch{return null}}).filter(Boolean),V=Array.isArray(_)?_:[_];let x=setInterval(()=>{U=U.filter((R)=>{let v=Date.now()-R.created<ZQ;if(!v)R.destroy();return v})},ZQ);J.offerCleanupTimer||=x,Z=!0}let w={},O={},M=new Map,S=new Map,g=new Map,c={},u=XQ(D5,H,N),p=GQ(u),h=GQ(XQ(u,H8)),f=lu(Q.password||"",H,N),t=(_)=>async(x)=>({type:x.type,sdp:await _(f,x.sdp)}),b=t(ou),J0=t(du),I0=(_)=>{return setTimeout(()=>{if(!_.isDead&&!Object.values(O).includes(_))_.destroy()},ZQ),_},k=(_)=>{try{return I0(tC(_,Q))}catch{return null}},l=(_,x)=>{if(O[x]===_)return;_.connectedAt=Date.now(),O[x]?.destroy(),O[x]=_,A(_,x),w[x]?.forEach((R)=>R!==_&&R.destroy()),delete w[x]},P=(_,x)=>{if(O[x]===_)delete O[x]},B=(_)=>async(x,R,v)=>{let[X0,V0]=await XG([p,h]);if(x!==X0&&x!==V0)return;let{peerId:Q0,offer:F0,answer:y0,type:A1,bye:v1}=typeof R==="string"?OQ(R):R;if(v1){if(Q0&&Q0!==H8)S.delete(Q0),I(Q0,null,!1),g.set(Q0,Date.now()),delete c[Q0];return}if(Q0&&Q0!==H8)I(Q0,A1,!0),S.set(Q0,Date.now()),g.delete(Q0);if(A1&&Q0)c[Q0]=A1;if(Q0===H8)return;if(O[Q0]){let G0=O[Q0].channel?.readyState==="open";if(!F0||G0||Date.now()-O[Q0].connectedAt<2000)return;O[Q0].destroy(),delete O[Q0]}if(Q.admit&&!Q.admit(Q0))return;if(F0){if(w[Q0]?.[_]&&H8>Q0)return;let G0=k(!1);if(!G0)return;G0.setHandlers({connect:()=>l(G0,Q0),close:()=>P(G0,Q0)});try{let C0=await b(F0);if(G0.isDead)return;let[B0,e]=await XG([GQ(XQ(u,Q0)),G0.signal(C0).then(J0)]);v(B0,w7({peerId:H8,answer:e,...Q.type&&{type:Q.type}}))}catch{q?.({error:"decryption failed (offer)",appId:H,peerId:Q0,roomId:N})}}else if(y0){let G0=w[Q0]?.[_];if(!G0||G0.isDead)return;G0.setHandlers({connect:()=>l(G0,Q0),close:()=>P(G0,Q0)});try{G0.signal(await b(y0))}catch{q?.({error:"decryption failed (answer)",appId:H,peerId:Q0,roomId:N})}}else{let G0=w[Q0]||=[];if(G0.forEach((e,T0)=>{if(e&&(e.isDead||Date.now()-(e.dialedAt??e.created)>ZQ)){if(e.isDead)M.set(Q0,Date.now()+30000);e.destroy(),delete G0[T0]}}),G0[_]||G0.filter(Boolean).length>=2||M.get(Q0)>Date.now())return;if(Object.values(w).reduce((e,T0)=>e+T0.filter((M0)=>M0&&!M0.isDead).length,0)>=Zh)return;let C0=U.pop(),B0=C0?I0(C0):k(!0);if(!B0){M.set(Q0,Date.now()+30000);return}B0.dialedAt=Date.now(),G0[_]=B0;try{let[e,{offer:T0}]=await XG([GQ(XQ(u,Q0)),B0.offerPromise.then(J0).then((M0)=>({offer:M0}))]);B0.setHandlers({connect:()=>l(B0,Q0),close:()=>P(B0,Q0)}),v(e,w7({peerId:H8,offer:T0,peer:B0,...Q.type&&{type:Q.type}}))}catch{if(G0[_]===B0)delete G0[_];B0.destroy()}}},m=[],a=[],n=[],E=()=>n.forEach(({relay:_,rootTopic:x})=>X?.(_,x));V.forEach(async(_,x)=>{let R=await _;if(!R)return;let[v,X0]=await XG([p,h]);a[x]=Y(R,v,X0,B(x)),n.push({relay:R,rootTopic:v});let V0=async()=>{let Q0=await G(R,v,X0);m[x]=setTimeout(V0,typeof Q0==="number"?Q0:Vh)};V0()}),J[H]||={};let $=Xh((_)=>A=_,(_)=>delete O[_],()=>$.onCleanup?.(),(_)=>c[_],(_)=>I=_);if(typeof window<"u")window.addEventListener("pagehide",E);return $.onCleanup=()=>{if(E(),typeof window<"u")window.removeEventListener("pagehide",E);if(delete J[H][N],m.forEach(clearTimeout),a.forEach((_)=>_?.()),Object.keys(J).length===0)clearInterval(J.offerCleanupTimer),delete J.offerCleanupTimer},$._census=()=>{for(let x of Object.keys(O))S.set(x,Date.now());let _=Date.now()-120000;for(let[x,R]of S)if(R<_)S.delete(x);return[...S.keys()]},$._gone=()=>{let _=Date.now()-60000;for(let[x,R]of g)if(R<_)g.delete(x);return[...g.keys()]},J[H][N]=$}},YT=3333,Qh=30000,SJ={},cT={},Nh=(W,Y)=>{let G={},X=null;G.reopenHandlers=new Set;let J=()=>{if(X)clearTimeout(X),X=null;if(G.socket)G.socket.onclose=null,G.socket.close();let Z=new WebSocket(W);Z.onclose=()=>{SJ[W]??=YT,X=setTimeout(J,SJ[W]),SJ[W]=Math.min(SJ[W]*2,Qh)},Z.onmessage=(V)=>Y(V.data),G.socket=Z,G.url=Z.url,G.ready=new Promise((V)=>{Z.onopen=()=>{SJ[W]=YT,V(G),G.reopenHandlers.forEach((U)=>U())}}),G.send=(V)=>{if(Z.readyState===1)Z.send(V)}};return G.forceReconnect=J,J(),cT[W]=G,G};if(typeof window<"u"){let W=(Y)=>{vJ.info("\u26A1 [GenosRTC] Network event detected. Forcing reconnection\u2026"),Object.values(cT).forEach((G)=>{if(G.socket&&G.socket.readyState!==WebSocket.OPEN&&(Y||G.socket.readyState!==WebSocket.CONNECTING))G.forceReconnect()})};window.addEventListener("online",()=>{vJ.info("\u2705 Reconnected to the network."),W(!0)}),window.addEventListener("offline",async()=>{vJ.info("\u274C Disconnected from the network.")}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible")W()})}var qh=(W)=>()=>mT(iu(W).map(([Y,G])=>[Y,G.socket])),Ah=(W,Y,G,X)=>(W.relayUrls??(X?ru(Y,uT(W.appId)):Y)).slice(0,W.relayUrls?.length??W.relayRedundancy??G),Hh=["wss://relay.primal.net","wss://relay.snort.social","wss://nostr.oxtr.dev","wss://nostr.vulpem.com","wss://relay.nostr.net","wss://nostr.sathoarder.com","wss://nostr.data.haus","wss://relay.mostr.pub"],VG={},zh=10,pT="x",lT="EVENT",Ih=/pow:\s*(\d+)\s*bits needed\.?/i,qQ=new Set,dT=Dz.utils.randomSecretKey(),wh=qz(Dz.getPublicKey(dT)),Mz={},yJ={},jh={},oT=()=>Math.floor(Date.now()/1000),nT=(W)=>jh[W]??=uT(W,1e4)+20000,uJ=(W)=>W.replace(/\/$/,""),Kh=(W,Y)=>{let[G,X,J,Z]=OQ(Y);if(G===lT)return yJ[X]?.(Mz[X],J.content);if(G==="NOTICE"||G==="OK"&&!J){if(+((G==="NOTICE"?X:Z).match(Ih)?.[1]??0)>0){let V=uJ(W);qQ.add(V),VG[V]?.close?.(),delete VG[V]}}},Oh=(W)=>{let Y=uJ(W);if(VG[Y])return VG[Y];let G=Nh(Y,(X)=>Kh(Y,X));return VG[Y]=G},Yz=async(W,Y)=>{let G={kind:nT(W),content:Y,pubkey:wh,created_at:oT(),tags:[[pT,W]]},X=PW(w7([0,G.pubkey,G.created_at,G.kind,G.tags,G.content])),J=new Uint8Array(await crypto.subtle.digest("SHA-256",X)),Z=Dz.sign(J,dT);return w7([lT,{...G,id:qz(J),sig:qz(Z)}])},GT=(W,Y)=>{return Mz[W]=Y,w7(["REQ",W,{kinds:[nT(Y)],since:oT(),["#"+pT]:[Y]}])},XT=(W)=>{return delete Mz[W],w7(["CLOSE",W])},iT=Uh({init:(W)=>{let Y=(W?.relayUrls?.length?W.relayUrls:null)??Hh;return Ah(W,Y,zh,!1).map(Oh).map((G)=>G.ready.then(()=>G).catch(()=>null))},subscribe:(W,Y,G,X)=>{let J=DQ(64),Z=DQ(64);yJ[J]=yJ[Z]=(U,Q)=>X(U,Q,async(N,q)=>{if(qQ.has(uJ(W.url)))return;W.send(await Yz(N,q))});let V=()=>{W.send(GT(J,Y)),W.send(GT(Z,G))};return V(),W.reopenHandlers.add(V),()=>{W.reopenHandlers.delete(V),W.send(XT(J)),W.send(XT(Z)),delete yJ[J],delete yJ[Z]}},announce:async(W,Y)=>{if(qQ.has(uJ(W.url)))return;W.send(await Yz(Y,w7({peerId:H8})))},bye:async(W,Y)=>{if(qQ.has(uJ(W.url)))return;W.send(await Yz(Y,w7({peerId:H8,bye:1})))}}),ke=qh(VG),Dh={cellSize:10},Ch=5000,Th=3000,Mh=2000,Rh=2000,Ph=1e4,Lh=30000,Bh=5000,Eh=30000,CQ=(W)=>{let Y=String(W||"").match(/cell-(\d+)/);return Y?Number(Y[1]):null},Gz=(W,Y)=>{let G=CQ(W);if(G==null)return[];let X=[];for(let J=1;J<Y;J*=2){if(G-J>=0)X.push(`cell-${G-J}`);if(G+J<Y)X.push(`cell-${G+J}`)}return X},VQ=(W)=>`c${(CQ(W)||0).toString(36)}`,$h=10,Fh=(W,Y)=>{let G=+Y.cellSize>=2?Y.cellSize|0:$h;return Math.max(1,Math.ceil(W/G))},rT=(W)=>{let Y=0;for(let G=0;G<W.length;G++)Y=Math.imul(Y^W.charCodeAt(G),2654435761);return Y>>>0},A6=(W,Y)=>{let G=0,X=-1;for(let J=0;J<Y;J++){let Z=rT(`${W}:${J}`);if(Z>X)X=Z,G=J}return G};function Sh(W,Y={},G={}){let X={...Dh,...Y},J=1,Z={epoch:0,roster:[H8],set:new Set([H8]),key:H8,C:1,cellId:null,isBridge:!1,bridges:[],edgeBridges:[]},V={cellId:null},U=0,Q=0,N="",q=0,H=0,A=0,I=null,w=null,O=null,M=new Map,S=new Set,g=new Map,c=new Set,u=0,p=new Set,h=new Map,f=()=>Math.min(150,Math.ceil(Math.log2(Z.C+1))*2+3),t=(e)=>Gz(e,Z.C),b=W.on?.bind(W),J0=W.off?.bind(W);if(b)W.on=(e,T0)=>String(e).startsWith("mesh:")?l(e,T0):b(e,T0);if(J0)W.off=(e,T0)=>String(e).startsWith("mesh:")?g.get(e)?.delete(T0):J0(e,T0);let I0=(e)=>(S.add(e),()=>S.delete(e)),k=(e,T0)=>{for(let M0 of S)try{M0(e,T0)}catch(q0){vJ.error("\uD83D\uDD78\uFE0F [Cells] Error in deliver handler:",q0)}},l=(e,T0)=>{if(!g.has(e))g.set(e,new Set);return g.get(e).add(T0),()=>g.get(e)?.delete(T0)},P=(e,...T0)=>{let M0=g.get(e);if(M0)for(let q0 of M0)try{q0(...T0)}catch{}},B=(e)=>{try{return typeof e==="string"?JSON.parse(e):e}catch{return null}},m=()=>`${H8}:${Date.now().toString(36)}:${(u++&65535).toString(36)}`,a=()=>{if(c.size>Ch)c.delete(c.values().next().value)},n=()=>[...new Set([...W._census(),H8])].sort(),E=(e,T0,M0)=>T0.filter((q0)=>A6(q0,M0)===e),$=(e,T0,M0)=>{if(e==null)return null;let q0=(t0)=>rT(`${t0}@${e}`),_0=null,Y1=-1;for(let t0 of E(e,T0,M0)){let $1=q0(t0);if($1>Y1)Y1=$1,_0=t0}return _0},_=(e)=>{let T0=Z.audience?.get(e);if(!T0)return[];return Object.keys(W.getPeers?.()||{}).filter((M0)=>T0.has(M0))},x=(e,T0)=>{if(e!==w&&!(Z.isBridge&&Z.bridges.some((r0)=>VQ(r0)===e)))return;let M0=B(T0);if(!M0?.id||!M0?.t)return;if(c.has(M0.id))return;c.add(M0.id),a();let{t:q0,id:_0,ttl:Y1,data:t0,origin:$1,originCell:Y8}=M0,e0=Z.cellId;if(q0==="ping"&&t0?.pingId&&t0.target===H8&&$1!==H8){let r0={t:"pong",id:m(),ttl:f(),data:{pingId:t0.pingId,receivedAt:Date.now()},origin:H8,originCell:e0},t1=W.getPeers?.()?.[$1]?[$1]:_(e0);I?.send(JSON.stringify(r0),t1)}if(q0==="pong"&&t0?.pingId){let r0=h.get(t0.pingId);if(r0)clearTimeout(r0.timeout),r0.resolve(Date.now()-r0.start),h.delete(t0.pingId)}if(q0==="msg"&&$1!==H8)k(t0,$1);if(!Z.isBridge)return;if((Y1??0)<=0)return;let D1=(r0,t1,t8=null)=>{if(!r0||!t1.length)return;let C8={t:q0,id:_0,ttl:t8??(Y1??f())-1,data:t0,origin:$1||H8,originCell:Y8||e0};r0.send(JSON.stringify(C8),t1)};if(e===w){for(let r0 of t(e0))D1(R(r0),_(r0));return}D1(I,_(e0));for(let r0 of t(e0))if(VQ(r0)!==e)D1(R(r0),_(r0))},R=(e)=>{let T0=VQ(e),M0=W.channel(T0);if(!p.has(T0))p.add(T0),M0.on("message",(q0)=>x(T0,q0));return M0},v=()=>{if(!Z.cellId)return;if(w=VQ(Z.cellId),I=W.channel(w),!p.has(w))p.add(w),I.on("message",(e)=>x(w,e));if(Z.isBridge)for(let e of t(Z.cellId))R(e)},X0=(e,T0)=>{if(!e.cellId||!e.set.has(T0))return!1;let M0=`cell-${A6(T0,e.C)}`;return M0===e.cellId||e.bridges.includes(M0)||Gz(M0,e.C).includes(e.cellId)&&$(A6(T0,e.C),e.roster,e.C)===T0},V0=(e)=>Z.set.size<2&&(V.set?.size??0)<2||X0(Z,e)||Date.now()<U&&X0(V,e),Q0=()=>{let e=W.getPeers?.()||{};for(let T0 of Object.keys(e))if(!V0(T0))e[T0].close?.()};G.admit=V0;let F0=()=>({epoch:Z.epoch,cellId:Z.cellId,isBridge:Z.isBridge,bridges:Z.bridges,roster:[...Z.roster],cellSize:J,dynamicTTL:f(),totalCells:Z.C}),y0=()=>{H=Date.now();for(let[e,T0]of M){if(e===H8)continue;P("mesh:peer-state",{id:e,cell:T0.cell,bridges:T0.bridges,timestamp:H})}},A1=(e)=>{let T0=Fh(e.length,X);J=Math.ceil(e.length/T0);let M0=`cell-${A6(H8,T0)}`,q0=new Map,_0=new Set,Y1=new Map,t0=(r0)=>Y1.get(r0)??Y1.set(r0,new Set).get(r0);for(let r0 of e)t0(`cell-${A6(r0,T0)}`).add(r0);let $1=new Map,Y8=(r0)=>$1.has(r0)?$1.get(r0):$1.set(r0,$(r0,e,T0)).get(r0);for(let r0 of new Set(e.map((t1)=>A6(t1,T0)))){let t1=`cell-${r0}`;for(let t8 of Gz(t1,T0)){if(CQ(t8)<r0)continue;for(let C8 of[Y8(r0),Y8(CQ(t8))]){if(!C8)continue;let w5=`cell-${A6(C8,T0)}`===t1?t8:t1,d=q0.get(C8)??[];if(!d.includes(w5))d.push(w5);if(q0.set(C8,d),t0(t1).add(C8),t0(t8).add(C8),t1===M0||t8===M0)_0.add(C8)}}}let e0=q0.get(H8)??[],D1=Z.cellId!==M0||String(Z.bridges)!==String(e0);V=Z,Z={epoch:Z.epoch+1,roster:e,set:new Set(e),key:e.join("|"),C:T0,cellId:M0,isBridge:e0.length>0,bridges:e0,edgeBridges:[..._0],audience:Y1},A=Date.now(),M.clear();for(let r0 of e){let t1=q0.get(r0)??[];M.set(r0,{cell:`cell-${A6(r0,T0)}`,isBridge:t1.length>0,bridges:t1})}if(U=Date.now()+Bh,D1)v();vJ.info("\uD83D\uDD78\uFE0F [Cells] seal",{epoch:Z.epoch,myCell:M0,bridges:e0,C:T0,roster:e.length}),y0(),P("mesh:state",F0())},v1=()=>{let e=n(),T0=e.join("|");if(T0===Z.key)Q=0;else{let M0=Date.now();if(Q||=M0,T0!==N)N=T0,q=M0;if(e.some((q0)=>!Z.set.has(q0))||Z.edgeBridges.some((q0)=>!e.includes(q0))||(W._gone?.()??[]).some((q0)=>Z.set.has(q0))?M0-q>=Rh||M0-Q>=Ph:M0-Q>=Lh)Q=0,A1(e)}if(U&&Date.now()>=U)U=0,Q0()},G0=()=>{if(O)return;O=setInterval(()=>{if(v1(),Date.now()-H>=Eh)y0()},Mh)},C0=()=>{if(O)clearInterval(O),O=null},B0=(e)=>{return new Promise((T0,M0)=>{let q0=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,_0=Date.now(),Y1=setTimeout(()=>{h.delete(q0),M0(Error("Ping timeout"))},Th);h.set(q0,{start:_0,resolve:T0,reject:M0,timeout:Y1,peerId:e});let t0={t:"ping",id:m(),ttl:f(),data:{pingId:q0,target:e},origin:H8,originCell:Z.cellId};I?.send(JSON.stringify(t0),_(Z.cellId))})};return W.on?.("peer:join",()=>v1()),W.on?.("peer:leave",()=>v1()),A1(n()),G0(),{send:(e)=>{let T0={t:"msg",id:m(),ttl:f(),data:e,origin:H8,originCell:Z.cellId},M0=JSON.stringify(T0);I.send(M0,_(Z.cellId)),x(w,M0)},on:(e,T0)=>e==="message"?I0(T0):void 0,ping:B0,getState:()=>({...F0(),knownCells:new Set([...M.values()].map((e)=>e.cell)).size}),getPeerInfo:()=>new Map(M),getStableRoster:()=>[...Z.roster],getKnownCells:()=>{let e=new Map;for(let[T0,{cell:M0}]of M)if(!e.has(M0))e.set(M0,{lastSeen:A,peerId:T0});return e},getCellSize:()=>J,destroy:()=>{C0(),h.forEach((e)=>clearTimeout(e.timeout)),h.clear()}}}function xh(W,Y,G){let X={},J=iT({...W,admit:(Q)=>X.admit?.(Q)??!0},Y,G),Z=W.overlay||{},V=Sh(J,Z,X),U=new Map;return{on:(Q,N)=>J.on(Q,N),off:(Q,N)=>J.off?.(Q,N),channel:(Q)=>{if(U.has(Q))return U.get(Q);let N=J.channel(Q),q={send:(H,A)=>{if(A){let I=[].concat(A),w=J.getPeers?.()||{};if(I.every((O)=>w[O]))return N.send(H,A)}V.send({_ch:Q,_d:H,_t:A})},on:(H,A)=>{if(H==="message")V.on("message",(I,w)=>{if(I?._ch!==Q)return;if(I._t&&![].concat(I._t).includes(H8))return;A(I._d,w)}),N.on(H,A);else N.on(H,A)},off:(H,A)=>N.off?.(H,A),_original:N};return U.set(Q,q),q},get id(){return J.id},get peers(){return J.peers},getPeers:()=>J.getPeers?.()||{},mesh:V,_room:J,getState:()=>V.getState(),getPeerInfo:()=>V.getPeerInfo(),ping:(Q)=>V.ping(Q),leave:()=>{V.destroy(),U.clear(),J.leave()},destroy:()=>{V.destroy(),U.clear()}}}var Rz=(W,Y,G)=>W?.cells||W?.overlay?xh(W,Y,G):iT(W,Y,G);import{randomBytes as IS}from"crypto";function kh(){var W,Y=!1,G=this;G._DeArray=function(X,J,Z){return[X.slice(J,J+Z)]},G._EnArray=function(X,J,Z,V){for(var U=0;U<Z;X[J+U]=V[U]?V[U]:0,U++);},G._DeChar=function(X,J){return String.fromCharCode(X[J])},G._EnChar=function(X,J,Z){X[J]=Z.charCodeAt(0)},G._DeInt=function(X,J){var Z=Y?W.len-1:0,V=Y?-1:1,U=Z+V*W.len,Q,N,q;for(Q=0,N=Z,q=1;N!=U;Q+=X[J+N]*q,N+=V,q*=256);if(W.bSigned&&Q&Math.pow(2,W.len*8-1))Q-=Math.pow(2,W.len*8);return Q},G._EnInt=function(X,J,Z){var V=Y?W.len-1:0,U=Y?-1:1,Q=V+U*W.len,N;Z=Z<W.min?W.min:Z>W.max?W.max:Z;for(N=V;N!=Q;X[J+N]=Z&255,N+=U,Z>>=8);},G._DeString=function(X,J,Z){for(var V=Array(Z),U=0;U<Z;V[U]=String.fromCharCode(X[J+U]),U++);return V.join("")},G._EnString=function(X,J,Z,V){for(var U,Q=0;Q<Z;X[J+Q]=(U=V.charCodeAt(Q))?U:0,Q++);},G._De754=function(X,J){var Z,V,U,Q,N,q,H,A,I,w;H=W.mLen,A=W.len*8-W.mLen-1,w=(1<<A)-1,I=w>>1,Q=Y?0:W.len-1,N=Y?1:-1,Z=X[J+Q],Q+=N,q=-7;for(V=Z&(1<<-q)-1,Z>>=-q,q+=A;q>0;V=V*256+X[J+Q],Q+=N,q-=8);for(U=V&(1<<-q)-1,V>>=-q,q+=H;q>0;U=U*256+X[J+Q],Q+=N,q-=8);switch(V){case 0:V=1-I;break;case w:return U?NaN:(Z?-1:1)*(1/0);default:U=U+Math.pow(2,H),V=V-I;break}return(Z?-1:1)*U*Math.pow(2,V-H)},G._En754=function(X,J,Z){var V,U,Q,N,q,H,A,I,w,O;if(A=W.mLen,I=W.len*8-W.mLen-1,O=(1<<I)-1,w=O>>1,V=Z<0?1:0,Z=Math.abs(Z),isNaN(Z)||Z==1/0)Q=isNaN(Z)?1:0,U=O;else{if(U=Math.floor(Math.log(Z)/Math.LN2),Z*(H=Math.pow(2,-U))<1)U--,H*=2;if(U+w>=1)Z+=W.rt/H;else Z+=W.rt*Math.pow(2,1-w);if(Z*H>=2)U++,H/=2;if(U+w>=O)Q=0,U=O;else if(U+w>=1)Q=(Z*H-1)*Math.pow(2,A),U=U+w;else Q=Z*Math.pow(2,w-1)*Math.pow(2,A),U=0}for(N=Y?W.len-1:0,q=Y?-1:1;A>=8;X[J+N]=Q&255,N+=q,Q/=256,A-=8);for(U=U<<A|Q,I+=A;I>0;X[J+N]=U&255,N+=q,U/=256,I-=8);X[J+N-q]|=V*128},G._DeInt64=function(X,J){var Z=Y?0:7,V=Y?1:-1,U=Z+V*8,Q=[0,0,!W.bSigned],N,q,H;for(N=Z,H=1,q=0;N!=U;Q[H]=(Q[H]<<8>>>0)+X[J+N],N+=V,q++,H=q<4?1:0);return Q},G._EnInt64=function(X,J,Z){var V=Y?0:7,U=Y?1:-1,Q=V+U*8,N,q,H,A;for(N=V,H=1,q=0,A=24;N!=Q;X[J+N]=Z[H]>>A&255,N+=U,q++,H=q<4?1:0,A=24-8*(q%4));},G._sPattern="(\\d + )?([AxcbBhHsfdiIlLqQ])",G._lenLut={A:1,x:1,c:1,b:1,B:1,h:2,H:2,s:1,f:4,d:8,i:4,I:4,l:4,L:4,q:8,Q:8},G._elLut={A:{en:G._EnArray,de:G._DeArray},s:{en:G._EnString,de:G._DeString},c:{en:G._EnChar,de:G._DeChar},b:{en:G._EnInt,de:G._DeInt,len:1,bSigned:!0,min:-Math.pow(2,7),max:Math.pow(2,7)-1},B:{en:G._EnInt,de:G._DeInt,len:1,bSigned:!1,min:0,max:Math.pow(2,8)-1},h:{en:G._EnInt,de:G._DeInt,len:2,bSigned:!0,min:-Math.pow(2,15),max:Math.pow(2,15)-1},H:{en:G._EnInt,de:G._DeInt,len:2,bSigned:!1,min:0,max:Math.pow(2,16)-1},i:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!0,min:-Math.pow(2,31),max:Math.pow(2,31)-1},I:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!1,min:0,max:Math.pow(2,32)-1},l:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!0,min:-Math.pow(2,31),max:Math.pow(2,31)-1},L:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!1,min:0,max:Math.pow(2,32)-1},f:{en:G._En754,de:G._De754,len:4,mLen:23,rt:Math.pow(2,-24)-Math.pow(2,-77)},d:{en:G._En754,de:G._De754,len:8,mLen:52,rt:0},q:{en:G._EnInt64,de:G._DeInt64,bSigned:!0},Q:{en:G._EnInt64,de:G._DeInt64,bSigned:!1}},G._UnpackSeries=function(X,J,Z,V){for(var U=W.de,Q=[],N=0;N<X;Q.push(U(Z,V+N*J)),N++);return Q},G._PackSeries=function(X,J,Z,V,U,Q){for(var N=W.en,q=0;q<X;N(Z,V+q*J,U[Q+q]),q++);},G.Unpack=function(X,J,Z){Y=X.charAt(0)!="<",Z=Z?Z:0;var V=new RegExp(this._sPattern,"g"),U,Q,N,q=[];while(U=V.exec(X)){if(Q=U[1]==null||U[1]==""?1:parseInt(U[1]),N=this._lenLut[U[2]],Z+Q*N>J.length)return;switch(U[2]){case"A":case"s":q.push(this._elLut[U[2]].de(J,Z,Q));break;case"c":case"b":case"B":case"h":case"H":case"i":case"I":case"l":case"L":case"f":case"d":case"q":case"Q":W=this._elLut[U[2]],q.push(this._UnpackSeries(Q,N,J,Z));break}Z+=Q*N}return Array.prototype.concat.apply([],q)},G.PackTo=function(X,J,Z,V){Y=X.charAt(0)!="<";var U=new RegExp(this._sPattern,"g"),Q,N,q,H,A=0;while(Q=U.exec(X)){if(N=Q[1]==null||Q[1]==""?1:parseInt(Q[1]),q=this._lenLut[Q[2]],Z+N*q>J.length)return!1;switch(Q[2]){case"A":case"s":if(A+1>V.length)return!1;this._elLut[Q[2]].en(J,Z,N,V[A]),A+=1;break;case"c":case"b":case"B":case"h":case"H":case"i":case"I":case"l":case"L":case"f":case"d":case"q":case"Q":if(W=this._elLut[Q[2]],A+N>V.length)return!1;this._PackSeries(N,q,J,Z,V,A),A+=N;break;case"x":for(H=0;H<N;H++)J[Z+H]=0;break}Z+=N*q}return J},G.Pack=function(X,J){return this.PackTo(X,Array(this.CalcLength(X)),0,J)},G.CalcLength=function(X){var J=new RegExp(this._sPattern,"g"),Z=0,V;while(V=J.exec(X))Z+=(V[1]==null||V[1]==""?1:parseInt(V[1]))*this._lenLut[V[2]];return Z}}var a1=new kh;var LS=y1(ZM(),1),NA=y1(gz(),1);import{createSocket as kd}from"dgram";import{createSocket as vd}from"dgram";import*as BS from"net";import{connect as gd}from"net";import{createSign as hd,randomBytes as bd,webcrypto as md}from"crypto";var KN0=y1(_M(),1);var R7={};qH(R7,{verifySchema:()=>lm,fromBER:()=>Q4,compareSchema:()=>J4,VisibleString:()=>FW,ViewWriter:()=>dJ,VideotexString:()=>RG,ValueBlock:()=>W9,Utf8String:()=>h5,UniversalString:()=>DG,UTCTime:()=>SW,TimeOfDay:()=>aQ,TeletexString:()=>MG,TIME:()=>eQ,Set:()=>f9,Sequence:()=>_9,Repeated:()=>IG,RelativeObjectIdentifier:()=>iQ,RawData:()=>PR,PrintableString:()=>TG,Primitive:()=>K6,OctetString:()=>T7,ObjectIdentifier:()=>KG,NumericString:()=>CG,Null:()=>C7,Integer:()=>O6,IA5String:()=>PG,HexBlock:()=>D7,GraphicString:()=>LG,GeneralizedTime:()=>$G,GeneralString:()=>BG,Enumerated:()=>jG,EndOfContent:()=>oQ,Duration:()=>tQ,DateTime:()=>sQ,DEFAULT_MAX_NODES:()=>oM,DEFAULT_MAX_DEPTH:()=>dM,DEFAULT_MAX_CONTENT_LENGTH:()=>nM,DATE:()=>rQ,Constructed:()=>c8,Choice:()=>nJ,CharacterString:()=>EG,Boolean:()=>wG,BmpString:()=>OG,BitString:()=>M7,BaseStringBlock:()=>lQ,BaseBlock:()=>k8,Any:()=>V4});/*!
|
|
147
|
+
`),Zq.prototype[W]=Y.toFunction({assertSize:Rj})});ZE.exports=Zq;function Rj(W,Y){if(W>Y)throw new fp(W,Y)}});var j8=U1((aN0,IE)=>{var Pj=wV(),cp=hB(),pp=cB(),lp=lB(),dp=oB(),op=rB(),UE=sB(),np=eB(),ip=GE(),{encode:qE}=KV(),{decode:AE}=IX(),{encodingLength:rp}=OV(),ap=VE(),HE=HX(),zE={array:cp,bool:lp,buffer:pp,reserved:dp,string:op,when:np,select:ip};for(let W of Object.keys(UE))zE[W]=UE[W];var Vq=Symbol("schema");function QE(W){let Y=new Pj({readableObjectMode:!1,writableObjectMode:!0,transform:sp});return Y[Vq]=W,Y}function NE(W){let Y=null,G=Buffer.isBuffer(W);if(!G)Y=W;let X=new Pj({transform:tp,readableObjectMode:!0,writableObjectMode:!1});if(X[Vq]=Y,G)X.append(W);return X}function sp(W,Y,G){try{qE(W,this[Vq],this);let X=this.slice();this.consume(X.length),G(null,X)}catch(X){G(X)}}function tp(W,Y,G){this.append(W);try{while(this.length>0){let X=new ap(this),J=AE(X,this[Vq]);X.commit(),this.push(J)}G()}catch(X){if(X instanceof HE)G();else G(X)}}IE.exports={createEncodeStream:QE,createDecodeStream:NE,encode:qE,decode:AE,encodingLength:rp,createEncode:QE,createDecode:NE,types:zE,BinaryStream:Pj,NotEnoughDataError:HE}});var z$=U1((A$)=>{Object.defineProperty(A$,"__esModule",{value:!0});A$.LEB128=A$.SignedLEB128=A$.UnsignedLEB128=void 0;var TX;(function(W){W[W.LOWER_7=127]="LOWER_7",W[W.UPPER_1=128]="UPPER_1"})(TX||(TX={}));var q$=(W)=>Number.isSafeInteger(W);class MX{static decode(W,Y=0){let G=this.$scanForNullBytes(W,Y),X=0,J=0;for(let Z=0;Z<=G-Y;Z++){let V=W[Y+Z]&TX.LOWER_7;X|=V<<J,J+=7}return X}static encode(W){if(this.check(W),W<0)throw Error(`An unsigned number must NOT be negative, ${W} is!`);let Y=[],G=W;do{let X=G&TX.LOWER_7;if(G>>=7,G)X=X|TX.UPPER_1;Y.push(X)}while(G);return Uint8Array.from(Y)}static check(W){if(!q$(W))throw Error(`${W} is not a safe integer!`)}static $scanForNullBytes(W,Y=0){let G=Y,X=0;do{if(G>=W.byteLength)throw Error("This is not a LEB128-encoded Uint8Array, no ending found!");X=W.slice(G,G+1)[0],G++}while(X&TX.UPPER_1);return G-1}static getLength(W,Y=0){return this.$scanForNullBytes(W,Y)-Y}}A$.UnsignedLEB128=MX;class Cq{static $ceil7mul(W){let Y=W;while(Y%7)Y++;return Y}static check(W){if(!q$(W))throw Error(`${W} is not a safe integer!`)}static encode(W){if(this.check(W),W>=0)throw Error(`A signed number must be negative, ${W} isn't!`);let Y=Math.ceil(Math.log2(-W));return MX.encode((1<<this.$ceil7mul(Y))+W)}static decode(W,Y=0){let G=MX.decode(W,Y);return-((1<<Math.ceil(Math.log2(G)))-G)}}A$.SignedLEB128=Cq;class Tq{}A$.LEB128=Tq;Tq.encode=(W)=>(W>=0?MX:Cq).encode(W);Tq.decode=(W,Y=0,G=!1)=>(G?Cq:MX).decode(W,Y)});var w$=U1((dj,I$)=>{/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */(function(W){function Y(E){return parseInt(E)===E}function G(E){if(!Y(E.length))return!1;for(var $=0;$<E.length;$++)if(!Y(E[$])||E[$]<0||E[$]>255)return!1;return!0}function X(E,$){if(E.buffer&&E.name==="Uint8Array"){if($)if(E.slice)E=E.slice();else E=Array.prototype.slice.call(E);return E}if(Array.isArray(E)){if(!G(E))throw Error("Array contains invalid value: "+E);return new Uint8Array(E)}if(Y(E.length)&&G(E))return new Uint8Array(E);throw Error("unsupported array-like object")}function J(E){return new Uint8Array(E)}function Z(E,$,_,x,R){if(x!=null||R!=null)if(E.slice)E=E.slice(x,R);else E=Array.prototype.slice.call(E,x,R);$.set(E,_)}var V=function(){function E(_){var x=[],R=0;_=encodeURI(_);while(R<_.length){var v=_.charCodeAt(R++);if(v===37)x.push(parseInt(_.substr(R,2),16)),R+=2;else x.push(v)}return X(x)}function $(_){var x=[],R=0;while(R<_.length){var v=_[R];if(v<128)x.push(String.fromCharCode(v)),R++;else if(v>191&&v<224)x.push(String.fromCharCode((v&31)<<6|_[R+1]&63)),R+=2;else x.push(String.fromCharCode((v&15)<<12|(_[R+1]&63)<<6|_[R+2]&63)),R+=3}return x.join("")}return{toBytes:E,fromBytes:$}}(),U=function(){function E(x){var R=[];for(var v=0;v<x.length;v+=2)R.push(parseInt(x.substr(v,2),16));return R}var $="0123456789abcdef";function _(x){var R=[];for(var v=0;v<x.length;v++){var X0=x[v];R.push($[(X0&240)>>4]+$[X0&15])}return R.join("")}return{toBytes:E,fromBytes:_}}(),Q={16:10,24:12,32:14},N=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],q=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],H=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],A=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],I=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],w=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],O=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],M=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],S=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],g=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239000,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],c=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998000,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],u=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],p=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],h=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239000,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],f=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998000,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function t(E){var $=[];for(var _=0;_<E.length;_+=4)$.push(E[_]<<24|E[_+1]<<16|E[_+2]<<8|E[_+3]);return $}var b=function(E){if(!(this instanceof b))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:X(E,!0)}),this._prepare()};b.prototype._prepare=function(){var E=Q[this.key.length];if(E==null)throw Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var $=0;$<=E;$++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var _=(E+1)*4,x=this.key.length/4,R=t(this.key),v;for(var $=0;$<x;$++)v=$>>2,this._Ke[v][$%4]=R[$],this._Kd[E-v][$%4]=R[$];var X0=0,V0=x,Q0;while(V0<_){if(Q0=R[x-1],R[0]^=q[Q0>>16&255]<<24^q[Q0>>8&255]<<16^q[Q0&255]<<8^q[Q0>>24&255]^N[X0]<<24,X0+=1,x!=8)for(var $=1;$<x;$++)R[$]^=R[$-1];else{for(var $=1;$<x/2;$++)R[$]^=R[$-1];Q0=R[x/2-1],R[x/2]^=q[Q0&255]^q[Q0>>8&255]<<8^q[Q0>>16&255]<<16^q[Q0>>24&255]<<24;for(var $=x/2+1;$<x;$++)R[$]^=R[$-1]}var $=0,F0,y0;while($<x&&V0<_)F0=V0>>2,y0=V0%4,this._Ke[F0][y0]=R[$],this._Kd[E-F0][y0]=R[$++],V0++}for(var F0=1;F0<E;F0++)for(var y0=0;y0<4;y0++)Q0=this._Kd[F0][y0],this._Kd[F0][y0]=u[Q0>>24&255]^p[Q0>>16&255]^h[Q0>>8&255]^f[Q0&255]},b.prototype.encrypt=function(E){if(E.length!=16)throw Error("invalid plaintext size (must be 16 bytes)");var $=this._Ke.length-1,_=[0,0,0,0],x=t(E);for(var R=0;R<4;R++)x[R]^=this._Ke[0][R];for(var v=1;v<$;v++){for(var R=0;R<4;R++)_[R]=A[x[R]>>24&255]^I[x[(R+1)%4]>>16&255]^w[x[(R+2)%4]>>8&255]^O[x[(R+3)%4]&255]^this._Ke[v][R];x=_.slice()}var X0=J(16),V0;for(var R=0;R<4;R++)V0=this._Ke[$][R],X0[4*R]=(q[x[R]>>24&255]^V0>>24)&255,X0[4*R+1]=(q[x[(R+1)%4]>>16&255]^V0>>16)&255,X0[4*R+2]=(q[x[(R+2)%4]>>8&255]^V0>>8)&255,X0[4*R+3]=(q[x[(R+3)%4]&255]^V0)&255;return X0},b.prototype.decrypt=function(E){if(E.length!=16)throw Error("invalid ciphertext size (must be 16 bytes)");var $=this._Kd.length-1,_=[0,0,0,0],x=t(E);for(var R=0;R<4;R++)x[R]^=this._Kd[0][R];for(var v=1;v<$;v++){for(var R=0;R<4;R++)_[R]=M[x[R]>>24&255]^S[x[(R+3)%4]>>16&255]^g[x[(R+2)%4]>>8&255]^c[x[(R+1)%4]&255]^this._Kd[v][R];x=_.slice()}var X0=J(16),V0;for(var R=0;R<4;R++)V0=this._Kd[$][R],X0[4*R]=(H[x[R]>>24&255]^V0>>24)&255,X0[4*R+1]=(H[x[(R+3)%4]>>16&255]^V0>>16)&255,X0[4*R+2]=(H[x[(R+2)%4]>>8&255]^V0>>8)&255,X0[4*R+3]=(H[x[(R+1)%4]&255]^V0)&255;return X0};var J0=function(E){if(!(this instanceof J0))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new b(E)};J0.prototype.encrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16)Z(E,_,0,x,x+16),_=this._aes.encrypt(_),Z(_,$,x);return $},J0.prototype.decrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid ciphertext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16)Z(E,_,0,x,x+16),_=this._aes.decrypt(_),Z(_,$,x);return $};var I0=function(E,$){if(!(this instanceof I0))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!$)$=J(16);else if($.length!=16)throw Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=X($,!0),this._aes=new b(E)};I0.prototype.encrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16){Z(E,_,0,x,x+16);for(var R=0;R<16;R++)_[R]^=this._lastCipherblock[R];this._lastCipherblock=this._aes.encrypt(_),Z(this._lastCipherblock,$,x)}return $},I0.prototype.decrypt=function(E){if(E=X(E),E.length%16!==0)throw Error("invalid ciphertext size (must be multiple of 16 bytes)");var $=J(E.length),_=J(16);for(var x=0;x<E.length;x+=16){Z(E,_,0,x,x+16),_=this._aes.decrypt(_);for(var R=0;R<16;R++)$[x+R]=_[R]^this._lastCipherblock[R];Z(E,this._lastCipherblock,0,x,x+16)}return $};var k=function(E,$,_){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!$)$=J(16);else if($.length!=16)throw Error("invalid initialation vector size (must be 16 size)");if(!_)_=1;this.segmentSize=_,this._shiftRegister=X($,!0),this._aes=new b(E)};k.prototype.encrypt=function(E){if(E.length%this.segmentSize!=0)throw Error("invalid plaintext size (must be segmentSize bytes)");var $=X(E,!0),_;for(var x=0;x<$.length;x+=this.segmentSize){_=this._aes.encrypt(this._shiftRegister);for(var R=0;R<this.segmentSize;R++)$[x+R]^=_[R];Z(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Z($,this._shiftRegister,16-this.segmentSize,x,x+this.segmentSize)}return $},k.prototype.decrypt=function(E){if(E.length%this.segmentSize!=0)throw Error("invalid ciphertext size (must be segmentSize bytes)");var $=X(E,!0),_;for(var x=0;x<$.length;x+=this.segmentSize){_=this._aes.encrypt(this._shiftRegister);for(var R=0;R<this.segmentSize;R++)$[x+R]^=_[R];Z(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Z(E,this._shiftRegister,16-this.segmentSize,x,x+this.segmentSize)}return $};var l=function(E,$){if(!(this instanceof l))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!$)$=J(16);else if($.length!=16)throw Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=X($,!0),this._lastPrecipherIndex=16,this._aes=new b(E)};l.prototype.encrypt=function(E){var $=X(E,!0);for(var _=0;_<$.length;_++){if(this._lastPrecipherIndex===16)this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0;$[_]^=this._lastPrecipher[this._lastPrecipherIndex++]}return $},l.prototype.decrypt=l.prototype.encrypt;var P=function(E){if(!(this instanceof P))throw Error("Counter must be instanitated with `new`");if(E!==0&&!E)E=1;if(typeof E==="number")this._counter=J(16),this.setValue(E);else this.setBytes(E)};P.prototype.setValue=function(E){if(typeof E!=="number"||parseInt(E)!=E)throw Error("invalid counter value (must be an integer)");if(E>Number.MAX_SAFE_INTEGER)throw Error("integer value out of safe range");for(var $=15;$>=0;--$)this._counter[$]=E%256,E=parseInt(E/256)},P.prototype.setBytes=function(E){if(E=X(E,!0),E.length!=16)throw Error("invalid counter bytes size (must be 16 bytes)");this._counter=E},P.prototype.increment=function(){for(var E=15;E>=0;E--)if(this._counter[E]===255)this._counter[E]=0;else{this._counter[E]++;break}};var B=function(E,$){if(!(this instanceof B))throw Error("AES must be instanitated with `new`");if(this.description="Counter",this.name="ctr",!($ instanceof P))$=new P($);this._counter=$,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new b(E)};B.prototype.encrypt=function(E){var $=X(E,!0);for(var _=0;_<$.length;_++){if(this._remainingCounterIndex===16)this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment();$[_]^=this._remainingCounter[this._remainingCounterIndex++]}return $},B.prototype.decrypt=B.prototype.encrypt;function m(E){E=X(E,!0);var $=16-E.length%16,_=J(E.length+$);Z(E,_);for(var x=E.length;x<_.length;x++)_[x]=$;return _}function a(E){if(E=X(E,!0),E.length<16)throw Error("PKCS#7 invalid length");var $=E[E.length-1];if($>16)throw Error("PKCS#7 padding byte out of range");var _=E.length-$;for(var x=0;x<$;x++)if(E[_+x]!==$)throw Error("PKCS#7 invalid padding byte");var R=J(_);return Z(E,R,0,0,_),R}var n={AES:b,Counter:P,ModeOfOperation:{ecb:J0,cbc:I0,cfb:k,ofb:l,ctr:B},utils:{hex:U,utf8:V},padding:{pkcs7:{pad:m,strip:a}},_arrayTest:{coerceArray:X,createArray:J,copyArray:Z}};if(typeof dj<"u")I$.exports=n;else if(typeof define==="function"&&define.amd)define([],function(){return n});else{if(W.aesjs)n._aesjs=W.aesjs;W.aesjs=n}})(dj)});var rj=U1((T$)=>{var X1=T$,{Buffer:Lq}=x8("buffer"),ul=x8("os");X1.toBuffer=function(W,Y,G){G=~~G;let X;if(this.isV4Format(W))X=Y||Lq.alloc(G+4),W.split(/\./g).map((J)=>{X[G++]=parseInt(J,10)&255});else if(this.isV6Format(W)){let J=W.split(":",8),Z;for(Z=0;Z<J.length;Z++){let V=this.isV4Format(J[Z]),U;if(V)U=this.toBuffer(J[Z]),J[Z]=U.slice(0,2).toString("hex");if(U&&++Z<8)J.splice(Z,0,U.slice(2,4).toString("hex"))}if(J[0]==="")while(J.length<8)J.unshift("0");else if(J[J.length-1]==="")while(J.length<8)J.push("0");else if(J.length<8){for(Z=0;Z<J.length&&J[Z]!=="";Z++);let V=[Z,1];for(Z=9-J.length;Z>0;Z--)V.push("0");J.splice(...V)}X=Y||Lq.alloc(G+16);for(Z=0;Z<J.length;Z++){let V=parseInt(J[Z],16);X[G++]=V>>8&255,X[G++]=V&255}}if(!X)throw Error(`Invalid ip address: ${W}`);return X};X1.toString=function(W,Y,G){Y=~~Y,G=G||W.length-Y;let X=[];if(G===4){for(let J=0;J<G;J++)X.push(W[Y+J]);X=X.join(".")}else if(G===16){for(let J=0;J<G;J+=2)X.push(W.readUInt16BE(Y+J).toString(16));X=X.join(":"),X=X.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),X=X.replace(/:{3,4}/,"::")}return X};var hl=/^(\d{1,3}\.){3,3}\d{1,3}$/,bl=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;X1.isV4Format=function(W){return hl.test(W)};X1.isV6Format=function(W){return bl.test(W)};function FV(W){if(W===4)return"ipv4";if(W===6)return"ipv6";return W?W.toLowerCase():"ipv4"}X1.fromPrefixLen=function(W,Y){if(W>32)Y="ipv6";else Y=FV(Y);let G=4;if(Y==="ipv6")G=16;let X=Lq.alloc(G);for(let J=0,Z=X.length;J<Z;++J){let V=8;if(W<8)V=W;W-=V,X[J]=~(255>>V)&255}return X1.toString(X)};X1.mask=function(W,Y){W=X1.toBuffer(W),Y=X1.toBuffer(Y);let G=Lq.alloc(Math.max(W.length,Y.length)),X;if(W.length===Y.length)for(X=0;X<W.length;X++)G[X]=W[X]&Y[X];else if(Y.length===4)for(X=0;X<Y.length;X++)G[X]=W[W.length-4+X]&Y[X];else{for(X=0;X<G.length-6;X++)G[X]=0;G[10]=255,G[11]=255;for(X=0;X<W.length;X++)G[X+12]=W[X]&Y[X+12];X+=12}for(;X<G.length;X++)G[X]=0;return X1.toString(G)};X1.cidr=function(W){let Y=W.split("/"),G=Y[0];if(Y.length!==2)throw Error(`invalid CIDR subnet: ${G}`);let X=X1.fromPrefixLen(parseInt(Y[1],10));return X1.mask(G,X)};X1.subnet=function(W,Y){let G=X1.toLong(X1.mask(W,Y)),X=X1.toBuffer(Y),J=0;for(let V=0;V<X.length;V++)if(X[V]===255)J+=8;else{let U=X[V]&255;while(U)U=U<<1&255,J++}let Z=2**(32-J);return{networkAddress:X1.fromLong(G),firstAddress:Z<=2?X1.fromLong(G):X1.fromLong(G+1),lastAddress:Z<=2?X1.fromLong(G+Z-1):X1.fromLong(G+Z-2),broadcastAddress:X1.fromLong(G+Z-1),subnetMask:Y,subnetMaskLength:J,numHosts:Z<=2?Z:Z-2,length:Z,contains(V){return G===X1.toLong(X1.mask(V,Y))}}};X1.cidrSubnet=function(W){let Y=W.split("/"),G=Y[0];if(Y.length!==2)throw Error(`invalid CIDR subnet: ${G}`);let X=X1.fromPrefixLen(parseInt(Y[1],10));return X1.subnet(G,X)};X1.not=function(W){let Y=X1.toBuffer(W);for(let G=0;G<Y.length;G++)Y[G]=255^Y[G];return X1.toString(Y)};X1.or=function(W,Y){if(W=X1.toBuffer(W),Y=X1.toBuffer(Y),W.length===Y.length){for(let Z=0;Z<W.length;++Z)W[Z]|=Y[Z];return X1.toString(W)}let G=W,X=Y;if(Y.length>W.length)G=Y,X=W;let J=G.length-X.length;for(let Z=J;Z<G.length;++Z)G[Z]|=X[Z-J];return X1.toString(G)};X1.isEqual=function(W,Y){if(W=X1.toBuffer(W),Y=X1.toBuffer(Y),W.length===Y.length){for(let X=0;X<W.length;X++)if(W[X]!==Y[X])return!1;return!0}if(Y.length===4){let X=Y;Y=W,W=X}for(let X=0;X<10;X++)if(Y[X]!==0)return!1;let G=Y.readUInt16BE(10);if(G!==0&&G!==65535)return!1;for(let X=0;X<4;X++)if(W[X]!==Y[X+12])return!1;return!0};X1.isPrivate=function(W){if(X1.isLoopback(W))return!0;if(!X1.isV6Format(W)){let Y=X1.normalizeToLong(W);if(Y<0)throw Error("invalid ipv4 address");W=X1.fromLong(Y)}return/^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(W)||/^f[cd][0-9a-f]{2}:/i.test(W)||/^fe80:/i.test(W)||/^::1$/.test(W)||/^::$/.test(W)};X1.isPublic=function(W){return!X1.isPrivate(W)};X1.isLoopback=function(W){if(!/\./.test(W)&&!/:/.test(W))W=X1.fromLong(Number(W));return/^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(W)||/^0177\./.test(W)||/^0x7f\./i.test(W)||/^fe80::1$/i.test(W)||/^::1$/.test(W)||/^::$/.test(W)};X1.loopback=function(W){if(W=FV(W),W!=="ipv4"&&W!=="ipv6")throw Error("family must be ipv4 or ipv6");return W==="ipv4"?"127.0.0.1":"fe80::1"};X1.address=function(W,Y){let G=ul.networkInterfaces();if(Y=FV(Y),W&&W!=="private"&&W!=="public"){let J=G[W].filter((Z)=>{return FV(Z.family)===Y});if(J.length===0)return;return J[0].address}let X=Object.keys(G).map((J)=>{let Z=G[J].filter((V)=>{if(V.family=FV(V.family),V.family!==Y||X1.isLoopback(V.address))return!1;if(!W)return!0;return W==="public"?X1.isPrivate(V.address):X1.isPublic(V.address)});return Z.length?Z[0].address:void 0}).filter(Boolean);return!X.length?X1.loopback(Y):X[0]};X1.toLong=function(W){let Y=0;return W.split(".").forEach((G)=>{Y<<=8,Y+=parseInt(G)}),Y>>>0};X1.fromLong=function(W){return`${W>>>24}.${W>>16&255}.${W>>8&255}.${W&255}`};X1.normalizeToLong=function(W){let Y=W.split(".").map((J)=>{if(J.startsWith("0x")||J.startsWith("0X"))return parseInt(J,16);else if(J.startsWith("0")&&J!=="0"&&/^[0-7]+$/.test(J))return parseInt(J,8);else if(/^[1-9]\d*$/.test(J)||J==="0")return parseInt(J,10);else return NaN});if(Y.some(isNaN))return-1;let G=0;switch(Y.length){case 1:G=Y[0];break;case 2:if(Y[0]>255||Y[1]>16777215)return-1;G=Y[0]<<24|Y[1]&16777215;break;case 3:if(Y[0]>255||Y[1]>255||Y[2]>65535)return-1;G=Y[0]<<24|Y[1]<<16|Y[2]&65535;break;case 4:if(Y.some((J)=>J>255))return-1;G=Y[0]<<24|Y[1]<<16|Y[2]<<8|Y[3];break;default:return-1}return G>>>0}});var R$=U1((uq0,M$)=>{M$.exports=function W(Y,G){if(Y===G)return!0;if(Y&&G&&typeof Y=="object"&&typeof G=="object"){if(Y.constructor!==G.constructor)return!1;var X,J,Z;if(Array.isArray(Y)){if(X=Y.length,X!=G.length)return!1;for(J=X;J--!==0;)if(!W(Y[J],G[J]))return!1;return!0}if(Y.constructor===RegExp)return Y.source===G.source&&Y.flags===G.flags;if(Y.valueOf!==Object.prototype.valueOf)return Y.valueOf()===G.valueOf();if(Y.toString!==Object.prototype.toString)return Y.toString()===G.toString();if(Z=Object.keys(Y),X=Z.length,X!==Object.keys(G).length)return!1;for(J=X;J--!==0;)if(!Object.prototype.hasOwnProperty.call(G,Z[J]))return!1;for(J=X;J--!==0;){var V=Z[J];if(!W(Y[V],G[V]))return!1}return!0}return Y!==Y&&G!==G}});var P$=U1((ml)=>{ml.toString=function(W){switch(W){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+W};ml.toType=function(W){switch(W.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}if(W.toUpperCase().startsWith("UNKNOWN_"))return parseInt(W.slice(8));return 0}});var L$=U1((pl)=>{pl.toString=function(W){switch(W){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+W};pl.toRcode=function(W){switch(W.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var B$=U1((ol)=>{ol.toString=function(W){switch(W){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+W};ol.toOpcode=function(W){switch(W.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var E$=U1((rl)=>{rl.toString=function(W){switch(W){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+W};rl.toClass=function(W){switch(W.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var $$=U1((tl)=>{tl.toString=function(W){switch(W){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}if(W<0)return null;return`OPTION_${W}`};tl.toCode=function(W){if(typeof W==="number")return W;if(!W)return-1;switch(W.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let Y=W.match(/_(\d+)$/);if(Y)return parseInt(Y[1],10);return-1}});var x$=U1((S$,aj)=>{var F$=function(W){Object.defineProperty(W,"__esModule",{value:!0}),W.decode=H,W.encode=q,W.familyOf=N,W.name=void 0,W.sizeOf=Q,W.v6=W.v4=void 0;let Y=/^(\d{1,3}\.){3,3}\d{1,3}$/,G=4,X=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,J=16,Z={name:"v4",size:G,isFormat:(A)=>Y.test(A),encode(A,I,w){w=~~w,I=I||new Uint8Array(w+G);let O=A.length,M=0;for(let S=0;S<O;){let g=A.charCodeAt(S++);if(g===46)I[w++]=M,M=0;else M=M*10+(g-48)}return I[w]=M,I},decode(A,I){return I=~~I,`${A[I++]}.${A[I++]}.${A[I++]}.${A[I]}`}};W.v4=Z;let V={name:"v6",size:J,isFormat:(A)=>A.length>0&&X.test(A),encode(A,I,w){w=~~w;let O=w+J,M=-1,S=0,g=0,c=!0,u=!1;I=I||new Uint8Array(w+J);for(let p=0;p<A.length;p++){let h=A.charCodeAt(p);if(h===58){if(c){if(M!==-1){if(w<O)I[w]=0;if(w<O-1)I[w+1]=0;w+=2}else if(w<O)M=w}else{if(u===!0){if(w<O)I[w]=g;w++}else{if(w<O)I[w]=S>>8;if(w<O-1)I[w+1]=S&255;w+=2}S=0,g=0}c=!0,u=!1}else if(h===46){if(w<O)I[w]=g;w++,g=0,S=0,c=!1,u=!0}else{if(c=!1,h>=97)h-=87;else if(h>=65)h-=55;else h-=48,g=g*10+h;S=(S<<4)+h}}if(c===!1)if(u===!0){if(w<O)I[w]=g;w++}else{if(w<O)I[w]=S>>8;if(w<O-1)I[w+1]=S&255;w+=2}else if(M===0){if(w<O)I[w]=0;if(w<O-1)I[w+1]=0;w+=2}else if(M!==-1){w+=2;for(let p=Math.min(w-1,O-1);p>=M+2;p--)I[p]=I[p-2];I[M]=0,I[M+1]=0,M=w}if(M!==w&&M!==-1){if(w>O-2)w=O-2;while(O>M)I[--O]=w<O&&w>M?I[--w]:0}else while(w<O)I[w++]=0;return I},decode(A,I){I=~~I;let w="";for(let O=0;O<J;O+=2){if(O!==0)w+=":";w+=(A[I+O]<<8|A[I+O+1]).toString(16)}return w.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};W.v6=V;let U="ip";W.name=U;function Q(A){if(Z.isFormat(A))return Z.size;if(V.isFormat(A))return V.size;throw Error(`Invalid ip address: ${A}`)}function N(A){return Q(A)===Z.size?1:2}function q(A,I,w){w=~~w;let O=Q(A);if(typeof I==="function")I=I(w+O);if(O===Z.size)return Z.encode(A,I,w);return V.encode(A,I,w)}function H(A,I,w){if(I=~~I,w=w||A.length-I,w===Z.size)return Z.decode(A,I,w);if(w===V.size)return V.decode(A,I,w);throw Error(`Invalid buffer size needs to be ${Z.size} for v4 or ${V.size} for v6.`)}return"default"in W?W.default:W}({});if(typeof define==="function"&&define.amd)define([],function(){return F$});else if(typeof aj==="object"&&typeof S$==="object")aj.exports=F$});var k$=U1((Zd)=>{var V1=x8("buffer").Buffer,b4=P$(),Yd=L$(),Gd=B$(),Eq=E$(),ej=$$(),wY=x$(),g0=Zd.name={};g0.encode=function(W,Y,G,{mail:X=!1}={}){if(!Y)Y=V1.alloc(g0.encodingLength(W));if(!G)G=0;let J=G,Z=W.replace(/^\.|\.$/gm,"");if(Z.length){let V=[];if(X){let U="";Z.split(".").forEach((Q)=>{if(Q.endsWith("\\"))U+=(U.length?".":"")+Q.slice(0,-1);else if(V.length===0&&U.length)V.push(U+"."+Q);else V.push(Q)})}else V=Z.split(".");for(let U=0;U<V.length;U++){let Q=Y.write(V[U],G+1);Y[G]=Q,G+=Q+1}}return Y[G++]=0,g0.encode.bytes=G-J,Y};g0.encode.bytes=0;g0.decode=function(W,Y,{mail:G=!1}={}){if(!Y)Y=0;let X=[],J=Y,Z=0,V=0,U=!1;while(!0){if(Y>=W.length)throw Error("Cannot decode name (buffer overflow)");let Q=W[Y++];if(V+=U?0:1,Q===0)break;else if((Q&192)===0){if(Y+Q>W.length)throw Error("Cannot decode name (buffer overflow)");if(Z+=Q+1,Z>254)throw Error("Cannot decode name (name too long)");let N=W.toString("utf-8",Y,Y+Q);if(G)N=N.replace(/\./g,"\\.");X.push(N),Y+=Q,V+=U?0:Q}else if((Q&192)===192){if(Y+1>W.length)throw Error("Cannot decode name (buffer overflow)");let N=W.readUInt16BE(Y-1)-49152;if(N>=J)throw Error("Cannot decode name (bad pointer)");Y=N,J=N,V+=U?0:1,U=!0}else throw Error("Cannot decode name (bad label)")}return g0.decode.bytes=V,X.length===0?".":X.join(".")};g0.decode.bytes=0;g0.encodingLength=function(W){if(W==="."||W==="..")return 1;return V1.byteLength(W.replace(/^\.|\.$/gm,""))+2};var x1={};x1.encode=function(W,Y,G){if(!Y)Y=V1.alloc(x1.encodingLength(W));if(!G)G=0;let X=Y.write(W,G+1);return Y[G]=X,x1.encode.bytes=X+1,Y};x1.encode.bytes=0;x1.decode=function(W,Y){if(!Y)Y=0;let G=W[Y],X=W.toString("utf-8",Y+1,Y+1+G);return x1.decode.bytes=G+1,X};x1.decode.bytes=0;x1.encodingLength=function(W){return V1.byteLength(W)+1};var t5={};t5.encode=function(W,Y,G){if(!Y)Y=t5.encodingLength(W);if(!G)G=0;let X=(W.flags||0)&32767,J=W.type==="response"?32768:0;return Y.writeUInt16BE(W.id||0,G),Y.writeUInt16BE(X|J,G+2),Y.writeUInt16BE(W.questions.length,G+4),Y.writeUInt16BE(W.answers.length,G+6),Y.writeUInt16BE(W.authorities.length,G+8),Y.writeUInt16BE(W.additionals.length,G+10),Y};t5.encode.bytes=12;t5.decode=function(W,Y){if(!Y)Y=0;if(W.length<12)throw Error("Header must be 12 bytes");let G=W.readUInt16BE(Y+2);return{id:W.readUInt16BE(Y),type:G&32768?"response":"query",flags:G&32767,flag_qr:(G>>15&1)===1,opcode:Gd.toString(G>>11&15),flag_aa:(G>>10&1)===1,flag_tc:(G>>9&1)===1,flag_rd:(G>>8&1)===1,flag_ra:(G>>7&1)===1,flag_z:(G>>6&1)===1,flag_ad:(G>>5&1)===1,flag_cd:(G>>4&1)===1,rcode:Yd.toString(G&15),questions:Array(W.readUInt16BE(Y+4)),answers:Array(W.readUInt16BE(Y+6)),authorities:Array(W.readUInt16BE(Y+8)),additionals:Array(W.readUInt16BE(Y+10))}};t5.decode.bytes=12;t5.encodingLength=function(){return 12};var S4=Zd.unknown={};S4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(S4.encodingLength(W));if(!G)G=0;return Y.writeUInt16BE(W.length,G),W.copy(Y,G+2),S4.encode.bytes=W.length+2,Y};S4.encode.bytes=0;S4.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y),X=W.slice(Y+2,Y+2+G);return S4.decode.bytes=G+2,X};S4.decode.bytes=0;S4.encodingLength=function(W){return W.length+2};var x4=Zd.ns={};x4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(x4.encodingLength(W));if(!G)G=0;return g0.encode(W,Y,G+2),Y.writeUInt16BE(g0.encode.bytes,G),x4.encode.bytes=g0.encode.bytes+2,Y};x4.encode.bytes=0;x4.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y),X=g0.decode(W,Y+2);return x4.decode.bytes=G+2,X};x4.decode.bytes=0;x4.encodingLength=function(W){return g0.encodingLength(W)+2};var k4=Zd.soa={};k4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(k4.encodingLength(W));if(!G)G=0;let X=G;return G+=2,g0.encode(W.mname,Y,G),G+=g0.encode.bytes,g0.encode(W.rname,Y,G,{mail:!0}),G+=g0.encode.bytes,Y.writeUInt32BE(W.serial||0,G),G+=4,Y.writeUInt32BE(W.refresh||0,G),G+=4,Y.writeUInt32BE(W.retry||0,G),G+=4,Y.writeUInt32BE(W.expire||0,G),G+=4,Y.writeUInt32BE(W.minimum||0,G),G+=4,Y.writeUInt16BE(G-X-2,X),k4.encode.bytes=G-X,Y};k4.encode.bytes=0;k4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.mname=g0.decode(W,Y),Y+=g0.decode.bytes,X.rname=g0.decode(W,Y,{mail:!0}),Y+=g0.decode.bytes,X.serial=W.readUInt32BE(Y),Y+=4,X.refresh=W.readUInt32BE(Y),Y+=4,X.retry=W.readUInt32BE(Y),Y+=4,X.expire=W.readUInt32BE(Y),Y+=4,X.minimum=W.readUInt32BE(Y),Y+=4,k4.decode.bytes=Y-G,X};k4.decode.bytes=0;k4.encodingLength=function(W){return 22+g0.encodingLength(W.mname)+g0.encodingLength(W.rname)};var _4=Zd.txt={};_4.encode=function(W,Y,G){if(!Array.isArray(W))W=[W];for(let J=0;J<W.length;J++){if(typeof W[J]==="string")W[J]=V1.from(W[J]);if(!V1.isBuffer(W[J]))throw Error("Must be a Buffer")}if(!Y)Y=V1.alloc(_4.encodingLength(W));if(!G)G=0;let X=G;return G+=2,W.forEach(function(J){Y[G++]=J.length,J.copy(Y,G,0,J.length),G+=J.length}),Y.writeUInt16BE(G-X-2,X),_4.encode.bytes=G-X,Y};_4.encode.bytes=0;_4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=W.readUInt16BE(Y);Y+=2;let J=[];while(X>0){let Z=W[Y++];if(--X,X<Z)throw Error("Buffer overflow");J.push(W.slice(Y,Y+Z)),Y+=Z,X-=Z}return _4.decode.bytes=Y-G,J};_4.decode.bytes=0;_4.encodingLength=function(W){if(!Array.isArray(W))W=[W];let Y=2;return W.forEach(function(G){if(typeof G==="string")Y+=V1.byteLength(G)+1;else Y+=G.length+1}),Y};var y4=Zd.null={};y4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(y4.encodingLength(W));if(!G)G=0;if(typeof W==="string")W=V1.from(W);if(!W)W=V1.alloc(0);let X=G;G+=2;let J=W.length;return W.copy(Y,G,0,J),G+=J,Y.writeUInt16BE(G-X-2,X),y4.encode.bytes=G-X,Y};y4.encode.bytes=0;y4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=W.readUInt16BE(Y);Y+=2;let J=W.slice(Y,Y+X);return Y+=X,y4.decode.bytes=Y-G,J};y4.decode.bytes=0;y4.encodingLength=function(W){if(!W)return 2;return(V1.isBuffer(W)?W.length:V1.byteLength(W))+2};var v4=Zd.hinfo={};v4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(v4.encodingLength(W));if(!G)G=0;let X=G;return G+=2,x1.encode(W.cpu,Y,G),G+=x1.encode.bytes,x1.encode(W.os,Y,G),G+=x1.encode.bytes,Y.writeUInt16BE(G-X-2,X),v4.encode.bytes=G-X,Y};v4.encode.bytes=0;v4.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.cpu=x1.decode(W,Y),Y+=x1.decode.bytes,X.os=x1.decode(W,Y),Y+=x1.decode.bytes,v4.decode.bytes=Y-G,X};v4.decode.bytes=0;v4.encodingLength=function(W){return x1.encodingLength(W.cpu)+x1.encodingLength(W.os)+2};var a5=Zd.ptr={},Xd=Zd.cname=a5,Jd=Zd.dname=a5;a5.encode=function(W,Y,G){if(!Y)Y=V1.alloc(a5.encodingLength(W));if(!G)G=0;return g0.encode(W,Y,G+2),Y.writeUInt16BE(g0.encode.bytes,G),a5.encode.bytes=g0.encode.bytes+2,Y};a5.encode.bytes=0;a5.decode=function(W,Y){if(!Y)Y=0;let G=g0.decode(W,Y+2);return a5.decode.bytes=g0.decode.bytes+2,G};a5.decode.bytes=0;a5.encodingLength=function(W){return g0.encodingLength(W)+2};var g4=Zd.srv={};g4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(g4.encodingLength(W));if(!G)G=0;Y.writeUInt16BE(W.priority||0,G+2),Y.writeUInt16BE(W.weight||0,G+4),Y.writeUInt16BE(W.port||0,G+6),g0.encode(W.target,Y,G+8);let X=g0.encode.bytes+6;return Y.writeUInt16BE(X,G),g4.encode.bytes=X+2,Y};g4.encode.bytes=0;g4.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y),X={};return X.priority=W.readUInt16BE(Y+2),X.weight=W.readUInt16BE(Y+4),X.port=W.readUInt16BE(Y+6),X.target=g0.decode(W,Y+8),g4.decode.bytes=G+2,X};g4.decode.bytes=0;g4.encodingLength=function(W){return 8+g0.encodingLength(W.target)};var N5=Zd.caa={};N5.ISSUER_CRITICAL=128;N5.encode=function(W,Y,G){let X=N5.encodingLength(W);if(!Y)Y=V1.alloc(N5.encodingLength(W));if(!G)G=0;if(W.issuerCritical)W.flags=N5.ISSUER_CRITICAL;return Y.writeUInt16BE(X-2,G),G+=2,Y.writeUInt8(W.flags||0,G),G+=1,x1.encode(W.tag,Y,G),G+=x1.encode.bytes,Y.write(W.value,G),G+=V1.byteLength(W.value),N5.encode.bytes=X,Y};N5.encode.bytes=0;N5.decode=function(W,Y){if(!Y)Y=0;let G=W.readUInt16BE(Y);Y+=2;let X=Y,J={};return J.flags=W.readUInt8(Y),Y+=1,J.tag=x1.decode(W,Y),Y+=x1.decode.bytes,J.value=W.toString("utf-8",Y,X+G),J.issuerCritical=!!(J.flags&N5.ISSUER_CRITICAL),N5.decode.bytes=G+2,J};N5.decode.bytes=0;N5.encodingLength=function(W){return x1.encodingLength(W.tag)+x1.encodingLength(W.value)+2};var o6=Zd.mx={};o6.encode=function(W,Y,G){if(!Y)Y=V1.alloc(o6.encodingLength(W));if(!G)G=0;let X=G;return G+=2,Y.writeUInt16BE(W.preference||0,G),G+=2,g0.encode(W.exchange,Y,G),G+=g0.encode.bytes,Y.writeUInt16BE(G-X-2,X),o6.encode.bytes=G-X,Y};o6.encode.bytes=0;o6.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.preference=W.readUInt16BE(Y),Y+=2,X.exchange=g0.decode(W,Y),Y+=g0.decode.bytes,o6.decode.bytes=Y-G,X};o6.encodingLength=function(W){return 4+g0.encodingLength(W.exchange)};var u4=Zd.a={};u4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(u4.encodingLength(W));if(!G)G=0;return Y.writeUInt16BE(4,G),G+=2,wY.v4.encode(W,Y,G),u4.encode.bytes=6,Y};u4.encode.bytes=0;u4.decode=function(W,Y){if(!Y)Y=0;Y+=2;let G=wY.v4.decode(W,Y);return u4.decode.bytes=6,G};u4.decode.bytes=0;u4.encodingLength=function(){return 6};var h4=Zd.aaaa={};h4.encode=function(W,Y,G){if(!Y)Y=V1.alloc(h4.encodingLength(W));if(!G)G=0;return Y.writeUInt16BE(16,G),G+=2,wY.v6.encode(W,Y,G),h4.encode.bytes=18,Y};h4.encode.bytes=0;h4.decode=function(W,Y){if(!Y)Y=0;Y+=2;let G=wY.v6.decode(W,Y);return h4.decode.bytes=18,G};h4.decode.bytes=0;h4.encodingLength=function(){return 18};var r9=Zd.option={};r9.encode=function(W,Y,G){if(!Y)Y=V1.alloc(r9.encodingLength(W));if(!G)G=0;let X=G,J=ej.toCode(W.code);if(Y.writeUInt16BE(J,G),G+=2,W.data)Y.writeUInt16BE(W.data.length,G),G+=2,W.data.copy(Y,G),G+=W.data.length;else switch(J){case 8:let Z=W.sourcePrefixLength||0,V=W.family||wY.familyOf(W.ip),U=wY.encode(W.ip,V1.alloc),Q=Math.ceil(Z/8);Y.writeUInt16BE(Q+4,G),G+=2,Y.writeUInt16BE(V,G),G+=2,Y.writeUInt8(Z,G++),Y.writeUInt8(W.scopePrefixLength||0,G++),U.copy(Y,G,0,Q),G+=Q;break;case 11:if(W.timeout)Y.writeUInt16BE(2,G),G+=2,Y.writeUInt16BE(W.timeout,G),G+=2;else Y.writeUInt16BE(0,G),G+=2;break;case 12:let N=W.length||0;Y.writeUInt16BE(N,G),G+=2,Y.fill(0,G,G+N),G+=N;break;case 14:let q=W.tags.length*2;Y.writeUInt16BE(q,G),G+=2;for(let H of W.tags)Y.writeUInt16BE(H,G),G+=2;break;default:throw Error(`Unknown roption code: ${W.code}`)}return r9.encode.bytes=G-X,Y};r9.encode.bytes=0;r9.decode=function(W,Y){if(!Y)Y=0;let G={};G.code=W.readUInt16BE(Y),G.type=ej.toString(G.code),Y+=2;let X=W.readUInt16BE(Y);switch(Y+=2,G.data=W.slice(Y,Y+X),G.code){case 8:G.family=W.readUInt16BE(Y),Y+=2,G.sourcePrefixLength=W.readUInt8(Y++),G.scopePrefixLength=W.readUInt8(Y++);let J=V1.alloc(G.family===1?4:16);W.copy(J,0,Y,Y+X-4),G.ip=wY.decode(J);break;case 11:if(X>0)G.timeout=W.readUInt16BE(Y),Y+=2;break;case 14:G.tags=[];for(let Z=0;Z<X;Z+=2)G.tags.push(W.readUInt16BE(Y)),Y+=2}return r9.decode.bytes=X+4,G};r9.decode.bytes=0;r9.encodingLength=function(W){if(W.data)return W.data.length+4;switch(ej.toCode(W.code)){case 8:let G=W.sourcePrefixLength||0;return Math.ceil(G/8)+8;case 11:return typeof W.timeout==="number"?6:4;case 12:return W.length+4;case 14:return 4+W.tags.length*2}throw Error(`Unknown roption code: ${W.code}`)};var A5=Zd.opt={};A5.encode=function(W,Y,G){if(!Y)Y=V1.alloc(A5.encodingLength(W));if(!G)G=0;let X=G,J=EX(W,r9);return Y.writeUInt16BE(J,G),G=SV(W,r9,Y,G+2),A5.encode.bytes=G-X,Y};A5.encode.bytes=0;A5.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=[],J=W.readUInt16BE(Y);Y+=2;let Z=0;while(J>0)X[Z++]=r9.decode(W,Y),Y+=r9.decode.bytes,J-=r9.decode.bytes;return A5.decode.bytes=Y-G,X};A5.decode.bytes=0;A5.encodingLength=function(W){return 2+EX(W||[],r9)};var g9=Zd.dnskey={};g9.PROTOCOL_DNSSEC=3;g9.ZONE_KEY=128;g9.SECURE_ENTRYPOINT=32768;g9.encode=function(W,Y,G){if(!Y)Y=V1.alloc(g9.encodingLength(W));if(!G)G=0;let X=G,J=W.key;if(!V1.isBuffer(J))throw Error("Key must be a Buffer");return G+=2,Y.writeUInt16BE(W.flags,G),G+=2,Y.writeUInt8(g9.PROTOCOL_DNSSEC,G),G+=1,Y.writeUInt8(W.algorithm,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,g9.encode.bytes=G-X,Y.writeUInt16BE(g9.encode.bytes-2,X),Y};g9.encode.bytes=0;g9.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);if(Y+=2,X.flags=W.readUInt16BE(Y),Y+=2,W.readUInt8(Y)!==g9.PROTOCOL_DNSSEC)throw Error("Protocol must be 3");return Y+=1,X.algorithm=W.readUInt8(Y),Y+=1,X.key=W.slice(Y,G+J+2),Y+=X.key.length,g9.decode.bytes=Y-G,X};g9.decode.bytes=0;g9.encodingLength=function(W){return 6+V1.byteLength(W.key)};var _7=Zd.rrsig={};_7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(_7.encodingLength(W));if(!G)G=0;let X=G,J=W.signature;if(!V1.isBuffer(J))throw Error("Signature must be a Buffer");return G+=2,Y.writeUInt16BE(b4.toType(W.typeCovered),G),G+=2,Y.writeUInt8(W.algorithm,G),G+=1,Y.writeUInt8(W.labels,G),G+=1,Y.writeUInt32BE(W.originalTTL,G),G+=4,Y.writeUInt32BE(W.expiration,G),G+=4,Y.writeUInt32BE(W.inception,G),G+=4,Y.writeUInt16BE(W.keyTag,G),G+=2,g0.encode(W.signersName,Y,G),G+=g0.encode.bytes,J.copy(Y,G,0,J.length),G+=J.length,_7.encode.bytes=G-X,Y.writeUInt16BE(_7.encode.bytes-2,X),Y};_7.encode.bytes=0;_7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);return Y+=2,X.typeCovered=b4.toString(W.readUInt16BE(Y)),Y+=2,X.algorithm=W.readUInt8(Y),Y+=1,X.labels=W.readUInt8(Y),Y+=1,X.originalTTL=W.readUInt32BE(Y),Y+=4,X.expiration=W.readUInt32BE(Y),Y+=4,X.inception=W.readUInt32BE(Y),Y+=4,X.keyTag=W.readUInt16BE(Y),Y+=2,X.signersName=g0.decode(W,Y),Y+=g0.decode.bytes,X.signature=W.slice(Y,G+J+2),Y+=X.signature.length,_7.decode.bytes=Y-G,X};_7.decode.bytes=0;_7.encodingLength=function(W){return 20+g0.encodingLength(W.signersName)+V1.byteLength(W.signature)};var y7=Zd.rp={};y7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(y7.encodingLength(W));if(!G)G=0;let X=G;return G+=2,g0.encode(W.mbox||".",Y,G,{mail:!0}),G+=g0.encode.bytes,g0.encode(W.txt||".",Y,G),G+=g0.encode.bytes,y7.encode.bytes=G-X,Y.writeUInt16BE(y7.encode.bytes-2,X),Y};y7.encode.bytes=0;y7.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.mbox=g0.decode(W,Y,{mail:!0})||".",Y+=g0.decode.bytes,X.txt=g0.decode(W,Y)||".",Y+=g0.decode.bytes,y7.decode.bytes=Y-G,X};y7.decode.bytes=0;y7.encodingLength=function(W){return 2+g0.encodingLength(W.mbox||".")+g0.encodingLength(W.txt||".")};var i8={};i8.encode=function(W,Y,G){if(!Y)Y=V1.alloc(i8.encodingLength(W));if(!G)G=0;let X=G;var J=[];for(var Z=0;Z<W.length;Z++){var V=b4.toType(W[Z]);if(J[V>>8]===void 0)J[V>>8]=[];J[V>>8][V>>3&31]|=1<<7-(V&7)}for(Z=0;Z<J.length;Z++)if(J[Z]!==void 0){var U=V1.from(J[Z]);Y.writeUInt8(Z,G),G+=1,Y.writeUInt8(U.length,G),G+=1,U.copy(Y,G),G+=U.length}return i8.encode.bytes=G-X,Y};i8.encode.bytes=0;i8.decode=function(W,Y,G){if(!Y)Y=0;let X=Y;var J=[];while(Y-X<G){var Z=W.readUInt8(Y);Y+=1;var V=W.readUInt8(Y);Y+=1;for(var U=0;U<V;U++){var Q=W.readUInt8(Y+U);for(var N=0;N<8;N++)if(Q&1<<7-N){var q=b4.toString(Z<<8|U<<3|N);J.push(q)}}Y+=V}return i8.decode.bytes=Y-X,J};i8.decode.bytes=0;i8.encodingLength=function(W){var Y=[];for(var G=0;G<W.length;G++){var X=b4.toType(W[G]);Y[X>>8]=Math.max(Y[X>>8]||0,X&255)}var J=0;for(G=0;G<Y.length;G++)if(Y[G]!==void 0)J+=2+Math.ceil((Y[G]+1)/8);return J};var v7=Zd.nsec={};v7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(v7.encodingLength(W));if(!G)G=0;let X=G;return G+=2,g0.encode(W.nextDomain,Y,G),G+=g0.encode.bytes,i8.encode(W.rrtypes,Y,G),G+=i8.encode.bytes,v7.encode.bytes=G-X,Y.writeUInt16BE(v7.encode.bytes-2,X),Y};v7.encode.bytes=0;v7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);return Y+=2,X.nextDomain=g0.decode(W,Y),Y+=g0.decode.bytes,X.rrtypes=i8.decode(W,Y,J-(Y-G)),Y+=i8.decode.bytes,v7.decode.bytes=Y-G,X};v7.decode.bytes=0;v7.encodingLength=function(W){return 2+g0.encodingLength(W.nextDomain)+i8.encodingLength(W.rrtypes)};var g7=Zd.nsec3={};g7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(g7.encodingLength(W));if(!G)G=0;let X=G,J=W.salt;if(!V1.isBuffer(J))throw Error("salt must be a Buffer");let Z=W.nextDomain;if(!V1.isBuffer(Z))throw Error("nextDomain must be a Buffer");return G+=2,Y.writeUInt8(W.algorithm,G),G+=1,Y.writeUInt8(W.flags,G),G+=1,Y.writeUInt16BE(W.iterations,G),G+=2,Y.writeUInt8(J.length,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,Y.writeUInt8(Z.length,G),G+=1,Z.copy(Y,G,0,Z.length),G+=Z.length,i8.encode(W.rrtypes,Y,G),G+=i8.encode.bytes,g7.encode.bytes=G-X,Y.writeUInt16BE(g7.encode.bytes-2,X),Y};g7.encode.bytes=0;g7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);Y+=2,X.algorithm=W.readUInt8(Y),Y+=1,X.flags=W.readUInt8(Y),Y+=1,X.iterations=W.readUInt16BE(Y),Y+=2;let Z=W.readUInt8(Y);Y+=1,X.salt=W.slice(Y,Y+Z),Y+=Z;let V=W.readUInt8(Y);return Y+=1,X.nextDomain=W.slice(Y,Y+V),Y+=V,X.rrtypes=i8.decode(W,Y,J-(Y-G)),Y+=i8.decode.bytes,g7.decode.bytes=Y-G,X};g7.decode.bytes=0;g7.encodingLength=function(W){return 8+W.salt.length+W.nextDomain.length+i8.encodingLength(W.rrtypes)};var u7=Zd.ds={};u7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(u7.encodingLength(W));if(!G)G=0;let X=G,J=W.digest;if(!V1.isBuffer(J))throw Error("Digest must be a Buffer");return G+=2,Y.writeUInt16BE(W.keyTag,G),G+=2,Y.writeUInt8(W.algorithm,G),G+=1,Y.writeUInt8(W.digestType,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,u7.encode.bytes=G-X,Y.writeUInt16BE(u7.encode.bytes-2,X),Y};u7.encode.bytes=0;u7.decode=function(W,Y){if(!Y)Y=0;let G=Y;var X={},J=W.readUInt16BE(Y);return Y+=2,X.keyTag=W.readUInt16BE(Y),Y+=2,X.algorithm=W.readUInt8(Y),Y+=1,X.digestType=W.readUInt8(Y),Y+=1,X.digest=W.slice(Y,G+J+2),Y+=X.digest.length,u7.decode.bytes=Y-G,X};u7.decode.bytes=0;u7.encodingLength=function(W){return 6+V1.byteLength(W.digest)};var q5=Zd.sshfp={};q5.getFingerprintLengthForHashType=function(Y){switch(Y){case 1:return 20;case 2:return 32}};q5.encode=function(Y,G,X){if(!G)G=V1.alloc(q5.encodingLength(Y));if(!X)X=0;let J=X;X+=2,G[X]=Y.algorithm,X+=1,G[X]=Y.hash,X+=1;let Z=V1.from(Y.fingerprint.toUpperCase(),"hex");if(Z.length!==q5.getFingerprintLengthForHashType(Y.hash))throw Error("Invalid fingerprint length");return Z.copy(G,X),X+=Z.byteLength,q5.encode.bytes=X-J,G.writeUInt16BE(q5.encode.bytes-2,J),G};q5.encode.bytes=0;q5.decode=function(Y,G){if(!G)G=0;let X=G,J={};G+=2,J.algorithm=Y[G],G+=1,J.hash=Y[G],G+=1;let Z=q5.getFingerprintLengthForHashType(J.hash);return J.fingerprint=Y.slice(G,G+Z).toString("hex").toUpperCase(),G+=Z,q5.decode.bytes=G-X,J};q5.decode.bytes=0;q5.encodingLength=function(W){return 4+V1.from(W.fingerprint,"hex").byteLength};var h7=Zd.naptr={};h7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(h7.encodingLength(W));if(!G)G=0;let X=G;return G+=2,Y.writeUInt16BE(W.order||0,G),G+=2,Y.writeUInt16BE(W.preference||0,G),G+=2,x1.encode(W.flags,Y,G),G+=x1.encode.bytes,x1.encode(W.services,Y,G),G+=x1.encode.bytes,x1.encode(W.regexp,Y,G),G+=x1.encode.bytes,g0.encode(W.replacement,Y,G),G+=g0.encode.bytes,h7.encode.bytes=G-X,Y.writeUInt16BE(h7.encode.bytes-2,X),Y};h7.encode.bytes=0;h7.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};return Y+=2,X.order=W.readUInt16BE(Y),Y+=2,X.preference=W.readUInt16BE(Y),Y+=2,X.flags=x1.decode(W,Y),Y+=x1.decode.bytes,X.services=x1.decode(W,Y),Y+=x1.decode.bytes,X.regexp=x1.decode(W,Y),Y+=x1.decode.bytes,X.replacement=g0.decode(W,Y),Y+=g0.decode.bytes,h7.decode.bytes=Y-G,X};h7.decode.bytes=0;h7.encodingLength=function(W){return x1.encodingLength(W.flags)+x1.encodingLength(W.services)+x1.encodingLength(W.regexp)+g0.encodingLength(W.replacement)+6};var b7=Zd.tlsa={};b7.encode=function(W,Y,G){if(!Y)Y=V1.alloc(b7.encodingLength(W));if(!G)G=0;let X=G,J=W.certificate;if(!V1.isBuffer(J))throw Error("Certificate must be a Buffer");return G+=2,Y.writeUInt8(W.usage,G),G+=1,Y.writeUInt8(W.selector,G),G+=1,Y.writeUInt8(W.matchingType,G),G+=1,J.copy(Y,G,0,J.length),G+=J.length,b7.encode.bytes=G-X,Y.writeUInt16BE(b7.encode.bytes-2,X),Y};b7.encode.bytes=0;b7.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={},J=W.readUInt16BE(Y);return Y+=2,X.usage=W.readUInt8(Y),Y+=1,X.selector=W.readUInt8(Y),Y+=1,X.matchingType=W.readUInt8(Y),Y+=1,X.certificate=W.slice(Y,G+J+2),Y+=X.certificate.length,b7.decode.bytes=Y-G,X};b7.decode.bytes=0;b7.encodingLength=function(W){return 5+V1.byteLength(W.certificate)};var WK=Zd.record=function(W){switch(W.toUpperCase()){case"A":return u4;case"PTR":return a5;case"CNAME":return Xd;case"DNAME":return Jd;case"TXT":return _4;case"NULL":return y4;case"AAAA":return h4;case"SRV":return g4;case"HINFO":return v4;case"CAA":return N5;case"NS":return x4;case"SOA":return k4;case"MX":return o6;case"OPT":return A5;case"DNSKEY":return g9;case"RRSIG":return _7;case"RP":return y7;case"NSEC":return v7;case"NSEC3":return g7;case"SSHFP":return q5;case"DS":return u7;case"NAPTR":return h7;case"TLSA":return b7}return S4},Z9=Zd.answer={};Z9.encode=function(W,Y,G){if(!Y)Y=V1.alloc(Z9.encodingLength(W));if(!G)G=0;let X=G;if(g0.encode(W.name,Y,G),G+=g0.encode.bytes,Y.writeUInt16BE(b4.toType(W.type),G),W.type.toUpperCase()==="OPT"){if(W.name!==".")throw Error("OPT name must be root.");Y.writeUInt16BE(W.udpPayloadSize||4096,G+2),Y.writeUInt8(W.extendedRcode||0,G+4),Y.writeUInt8(W.ednsVersion||0,G+5),Y.writeUInt16BE(W.flags||0,G+6),G+=8,A5.encode(W.options||[],Y,G),G+=A5.encode.bytes}else{let J=Eq.toClass(W.class===void 0?"IN":W.class);if(W.flush)J|=32768;Y.writeUInt16BE(J,G+2),Y.writeUInt32BE(W.ttl||0,G+4),G+=8;let Z=WK(W.type);Z.encode(W.data,Y,G),G+=Z.encode.bytes}return Z9.encode.bytes=G-X,Y};Z9.encode.bytes=0;Z9.decode=function(W,Y){if(!Y)Y=0;let G={},X=Y;if(G.name=g0.decode(W,Y),Y+=g0.decode.bytes,G.type=b4.toString(W.readUInt16BE(Y)),G.type==="OPT")G.udpPayloadSize=W.readUInt16BE(Y+2),G.extendedRcode=W.readUInt8(Y+4),G.ednsVersion=W.readUInt8(Y+5),G.flags=W.readUInt16BE(Y+6),G.flag_do=(G.flags>>15&1)===1,G.options=A5.decode(W,Y+8),Y+=8+A5.decode.bytes;else{let J=W.readUInt16BE(Y+2);G.ttl=W.readUInt32BE(Y+4),G.class=Eq.toString(J&-32769),G.flush=!!(J&32768);let Z=WK(G.type);G.data=Z.decode(W,Y+8),Y+=8+Z.decode.bytes}return Z9.decode.bytes=Y-X,G};Z9.decode.bytes=0;Z9.encodingLength=function(W){let Y=W.data!==null&&W.data!==void 0?W.data:W.options;return g0.encodingLength(W.name)+8+WK(W.type).encodingLength(Y)};var s5=Zd.question={};s5.encode=function(W,Y,G){if(!Y)Y=V1.alloc(s5.encodingLength(W));if(!G)G=0;let X=G;return g0.encode(W.name,Y,G),G+=g0.encode.bytes,Y.writeUInt16BE(b4.toType(W.type),G),G+=2,Y.writeUInt16BE(Eq.toClass(W.class===void 0?"IN":W.class),G),G+=2,s5.encode.bytes=G-X,W};s5.encode.bytes=0;s5.decode=function(W,Y){if(!Y)Y=0;let G=Y,X={};if(X.name=g0.decode(W,Y),Y+=g0.decode.bytes,X.type=b4.toString(W.readUInt16BE(Y)),Y+=2,X.class=Eq.toString(W.readUInt16BE(Y)),Y+=2,!!(X.class&32768))X.class&=-32769;return s5.decode.bytes=Y-G,X};s5.decode.bytes=0;s5.encodingLength=function(W){return g0.encodingLength(W.name)+4};Zd.AUTHORITATIVE_ANSWER=1024;Zd.TRUNCATED_RESPONSE=512;Zd.RECURSION_DESIRED=256;Zd.RECURSION_AVAILABLE=128;Zd.AUTHENTIC_DATA=32;Zd.CHECKING_DISABLED=16;Zd.DNSSEC_OK=32768;Zd.encode=function(W,Y,G){let X=!Y;if(X)Y=V1.alloc(Zd.encodingLength(W));if(!G)G=0;let J=G;if(!W.questions)W.questions=[];if(!W.answers)W.answers=[];if(!W.authorities)W.authorities=[];if(!W.additionals)W.additionals=[];if(t5.encode(W,Y,G),G+=t5.encode.bytes,G=SV(W.questions,s5,Y,G),G=SV(W.answers,Z9,Y,G),G=SV(W.authorities,Z9,Y,G),G=SV(W.additionals,Z9,Y,G),Zd.encode.bytes=G-J,X&&Zd.encode.bytes!==Y.length)return Y.slice(0,Zd.encode.bytes);return Y};Zd.encode.bytes=0;Zd.decode=function(W,Y){if(!Y)Y=0;let G=Y,X=t5.decode(W,Y);return Y+=t5.decode.bytes,Y=Bq(X.questions,s5,W,Y),Y=Bq(X.answers,Z9,W,Y),Y=Bq(X.authorities,Z9,W,Y),Y=Bq(X.additionals,Z9,W,Y),Zd.decode.bytes=Y-G,X};Zd.decode.bytes=0;Zd.encodingLength=function(W){return t5.encodingLength(W)+EX(W.questions||[],s5)+EX(W.answers||[],Z9)+EX(W.authorities||[],Z9)+EX(W.additionals||[],Z9)};Zd.streamEncode=function(W){let Y=Zd.encode(W),G=V1.alloc(2);G.writeUInt16BE(Y.byteLength);let X=V1.concat([G,Y]);return Zd.streamEncode.bytes=X.byteLength,X};Zd.streamEncode.bytes=0;Zd.streamDecode=function(W){let Y=W.readUInt16BE(0);if(W.byteLength<Y+2)return null;let G=Zd.decode(W.slice(2));return Zd.streamDecode.bytes=Zd.decode.bytes,G};Zd.streamDecode.bytes=0;function EX(W,Y){let G=0;for(let X=0;X<W.length;X++)G+=Y.encodingLength(W[X]);return G}function SV(W,Y,G,X){for(let J=0;J<W.length;J++)Y.encode(W[J],G,X),X+=Y.encode.bytes;return X}function Bq(W,Y,G,X){for(let J=0;J<W.length;J++)W[J]=Y.decode(G,X),X+=Y.decode.bytes;return X}});var v$=U1((DA0,y$)=>{var _$=Dd;process.nextTick(Od,42);y$.exports=Id;function Id(W){var Y=X;return G;function G(J){Y(J||jd)}function X(J){var Z=[J];Y=V,W(U);function V(Q){Z.push(Q)}function U(Q){var N=arguments;Y=wd(Q)?X:q;while(Z.length)q(Z.shift());function q(H){_$(Kd,H,N)}}}}function wd(W){return Object.prototype.toString.call(W)==="[object Error]"}function jd(){}function Kd(W,Y){W.apply(null,Y)}function Od(W){if(W===42)_$=process.nextTick}function Dd(W,Y,G){process.nextTick(function(){W(Y,G)})}});var h$=U1((CA0,u$)=>{var YK=k$(),Cd=x8("dgram"),Td=v$(),Md=x8("events"),XK=x8("os"),GK=function(){};u$.exports=function(W){if(!W)W={};var Y=new Md.EventEmitter,G=typeof W.port==="number"?W.port:5353,X=W.type||"udp4",J=W.ip||W.host||(X==="udp4"?"224.0.0.251":null),Z={address:J,port:G},V={},U=!1,Q=null;if(X==="udp6"&&(!J||!W.interface))throw Error("For IPv6 multicast you must specify `ip` and `interface`");var N=W.socket||Cd.createSocket({type:X,reuseAddr:W.reuseAddr!==!1,toString:function(){return X}});N.on("error",function(H){if(H.code==="EACCES"||H.code==="EADDRINUSE")Y.emit("error",H);else Y.emit("warning",H)}),N.on("message",function(H,A){try{H=YK.decode(H)}catch(I){Y.emit("warning",I);return}if(Y.emit("packet",H,A),H.type==="query")Y.emit("query",H,A);if(H.type==="response")Y.emit("response",H,A)}),N.on("listening",function(){if(!G)G=Z.port=N.address().port;if(W.multicast!==!1)Y.update(),Q=setInterval(Y.update,5000),N.setMulticastTTL(W.ttl||255),N.setMulticastLoopback(W.loopback!==!1)});var q=Td(function(H){if(!G||W.bind===!1)return H(null);N.once("error",H),N.bind(G,W.bind||W.interface,function(){N.removeListener("error",H),H(null)})});return q(function(H){if(H)return Y.emit("error",H);Y.emit("ready")}),Y.send=function(H,A,I){if(typeof A==="function")return Y.send(H,null,A);if(!I)I=GK;if(!A)A=Z;else if(!A.host&&!A.address)A.address=Z.address;q(w);function w(O){if(U)return I();if(O)return I(O);var M=YK.encode(H);N.send(M,0,M.length,A.port,A.address||A.host,I)}},Y.response=Y.respond=function(H,A,I){if(Array.isArray(H))H={answers:H};H.type="response",H.flags=(H.flags||0)|YK.AUTHORITATIVE_ANSWER,Y.send(H,A,I)},Y.query=function(H,A,I,w){if(typeof A==="function")return Y.query(H,null,null,A);if(typeof A==="object"&&A&&A.port)return Y.query(H,null,A,I);if(typeof I==="function")return Y.query(H,A,null,I);if(!w)w=GK;if(typeof H==="string")H=[{name:H,type:A||"ANY"}];if(Array.isArray(H))H={type:"query",questions:H};H.type="query",Y.send(H,I,w)},Y.destroy=function(H){if(!H)H=GK;if(U)return process.nextTick(H);U=!0,clearInterval(Q);for(var A in V)try{N.dropMembership(J,A)}catch(I){}V={},N.close(H)},Y.update=function(){var H=W.interface?[].concat(W.interface):Pd(),A=!1;for(var I=0;I<H.length;I++){var w=H[I];if(V[w])continue;try{N.addMembership(J,w),V[w]=!0,A=!0}catch(O){Y.emit("warning",O)}}if(A){if(N.setMulticastInterface)try{N.setMulticastInterface(W.interface||Rd())}catch(O){Y.emit("warning",O)}Y.emit("networkInterface")}},Y};function Rd(){var W=XK.networkInterfaces(),Y=Object.keys(W);for(var G=0;G<Y.length;G++){var X=W[Y[G]];for(var J=0;J<X.length;J++){var Z=X[J];if(g$(Z.family)&&!Z.internal){if(XK.platform()==="darwin"&&Y[G]==="en0")return Z.address;return"0.0.0.0"}}}return"127.0.0.1"}function Pd(){var W=XK.networkInterfaces(),Y=Object.keys(W),G=[];for(var X=0;X<Y.length;X++){var J=W[Y[X]];for(var Z=0;Z<J.length;Z++){var V=J[Z];if(g$(V.family)){G.push(V.address);break}}}return G}function g$(W){return W===4||W==="IPv4"}});import{Database as jt}from"bun:sqlite";import{mkdirSync as Kt}from"fs";import{dirname as Ot}from"path";function QD(W){let Y=W.length,G=0,X=0;while(X<Y){let J=W.charCodeAt(X++);if((J&4294967168)===0){G++;continue}else if((J&4294965248)===0)G+=2;else{if(J>=55296&&J<=56319){if(X<Y){let Z=W.charCodeAt(X);if((Z&64512)===56320)++X,J=((J&1023)<<10)+(Z&1023)+65536}}if((J&4294901760)===0)G+=3;else G+=4}}return G}function h_(W,Y,G){let X=W.length,J=G,Z=0;while(Z<X){let V=W.charCodeAt(Z++);if((V&4294967168)===0){Y[J++]=V;continue}else if((V&4294965248)===0)Y[J++]=V>>6&31|192;else{if(V>=55296&&V<=56319){if(Z<X){let U=W.charCodeAt(Z);if((U&64512)===56320)++Z,V=((V&1023)<<10)+(U&1023)+65536}}if((V&4294901760)===0)Y[J++]=V>>12&15|224,Y[J++]=V>>6&63|128;else Y[J++]=V>>18&7|240,Y[J++]=V>>12&63|128,Y[J++]=V>>6&63|128}Y[J++]=V&63|128}}var b_=new TextEncoder,m_=50;function f_(W,Y,G){b_.encodeInto(W,Y.subarray(G))}function ND(W,Y,G){if(W.length>m_)f_(W,Y,G);else h_(W,Y,G)}var c_=4096;function AH(W,Y,G){let X=Y,J=X+G,Z=[],V="";while(X<J){let U=W[X++];if((U&128)===0)Z.push(U);else if((U&224)===192){let Q=W[X++]&63;Z.push((U&31)<<6|Q)}else if((U&240)===224){let Q=W[X++]&63,N=W[X++]&63;Z.push((U&31)<<12|Q<<6|N)}else if((U&248)===240){let Q=W[X++]&63,N=W[X++]&63,q=W[X++]&63,H=(U&7)<<18|Q<<12|N<<6|q;if(H>65535)H-=65536,Z.push(H>>>10&1023|55296),H=56320|H&1023;Z.push(H)}else Z.push(U);if(Z.length>=c_)V+=String.fromCharCode(...Z),Z.length=0}if(Z.length>0)V+=String.fromCharCode(...Z);return V}var p_=new TextDecoder,l_=200;function d_(W,Y,G){let X=W.subarray(Y,Y+G);return p_.decode(X)}function qD(W,Y,G){if(G>l_)return d_(W,Y,G);else return AH(W,Y,G)}class pY{type;data;constructor(W,Y){this.type=W,this.data=Y}}class S9 extends Error{constructor(W){super(W);let Y=Object.create(S9.prototype);Object.setPrototypeOf(this,Y),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:S9.name})}}var lY=4294967295;function AD(W,Y,G){let X=G/4294967296,J=G;W.setUint32(Y,X),W.setUint32(Y+4,J)}function yU(W,Y,G){let X=Math.floor(G/4294967296),J=G;W.setUint32(Y,X),W.setUint32(Y+4,J)}function vU(W,Y){let G=W.getInt32(Y),X=W.getUint32(Y+4);return G*4294967296+X}function HD(W,Y){let G=W.getUint32(Y),X=W.getUint32(Y+4);return G*4294967296+X}var o_=-1,n_=4294967295,i_=17179869183;function r_({sec:W,nsec:Y}){if(W>=0&&Y>=0&&W<=i_)if(Y===0&&W<=n_){let G=new Uint8Array(4);return new DataView(G.buffer).setUint32(0,W),G}else{let G=W/4294967296,X=W&4294967295,J=new Uint8Array(8),Z=new DataView(J.buffer);return Z.setUint32(0,Y<<2|G&3),Z.setUint32(4,X),J}else{let G=new Uint8Array(12),X=new DataView(G.buffer);return X.setUint32(0,Y),yU(X,4,W),G}}function a_(W){let Y=W.getTime(),G=Math.floor(Y/1000),X=(Y-G*1000)*1e6,J=Math.floor(X/1e9);return{sec:G+J,nsec:X-J*1e9}}function s_(W){if(W instanceof Date){let Y=a_(W);return r_(Y)}else return null}function t_(W){let Y=new DataView(W.buffer,W.byteOffset,W.byteLength);switch(W.byteLength){case 4:{let G=Y.getUint32(0),X=0;return{sec:G,nsec:0}}case 8:{let G=Y.getUint32(0),X=Y.getUint32(4),J=(G&3)*4294967296+X,Z=G>>>2;return{sec:J,nsec:Z}}case 12:{let G=vU(Y,4),X=Y.getUint32(0);return{sec:G,nsec:X}}default:throw new S9(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${W.length}`)}}function e_(W){let Y=t_(W);return new Date(Y.sec*1000+Y.nsec/1e6)}var zD={type:o_,encode:s_,decode:e_};class dY{static defaultCodec=new dY;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(zD)}register({type:W,encode:Y,decode:G}){if(W>=0)this.encoders[W]=Y,this.decoders[W]=G;else{let X=-1-W;this.builtInEncoders[X]=Y,this.builtInDecoders[X]=G}}tryToEncode(W,Y){for(let G=0;G<this.builtInEncoders.length;G++){let X=this.builtInEncoders[G];if(X!=null){let J=X(W,Y);if(J!=null){let Z=-1-G;return new pY(Z,J)}}}for(let G=0;G<this.encoders.length;G++){let X=this.encoders[G];if(X!=null){let J=X(W,Y);if(J!=null)return new pY(G,J)}}if(W instanceof pY)return W;return null}decode(W,Y,G){let X=Y<0?this.builtInDecoders[-1-Y]:this.decoders[Y];if(X)return X(W,Y,G);else return new pY(Y,W)}}function Wy(W){return W instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&W instanceof SharedArrayBuffer}function UJ(W){if(W instanceof Uint8Array)return W;else if(ArrayBuffer.isView(W))return new Uint8Array(W.buffer,W.byteOffset,W.byteLength);else if(Wy(W))return new Uint8Array(W);else return Uint8Array.from(W)}var Yy=100,Gy=2048;class gU{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(W){this.extensionCodec=W?.extensionCodec??dY.defaultCodec,this.context=W?.context,this.useBigInt64=W?.useBigInt64??!1,this.maxDepth=W?.maxDepth??Yy,this.initialBufferSize=W?.initialBufferSize??Gy,this.sortKeys=W?.sortKeys??!1,this.forceFloat32=W?.forceFloat32??!1,this.ignoreUndefined=W?.ignoreUndefined??!1,this.forceIntegerToFloat=W?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new gU({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(W){if(this.entered)return this.clone().encodeSharedRef(W);try{return this.entered=!0,this.reinitializeState(),this.doEncode(W,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(W){if(this.entered)return this.clone().encode(W);try{return this.entered=!0,this.reinitializeState(),this.doEncode(W,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(W,Y){if(Y>this.maxDepth)throw Error(`Too deep objects in depth ${Y}`);if(W==null)this.encodeNil();else if(typeof W==="boolean")this.encodeBoolean(W);else if(typeof W==="number")if(!this.forceIntegerToFloat)this.encodeNumber(W);else this.encodeNumberAsFloat(W);else if(typeof W==="string")this.encodeString(W);else if(this.useBigInt64&&typeof W==="bigint")this.encodeBigInt64(W);else this.encodeObject(W,Y)}ensureBufferSizeToWrite(W){let Y=this.pos+W;if(this.view.byteLength<Y)this.resizeBuffer(Y*2)}resizeBuffer(W){let Y=new ArrayBuffer(W),G=new Uint8Array(Y),X=new DataView(Y);G.set(this.bytes),this.view=X,this.bytes=G}encodeNil(){this.writeU8(192)}encodeBoolean(W){if(W===!1)this.writeU8(194);else this.writeU8(195)}encodeNumber(W){if(!this.forceIntegerToFloat&&Number.isSafeInteger(W))if(W>=0)if(W<128)this.writeU8(W);else if(W<256)this.writeU8(204),this.writeU8(W);else if(W<65536)this.writeU8(205),this.writeU16(W);else if(W<4294967296)this.writeU8(206),this.writeU32(W);else if(!this.useBigInt64)this.writeU8(207),this.writeU64(W);else this.encodeNumberAsFloat(W);else if(W>=-32)this.writeU8(224|W+32);else if(W>=-128)this.writeU8(208),this.writeI8(W);else if(W>=-32768)this.writeU8(209),this.writeI16(W);else if(W>=-2147483648)this.writeU8(210),this.writeI32(W);else if(!this.useBigInt64)this.writeU8(211),this.writeI64(W);else this.encodeNumberAsFloat(W);else this.encodeNumberAsFloat(W)}encodeNumberAsFloat(W){if(this.forceFloat32)this.writeU8(202),this.writeF32(W);else this.writeU8(203),this.writeF64(W)}encodeBigInt64(W){if(W>=BigInt(0))this.writeU8(207),this.writeBigUint64(W);else this.writeU8(211),this.writeBigInt64(W)}writeStringHeader(W){if(W<32)this.writeU8(160+W);else if(W<256)this.writeU8(217),this.writeU8(W);else if(W<65536)this.writeU8(218),this.writeU16(W);else if(W<4294967296)this.writeU8(219),this.writeU32(W);else throw Error(`Too long string: ${W} bytes in UTF-8`)}encodeString(W){let G=QD(W);this.ensureBufferSizeToWrite(5+G),this.writeStringHeader(G),ND(W,this.bytes,this.pos),this.pos+=G}encodeObject(W,Y){let G=this.extensionCodec.tryToEncode(W,this.context);if(G!=null)this.encodeExtension(G);else if(Array.isArray(W))this.encodeArray(W,Y);else if(ArrayBuffer.isView(W))this.encodeBinary(W);else if(typeof W==="object")this.encodeMap(W,Y);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(W)}`)}encodeBinary(W){let Y=W.byteLength;if(Y<256)this.writeU8(196),this.writeU8(Y);else if(Y<65536)this.writeU8(197),this.writeU16(Y);else if(Y<4294967296)this.writeU8(198),this.writeU32(Y);else throw Error(`Too large binary: ${Y}`);let G=UJ(W);this.writeU8a(G)}encodeArray(W,Y){let G=W.length;if(G<16)this.writeU8(144+G);else if(G<65536)this.writeU8(220),this.writeU16(G);else if(G<4294967296)this.writeU8(221),this.writeU32(G);else throw Error(`Too large array: ${G}`);for(let X of W)this.doEncode(X,Y+1)}countWithoutUndefined(W,Y){let G=0;for(let X of Y)if(W[X]!==void 0)G++;return G}encodeMap(W,Y){let G=Object.keys(W);if(this.sortKeys)G.sort();let X=this.ignoreUndefined?this.countWithoutUndefined(W,G):G.length;if(X<16)this.writeU8(128+X);else if(X<65536)this.writeU8(222),this.writeU16(X);else if(X<4294967296)this.writeU8(223),this.writeU32(X);else throw Error(`Too large map object: ${X}`);for(let J of G){let Z=W[J];if(!(this.ignoreUndefined&&Z===void 0))this.encodeString(J),this.doEncode(Z,Y+1)}}encodeExtension(W){if(typeof W.data==="function"){let G=W.data(this.pos+6),X=G.length;if(X>=4294967296)throw Error(`Too large extension object: ${X}`);this.writeU8(201),this.writeU32(X),this.writeI8(W.type),this.writeU8a(G);return}let Y=W.data.length;if(Y===1)this.writeU8(212);else if(Y===2)this.writeU8(213);else if(Y===4)this.writeU8(214);else if(Y===8)this.writeU8(215);else if(Y===16)this.writeU8(216);else if(Y<256)this.writeU8(199),this.writeU8(Y);else if(Y<65536)this.writeU8(200),this.writeU16(Y);else if(Y<4294967296)this.writeU8(201),this.writeU32(Y);else throw Error(`Too large extension object: ${Y}`);this.writeI8(W.type),this.writeU8a(W.data)}writeU8(W){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,W),this.pos++}writeU8a(W){let Y=W.length;this.ensureBufferSizeToWrite(Y),this.bytes.set(W,this.pos),this.pos+=Y}writeI8(W){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,W),this.pos++}writeU16(W){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,W),this.pos+=2}writeI16(W){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,W),this.pos+=2}writeU32(W){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,W),this.pos+=4}writeI32(W){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,W),this.pos+=4}writeF32(W){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,W),this.pos+=4}writeF64(W){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,W),this.pos+=8}writeU64(W){this.ensureBufferSizeToWrite(8),AD(this.view,this.pos,W),this.pos+=8}writeI64(W){this.ensureBufferSizeToWrite(8),yU(this.view,this.pos,W),this.pos+=8}writeBigUint64(W){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,W),this.pos+=8}writeBigInt64(W){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,W),this.pos+=8}}function uU(W,Y){return new gU(Y).encodeSharedRef(W)}function hU(W){return`${W<0?"-":""}0x${Math.abs(W).toString(16).padStart(2,"0")}`}var Xy=16,Jy=16;class HH{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(W=Xy,Y=Jy){this.maxKeyLength=W,this.maxLengthPerKey=Y,this.caches=[];for(let G=0;G<this.maxKeyLength;G++)this.caches.push([])}canBeCached(W){return W>0&&W<=this.maxKeyLength}find(W,Y,G){let X=this.caches[G-1];W:for(let J of X){let Z=J.bytes;for(let V=0;V<G;V++)if(Z[V]!==W[Y+V])continue W;return J.str}return null}store(W,Y){let G=this.caches[W.length-1],X={bytes:W,str:Y};if(G.length>=this.maxLengthPerKey)G[Math.random()*G.length|0]=X;else G.push(X)}decode(W,Y,G){let X=this.find(W,Y,G);if(X!=null)return this.hit++,X;this.miss++;let J=AH(W,Y,G),Z=Uint8Array.prototype.slice.call(W,Y,Y+G);return this.store(Z,J),J}}var zH="array",NJ="map_key",wD="map_value",Zy=(W)=>{if(typeof W==="string"||typeof W==="number")return W;throw new S9("The type of key must be string or number but "+typeof W)};class jD{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(W){let Y=this.getUninitializedStateFromPool();Y.type=zH,Y.position=0,Y.size=W,Y.array=Array(W)}pushMapState(W){let Y=this.getUninitializedStateFromPool();Y.type=NJ,Y.readCount=0,Y.size=W,Y.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let W={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(W)}return this.stack[this.stackHeadPosition]}release(W){if(this.stack[this.stackHeadPosition]!==W)throw Error("Invalid stack state. Released state is not on top of the stack.");if(W.type===zH){let G=W;G.size=0,G.array=void 0,G.position=0,G.type=void 0}if(W.type===NJ||W.type===wD){let G=W;G.size=0,G.map=void 0,G.readCount=0,G.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}var QJ=-1,IH=new DataView(new ArrayBuffer(0)),Vy=new Uint8Array(IH.buffer);try{IH.getInt8(0)}catch(W){if(!(W instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ID=RangeError("Insufficient data"),Uy=new HH;class bU{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=IH;bytes=Vy;headByte=QJ;stack=new jD;entered=!1;constructor(W){this.extensionCodec=W?.extensionCodec??dY.defaultCodec,this.context=W?.context,this.useBigInt64=W?.useBigInt64??!1,this.rawStrings=W?.rawStrings??!1,this.maxStrLength=W?.maxStrLength??lY,this.maxBinLength=W?.maxBinLength??lY,this.maxArrayLength=W?.maxArrayLength??lY,this.maxMapLength=W?.maxMapLength??lY,this.maxExtLength=W?.maxExtLength??lY,this.keyDecoder=W?.keyDecoder!==void 0?W.keyDecoder:Uy,this.mapKeyConverter=W?.mapKeyConverter??Zy}clone(){return new bU({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=QJ,this.stack.reset()}setBuffer(W){let Y=UJ(W);this.bytes=Y,this.view=new DataView(Y.buffer,Y.byteOffset,Y.byteLength),this.pos=0}appendBuffer(W){if(this.headByte===QJ&&!this.hasRemaining(1))this.setBuffer(W);else{let Y=this.bytes.subarray(this.pos),G=UJ(W),X=new Uint8Array(Y.length+G.length);X.set(Y),X.set(G,Y.length),this.setBuffer(X)}}hasRemaining(W){return this.view.byteLength-this.pos>=W}createExtraByteError(W){let{view:Y,pos:G}=this;return RangeError(`Extra ${Y.byteLength-G} of ${Y.byteLength} byte(s) found at buffer[${W}]`)}decode(W){if(this.entered)return this.clone().decode(W);try{this.entered=!0,this.reinitializeState(),this.setBuffer(W);let Y=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return Y}finally{this.entered=!1}}*decodeMulti(W){if(this.entered){yield*this.clone().decodeMulti(W);return}try{this.entered=!0,this.reinitializeState(),this.setBuffer(W);while(this.hasRemaining(1))yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(W){if(this.entered)return this.clone().decodeAsync(W);try{this.entered=!0;let Y=!1,G;for await(let V of W){if(Y)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(V);try{G=this.doDecodeSync(),Y=!0}catch(U){if(!(U instanceof RangeError))throw U}this.totalPos+=this.pos}if(Y){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return G}let{headByte:X,pos:J,totalPos:Z}=this;throw RangeError(`Insufficient data in parsing ${hU(X)} at ${Z} (${J} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(W){return this.decodeMultiAsync(W,!0)}decodeStream(W){return this.decodeMultiAsync(W,!1)}async*decodeMultiAsync(W,Y){if(this.entered){yield*this.clone().decodeMultiAsync(W,Y);return}try{this.entered=!0;let G=Y,X=-1;for await(let J of W){if(Y&&X===0)throw this.createExtraByteError(this.totalPos);if(this.appendBuffer(J),G)X=this.readArraySize(),G=!1,this.complete();try{while(!0)if(yield this.doDecodeSync(),--X===0)break}catch(Z){if(!(Z instanceof RangeError))throw Z}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){W:while(!0){let W=this.readHeadByte(),Y;if(W>=224)Y=W-256;else if(W<192)if(W<128)Y=W;else if(W<144){let X=W-128;if(X!==0){this.pushMapState(X),this.complete();continue W}else Y={}}else if(W<160){let X=W-144;if(X!==0){this.pushArrayState(X),this.complete();continue W}else Y=[]}else{let X=W-160;Y=this.decodeString(X,0)}else if(W===192)Y=null;else if(W===194)Y=!1;else if(W===195)Y=!0;else if(W===202)Y=this.readF32();else if(W===203)Y=this.readF64();else if(W===204)Y=this.readU8();else if(W===205)Y=this.readU16();else if(W===206)Y=this.readU32();else if(W===207)if(this.useBigInt64)Y=this.readU64AsBigInt();else Y=this.readU64();else if(W===208)Y=this.readI8();else if(W===209)Y=this.readI16();else if(W===210)Y=this.readI32();else if(W===211)if(this.useBigInt64)Y=this.readI64AsBigInt();else Y=this.readI64();else if(W===217){let X=this.lookU8();Y=this.decodeString(X,1)}else if(W===218){let X=this.lookU16();Y=this.decodeString(X,2)}else if(W===219){let X=this.lookU32();Y=this.decodeString(X,4)}else if(W===220){let X=this.readU16();if(X!==0){this.pushArrayState(X),this.complete();continue W}else Y=[]}else if(W===221){let X=this.readU32();if(X!==0){this.pushArrayState(X),this.complete();continue W}else Y=[]}else if(W===222){let X=this.readU16();if(X!==0){this.pushMapState(X),this.complete();continue W}else Y={}}else if(W===223){let X=this.readU32();if(X!==0){this.pushMapState(X),this.complete();continue W}else Y={}}else if(W===196){let X=this.lookU8();Y=this.decodeBinary(X,1)}else if(W===197){let X=this.lookU16();Y=this.decodeBinary(X,2)}else if(W===198){let X=this.lookU32();Y=this.decodeBinary(X,4)}else if(W===212)Y=this.decodeExtension(1,0);else if(W===213)Y=this.decodeExtension(2,0);else if(W===214)Y=this.decodeExtension(4,0);else if(W===215)Y=this.decodeExtension(8,0);else if(W===216)Y=this.decodeExtension(16,0);else if(W===199){let X=this.lookU8();Y=this.decodeExtension(X,1)}else if(W===200){let X=this.lookU16();Y=this.decodeExtension(X,2)}else if(W===201){let X=this.lookU32();Y=this.decodeExtension(X,4)}else throw new S9(`Unrecognized type byte: ${hU(W)}`);this.complete();let G=this.stack;while(G.length>0){let X=G.top();if(X.type===zH)if(X.array[X.position]=Y,X.position++,X.position===X.size)Y=X.array,G.release(X);else continue W;else if(X.type===NJ){if(Y==="__proto__")throw new S9("The key __proto__ is not allowed");X.key=this.mapKeyConverter(Y),X.type=wD;continue W}else if(X.map[X.key]=Y,X.readCount++,X.readCount===X.size)Y=X.map,G.release(X);else{X.key=null,X.type=NJ;continue W}}return Y}}readHeadByte(){if(this.headByte===QJ)this.headByte=this.readU8();return this.headByte}complete(){this.headByte=QJ}readArraySize(){let W=this.readHeadByte();switch(W){case 220:return this.readU16();case 221:return this.readU32();default:if(W<160)return W-144;else throw new S9(`Unrecognized array type byte: ${hU(W)}`)}}pushMapState(W){if(W>this.maxMapLength)throw new S9(`Max length exceeded: map length (${W}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(W)}pushArrayState(W){if(W>this.maxArrayLength)throw new S9(`Max length exceeded: array length (${W}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(W)}decodeString(W,Y){if(!this.rawStrings||this.stateIsMapKey())return this.decodeUtf8String(W,Y);return this.decodeBinary(W,Y)}decodeUtf8String(W,Y){if(W>this.maxStrLength)throw new S9(`Max length exceeded: UTF-8 byte length (${W}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+Y+W)throw ID;let G=this.pos+Y,X;if(this.stateIsMapKey()&&this.keyDecoder?.canBeCached(W))X=this.keyDecoder.decode(this.bytes,G,W);else X=qD(this.bytes,G,W);return this.pos+=Y+W,X}stateIsMapKey(){if(this.stack.length>0)return this.stack.top().type===NJ;return!1}decodeBinary(W,Y){if(W>this.maxBinLength)throw new S9(`Max length exceeded: bin length (${W}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(W+Y))throw ID;let G=this.pos+Y,X=this.bytes.subarray(G,G+W);return this.pos+=Y+W,X}decodeExtension(W,Y){if(W>this.maxExtLength)throw new S9(`Max length exceeded: ext length (${W}) > maxExtLength (${this.maxExtLength})`);let G=this.view.getInt8(this.pos+Y),X=this.decodeBinary(W,Y+1);return this.extensionCodec.decode(X,G,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let W=this.view.getUint8(this.pos);return this.pos++,W}readI8(){let W=this.view.getInt8(this.pos);return this.pos++,W}readU16(){let W=this.view.getUint16(this.pos);return this.pos+=2,W}readI16(){let W=this.view.getInt16(this.pos);return this.pos+=2,W}readU32(){let W=this.view.getUint32(this.pos);return this.pos+=4,W}readI32(){let W=this.view.getInt32(this.pos);return this.pos+=4,W}readU64(){let W=HD(this.view,this.pos);return this.pos+=8,W}readI64(){let W=vU(this.view,this.pos);return this.pos+=8,W}readU64AsBigInt(){let W=this.view.getBigUint64(this.pos);return this.pos+=8,W}readI64AsBigInt(){let W=this.view.getBigInt64(this.pos);return this.pos+=8,W}readF32(){let W=this.view.getFloat32(this.pos);return this.pos+=4,W}readF64(){let W=this.view.getFloat64(this.pos);return this.pos+=8,W}}function AW(W,Y){return new bU(Y).decode(W)}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function sY(W){let Y=W.length;while(--Y>=0)W[Y]=0}var Qy=0,YC=1,Ny=2,qy=3,Ay=258,hH=29,PJ=256,jJ=PJ+1+hH,iY=30,bH=19,GC=2*jJ+1,HW=15,wH=16,Hy=7,mH=256,XC=16,JC=17,ZC=18,FH=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),dU=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),zy=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),VC=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Iy=512,t7=Array((jJ+2)*2);sY(t7);var zJ=Array(iY*2);sY(zJ);var KJ=Array(Iy);sY(KJ);var OJ=Array(Ay-qy+1);sY(OJ);var fH=Array(hH);sY(fH);var oU=Array(iY);sY(oU);function jH(W,Y,G,X,J){this.static_tree=W,this.extra_bits=Y,this.extra_base=G,this.elems=X,this.max_length=J,this.has_stree=W&&W.length}var UC,QC,NC;function KH(W,Y){this.dyn_tree=W,this.max_code=0,this.stat_desc=Y}var qC=(W)=>{return W<256?KJ[W]:KJ[256+(W>>>7)]},DJ=(W,Y)=>{W.pending_buf[W.pending++]=Y&255,W.pending_buf[W.pending++]=Y>>>8&255},h9=(W,Y,G)=>{if(W.bi_valid>wH-G)W.bi_buf|=Y<<W.bi_valid&65535,DJ(W,W.bi_buf),W.bi_buf=Y>>wH-W.bi_valid,W.bi_valid+=G-wH;else W.bi_buf|=Y<<W.bi_valid&65535,W.bi_valid+=G},q7=(W,Y,G)=>{h9(W,G[Y*2],G[Y*2+1])},AC=(W,Y)=>{let G=0;do G|=W&1,W>>>=1,G<<=1;while(--Y>0);return G>>>1},wy=(W)=>{if(W.bi_valid===16)DJ(W,W.bi_buf),W.bi_buf=0,W.bi_valid=0;else if(W.bi_valid>=8)W.pending_buf[W.pending++]=W.bi_buf&255,W.bi_buf>>=8,W.bi_valid-=8},jy=(W,Y)=>{let{dyn_tree:G,max_code:X}=Y,J=Y.stat_desc.static_tree,Z=Y.stat_desc.has_stree,V=Y.stat_desc.extra_bits,U=Y.stat_desc.extra_base,Q=Y.stat_desc.max_length,N,q,H,A,I,w,O=0;for(A=0;A<=HW;A++)W.bl_count[A]=0;G[W.heap[W.heap_max]*2+1]=0;for(N=W.heap_max+1;N<GC;N++){if(q=W.heap[N],A=G[G[q*2+1]*2+1]+1,A>Q)A=Q,O++;if(G[q*2+1]=A,q>X)continue;if(W.bl_count[A]++,I=0,q>=U)I=V[q-U];if(w=G[q*2],W.opt_len+=w*(A+I),Z)W.static_len+=w*(J[q*2+1]+I)}if(O===0)return;do{A=Q-1;while(W.bl_count[A]===0)A--;W.bl_count[A]--,W.bl_count[A+1]+=2,W.bl_count[Q]--,O-=2}while(O>0);for(A=Q;A!==0;A--){q=W.bl_count[A];while(q!==0){if(H=W.heap[--N],H>X)continue;if(G[H*2+1]!==A)W.opt_len+=(A-G[H*2+1])*G[H*2],G[H*2+1]=A;q--}}},HC=(W,Y,G)=>{let X=Array(HW+1),J=0,Z,V;for(Z=1;Z<=HW;Z++)J=J+G[Z-1]<<1,X[Z]=J;for(V=0;V<=Y;V++){let U=W[V*2+1];if(U===0)continue;W[V*2]=AC(X[U]++,U)}},Ky=()=>{let W,Y,G,X,J,Z=Array(HW+1);G=0;for(X=0;X<hH-1;X++){fH[X]=G;for(W=0;W<1<<FH[X];W++)OJ[G++]=X}OJ[G-1]=X,J=0;for(X=0;X<16;X++){oU[X]=J;for(W=0;W<1<<dU[X];W++)KJ[J++]=X}J>>=7;for(;X<iY;X++){oU[X]=J<<7;for(W=0;W<1<<dU[X]-7;W++)KJ[256+J++]=X}for(Y=0;Y<=HW;Y++)Z[Y]=0;W=0;while(W<=143)t7[W*2+1]=8,W++,Z[8]++;while(W<=255)t7[W*2+1]=9,W++,Z[9]++;while(W<=279)t7[W*2+1]=7,W++,Z[7]++;while(W<=287)t7[W*2+1]=8,W++,Z[8]++;HC(t7,jJ+1,Z);for(W=0;W<iY;W++)zJ[W*2+1]=5,zJ[W*2]=AC(W,5);UC=new jH(t7,FH,PJ+1,jJ,HW),QC=new jH(zJ,dU,0,iY,HW),NC=new jH([],zy,0,bH,Hy)},zC=(W)=>{let Y;for(Y=0;Y<jJ;Y++)W.dyn_ltree[Y*2]=0;for(Y=0;Y<iY;Y++)W.dyn_dtree[Y*2]=0;for(Y=0;Y<bH;Y++)W.bl_tree[Y*2]=0;W.dyn_ltree[mH*2]=1,W.opt_len=W.static_len=0,W.sym_next=W.matches=0},IC=(W)=>{if(W.bi_valid>8)DJ(W,W.bi_buf);else if(W.bi_valid>0)W.pending_buf[W.pending++]=W.bi_buf;W.bi_buf=0,W.bi_valid=0},KD=(W,Y,G,X)=>{let J=Y*2,Z=G*2;return W[J]<W[Z]||W[J]===W[Z]&&X[Y]<=X[G]},OH=(W,Y,G)=>{let X=W.heap[G],J=G<<1;while(J<=W.heap_len){if(J<W.heap_len&&KD(Y,W.heap[J+1],W.heap[J],W.depth))J++;if(KD(Y,X,W.heap[J],W.depth))break;W.heap[G]=W.heap[J],G=J,J<<=1}W.heap[G]=X},OD=(W,Y,G)=>{let X,J,Z=0,V,U;if(W.sym_next!==0)do if(X=W.pending_buf[W.sym_buf+Z++]&255,X+=(W.pending_buf[W.sym_buf+Z++]&255)<<8,J=W.pending_buf[W.sym_buf+Z++],X===0)q7(W,J,Y);else{if(V=OJ[J],q7(W,V+PJ+1,Y),U=FH[V],U!==0)J-=fH[V],h9(W,J,U);if(X--,V=qC(X),q7(W,V,G),U=dU[V],U!==0)X-=oU[V],h9(W,X,U)}while(Z<W.sym_next);q7(W,mH,Y)},SH=(W,Y)=>{let G=Y.dyn_tree,X=Y.stat_desc.static_tree,J=Y.stat_desc.has_stree,Z=Y.stat_desc.elems,V,U,Q=-1,N;W.heap_len=0,W.heap_max=GC;for(V=0;V<Z;V++)if(G[V*2]!==0)W.heap[++W.heap_len]=Q=V,W.depth[V]=0;else G[V*2+1]=0;while(W.heap_len<2)if(N=W.heap[++W.heap_len]=Q<2?++Q:0,G[N*2]=1,W.depth[N]=0,W.opt_len--,J)W.static_len-=X[N*2+1];Y.max_code=Q;for(V=W.heap_len>>1;V>=1;V--)OH(W,G,V);N=Z;do V=W.heap[1],W.heap[1]=W.heap[W.heap_len--],OH(W,G,1),U=W.heap[1],W.heap[--W.heap_max]=V,W.heap[--W.heap_max]=U,G[N*2]=G[V*2]+G[U*2],W.depth[N]=(W.depth[V]>=W.depth[U]?W.depth[V]:W.depth[U])+1,G[V*2+1]=G[U*2+1]=N,W.heap[1]=N++,OH(W,G,1);while(W.heap_len>=2);W.heap[--W.heap_max]=W.heap[1],jy(W,Y),HC(G,Q,W.bl_count)},DD=(W,Y,G)=>{let X,J=-1,Z,V=Y[1],U=0,Q=7,N=4;if(V===0)Q=138,N=3;Y[(G+1)*2+1]=65535;for(X=0;X<=G;X++){if(Z=V,V=Y[(X+1)*2+1],++U<Q&&Z===V)continue;else if(U<N)W.bl_tree[Z*2]+=U;else if(Z!==0){if(Z!==J)W.bl_tree[Z*2]++;W.bl_tree[XC*2]++}else if(U<=10)W.bl_tree[JC*2]++;else W.bl_tree[ZC*2]++;if(U=0,J=Z,V===0)Q=138,N=3;else if(Z===V)Q=6,N=3;else Q=7,N=4}},CD=(W,Y,G)=>{let X,J=-1,Z,V=Y[1],U=0,Q=7,N=4;if(V===0)Q=138,N=3;for(X=0;X<=G;X++){if(Z=V,V=Y[(X+1)*2+1],++U<Q&&Z===V)continue;else if(U<N)do q7(W,Z,W.bl_tree);while(--U!==0);else if(Z!==0){if(Z!==J)q7(W,Z,W.bl_tree),U--;q7(W,XC,W.bl_tree),h9(W,U-3,2)}else if(U<=10)q7(W,JC,W.bl_tree),h9(W,U-3,3);else q7(W,ZC,W.bl_tree),h9(W,U-11,7);if(U=0,J=Z,V===0)Q=138,N=3;else if(Z===V)Q=6,N=3;else Q=7,N=4}},Oy=(W)=>{let Y;DD(W,W.dyn_ltree,W.l_desc.max_code),DD(W,W.dyn_dtree,W.d_desc.max_code),SH(W,W.bl_desc);for(Y=bH-1;Y>=3;Y--)if(W.bl_tree[VC[Y]*2+1]!==0)break;return W.opt_len+=3*(Y+1)+5+5+4,Y},Dy=(W,Y,G,X)=>{let J;h9(W,Y-257,5),h9(W,G-1,5),h9(W,X-4,4);for(J=0;J<X;J++)h9(W,W.bl_tree[VC[J]*2+1],3);CD(W,W.dyn_ltree,Y-1),CD(W,W.dyn_dtree,G-1)},Cy=(W)=>{let Y=4093624447,G;for(G=0;G<=31;G++,Y>>>=1)if(Y&1&&W.dyn_ltree[G*2]!==0)return 0;if(W.dyn_ltree[18]!==0||W.dyn_ltree[20]!==0||W.dyn_ltree[26]!==0)return 1;for(G=32;G<PJ;G++)if(W.dyn_ltree[G*2]!==0)return 1;return 0},TD=!1,Ty=(W)=>{if(!TD)Ky(),TD=!0;W.l_desc=new KH(W.dyn_ltree,UC),W.d_desc=new KH(W.dyn_dtree,QC),W.bl_desc=new KH(W.bl_tree,NC),W.bi_buf=0,W.bi_valid=0,zC(W)},wC=(W,Y,G,X)=>{if(h9(W,(Qy<<1)+(X?1:0),3),IC(W),DJ(W,G),DJ(W,~G),G)W.pending_buf.set(W.window.subarray(Y,Y+G),W.pending);W.pending+=G},My=(W)=>{h9(W,YC<<1,3),q7(W,mH,t7),wy(W)},Ry=(W,Y,G,X)=>{let J,Z,V=0;if(W.level>0){if(W.strm.data_type===2)W.strm.data_type=Cy(W);if(SH(W,W.l_desc),SH(W,W.d_desc),V=Oy(W),J=W.opt_len+3+7>>>3,Z=W.static_len+3+7>>>3,Z<=J)J=Z}else J=Z=G+5;if(G+4<=J&&Y!==-1)wC(W,Y,G,X);else if(W.strategy===4||Z===J)h9(W,(YC<<1)+(X?1:0),3),OD(W,t7,zJ);else h9(W,(Ny<<1)+(X?1:0),3),Dy(W,W.l_desc.max_code+1,W.d_desc.max_code+1,V+1),OD(W,W.dyn_ltree,W.dyn_dtree);if(zC(W),X)IC(W)},Py=(W,Y,G)=>{if(W.pending_buf[W.sym_buf+W.sym_next++]=Y,W.pending_buf[W.sym_buf+W.sym_next++]=Y>>8,W.pending_buf[W.sym_buf+W.sym_next++]=G,Y===0)W.dyn_ltree[G*2]++;else W.matches++,Y--,W.dyn_ltree[(OJ[G]+PJ+1)*2]++,W.dyn_dtree[qC(Y)*2]++;return W.sym_next===W.sym_end},Ly=Ty,By=wC,Ey=Ry,$y=Py,Fy=My,Sy={_tr_init:Ly,_tr_stored_block:By,_tr_flush_block:Ey,_tr_tally:$y,_tr_align:Fy},xy=(W,Y,G,X)=>{let J=W&65535|0,Z=W>>>16&65535|0,V=0;while(G!==0){V=G>2000?2000:G,G-=V;do J=J+Y[X++]|0,Z=Z+J|0;while(--V);J%=65521,Z%=65521}return J|Z<<16|0},CJ=xy,ky=()=>{let W,Y=[];for(var G=0;G<256;G++){W=G;for(var X=0;X<8;X++)W=W&1?3988292384^W>>>1:W>>>1;Y[G]=W}return Y},_y=new Uint32Array(ky()),yy=(W,Y,G,X)=>{let J=_y,Z=X+G;W^=-1;for(let V=X;V<Z;V++)W=W>>>8^J[(W^Y[V])&255];return W^-1},n8=yy,wW={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},OW={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:vy,_tr_stored_block:xH,_tr_flush_block:gy,_tr_tally:V6,_tr_align:uy}=Sy,{Z_NO_FLUSH:U6,Z_PARTIAL_FLUSH:hy,Z_FULL_FLUSH:by,Z_FINISH:j5,Z_BLOCK:MD,Z_OK:e8,Z_STREAM_END:RD,Z_STREAM_ERROR:A7,Z_DATA_ERROR:my,Z_BUF_ERROR:DH,Z_DEFAULT_COMPRESSION:fy,Z_FILTERED:cy,Z_HUFFMAN_ONLY:mU,Z_RLE:py,Z_FIXED:ly,Z_DEFAULT_STRATEGY:dy,Z_UNKNOWN:oy,Z_DEFLATED:rU}=OW,ny=9,iy=15,ry=8,ay=29,sy=256,kH=sy+1+ay,ty=30,ey=19,Wv=2*kH+1,Yv=15,g1=3,Z6=258,H7=Z6+g1+1,Gv=32,rY=42,cH=57,_H=69,yH=73,vH=91,gH=103,zW=113,AJ=666,x9=1,tY=2,jW=3,eY=4,Xv=3,IW=(W,Y)=>{return W.msg=wW[Y],Y},PD=(W)=>{return W*2-(W>4?9:0)},J6=(W)=>{let Y=W.length;while(--Y>=0)W[Y]=0},Jv=(W)=>{let Y,G,X,J=W.w_size;Y=W.hash_size,X=Y;do G=W.head[--X],W.head[X]=G>=J?G-J:0;while(--Y);Y=J,X=Y;do G=W.prev[--X],W.prev[X]=G>=J?G-J:0;while(--Y)},Zv=(W,Y,G)=>(Y<<W.hash_shift^G)&W.hash_mask,Q6=Zv,W5=(W)=>{let Y=W.state,G=Y.pending;if(G>W.avail_out)G=W.avail_out;if(G===0)return;if(W.output.set(Y.pending_buf.subarray(Y.pending_out,Y.pending_out+G),W.next_out),W.next_out+=G,Y.pending_out+=G,W.total_out+=G,W.avail_out-=G,Y.pending-=G,Y.pending===0)Y.pending_out=0},Y5=(W,Y)=>{gy(W,W.block_start>=0?W.block_start:-1,W.strstart-W.block_start,Y),W.block_start=W.strstart,W5(W.strm)},i1=(W,Y)=>{W.pending_buf[W.pending++]=Y},qJ=(W,Y)=>{W.pending_buf[W.pending++]=Y>>>8&255,W.pending_buf[W.pending++]=Y&255},uH=(W,Y,G,X)=>{let J=W.avail_in;if(J>X)J=X;if(J===0)return 0;if(W.avail_in-=J,Y.set(W.input.subarray(W.next_in,W.next_in+J),G),W.state.wrap===1)W.adler=CJ(W.adler,Y,J,G);else if(W.state.wrap===2)W.adler=n8(W.adler,Y,J,G);return W.next_in+=J,W.total_in+=J,J},jC=(W,Y)=>{let{max_chain_length:G,strstart:X}=W,J,Z,V=W.prev_length,U=W.nice_match,Q=W.strstart>W.w_size-H7?W.strstart-(W.w_size-H7):0,N=W.window,q=W.w_mask,H=W.prev,A=W.strstart+Z6,I=N[X+V-1],w=N[X+V];if(W.prev_length>=W.good_match)G>>=2;if(U>W.lookahead)U=W.lookahead;do{if(J=Y,N[J+V]!==w||N[J+V-1]!==I||N[J]!==N[X]||N[++J]!==N[X+1])continue;X+=2,J++;do;while(N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&N[++X]===N[++J]&&X<A);if(Z=Z6-(A-X),X=A-Z6,Z>V){if(W.match_start=Y,V=Z,Z>=U)break;I=N[X+V-1],w=N[X+V]}}while((Y=H[Y&q])>Q&&--G!==0);if(V<=W.lookahead)return V;return W.lookahead},aY=(W)=>{let Y=W.w_size,G,X,J;do{if(X=W.window_size-W.lookahead-W.strstart,W.strstart>=Y+(Y-H7)){if(W.window.set(W.window.subarray(Y,Y+Y-X),0),W.match_start-=Y,W.strstart-=Y,W.block_start-=Y,W.insert>W.strstart)W.insert=W.strstart;Jv(W),X+=Y}if(W.strm.avail_in===0)break;if(G=uH(W.strm,W.window,W.strstart+W.lookahead,X),W.lookahead+=G,W.lookahead+W.insert>=g1){J=W.strstart-W.insert,W.ins_h=W.window[J],W.ins_h=Q6(W,W.ins_h,W.window[J+1]);while(W.insert)if(W.ins_h=Q6(W,W.ins_h,W.window[J+g1-1]),W.prev[J&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=J,J++,W.insert--,W.lookahead+W.insert<g1)break}}while(W.lookahead<H7&&W.strm.avail_in!==0)},KC=(W,Y)=>{let G=W.pending_buf_size-5>W.w_size?W.w_size:W.pending_buf_size-5,X,J,Z,V=0,U=W.strm.avail_in;do{if(X=65535,Z=W.bi_valid+42>>3,W.strm.avail_out<Z)break;if(Z=W.strm.avail_out-Z,J=W.strstart-W.block_start,X>J+W.strm.avail_in)X=J+W.strm.avail_in;if(X>Z)X=Z;if(X<G&&(X===0&&Y!==j5||Y===U6||X!==J+W.strm.avail_in))break;if(V=Y===j5&&X===J+W.strm.avail_in?1:0,xH(W,0,0,V),W.pending_buf[W.pending-4]=X,W.pending_buf[W.pending-3]=X>>8,W.pending_buf[W.pending-2]=~X,W.pending_buf[W.pending-1]=~X>>8,W5(W.strm),J){if(J>X)J=X;W.strm.output.set(W.window.subarray(W.block_start,W.block_start+J),W.strm.next_out),W.strm.next_out+=J,W.strm.avail_out-=J,W.strm.total_out+=J,W.block_start+=J,X-=J}if(X)uH(W.strm,W.strm.output,W.strm.next_out,X),W.strm.next_out+=X,W.strm.avail_out-=X,W.strm.total_out+=X}while(V===0);if(U-=W.strm.avail_in,U){if(U>=W.w_size)W.matches=2,W.window.set(W.strm.input.subarray(W.strm.next_in-W.w_size,W.strm.next_in),0),W.strstart=W.w_size,W.insert=W.strstart;else{if(W.window_size-W.strstart<=U){if(W.strstart-=W.w_size,W.window.set(W.window.subarray(W.w_size,W.w_size+W.strstart),0),W.matches<2)W.matches++;if(W.insert>W.strstart)W.insert=W.strstart}W.window.set(W.strm.input.subarray(W.strm.next_in-U,W.strm.next_in),W.strstart),W.strstart+=U,W.insert+=U>W.w_size-W.insert?W.w_size-W.insert:U}W.block_start=W.strstart}if(W.high_water<W.strstart)W.high_water=W.strstart;if(V)return eY;if(Y!==U6&&Y!==j5&&W.strm.avail_in===0&&W.strstart===W.block_start)return tY;if(Z=W.window_size-W.strstart,W.strm.avail_in>Z&&W.block_start>=W.w_size){if(W.block_start-=W.w_size,W.strstart-=W.w_size,W.window.set(W.window.subarray(W.w_size,W.w_size+W.strstart),0),W.matches<2)W.matches++;if(Z+=W.w_size,W.insert>W.strstart)W.insert=W.strstart}if(Z>W.strm.avail_in)Z=W.strm.avail_in;if(Z)uH(W.strm,W.window,W.strstart,Z),W.strstart+=Z,W.insert+=Z>W.w_size-W.insert?W.w_size-W.insert:Z;if(W.high_water<W.strstart)W.high_water=W.strstart;if(Z=W.bi_valid+42>>3,Z=W.pending_buf_size-Z>65535?65535:W.pending_buf_size-Z,G=Z>W.w_size?W.w_size:Z,J=W.strstart-W.block_start,J>=G||(J||Y===j5)&&Y!==U6&&W.strm.avail_in===0&&J<=Z)X=J>Z?Z:J,V=Y===j5&&W.strm.avail_in===0&&X===J?1:0,xH(W,W.block_start,X,V),W.block_start+=X,W5(W.strm);return V?jW:x9},CH=(W,Y)=>{let G,X;for(;;){if(W.lookahead<H7){if(aY(W),W.lookahead<H7&&Y===U6)return x9;if(W.lookahead===0)break}if(G=0,W.lookahead>=g1)W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;if(G!==0&&W.strstart-G<=W.w_size-H7)W.match_length=jC(W,G);if(W.match_length>=g1)if(X=V6(W,W.strstart-W.match_start,W.match_length-g1),W.lookahead-=W.match_length,W.match_length<=W.max_lazy_match&&W.lookahead>=g1){W.match_length--;do W.strstart++,W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;while(--W.match_length!==0);W.strstart++}else W.strstart+=W.match_length,W.match_length=0,W.ins_h=W.window[W.strstart],W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+1]);else X=V6(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++;if(X){if(Y5(W,!1),W.strm.avail_out===0)return x9}}if(W.insert=W.strstart<g1-1?W.strstart:g1-1,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY},oY=(W,Y)=>{let G,X,J;for(;;){if(W.lookahead<H7){if(aY(W),W.lookahead<H7&&Y===U6)return x9;if(W.lookahead===0)break}if(G=0,W.lookahead>=g1)W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;if(W.prev_length=W.match_length,W.prev_match=W.match_start,W.match_length=g1-1,G!==0&&W.prev_length<W.max_lazy_match&&W.strstart-G<=W.w_size-H7){if(W.match_length=jC(W,G),W.match_length<=5&&(W.strategy===cy||W.match_length===g1&&W.strstart-W.match_start>4096))W.match_length=g1-1}if(W.prev_length>=g1&&W.match_length<=W.prev_length){J=W.strstart+W.lookahead-g1,X=V6(W,W.strstart-1-W.prev_match,W.prev_length-g1),W.lookahead-=W.prev_length-1,W.prev_length-=2;do if(++W.strstart<=J)W.ins_h=Q6(W,W.ins_h,W.window[W.strstart+g1-1]),G=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart;while(--W.prev_length!==0);if(W.match_available=0,W.match_length=g1-1,W.strstart++,X){if(Y5(W,!1),W.strm.avail_out===0)return x9}}else if(W.match_available){if(X=V6(W,0,W.window[W.strstart-1]),X)Y5(W,!1);if(W.strstart++,W.lookahead--,W.strm.avail_out===0)return x9}else W.match_available=1,W.strstart++,W.lookahead--}if(W.match_available)X=V6(W,0,W.window[W.strstart-1]),W.match_available=0;if(W.insert=W.strstart<g1-1?W.strstart:g1-1,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY},Vv=(W,Y)=>{let G,X,J,Z,V=W.window;for(;;){if(W.lookahead<=Z6){if(aY(W),W.lookahead<=Z6&&Y===U6)return x9;if(W.lookahead===0)break}if(W.match_length=0,W.lookahead>=g1&&W.strstart>0){if(J=W.strstart-1,X=V[J],X===V[++J]&&X===V[++J]&&X===V[++J]){Z=W.strstart+Z6;do;while(X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&X===V[++J]&&J<Z);if(W.match_length=Z6-(Z-J),W.match_length>W.lookahead)W.match_length=W.lookahead}}if(W.match_length>=g1)G=V6(W,1,W.match_length-g1),W.lookahead-=W.match_length,W.strstart+=W.match_length,W.match_length=0;else G=V6(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++;if(G){if(Y5(W,!1),W.strm.avail_out===0)return x9}}if(W.insert=0,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY},Uv=(W,Y)=>{let G;for(;;){if(W.lookahead===0){if(aY(W),W.lookahead===0){if(Y===U6)return x9;break}}if(W.match_length=0,G=V6(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++,G){if(Y5(W,!1),W.strm.avail_out===0)return x9}}if(W.insert=0,Y===j5){if(Y5(W,!0),W.strm.avail_out===0)return jW;return eY}if(W.sym_next){if(Y5(W,!1),W.strm.avail_out===0)return x9}return tY};function N7(W,Y,G,X,J){this.good_length=W,this.max_lazy=Y,this.nice_length=G,this.max_chain=X,this.func=J}var HJ=[new N7(0,0,0,0,KC),new N7(4,4,8,4,CH),new N7(4,5,16,8,CH),new N7(4,6,32,32,CH),new N7(4,4,16,16,oY),new N7(8,16,32,32,oY),new N7(8,16,128,128,oY),new N7(8,32,128,256,oY),new N7(32,128,258,1024,oY),new N7(32,258,258,4096,oY)],Qv=(W)=>{W.window_size=2*W.w_size,J6(W.head),W.max_lazy_match=HJ[W.level].max_lazy,W.good_match=HJ[W.level].good_length,W.nice_match=HJ[W.level].nice_length,W.max_chain_length=HJ[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=g1-1,W.match_available=0,W.ins_h=0};function Nv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rU,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Wv*2),this.dyn_dtree=new Uint16Array((2*ty+1)*2),this.bl_tree=new Uint16Array((2*ey+1)*2),J6(this.dyn_ltree),J6(this.dyn_dtree),J6(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Yv+1),this.heap=new Uint16Array(2*kH+1),J6(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*kH+1),J6(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var LJ=(W)=>{if(!W)return 1;let Y=W.state;if(!Y||Y.strm!==W||Y.status!==rY&&Y.status!==cH&&Y.status!==_H&&Y.status!==yH&&Y.status!==vH&&Y.status!==gH&&Y.status!==zW&&Y.status!==AJ)return 1;return 0},OC=(W)=>{if(LJ(W))return IW(W,A7);W.total_in=W.total_out=0,W.data_type=oy;let Y=W.state;if(Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap===2?cH:Y.wrap?rY:zW,W.adler=Y.wrap===2?0:1,Y.last_flush=-2,vy(Y),e8},DC=(W)=>{let Y=OC(W);if(Y===e8)Qv(W.state);return Y},qv=(W,Y)=>{if(LJ(W)||W.state.wrap!==2)return A7;return W.state.gzhead=Y,e8},CC=(W,Y,G,X,J,Z)=>{if(!W)return A7;let V=1;if(Y===fy)Y=6;if(X<0)V=0,X=-X;else if(X>15)V=2,X-=16;if(J<1||J>ny||G!==rU||X<8||X>15||Y<0||Y>9||Z<0||Z>ly||X===8&&V!==1)return IW(W,A7);if(X===8)X=9;let U=new Nv;return W.state=U,U.strm=W,U.status=rY,U.wrap=V,U.gzhead=null,U.w_bits=X,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=J+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+g1-1)/g1),U.window=new Uint8Array(U.w_size*2),U.head=new Uint16Array(U.hash_size),U.prev=new Uint16Array(U.w_size),U.lit_bufsize=1<<J+6,U.pending_buf_size=U.lit_bufsize*4,U.pending_buf=new Uint8Array(U.pending_buf_size),U.sym_buf=U.lit_bufsize,U.sym_end=(U.lit_bufsize-1)*3,U.level=Y,U.strategy=Z,U.method=G,DC(W)},Av=(W,Y)=>{return CC(W,Y,rU,iy,ry,dy)},Hv=(W,Y)=>{if(LJ(W)||Y>MD||Y<0)return W?IW(W,A7):A7;let G=W.state;if(!W.output||W.avail_in!==0&&!W.input||G.status===AJ&&Y!==j5)return IW(W,W.avail_out===0?DH:A7);let X=G.last_flush;if(G.last_flush=Y,G.pending!==0){if(W5(W),W.avail_out===0)return G.last_flush=-1,e8}else if(W.avail_in===0&&PD(Y)<=PD(X)&&Y!==j5)return IW(W,DH);if(G.status===AJ&&W.avail_in!==0)return IW(W,DH);if(G.status===rY&&G.wrap===0)G.status=zW;if(G.status===rY){let J=rU+(G.w_bits-8<<4)<<8,Z=-1;if(G.strategy>=mU||G.level<2)Z=0;else if(G.level<6)Z=1;else if(G.level===6)Z=2;else Z=3;if(J|=Z<<6,G.strstart!==0)J|=Gv;if(J+=31-J%31,qJ(G,J),G.strstart!==0)qJ(G,W.adler>>>16),qJ(G,W.adler&65535);if(W.adler=1,G.status=zW,W5(W),G.pending!==0)return G.last_flush=-1,e8}if(G.status===cH)if(W.adler=0,i1(G,31),i1(G,139),i1(G,8),!G.gzhead){if(i1(G,0),i1(G,0),i1(G,0),i1(G,0),i1(G,0),i1(G,G.level===9?2:G.strategy>=mU||G.level<2?4:0),i1(G,Xv),G.status=zW,W5(W),G.pending!==0)return G.last_flush=-1,e8}else{if(i1(G,(G.gzhead.text?1:0)+(G.gzhead.hcrc?2:0)+(!G.gzhead.extra?0:4)+(!G.gzhead.name?0:8)+(!G.gzhead.comment?0:16)),i1(G,G.gzhead.time&255),i1(G,G.gzhead.time>>8&255),i1(G,G.gzhead.time>>16&255),i1(G,G.gzhead.time>>24&255),i1(G,G.level===9?2:G.strategy>=mU||G.level<2?4:0),i1(G,G.gzhead.os&255),G.gzhead.extra&&G.gzhead.extra.length)i1(G,G.gzhead.extra.length&255),i1(G,G.gzhead.extra.length>>8&255);if(G.gzhead.hcrc)W.adler=n8(W.adler,G.pending_buf,G.pending,0);G.gzindex=0,G.status=_H}if(G.status===_H){if(G.gzhead.extra){let J=G.pending,Z=(G.gzhead.extra.length&65535)-G.gzindex;while(G.pending+Z>G.pending_buf_size){let U=G.pending_buf_size-G.pending;if(G.pending_buf.set(G.gzhead.extra.subarray(G.gzindex,G.gzindex+U),G.pending),G.pending=G.pending_buf_size,G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);if(G.gzindex+=U,W5(W),G.pending!==0)return G.last_flush=-1,e8;J=0,Z-=U}let V=new Uint8Array(G.gzhead.extra);if(G.pending_buf.set(V.subarray(G.gzindex,G.gzindex+Z),G.pending),G.pending+=Z,G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);G.gzindex=0}G.status=yH}if(G.status===yH){if(G.gzhead.name){let J=G.pending,Z;do{if(G.pending===G.pending_buf_size){if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);if(W5(W),G.pending!==0)return G.last_flush=-1,e8;J=0}if(G.gzindex<G.gzhead.name.length)Z=G.gzhead.name.charCodeAt(G.gzindex++)&255;else Z=0;i1(G,Z)}while(Z!==0);if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);G.gzindex=0}G.status=vH}if(G.status===vH){if(G.gzhead.comment){let J=G.pending,Z;do{if(G.pending===G.pending_buf_size){if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J);if(W5(W),G.pending!==0)return G.last_flush=-1,e8;J=0}if(G.gzindex<G.gzhead.comment.length)Z=G.gzhead.comment.charCodeAt(G.gzindex++)&255;else Z=0;i1(G,Z)}while(Z!==0);if(G.gzhead.hcrc&&G.pending>J)W.adler=n8(W.adler,G.pending_buf,G.pending-J,J)}G.status=gH}if(G.status===gH){if(G.gzhead.hcrc){if(G.pending+2>G.pending_buf_size){if(W5(W),G.pending!==0)return G.last_flush=-1,e8}i1(G,W.adler&255),i1(G,W.adler>>8&255),W.adler=0}if(G.status=zW,W5(W),G.pending!==0)return G.last_flush=-1,e8}if(W.avail_in!==0||G.lookahead!==0||Y!==U6&&G.status!==AJ){let J=G.level===0?KC(G,Y):G.strategy===mU?Uv(G,Y):G.strategy===py?Vv(G,Y):HJ[G.level].func(G,Y);if(J===jW||J===eY)G.status=AJ;if(J===x9||J===jW){if(W.avail_out===0)G.last_flush=-1;return e8}if(J===tY){if(Y===hy)uy(G);else if(Y!==MD){if(xH(G,0,0,!1),Y===by){if(J6(G.head),G.lookahead===0)G.strstart=0,G.block_start=0,G.insert=0}}if(W5(W),W.avail_out===0)return G.last_flush=-1,e8}}if(Y!==j5)return e8;if(G.wrap<=0)return RD;if(G.wrap===2)i1(G,W.adler&255),i1(G,W.adler>>8&255),i1(G,W.adler>>16&255),i1(G,W.adler>>24&255),i1(G,W.total_in&255),i1(G,W.total_in>>8&255),i1(G,W.total_in>>16&255),i1(G,W.total_in>>24&255);else qJ(G,W.adler>>>16),qJ(G,W.adler&65535);if(W5(W),G.wrap>0)G.wrap=-G.wrap;return G.pending!==0?e8:RD},zv=(W)=>{if(LJ(W))return A7;let Y=W.state.status;return W.state=null,Y===zW?IW(W,my):e8},Iv=(W,Y)=>{let G=Y.length;if(LJ(W))return A7;let X=W.state,J=X.wrap;if(J===2||J===1&&X.status!==rY||X.lookahead)return A7;if(J===1)W.adler=CJ(W.adler,Y,G,0);if(X.wrap=0,G>=X.w_size){if(J===0)J6(X.head),X.strstart=0,X.block_start=0,X.insert=0;let Q=new Uint8Array(X.w_size);Q.set(Y.subarray(G-X.w_size,G),0),Y=Q,G=X.w_size}let{avail_in:Z,next_in:V,input:U}=W;W.avail_in=G,W.next_in=0,W.input=Y,aY(X);while(X.lookahead>=g1){let Q=X.strstart,N=X.lookahead-(g1-1);do X.ins_h=Q6(X,X.ins_h,X.window[Q+g1-1]),X.prev[Q&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=Q,Q++;while(--N);X.strstart=Q,X.lookahead=g1-1,aY(X)}return X.strstart+=X.lookahead,X.block_start=X.strstart,X.insert=X.lookahead,X.lookahead=0,X.match_length=X.prev_length=g1-1,X.match_available=0,W.next_in=V,W.input=U,W.avail_in=Z,X.wrap=J,e8},wv=Av,jv=CC,Kv=DC,Ov=OC,Dv=qv,Cv=Hv,Tv=zv,Mv=Iv,Rv="pako deflate (from Nodeca project)",IJ={deflateInit:wv,deflateInit2:jv,deflateReset:Kv,deflateResetKeep:Ov,deflateSetHeader:Dv,deflate:Cv,deflateEnd:Tv,deflateSetDictionary:Mv,deflateInfo:Rv},Pv=(W,Y)=>{return Object.prototype.hasOwnProperty.call(W,Y)},Lv=function(W){let Y=Array.prototype.slice.call(arguments,1);while(Y.length){let G=Y.shift();if(!G)continue;if(typeof G!=="object")throw TypeError(G+"must be non-object");for(let X in G)if(Pv(G,X))W[X]=G[X]}return W},Bv=(W)=>{let Y=0;for(let X=0,J=W.length;X<J;X++)Y+=W[X].length;let G=new Uint8Array(Y);for(let X=0,J=0,Z=W.length;X<Z;X++){let V=W[X];G.set(V,J),J+=V.length}return G},aU={assign:Lv,flattenChunks:Bv},TC=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(W){TC=!1}var TJ=new Uint8Array(256);for(let W=0;W<256;W++)TJ[W]=W>=252?6:W>=248?5:W>=240?4:W>=224?3:W>=192?2:1;TJ[254]=TJ[254]=1;var Ev=(W)=>{if(typeof TextEncoder==="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(W);let Y,G,X,J,Z,V=W.length,U=0;for(J=0;J<V;J++){if(G=W.charCodeAt(J),(G&64512)===55296&&J+1<V){if(X=W.charCodeAt(J+1),(X&64512)===56320)G=65536+(G-55296<<10)+(X-56320),J++}U+=G<128?1:G<2048?2:G<65536?3:4}Y=new Uint8Array(U);for(Z=0,J=0;Z<U;J++){if(G=W.charCodeAt(J),(G&64512)===55296&&J+1<V){if(X=W.charCodeAt(J+1),(X&64512)===56320)G=65536+(G-55296<<10)+(X-56320),J++}if(G<128)Y[Z++]=G;else if(G<2048)Y[Z++]=192|G>>>6,Y[Z++]=128|G&63;else if(G<65536)Y[Z++]=224|G>>>12,Y[Z++]=128|G>>>6&63,Y[Z++]=128|G&63;else Y[Z++]=240|G>>>18,Y[Z++]=128|G>>>12&63,Y[Z++]=128|G>>>6&63,Y[Z++]=128|G&63}return Y},$v=(W,Y)=>{if(Y<65534){if(W.subarray&&TC)return String.fromCharCode.apply(null,W.length===Y?W:W.subarray(0,Y))}let G="";for(let X=0;X<Y;X++)G+=String.fromCharCode(W[X]);return G},Fv=(W,Y)=>{let G=Y||W.length;if(typeof TextDecoder==="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(W.subarray(0,Y));let X,J,Z=Array(G*2);for(J=0,X=0;X<G;){let V=W[X++];if(V<128){Z[J++]=V;continue}let U=TJ[V];if(U>4){Z[J++]=65533,X+=U-1;continue}V&=U===2?31:U===3?15:7;while(U>1&&X<G)V=V<<6|W[X++]&63,U--;if(U>1){Z[J++]=65533;continue}if(V<65536)Z[J++]=V;else V-=65536,Z[J++]=55296|V>>10&1023,Z[J++]=56320|V&1023}return $v(Z,J)},Sv=(W,Y)=>{if(Y=Y||W.length,Y>W.length)Y=W.length;let G=Y-1;while(G>=0&&(W[G]&192)===128)G--;if(G<0)return Y;if(G===0)return Y;return G+TJ[W[G]]>Y?G:Y},MJ={string2buf:Ev,buf2string:Fv,utf8border:Sv};function xv(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var MC=xv,RC=Object.prototype.toString,{Z_NO_FLUSH:kv,Z_SYNC_FLUSH:_v,Z_FULL_FLUSH:yv,Z_FINISH:vv,Z_OK:nU,Z_STREAM_END:gv,Z_DEFAULT_COMPRESSION:uv,Z_DEFAULT_STRATEGY:hv,Z_DEFLATED:bv}=OW;function BJ(W){this.options=aU.assign({level:uv,method:bv,chunkSize:16384,windowBits:15,memLevel:8,strategy:hv},W||{});let Y=this.options;if(Y.raw&&Y.windowBits>0)Y.windowBits=-Y.windowBits;else if(Y.gzip&&Y.windowBits>0&&Y.windowBits<16)Y.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new MC,this.strm.avail_out=0;let G=IJ.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(G!==nU)throw Error(wW[G]);if(Y.header)IJ.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){let X;if(typeof Y.dictionary==="string")X=MJ.string2buf(Y.dictionary);else if(RC.call(Y.dictionary)==="[object ArrayBuffer]")X=new Uint8Array(Y.dictionary);else X=Y.dictionary;if(G=IJ.deflateSetDictionary(this.strm,X),G!==nU)throw Error(wW[G]);this._dict_set=!0}}BJ.prototype.push=function(W,Y){let G=this.strm,X=this.options.chunkSize,J,Z;if(this.ended)return!1;if(Y===~~Y)Z=Y;else Z=Y===!0?vv:kv;if(typeof W==="string")G.input=MJ.string2buf(W);else if(RC.call(W)==="[object ArrayBuffer]")G.input=new Uint8Array(W);else G.input=W;G.next_in=0,G.avail_in=G.input.length;for(;;){if(G.avail_out===0)G.output=new Uint8Array(X),G.next_out=0,G.avail_out=X;if((Z===_v||Z===yv)&&G.avail_out<=6){this.onData(G.output.subarray(0,G.next_out)),G.avail_out=0;continue}if(J=IJ.deflate(G,Z),J===gv){if(G.next_out>0)this.onData(G.output.subarray(0,G.next_out));return J=IJ.deflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===nU}if(G.avail_out===0){this.onData(G.output);continue}if(Z>0&&G.next_out>0){this.onData(G.output.subarray(0,G.next_out)),G.avail_out=0;continue}if(G.avail_in===0)break}return!0};BJ.prototype.onData=function(W){this.chunks.push(W)};BJ.prototype.onEnd=function(W){if(W===nU)this.result=aU.flattenChunks(this.chunks);this.chunks=[],this.err=W,this.msg=this.strm.msg};function pH(W,Y){let G=new BJ(Y);if(G.push(W,!0),G.err)throw G.msg||wW[G.err];return G.result}function mv(W,Y){return Y=Y||{},Y.raw=!0,pH(W,Y)}function fv(W,Y){return Y=Y||{},Y.gzip=!0,pH(W,Y)}var cv=BJ,pv=pH,lv=mv,dv=fv,ov=OW,nv={Deflate:cv,deflate:pv,deflateRaw:lv,gzip:dv,constants:ov},fU=16209,iv=16191,rv=function(Y,G){let X,J,Z,V,U,Q,N,q,H,A,I,w,O,M,S,g,c,u,p,h,f,t,b,J0,I0=Y.state;X=Y.next_in,b=Y.input,J=X+(Y.avail_in-5),Z=Y.next_out,J0=Y.output,V=Z-(G-Y.avail_out),U=Z+(Y.avail_out-257),Q=I0.dmax,N=I0.wsize,q=I0.whave,H=I0.wnext,A=I0.window,I=I0.hold,w=I0.bits,O=I0.lencode,M=I0.distcode,S=(1<<I0.lenbits)-1,g=(1<<I0.distbits)-1;W:do{if(w<15)I+=b[X++]<<w,w+=8,I+=b[X++]<<w,w+=8;c=O[I&S];Y:for(;;){if(u=c>>>24,I>>>=u,w-=u,u=c>>>16&255,u===0)J0[Z++]=c&65535;else if(u&16){if(p=c&65535,u&=15,u){if(w<u)I+=b[X++]<<w,w+=8;p+=I&(1<<u)-1,I>>>=u,w-=u}if(w<15)I+=b[X++]<<w,w+=8,I+=b[X++]<<w,w+=8;c=M[I&g];G:for(;;){if(u=c>>>24,I>>>=u,w-=u,u=c>>>16&255,u&16){if(h=c&65535,u&=15,w<u){if(I+=b[X++]<<w,w+=8,w<u)I+=b[X++]<<w,w+=8}if(h+=I&(1<<u)-1,h>Q){Y.msg="invalid distance too far back",I0.mode=fU;break W}if(I>>>=u,w-=u,u=Z-V,h>u){if(u=h-u,u>q){if(I0.sane){Y.msg="invalid distance too far back",I0.mode=fU;break W}}if(f=0,t=A,H===0){if(f+=N-u,u<p){p-=u;do J0[Z++]=A[f++];while(--u);f=Z-h,t=J0}}else if(H<u){if(f+=N+H-u,u-=H,u<p){p-=u;do J0[Z++]=A[f++];while(--u);if(f=0,H<p){u=H,p-=u;do J0[Z++]=A[f++];while(--u);f=Z-h,t=J0}}}else if(f+=H-u,u<p){p-=u;do J0[Z++]=A[f++];while(--u);f=Z-h,t=J0}while(p>2)J0[Z++]=t[f++],J0[Z++]=t[f++],J0[Z++]=t[f++],p-=3;if(p){if(J0[Z++]=t[f++],p>1)J0[Z++]=t[f++]}}else{f=Z-h;do J0[Z++]=J0[f++],J0[Z++]=J0[f++],J0[Z++]=J0[f++],p-=3;while(p>2);if(p){if(J0[Z++]=J0[f++],p>1)J0[Z++]=J0[f++]}}}else if((u&64)===0){c=M[(c&65535)+(I&(1<<u)-1)];continue G}else{Y.msg="invalid distance code",I0.mode=fU;break W}break}}else if((u&64)===0){c=O[(c&65535)+(I&(1<<u)-1)];continue Y}else if(u&32){I0.mode=iv;break W}else{Y.msg="invalid literal/length code",I0.mode=fU;break W}break}}while(X<J&&Z<U);p=w>>3,X-=p,w-=p<<3,I&=(1<<w)-1,Y.next_in=X,Y.next_out=Z,Y.avail_in=X<J?5+(J-X):5-(X-J),Y.avail_out=Z<U?257+(U-Z):257-(Z-U),I0.hold=I,I0.bits=w;return},nY=15,LD=852,BD=592,ED=0,TH=1,$D=2,av=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),sv=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tv=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ev=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Wg=(W,Y,G,X,J,Z,V,U)=>{let Q=U.bits,N=0,q=0,H=0,A=0,I=0,w=0,O=0,M=0,S=0,g=0,c,u,p,h,f,t=null,b,J0=new Uint16Array(nY+1),I0=new Uint16Array(nY+1),k=null,l,P,B;for(N=0;N<=nY;N++)J0[N]=0;for(q=0;q<X;q++)J0[Y[G+q]]++;I=Q;for(A=nY;A>=1;A--)if(J0[A]!==0)break;if(I>A)I=A;if(A===0)return J[Z++]=20971520,J[Z++]=20971520,U.bits=1,0;for(H=1;H<A;H++)if(J0[H]!==0)break;if(I<H)I=H;M=1;for(N=1;N<=nY;N++)if(M<<=1,M-=J0[N],M<0)return-1;if(M>0&&(W===ED||A!==1))return-1;I0[1]=0;for(N=1;N<nY;N++)I0[N+1]=I0[N]+J0[N];for(q=0;q<X;q++)if(Y[G+q]!==0)V[I0[Y[G+q]]++]=q;if(W===ED)t=k=V,b=20;else if(W===TH)t=av,k=sv,b=257;else t=tv,k=ev,b=0;if(g=0,q=0,N=H,f=Z,w=I,O=0,p=-1,S=1<<I,h=S-1,W===TH&&S>LD||W===$D&&S>BD)return 1;for(;;){if(l=N-O,V[q]+1<b)P=0,B=V[q];else if(V[q]>=b)P=k[V[q]-b],B=t[V[q]-b];else P=96,B=0;c=1<<N-O,u=1<<w,H=u;do u-=c,J[f+(g>>O)+u]=l<<24|P<<16|B|0;while(u!==0);c=1<<N-1;while(g&c)c>>=1;if(c!==0)g&=c-1,g+=c;else g=0;if(q++,--J0[N]===0){if(N===A)break;N=Y[G+V[q]]}if(N>I&&(g&h)!==p){if(O===0)O=I;f+=H,w=N-O,M=1<<w;while(w+O<A){if(M-=J0[w+O],M<=0)break;w++,M<<=1}if(S+=1<<w,W===TH&&S>LD||W===$D&&S>BD)return 1;p=g&h,J[p]=I<<24|w<<16|f-Z|0}}if(g!==0)J[f+g]=N-O<<24|4194304|0;return U.bits=I,0},wJ=Wg,Yg=0,PC=1,LC=2,{Z_FINISH:FD,Z_BLOCK:Gg,Z_TREES:cU,Z_OK:KW,Z_STREAM_END:Xg,Z_NEED_DICT:Jg,Z_STREAM_ERROR:K5,Z_DATA_ERROR:BC,Z_MEM_ERROR:EC,Z_BUF_ERROR:Zg,Z_DEFLATED:SD}=OW,sU=16180,xD=16181,kD=16182,_D=16183,yD=16184,vD=16185,gD=16186,uD=16187,hD=16188,bD=16189,iU=16190,s7=16191,MH=16192,mD=16193,RH=16194,fD=16195,cD=16196,pD=16197,lD=16198,pU=16199,lU=16200,dD=16201,oD=16202,nD=16203,iD=16204,rD=16205,PH=16206,aD=16207,sD=16208,w8=16209,$C=16210,FC=16211,Vg=852,Ug=592,Qg=15,Ng=Qg,tD=(W)=>{return(W>>>24&255)+(W>>>8&65280)+((W&65280)<<8)+((W&255)<<24)};function qg(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var DW=(W)=>{if(!W)return 1;let Y=W.state;if(!Y||Y.strm!==W||Y.mode<sU||Y.mode>FC)return 1;return 0},SC=(W)=>{if(DW(W))return K5;let Y=W.state;if(W.total_in=W.total_out=Y.total=0,W.msg="",Y.wrap)W.adler=Y.wrap&1;return Y.mode=sU,Y.last=0,Y.havedict=0,Y.flags=-1,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new Int32Array(Vg),Y.distcode=Y.distdyn=new Int32Array(Ug),Y.sane=1,Y.back=-1,KW},xC=(W)=>{if(DW(W))return K5;let Y=W.state;return Y.wsize=0,Y.whave=0,Y.wnext=0,SC(W)},kC=(W,Y)=>{let G;if(DW(W))return K5;let X=W.state;if(Y<0)G=0,Y=-Y;else if(G=(Y>>4)+5,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return K5;if(X.window!==null&&X.wbits!==Y)X.window=null;return X.wrap=G,X.wbits=Y,xC(W)},_C=(W,Y)=>{if(!W)return K5;let G=new qg;W.state=G,G.strm=W,G.window=null,G.mode=sU;let X=kC(W,Y);if(X!==KW)W.state=null;return X},Ag=(W)=>{return _C(W,Ng)},eD=!0,LH,BH,Hg=(W)=>{if(eD){LH=new Int32Array(512),BH=new Int32Array(32);let Y=0;while(Y<144)W.lens[Y++]=8;while(Y<256)W.lens[Y++]=9;while(Y<280)W.lens[Y++]=7;while(Y<288)W.lens[Y++]=8;wJ(PC,W.lens,0,288,LH,0,W.work,{bits:9}),Y=0;while(Y<32)W.lens[Y++]=5;wJ(LC,W.lens,0,32,BH,0,W.work,{bits:5}),eD=!1}W.lencode=LH,W.lenbits=9,W.distcode=BH,W.distbits=5},yC=(W,Y,G,X)=>{let J,Z=W.state;if(Z.window===null)Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new Uint8Array(Z.wsize);if(X>=Z.wsize)Z.window.set(Y.subarray(G-Z.wsize,G),0),Z.wnext=0,Z.whave=Z.wsize;else{if(J=Z.wsize-Z.wnext,J>X)J=X;if(Z.window.set(Y.subarray(G-X,G-X+J),Z.wnext),X-=J,X)Z.window.set(Y.subarray(G-X,G),0),Z.wnext=X,Z.whave=Z.wsize;else{if(Z.wnext+=J,Z.wnext===Z.wsize)Z.wnext=0;if(Z.whave<Z.wsize)Z.whave+=J}}return 0},zg=(W,Y)=>{let G,X,J,Z,V,U,Q,N,q,H,A,I,w,O,M=0,S,g,c,u,p,h,f,t,b=new Uint8Array(4),J0,I0,k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(DW(W)||!W.output||!W.input&&W.avail_in!==0)return K5;if(G=W.state,G.mode===s7)G.mode=MH;V=W.next_out,J=W.output,Q=W.avail_out,Z=W.next_in,X=W.input,U=W.avail_in,N=G.hold,q=G.bits,H=U,A=Q,t=KW;W:for(;;)switch(G.mode){case sU:if(G.wrap===0){G.mode=MH;break}while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.wrap&2&&N===35615){if(G.wbits===0)G.wbits=15;G.check=0,b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0),N=0,q=0,G.mode=xD;break}if(G.head)G.head.done=!1;if(!(G.wrap&1)||(((N&255)<<8)+(N>>8))%31){W.msg="incorrect header check",G.mode=w8;break}if((N&15)!==SD){W.msg="unknown compression method",G.mode=w8;break}if(N>>>=4,q-=4,f=(N&15)+8,G.wbits===0)G.wbits=f;if(f>15||f>G.wbits){W.msg="invalid window size",G.mode=w8;break}G.dmax=1<<G.wbits,G.flags=0,W.adler=G.check=1,G.mode=N&512?bD:s7,N=0,q=0;break;case xD:while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.flags=N,(G.flags&255)!==SD){W.msg="unknown compression method",G.mode=w8;break}if(G.flags&57344){W.msg="unknown header flags set",G.mode=w8;break}if(G.head)G.head.text=N>>8&1;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0);N=0,q=0,G.mode=kD;case kD:while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.head)G.head.time=N;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,b[2]=N>>>16&255,b[3]=N>>>24&255,G.check=n8(G.check,b,4,0);N=0,q=0,G.mode=_D;case _D:while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.head)G.head.xflags=N&255,G.head.os=N>>8;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0);N=0,q=0,G.mode=yD;case yD:if(G.flags&1024){while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.length=N,G.head)G.head.extra_len=N;if(G.flags&512&&G.wrap&4)b[0]=N&255,b[1]=N>>>8&255,G.check=n8(G.check,b,2,0);N=0,q=0}else if(G.head)G.head.extra=null;G.mode=vD;case vD:if(G.flags&1024){if(I=G.length,I>U)I=U;if(I){if(G.head){if(f=G.head.extra_len-G.length,!G.head.extra)G.head.extra=new Uint8Array(G.head.extra_len);G.head.extra.set(X.subarray(Z,Z+I),f)}if(G.flags&512&&G.wrap&4)G.check=n8(G.check,X,I,Z);U-=I,Z+=I,G.length-=I}if(G.length)break W}G.length=0,G.mode=gD;case gD:if(G.flags&2048){if(U===0)break W;I=0;do if(f=X[Z+I++],G.head&&f&&G.length<65536)G.head.name+=String.fromCharCode(f);while(f&&I<U);if(G.flags&512&&G.wrap&4)G.check=n8(G.check,X,I,Z);if(U-=I,Z+=I,f)break W}else if(G.head)G.head.name=null;G.length=0,G.mode=uD;case uD:if(G.flags&4096){if(U===0)break W;I=0;do if(f=X[Z+I++],G.head&&f&&G.length<65536)G.head.comment+=String.fromCharCode(f);while(f&&I<U);if(G.flags&512&&G.wrap&4)G.check=n8(G.check,X,I,Z);if(U-=I,Z+=I,f)break W}else if(G.head)G.head.comment=null;G.mode=hD;case hD:if(G.flags&512){while(q<16){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.wrap&4&&N!==(G.check&65535)){W.msg="header crc mismatch",G.mode=w8;break}N=0,q=0}if(G.head)G.head.hcrc=G.flags>>9&1,G.head.done=!0;W.adler=G.check=0,G.mode=s7;break;case bD:while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}W.adler=G.check=tD(N),N=0,q=0,G.mode=iU;case iU:if(G.havedict===0)return W.next_out=V,W.avail_out=Q,W.next_in=Z,W.avail_in=U,G.hold=N,G.bits=q,Jg;W.adler=G.check=1,G.mode=s7;case s7:if(Y===Gg||Y===cU)break W;case MH:if(G.last){N>>>=q&7,q-=q&7,G.mode=PH;break}while(q<3){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}switch(G.last=N&1,N>>>=1,q-=1,N&3){case 0:G.mode=mD;break;case 1:if(Hg(G),G.mode=pU,Y===cU){N>>>=2,q-=2;break W}break;case 2:G.mode=cD;break;case 3:W.msg="invalid block type",G.mode=w8}N>>>=2,q-=2;break;case mD:N>>>=q&7,q-=q&7;while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if((N&65535)!==(N>>>16^65535)){W.msg="invalid stored block lengths",G.mode=w8;break}if(G.length=N&65535,N=0,q=0,G.mode=RH,Y===cU)break W;case RH:G.mode=fD;case fD:if(I=G.length,I){if(I>U)I=U;if(I>Q)I=Q;if(I===0)break W;J.set(X.subarray(Z,Z+I),V),U-=I,Z+=I,Q-=I,V+=I,G.length-=I;break}G.mode=s7;break;case cD:while(q<14){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.nlen=(N&31)+257,N>>>=5,q-=5,G.ndist=(N&31)+1,N>>>=5,q-=5,G.ncode=(N&15)+4,N>>>=4,q-=4,G.nlen>286||G.ndist>30){W.msg="too many length or distance symbols",G.mode=w8;break}G.have=0,G.mode=pD;case pD:while(G.have<G.ncode){while(q<3){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}G.lens[k[G.have++]]=N&7,N>>>=3,q-=3}while(G.have<19)G.lens[k[G.have++]]=0;if(G.lencode=G.lendyn,G.lenbits=7,J0={bits:G.lenbits},t=wJ(Yg,G.lens,0,19,G.lencode,0,G.work,J0),G.lenbits=J0.bits,t){W.msg="invalid code lengths set",G.mode=w8;break}G.have=0,G.mode=lD;case lD:while(G.have<G.nlen+G.ndist){for(;;){if(M=G.lencode[N&(1<<G.lenbits)-1],S=M>>>24,g=M>>>16&255,c=M&65535,S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(c<16)N>>>=S,q-=S,G.lens[G.have++]=c;else{if(c===16){I0=S+2;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(N>>>=S,q-=S,G.have===0){W.msg="invalid bit length repeat",G.mode=w8;break}f=G.lens[G.have-1],I=3+(N&3),N>>>=2,q-=2}else if(c===17){I0=S+3;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=S,q-=S,f=0,I=3+(N&7),N>>>=3,q-=3}else{I0=S+7;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=S,q-=S,f=0,I=11+(N&127),N>>>=7,q-=7}if(G.have+I>G.nlen+G.ndist){W.msg="invalid bit length repeat",G.mode=w8;break}while(I--)G.lens[G.have++]=f}}if(G.mode===w8)break;if(G.lens[256]===0){W.msg="invalid code -- missing end-of-block",G.mode=w8;break}if(G.lenbits=9,J0={bits:G.lenbits},t=wJ(PC,G.lens,0,G.nlen,G.lencode,0,G.work,J0),G.lenbits=J0.bits,t){W.msg="invalid literal/lengths set",G.mode=w8;break}if(G.distbits=6,G.distcode=G.distdyn,J0={bits:G.distbits},t=wJ(LC,G.lens,G.nlen,G.ndist,G.distcode,0,G.work,J0),G.distbits=J0.bits,t){W.msg="invalid distances set",G.mode=w8;break}if(G.mode=pU,Y===cU)break W;case pU:G.mode=lU;case lU:if(U>=6&&Q>=258){if(W.next_out=V,W.avail_out=Q,W.next_in=Z,W.avail_in=U,G.hold=N,G.bits=q,rv(W,A),V=W.next_out,J=W.output,Q=W.avail_out,Z=W.next_in,X=W.input,U=W.avail_in,N=G.hold,q=G.bits,G.mode===s7)G.back=-1;break}G.back=0;for(;;){if(M=G.lencode[N&(1<<G.lenbits)-1],S=M>>>24,g=M>>>16&255,c=M&65535,S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(g&&(g&240)===0){u=S,p=g,h=c;for(;;){if(M=G.lencode[h+((N&(1<<u+p)-1)>>u)],S=M>>>24,g=M>>>16&255,c=M&65535,u+S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=u,q-=u,G.back+=u}if(N>>>=S,q-=S,G.back+=S,G.length=c,g===0){G.mode=rD;break}if(g&32){G.back=-1,G.mode=s7;break}if(g&64){W.msg="invalid literal/length code",G.mode=w8;break}G.extra=g&15,G.mode=dD;case dD:if(G.extra){I0=G.extra;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}G.length+=N&(1<<G.extra)-1,N>>>=G.extra,q-=G.extra,G.back+=G.extra}G.was=G.length,G.mode=oD;case oD:for(;;){if(M=G.distcode[N&(1<<G.distbits)-1],S=M>>>24,g=M>>>16&255,c=M&65535,S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if((g&240)===0){u=S,p=g,h=c;for(;;){if(M=G.distcode[h+((N&(1<<u+p)-1)>>u)],S=M>>>24,g=M>>>16&255,c=M&65535,u+S<=q)break;if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}N>>>=u,q-=u,G.back+=u}if(N>>>=S,q-=S,G.back+=S,g&64){W.msg="invalid distance code",G.mode=w8;break}G.offset=c,G.extra=g&15,G.mode=nD;case nD:if(G.extra){I0=G.extra;while(q<I0){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}G.offset+=N&(1<<G.extra)-1,N>>>=G.extra,q-=G.extra,G.back+=G.extra}if(G.offset>G.dmax){W.msg="invalid distance too far back",G.mode=w8;break}G.mode=iD;case iD:if(Q===0)break W;if(I=A-Q,G.offset>I){if(I=G.offset-I,I>G.whave){if(G.sane){W.msg="invalid distance too far back",G.mode=w8;break}}if(I>G.wnext)I-=G.wnext,w=G.wsize-I;else w=G.wnext-I;if(I>G.length)I=G.length;O=G.window}else O=J,w=V-G.offset,I=G.length;if(I>Q)I=Q;Q-=I,G.length-=I;do J[V++]=O[w++];while(--I);if(G.length===0)G.mode=lU;break;case rD:if(Q===0)break W;J[V++]=G.length,Q--,G.mode=lU;break;case PH:if(G.wrap){while(q<32){if(U===0)break W;U--,N|=X[Z++]<<q,q+=8}if(A-=Q,W.total_out+=A,G.total+=A,G.wrap&4&&A)W.adler=G.check=G.flags?n8(G.check,J,A,V-A):CJ(G.check,J,A,V-A);if(A=Q,G.wrap&4&&(G.flags?N:tD(N))!==G.check){W.msg="incorrect data check",G.mode=w8;break}N=0,q=0}G.mode=aD;case aD:if(G.wrap&&G.flags){while(q<32){if(U===0)break W;U--,N+=X[Z++]<<q,q+=8}if(G.wrap&4&&N!==(G.total&4294967295)){W.msg="incorrect length check",G.mode=w8;break}N=0,q=0}G.mode=sD;case sD:t=Xg;break W;case w8:t=BC;break W;case $C:return EC;case FC:default:return K5}if(W.next_out=V,W.avail_out=Q,W.next_in=Z,W.avail_in=U,G.hold=N,G.bits=q,G.wsize||A!==W.avail_out&&G.mode<w8&&(G.mode<PH||Y!==FD)){if(yC(W,W.output,W.next_out,A-W.avail_out));}if(H-=W.avail_in,A-=W.avail_out,W.total_in+=H,W.total_out+=A,G.total+=A,G.wrap&4&&A)W.adler=G.check=G.flags?n8(G.check,J,A,W.next_out-A):CJ(G.check,J,A,W.next_out-A);if(W.data_type=G.bits+(G.last?64:0)+(G.mode===s7?128:0)+(G.mode===pU||G.mode===RH?256:0),(H===0&&A===0||Y===FD)&&t===KW)t=Zg;return t},Ig=(W)=>{if(DW(W))return K5;let Y=W.state;if(Y.window)Y.window=null;return W.state=null,KW},wg=(W,Y)=>{if(DW(W))return K5;let G=W.state;if((G.wrap&2)===0)return K5;return G.head=Y,Y.done=!1,KW},jg=(W,Y)=>{let G=Y.length,X,J,Z;if(DW(W))return K5;if(X=W.state,X.wrap!==0&&X.mode!==iU)return K5;if(X.mode===iU){if(J=1,J=CJ(J,Y,G,0),J!==X.check)return BC}if(Z=yC(W,Y,G,G),Z)return X.mode=$C,EC;return X.havedict=1,KW},Kg=xC,Og=kC,Dg=SC,Cg=Ag,Tg=_C,Mg=zg,Rg=Ig,Pg=wg,Lg=jg,Bg="pako inflate (from Nodeca project)",e7={inflateReset:Kg,inflateReset2:Og,inflateResetKeep:Dg,inflateInit:Cg,inflateInit2:Tg,inflate:Mg,inflateEnd:Rg,inflateGetHeader:Pg,inflateSetDictionary:Lg,inflateInfo:Bg};function Eg(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var $g=Eg,vC=Object.prototype.toString,{Z_NO_FLUSH:Fg,Z_FINISH:Sg,Z_OK:RJ,Z_STREAM_END:EH,Z_NEED_DICT:$H,Z_STREAM_ERROR:xg,Z_DATA_ERROR:WC,Z_MEM_ERROR:kg}=OW;function EJ(W){this.options=aU.assign({chunkSize:65536,windowBits:15,to:""},W||{});let Y=this.options;if(Y.raw&&Y.windowBits>=0&&Y.windowBits<16){if(Y.windowBits=-Y.windowBits,Y.windowBits===0)Y.windowBits=-15}if(Y.windowBits>=0&&Y.windowBits<16&&!(W&&W.windowBits))Y.windowBits+=32;if(Y.windowBits>15&&Y.windowBits<48){if((Y.windowBits&15)===0)Y.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new MC,this.strm.avail_out=0;let G=e7.inflateInit2(this.strm,Y.windowBits);if(G!==RJ)throw Error(wW[G]);if(this.header=new $g,e7.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=MJ.string2buf(Y.dictionary);else if(vC.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(G=e7.inflateSetDictionary(this.strm,Y.dictionary),G!==RJ)throw Error(wW[G])}}}EJ.prototype.push=function(W,Y){let G=this.strm,X=this.options.chunkSize,J=this.options.dictionary,Z,V,U;if(this.ended)return!1;if(Y===~~Y)V=Y;else V=Y===!0?Sg:Fg;if(vC.call(W)==="[object ArrayBuffer]")G.input=new Uint8Array(W);else G.input=W;G.next_in=0,G.avail_in=G.input.length;for(;;){if(G.avail_out===0)G.output=new Uint8Array(X),G.next_out=0,G.avail_out=X;if(Z=e7.inflate(G,V),Z===$H&&J){if(Z=e7.inflateSetDictionary(G,J),Z===RJ)Z=e7.inflate(G,V);else if(Z===WC)Z=$H}while(G.avail_in>0&&Z===EH&&G.state.wrap>0&&W[G.next_in]!==0)e7.inflateReset(G),Z=e7.inflate(G,V);switch(Z){case xg:case WC:case $H:case kg:return this.onEnd(Z),this.ended=!0,!1}if(U=G.avail_out,G.next_out){if(G.avail_out===0||Z===EH)if(this.options.to==="string"){let Q=MJ.utf8border(G.output,G.next_out),N=G.next_out-Q,q=MJ.buf2string(G.output,Q);if(G.next_out=N,G.avail_out=X-N,N)G.output.set(G.output.subarray(Q,Q+N),0);this.onData(q)}else this.onData(G.output.length===G.next_out?G.output:G.output.subarray(0,G.next_out))}if(Z===RJ&&U===0)continue;if(Z===EH)return Z=e7.inflateEnd(this.strm),this.onEnd(Z),this.ended=!0,!0;if(G.avail_in===0)break}return!0};EJ.prototype.onData=function(W){this.chunks.push(W)};EJ.prototype.onEnd=function(W){if(W===RJ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=aU.flattenChunks(this.chunks);this.chunks=[],this.err=W,this.msg=this.strm.msg};function lH(W,Y){let G=new EJ(Y);if(G.push(W),G.err)throw G.msg||wW[G.err];return G.result}function _g(W,Y){return Y=Y||{},Y.raw=!0,lH(W,Y)}var yg=EJ,vg=lH,gg=_g,ug=lH,hg=OW,bg={Inflate:yg,inflate:vg,inflateRaw:gg,ungzip:ug,constants:hg},{Deflate:mg,deflate:fg,deflateRaw:cg,gzip:pg}=nv,{Inflate:lg,inflate:dg,inflateRaw:og,ungzip:ng}=bg,ig=mg,rg=fg,ag=cg,sg=pg,tg=lg,eg=dg,Wu=og,Yu=ng,Gu=OW,WG={Deflate:ig,deflate:rg,deflateRaw:ag,gzip:sg,Inflate:tg,inflate:eg,inflateRaw:Wu,ungzip:Yu,constants:Gu};function gC(){let W=Date.now(),Y=0;return{now(){return W=Math.max(W,Date.now()),Y++,{physical:W,logical:Y}},update(G){if(!G||typeof G.physical!=="number"||typeof G.logical!=="number")return;W=Math.max(W,G.physical),Y=Math.max(Y,G.logical)+1},compare(G,X){if(!G&&!X)return 0;if(!G)return-1;if(!X)return 1;if(G.physical!==X.physical)return G.physical>X.physical?1:-1;if(G.logical!==X.logical)return G.logical>X.logical?1:-1;return 0}}}function uC(W,Y,G){let X=Y.timestamp;if(X?.physical>Date.now()+7200000)X={physical:Date.now()+7200000,logical:X.logical};if(Y?.value?.priority===!0&&typeof Y.id==="string"&&Y.id.startsWith("user:")&&"role"in Y.value){let{priority:J,...Z}=Y.value;return{resolved:!0,value:Z,timestamp:X}}if(Y?.value?.priority!==void 0){let{priority:J,...Z}=Y.value;Y={...Y,value:Z}}if(!W?.timestamp)return{resolved:!0,value:Y.value,timestamp:X};if(G.compare(X,W.timestamp)<=0)return{resolved:!1};return{resolved:!0,value:Y.value,timestamp:X}}var $J={$eq:(W,Y)=>W===Y,$ne:(W,Y)=>W!==Y,$gt:(W,Y)=>W>Y,$gte:(W,Y)=>W>=Y,$lt:(W,Y)=>W<Y,$lte:(W,Y)=>W<=Y,$in:(W,Y)=>Array.isArray(Y)&&(Array.isArray(W)?W.some((G)=>Y.includes(G)):Y.includes(W)),$between:(W,[Y,G])=>W>=Y&&W<=G,$exists:(W,Y)=>Y?W!==void 0:W===void 0,$startsWith:(W,Y)=>typeof W==="string"&&W.startsWith(Y),$endsWith:(W,Y)=>typeof W==="string"&&W.endsWith(Y),$contains:(W,Y)=>typeof W==="string"&&W.includes(Y),$text:{global:(W,Y)=>{let G=(J)=>String(J).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^\w\s]/g,""),X=G(Y);return Object.values(W).some((J)=>typeof J==="object"?null.fieldSearch(J,X):G(J).includes(X))},field:(W,Y)=>{let G=(J)=>String(J).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^\w\s]/g,""),X=G(Y);return Array.isArray(W)?W.some((J)=>G(J).includes(X)):G(W).includes(X)}},$like:(W,Y)=>typeof W==="string"&&typeof Y==="string"&&new RegExp(`^${Y.replace(/%/g,".*").replace(/_/g,".")}$`,"i").test(W),$regex:(W,Y)=>typeof W==="string"&&new RegExp(Y.$regex||Y,"i").test(W),$and:(W,Y,G)=>Y.every((X)=>G.createFilter(X,G.allNodes)(W)),$or:(W,Y,G)=>Y.some((X)=>G.createFilter(X,G.allNodes)(W)),$not:(W,Y,G)=>!G.createFilter(Y,G.allNodes)(W),$edge:(W,Y,G)=>{if(!W.edges?.length||typeof Y!=="object"||Y===null)return!1;let X=G.createFilter(Y,G.allNodes),J=[...W.edges],Z=new Set(J).add(W.id),V=[];while(J.length){let U=J.shift(),Q=G.allNodes[U];if(!Q)continue;if(X(Q))V.push(Q);Q.edges?.forEach((N)=>!Z.has(N)&&Z.add(N)&&J.push(N))}if(V.length)W._edgeResult=V;return V.length>0}},tU=(W,Y)=>Y.split(".").reduce((G,X)=>G&&typeof G==="object"&&(X in G)?G[X]:void 0,W),eU=(W,Y)=>{if(Object.keys(W).length===0)return()=>!0;return(G)=>Object.entries(W).every(([X,J])=>{if(X.startsWith("$"))return $J[X](G,J,{createFilter:eU,allNodes:Y});let Z=tU(G.value,X);if(Z===void 0)Z=tU(G,X);if(J instanceof RegExp)return J.test(String(Z));if(typeof J!=="object"||J===null)return $J.$eq(Z,J);return Object.entries(J).every(([V,U])=>{if(V==="$text")return $J.$text.field(Z,U);if(V==="$between"&&U.every((Q)=>Q instanceof Date))return $J.$between(new Date(Z),U);return $J[V]?.(Z,U,{createFilter:eU,allNodes:Y})??!1})})},dH=(W,Y)=>{let{$edge:G,...X}=Y.query||{},J=eU(X,W),Z=Object.values(W).filter(J),U=[...G?(()=>{let Q=eU({$edge:G},W);Z.forEach((q)=>Q(q));let N=new Map;return Z.forEach((q)=>{if(q._edgeResult)q._edgeResult.forEach((H)=>N.set(H.id,H)),delete q._edgeResult}),Array.from(N.values())})():Z];if(Y.field){let Q=Y.order==="asc"?1:-1;U.sort((N,q)=>{let H=tU(N.value,Y.field),A=tU(q.value,Y.field);if(typeof H==="string"&&typeof A==="string")return H.localeCompare(A)*Q;return((H??0)-(A??0))*Q})}if(Y.$after){let Q=U.findIndex((N)=>N.id===Y.$after);U=Q>=0?U.slice(Q+1):[]}if(Y.$before){let Q=U.findIndex((N)=>N.id===Y.$before);U=Q>=0?U.slice(0,Q):[]}if(Y.$limit)U=U.slice(0,Y.$limit);return U};var vJ=(()=>{let W=()=>{};return new Proxy(console,{get:(Y,G)=>globalThis.__gdbDebug?Y[G].bind(Y):W})})(),YG=typeof globalThis==="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function TQ(W){return W instanceof Uint8Array||ArrayBuffer.isView(W)&&W.constructor.name==="Uint8Array"}function Xz(W){if(!Number.isSafeInteger(W)||W<0)throw Error("positive integer expected, got "+W)}function LW(W,...Y){if(!TQ(W))throw Error("Uint8Array expected");if(Y.length>0&&!Y.includes(W.length))throw Error("Uint8Array expected of length "+Y+", got length="+W.length)}function JT(W){if(typeof W!=="function"||typeof W.create!=="function")throw Error("Hash should be wrapped by utils.createHasher");Xz(W.outputLen),Xz(W.blockLen)}function AQ(W,Y=!0){if(W.destroyed)throw Error("Hash instance has been destroyed");if(Y&&W.finished)throw Error("Hash#digest() has already been called")}function Xu(W,Y){LW(W);let G=Y.outputLen;if(W.length<G)throw Error("digestInto() expects output buffer of length at least "+G)}function HQ(...W){for(let Y=0;Y<W.length;Y++)W[Y].fill(0)}function oH(W){return new DataView(W.buffer,W.byteOffset,W.byteLength)}function z7(W,Y){return W<<32-Y|W>>>Y}var ZT=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),Ju=Array.from({length:256},(W,Y)=>Y.toString(16).padStart(2,"0"));function JG(W){if(LW(W),ZT)return W.toHex();let Y="";for(let G=0;G<W.length;G++)Y+=Ju[W[G]];return Y}var W4={_0:48,_9:57,A:65,F:70,a:97,f:102};function hC(W){if(W>=W4._0&&W<=W4._9)return W-W4._0;if(W>=W4.A&&W<=W4.F)return W-(W4.A-10);if(W>=W4.a&&W<=W4.f)return W-(W4.a-10);return}function zQ(W){if(typeof W!=="string")throw Error("hex string expected, got "+typeof W);if(ZT)return Uint8Array.fromHex(W);let Y=W.length,G=Y/2;if(Y%2)throw Error("hex string expected, got unpadded hex of length "+Y);let X=new Uint8Array(G);for(let J=0,Z=0;J<G;J++,Z+=2){let V=hC(W.charCodeAt(Z)),U=hC(W.charCodeAt(Z+1));if(V===void 0||U===void 0){let Q=W[Z]+W[Z+1];throw Error('hex string expected, got non-hex character "'+Q+'" at index '+Z)}X[J]=V*16+U}return X}function VT(W){if(typeof W!=="string")throw Error("string expected");return new Uint8Array(new TextEncoder().encode(W))}function Az(W){if(typeof W==="string")W=VT(W);return LW(W),W}function I7(...W){let Y=0;for(let X=0;X<W.length;X++){let J=W[X];LW(J),Y+=J.length}let G=new Uint8Array(Y);for(let X=0,J=0;X<W.length;X++){let Z=W[X];G.set(Z,J),J+=Z.length}return G}class Hz{}function Zu(W){let Y=(X)=>W().update(Az(X)).digest(),G=W();return Y.outputLen=G.outputLen,Y.blockLen=G.blockLen,Y.create=()=>W(),Y}function MQ(W=32){if(YG&&typeof YG.getRandomValues==="function")return YG.getRandomValues(new Uint8Array(W));if(YG&&typeof YG.randomBytes==="function")return Uint8Array.from(YG.randomBytes(W));throw Error("crypto.getRandomValues must be defined")}function Vu(W,Y,G,X){if(typeof W.setBigUint64==="function")return W.setBigUint64(Y,G,X);let J=BigInt(32),Z=BigInt(4294967295),V=Number(G>>J&Z),U=Number(G&Z),Q=X?4:0,N=X?0:4;W.setUint32(Y+Q,V,X),W.setUint32(Y+N,U,X)}function Uu(W,Y,G){return W&Y^~W&G}function Qu(W,Y,G){return W&Y^W&G^Y&G}class UT extends Hz{constructor(W,Y,G,X){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=W,this.outputLen=Y,this.padOffset=G,this.isLE=X,this.buffer=new Uint8Array(W),this.view=oH(this.buffer)}update(W){AQ(this),W=Az(W),LW(W);let{view:Y,buffer:G,blockLen:X}=this,J=W.length;for(let Z=0;Z<J;){let V=Math.min(X-this.pos,J-Z);if(V===X){let U=oH(W);for(;X<=J-Z;Z+=X)this.process(U,Z);continue}if(G.set(W.subarray(Z,Z+V),this.pos),this.pos+=V,Z+=V,this.pos===X)this.process(Y,0),this.pos=0}return this.length+=W.length,this.roundClean(),this}digestInto(W){AQ(this),Xu(W,this),this.finished=!0;let{buffer:Y,view:G,blockLen:X,isLE:J}=this,{pos:Z}=this;if(Y[Z++]=128,HQ(this.buffer.subarray(Z)),this.padOffset>X-Z)this.process(G,0),Z=0;for(let q=Z;q<X;q++)Y[q]=0;Vu(G,X-8,BigInt(this.length*8),J),this.process(G,0);let V=oH(W),U=this.outputLen;if(U%4)throw Error("_sha2: outputLen should be aligned to 32bit");let Q=U/4,N=this.get();if(Q>N.length)throw Error("_sha2: outputLen bigger than state");for(let q=0;q<Q;q++)V.setUint32(4*q,N[q],J)}digest(){let{buffer:W,outputLen:Y}=this;this.digestInto(W);let G=W.slice(0,Y);return this.destroy(),G}_cloneInto(W){W||(W=new this.constructor),W.set(...this.get());let{blockLen:Y,buffer:G,length:X,finished:J,destroyed:Z,pos:V}=this;if(W.destroyed=Z,W.finished=J,W.length=X,W.pos=V,X%Y)W.buffer.set(G);return W}clone(){return this._cloneInto()}}var N6=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Nu=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),q6=new Uint32Array(64);class QT extends UT{constructor(W=32){super(64,W,8,!1);this.A=N6[0]|0,this.B=N6[1]|0,this.C=N6[2]|0,this.D=N6[3]|0,this.E=N6[4]|0,this.F=N6[5]|0,this.G=N6[6]|0,this.H=N6[7]|0}get(){let{A:W,B:Y,C:G,D:X,E:J,F:Z,G:V,H:U}=this;return[W,Y,G,X,J,Z,V,U]}set(W,Y,G,X,J,Z,V,U){this.A=W|0,this.B=Y|0,this.C=G|0,this.D=X|0,this.E=J|0,this.F=Z|0,this.G=V|0,this.H=U|0}process(W,Y){for(let q=0;q<16;q++,Y+=4)q6[q]=W.getUint32(Y,!1);for(let q=16;q<64;q++){let H=q6[q-15],A=q6[q-2],I=z7(H,7)^z7(H,18)^H>>>3,w=z7(A,17)^z7(A,19)^A>>>10;q6[q]=w+q6[q-7]+I+q6[q-16]|0}let{A:G,B:X,C:J,D:Z,E:V,F:U,G:Q,H:N}=this;for(let q=0;q<64;q++){let H=z7(V,6)^z7(V,11)^z7(V,25),A=N+H+Uu(V,U,Q)+Nu[q]+q6[q]|0,I=(z7(G,2)^z7(G,13)^z7(G,22))+Qu(G,X,J)|0;N=Q,Q=U,U=V,V=Z+A|0,Z=J,J=X,X=G,G=A+I|0}G=G+this.A|0,X=X+this.B|0,J=J+this.C|0,Z=Z+this.D|0,V=V+this.E|0,U=U+this.F|0,Q=Q+this.G|0,N=N+this.H|0,this.set(G,X,J,Z,V,U,Q,N)}roundClean(){HQ(q6)}destroy(){this.set(0,0,0,0,0,0,0,0),HQ(this.buffer)}}var Jz=Zu(()=>new QT);class zz extends Hz{constructor(W,Y){super();this.finished=!1,this.destroyed=!1,JT(W);let G=Az(Y);if(this.iHash=W.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let X=this.blockLen,J=new Uint8Array(X);J.set(G.length>X?W.create().update(G).digest():G);for(let Z=0;Z<J.length;Z++)J[Z]^=54;this.iHash.update(J),this.oHash=W.create();for(let Z=0;Z<J.length;Z++)J[Z]^=106;this.oHash.update(J),HQ(J)}update(W){return AQ(this),this.iHash.update(W),this}digestInto(W){AQ(this),LW(W,this.outputLen),this.finished=!0,this.iHash.digestInto(W),this.oHash.update(W),this.oHash.digestInto(W),this.destroy()}digest(){let W=new Uint8Array(this.oHash.outputLen);return this.digestInto(W),W}_cloneInto(W){W||(W=Object.create(Object.getPrototypeOf(this),{}));let{oHash:Y,iHash:G,finished:X,destroyed:J,blockLen:Z,outputLen:V}=this;return W=W,W.finished=X,W.destroyed=J,W.blockLen=Z,W.outputLen=V,W.oHash=Y._cloneInto(W.oHash),W.iHash=G._cloneInto(W.iHash),W}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}var NT=(W,Y,G)=>new zz(W,Y).update(G).digest();NT.create=(W,Y)=>new zz(W,Y);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var Iz=BigInt(0),Zz=BigInt(1);function IQ(W,Y=""){if(typeof W!=="boolean"){let G=Y&&`"${Y}"`;throw Error(G+"expected boolean, got type="+typeof W)}return W}function CW(W,Y,G=""){let X=TQ(W),J=W?.length,Z=Y!==void 0;if(!X||Z&&J!==Y){let V=G&&`"${G}" `,U=Z?` of length ${Y}`:"",Q=X?`length=${J}`:`type=${typeof W}`;throw Error(V+"expected Uint8Array"+U+", got "+Q)}return W}function WQ(W){let Y=W.toString(16);return Y.length&1?"0"+Y:Y}function qT(W){if(typeof W!=="string")throw Error("hex string expected, got "+typeof W);return W===""?Iz:BigInt("0x"+W)}function NG(W){return qT(JG(W))}function AT(W){return LW(W),qT(JG(Uint8Array.from(W).reverse()))}function RQ(W,Y){return zQ(W.toString(16).padStart(Y*2,"0"))}function HT(W,Y){return RQ(W,Y).reverse()}function b8(W,Y,G){let X;if(typeof Y==="string")try{X=zQ(Y)}catch(Z){throw Error(W+" must be hex string or Uint8Array, cause: "+Z)}else if(TQ(Y))X=Uint8Array.from(Y);else throw Error(W+" must be hex string or Uint8Array");let J=X.length;if(typeof G==="number"&&J!==G)throw Error(W+" of length "+G+" expected, got "+J);return X}var nH=(W)=>typeof W==="bigint"&&Iz<=W;function Vz(W,Y,G){return nH(W)&&nH(Y)&&nH(G)&&Y<=W&&W<G}function qu(W,Y,G,X){if(!Vz(Y,G,X))throw Error("expected valid "+W+": "+G+" <= n < "+X+", got "+Y)}function zT(W){let Y;for(Y=0;W>Iz;W>>=Zz,Y+=1);return Y}var hJ=(W)=>(Zz<<BigInt(W))-Zz;function Au(W,Y,G){if(typeof W!=="number"||W<2)throw Error("hashLen must be a number");if(typeof Y!=="number"||Y<2)throw Error("qByteLen must be a number");if(typeof G!=="function")throw Error("hmacFn must be a function");let X=(A)=>new Uint8Array(A),J=(A)=>Uint8Array.of(A),Z=X(W),V=X(W),U=0,Q=()=>{Z.fill(1),V.fill(0),U=0},N=(...A)=>G(V,Z,...A),q=(A=X(0))=>{if(V=N(J(0),A),Z=N(),A.length===0)return;V=N(J(1),A),Z=N()},H=()=>{if(U++>=1000)throw Error("drbg: tried 1000 values");let A=0,I=[];while(A<Y){Z=N();let w=Z.slice();I.push(w),A+=Z.length}return I7(...I)};return(A,I)=>{Q(),q(A);let w=void 0;while(!(w=I(H())))q();return Q(),w}}function wz(W,Y,G={}){if(!W||typeof W!=="object")throw Error("expected valid options object");function X(J,Z,V){let U=W[J];if(V&&U===void 0)return;let Q=typeof U;if(Q!==Z||U===null)throw Error(`param "${J}" is invalid: expected ${Z}, got ${Q}`)}Object.entries(Y).forEach(([J,Z])=>X(J,Z,!1)),Object.entries(G).forEach(([J,Z])=>X(J,Z,!0))}function bC(W){let Y=new WeakMap;return(G,...X)=>{let J=Y.get(G);if(J!==void 0)return J;let Z=W(G,...X);return Y.set(G,Z),Z}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var k9=BigInt(0),H9=BigInt(1),TW=BigInt(2),IT=BigInt(3),wT=BigInt(4),jT=BigInt(5),Hu=BigInt(7),KT=BigInt(8),zu=BigInt(9),OT=BigInt(16);function C5(W,Y){let G=W%Y;return G>=k9?G:Y+G}function O5(W,Y,G){let X=W;while(Y-- >k9)X*=X,X%=G;return X}function mC(W,Y){if(W===k9)throw Error("invert: expected non-zero number");if(Y<=k9)throw Error("invert: expected positive modulus, got "+Y);let G=C5(W,Y),X=Y,J=k9,Z=H9,V=H9,U=k9;while(G!==k9){let Q=X/G,N=X%G,q=J-V*Q,H=Z-U*Q;X=G,G=N,J=V,Z=U,V=q,U=H}if(X!==H9)throw Error("invert: does not exist");return C5(J,Y)}function jz(W,Y,G){if(!W.eql(W.sqr(Y),G))throw Error("Cannot find square root")}function DT(W,Y){let G=(W.ORDER+H9)/wT,X=W.pow(Y,G);return jz(W,X,Y),X}function Iu(W,Y){let G=(W.ORDER-jT)/KT,X=W.mul(Y,TW),J=W.pow(X,G),Z=W.mul(Y,J),V=W.mul(W.mul(Z,TW),J),U=W.mul(Z,W.sub(V,W.ONE));return jz(W,U,Y),U}function wu(W){let Y=bJ(W),G=CT(W),X=G(Y,Y.neg(Y.ONE)),J=G(Y,X),Z=G(Y,Y.neg(X)),V=(W+Hu)/OT;return(U,Q)=>{let N=U.pow(Q,V),q=U.mul(N,X),H=U.mul(N,J),A=U.mul(N,Z),I=U.eql(U.sqr(q),Q),w=U.eql(U.sqr(H),Q);N=U.cmov(N,q,I),q=U.cmov(A,H,w);let O=U.eql(U.sqr(q),Q),M=U.cmov(N,q,O);return jz(U,M,Q),M}}function CT(W){if(W<IT)throw Error("sqrt is not defined for small field");let Y=W-H9,G=0;while(Y%TW===k9)Y/=TW,G++;let X=TW,J=bJ(W);while(fC(J,X)===1)if(X++>1000)throw Error("Cannot find square root: probably non-prime P");if(G===1)return DT;let Z=J.pow(X,Y),V=(Y+H9)/TW;return function(U,Q){if(U.is0(Q))return Q;if(fC(U,Q)!==1)throw Error("Cannot find square root");let N=G,q=U.mul(U.ONE,Z),H=U.pow(Q,Y),A=U.pow(Q,V);while(!U.eql(H,U.ONE)){if(U.is0(H))return U.ZERO;let I=1,w=U.sqr(H);while(!U.eql(w,U.ONE))if(I++,w=U.sqr(w),I===N)throw Error("Cannot find square root");let O=H9<<BigInt(N-I-1),M=U.pow(q,O);N=I,q=U.sqr(M),H=U.mul(H,q),A=U.mul(A,M)}return A}}function ju(W){if(W%wT===IT)return DT;if(W%KT===jT)return Iu;if(W%OT===zu)return wu(W);return CT(W)}var Ku=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ou(W){let Y={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},G=Ku.reduce((X,J)=>{return X[J]="function",X},Y);return wz(W,G),W}function Du(W,Y,G){if(G<k9)throw Error("invalid exponent, negatives unsupported");if(G===k9)return W.ONE;if(G===H9)return Y;let X=W.ONE,J=Y;while(G>k9){if(G&H9)X=W.mul(X,J);J=W.sqr(J),G>>=H9}return X}function TT(W,Y,G=!1){let X=Array(Y.length).fill(G?W.ZERO:void 0),J=Y.reduce((V,U,Q)=>{if(W.is0(U))return V;return X[Q]=V,W.mul(V,U)},W.ONE),Z=W.inv(J);return Y.reduceRight((V,U,Q)=>{if(W.is0(U))return V;return X[Q]=W.mul(V,X[Q]),W.mul(V,U)},Z),X}function fC(W,Y){let G=(W.ORDER-H9)/TW,X=W.pow(Y,G),J=W.eql(X,W.ONE),Z=W.eql(X,W.ZERO),V=W.eql(X,W.neg(W.ONE));if(!J&&!Z&&!V)throw Error("invalid Legendre symbol result");return J?1:Z?0:-1}function MT(W,Y){if(Y!==void 0)Xz(Y);let G=Y!==void 0?Y:W.toString(2).length,X=Math.ceil(G/8);return{nBitLength:G,nByteLength:X}}function bJ(W,Y,G=!1,X={}){if(W<=k9)throw Error("invalid field: expected ORDER > 0, got "+W);let J=void 0,Z=void 0,V=!1,U=void 0;if(typeof Y==="object"&&Y!=null){if(X.sqrt||G)throw Error("cannot specify opts in two arguments");let A=Y;if(A.BITS)J=A.BITS;if(A.sqrt)Z=A.sqrt;if(typeof A.isLE==="boolean")G=A.isLE;if(typeof A.modFromBytes==="boolean")V=A.modFromBytes;U=A.allowedLengths}else{if(typeof Y==="number")J=Y;if(X.sqrt)Z=X.sqrt}let{nBitLength:Q,nByteLength:N}=MT(W,J);if(N>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let q,H=Object.freeze({ORDER:W,isLE:G,BITS:Q,BYTES:N,MASK:hJ(Q),ZERO:k9,ONE:H9,allowedLengths:U,create:(A)=>C5(A,W),isValid:(A)=>{if(typeof A!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof A);return k9<=A&&A<W},is0:(A)=>A===k9,isValidNot0:(A)=>!H.is0(A)&&H.isValid(A),isOdd:(A)=>(A&H9)===H9,neg:(A)=>C5(-A,W),eql:(A,I)=>A===I,sqr:(A)=>C5(A*A,W),add:(A,I)=>C5(A+I,W),sub:(A,I)=>C5(A-I,W),mul:(A,I)=>C5(A*I,W),pow:(A,I)=>Du(H,A,I),div:(A,I)=>C5(A*mC(I,W),W),sqrN:(A)=>A*A,addN:(A,I)=>A+I,subN:(A,I)=>A-I,mulN:(A,I)=>A*I,inv:(A)=>mC(A,W),sqrt:Z||((A)=>{if(!q)q=ju(W);return q(H,A)}),toBytes:(A)=>G?HT(A,N):RQ(A,N),fromBytes:(A,I=!0)=>{if(U){if(!U.includes(A.length)||A.length>N)throw Error("Field.fromBytes: expected "+U+" bytes, got "+A.length);let O=new Uint8Array(N);O.set(A,G?0:O.length-A.length),A=O}if(A.length!==N)throw Error("Field.fromBytes: expected "+N+" bytes, got "+A.length);let w=G?AT(A):NG(A);if(V)w=C5(w,W);if(!I){if(!H.isValid(w))throw Error("invalid field element: outside of range 0..ORDER")}return w},invertBatch:(A)=>TT(H,A),cmov:(A,I,w)=>w?I:A});return Object.freeze(H)}function RT(W){if(typeof W!=="bigint")throw Error("field order must be bigint");let Y=W.toString(2).length;return Math.ceil(Y/8)}function PT(W){let Y=RT(W);return Y+Math.ceil(Y/2)}function LT(W,Y,G=!1){let X=W.length,J=RT(Y),Z=PT(Y);if(X<16||X<Z||X>1024)throw Error("expected "+Z+"-1024 bytes of input, got "+X);let V=G?AT(W):NG(W),U=C5(V,Y-H9)+H9;return G?HT(U,J):RQ(U,J)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var UG=BigInt(0),MW=BigInt(1);function wQ(W,Y){let G=Y.negate();return W?G:Y}function iH(W,Y){let G=TT(W.Fp,Y.map((X)=>X.Z));return Y.map((X,J)=>W.fromAffine(X.toAffine(G[J])))}function BT(W,Y){if(!Number.isSafeInteger(W)||W<=0||W>Y)throw Error("invalid window size, expected [1.."+Y+"], got W="+W)}function rH(W,Y){BT(W,Y);let G=Math.ceil(Y/W)+1,X=2**(W-1),J=2**W,Z=hJ(W),V=BigInt(W);return{windows:G,windowSize:X,mask:Z,maxNumber:J,shiftBy:V}}function cC(W,Y,G){let{windowSize:X,mask:J,maxNumber:Z,shiftBy:V}=G,U=Number(W&J),Q=W>>V;if(U>X)U-=Z,Q+=MW;let N=Y*X,q=N+Math.abs(U)-1,H=U===0,A=U<0,I=Y%2!==0;return{nextN:Q,offset:q,isZero:H,isNeg:A,isNegF:I,offsetF:N}}function Cu(W,Y){if(!Array.isArray(W))throw Error("array expected");W.forEach((G,X)=>{if(!(G instanceof Y))throw Error("invalid point at index "+X)})}function Tu(W,Y){if(!Array.isArray(W))throw Error("array of scalars expected");W.forEach((G,X)=>{if(!Y.isValid(G))throw Error("invalid scalar at index "+X)})}var aH=new WeakMap,ET=new WeakMap;function sH(W){return ET.get(W)||1}function pC(W){if(W!==UG)throw Error("invalid wNAF")}class $T{constructor(W,Y){this.BASE=W.BASE,this.ZERO=W.ZERO,this.Fn=W.Fn,this.bits=Y}_unsafeLadder(W,Y,G=this.ZERO){let X=W;while(Y>UG){if(Y&MW)G=G.add(X);X=X.double(),Y>>=MW}return G}precomputeWindow(W,Y){let{windows:G,windowSize:X}=rH(Y,this.bits),J=[],Z=W,V=Z;for(let U=0;U<G;U++){V=Z,J.push(V);for(let Q=1;Q<X;Q++)V=V.add(Z),J.push(V);Z=V.double()}return J}wNAF(W,Y,G){if(!this.Fn.isValid(G))throw Error("invalid scalar");let X=this.ZERO,J=this.BASE,Z=rH(W,this.bits);for(let V=0;V<Z.windows;V++){let{nextN:U,offset:Q,isZero:N,isNeg:q,isNegF:H,offsetF:A}=cC(G,V,Z);if(G=U,N)J=J.add(wQ(H,Y[A]));else X=X.add(wQ(q,Y[Q]))}return pC(G),{p:X,f:J}}wNAFUnsafe(W,Y,G,X=this.ZERO){let J=rH(W,this.bits);for(let Z=0;Z<J.windows;Z++){if(G===UG)break;let{nextN:V,offset:U,isZero:Q,isNeg:N}=cC(G,Z,J);if(G=V,Q)continue;else{let q=Y[U];X=X.add(N?q.negate():q)}}return pC(G),X}getPrecomputes(W,Y,G){let X=aH.get(Y);if(!X){if(X=this.precomputeWindow(Y,W),W!==1){if(typeof G==="function")X=G(X);aH.set(Y,X)}}return X}cached(W,Y,G){let X=sH(W);return this.wNAF(X,this.getPrecomputes(X,W,G),Y)}unsafe(W,Y,G,X){let J=sH(W);if(J===1)return this._unsafeLadder(W,Y,X);return this.wNAFUnsafe(J,this.getPrecomputes(J,W,G),Y,X)}createCache(W,Y){BT(Y,this.bits),ET.set(W,Y),aH.delete(W)}hasCache(W){return sH(W)!==1}}function Mu(W,Y,G,X){let J=Y,Z=W.ZERO,V=W.ZERO;while(G>UG||X>UG){if(G&MW)Z=Z.add(J);if(X&MW)V=V.add(J);J=J.double(),G>>=MW,X>>=MW}return{p1:Z,p2:V}}function Ru(W,Y,G,X){Cu(G,W),Tu(X,Y);let J=G.length,Z=X.length;if(J!==Z)throw Error("arrays of points and scalars must have equal length");let V=W.ZERO,U=zT(BigInt(J)),Q=1;if(U>12)Q=U-3;else if(U>4)Q=U-2;else if(U>0)Q=2;let N=hJ(Q),q=Array(Number(N)+1).fill(V),H=Math.floor((Y.BITS-1)/Q)*Q,A=V;for(let I=H;I>=0;I-=Q){q.fill(V);for(let O=0;O<Z;O++){let M=X[O],S=Number(M>>BigInt(I)&N);q[S]=q[S].add(G[O])}let w=V;for(let O=q.length-1,M=V;O>0;O--)M=M.add(q[O]),w=w.add(M);if(A=A.add(w),I!==0)for(let O=0;O<Q;O++)A=A.double()}return A}function lC(W,Y,G){if(Y){if(Y.ORDER!==W)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return Ou(Y),Y}else return bJ(W,{isLE:G})}function Pu(W,Y,G={},X){if(X===void 0)X=W==="edwards";if(!Y||typeof Y!=="object")throw Error(`expected valid ${W} CURVE object`);for(let U of["p","n","h"]){let Q=Y[U];if(!(typeof Q==="bigint"&&Q>UG))throw Error(`CURVE.${U} must be positive bigint`)}let J=lC(Y.p,G.Fp,X),Z=lC(Y.n,G.Fn,X),V=["Gx","Gy","a",W==="weierstrass"?"b":"d"];for(let U of V)if(!J.isValid(Y[U]))throw Error(`CURVE.${U} must be valid field element of CURVE.Fp`);return Y=Object.freeze(Object.assign({},Y)),{CURVE:Y,Fp:J,Fn:Z}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var dC=(W,Y)=>(W+(W>=0?Y:-Y)/ST)/Y;function Lu(W,Y,G){let[[X,J],[Z,V]]=Y,U=dC(V*W,G),Q=dC(-J*W,G),N=W-U*X-Q*Z,q=-U*J-Q*V,H=N<X4,A=q<X4;if(H)N=-N;if(A)q=-q;let I=hJ(Math.ceil(zT(G)/2))+ZG;if(N<X4||N>=I||q<X4||q>=I)throw Error("splitScalar (endomorphism): failed, k="+W);return{k1neg:H,k1:N,k2neg:A,k2:q}}function Uz(W){if(!["compact","recovered","der"].includes(W))throw Error('Signature format must be "compact", "recovered", or "der"');return W}function tH(W,Y){let G={};for(let X of Object.keys(Y))G[X]=W[X]===void 0?Y[X]:W[X];if(IQ(G.lowS,"lowS"),IQ(G.prehash,"prehash"),G.format!==void 0)Uz(G.format);return G}class FT extends Error{constructor(W=""){super(W)}}var G4={Err:FT,_tlv:{encode:(W,Y)=>{let{Err:G}=G4;if(W<0||W>256)throw new G("tlv.encode: wrong tag");if(Y.length&1)throw new G("tlv.encode: unpadded data");let X=Y.length/2,J=WQ(X);if(J.length/2&128)throw new G("tlv.encode: long form length too big");let Z=X>127?WQ(J.length/2|128):"";return WQ(W)+Z+J+Y},decode(W,Y){let{Err:G}=G4,X=0;if(W<0||W>256)throw new G("tlv.encode: wrong tag");if(Y.length<2||Y[X++]!==W)throw new G("tlv.decode: wrong tlv");let J=Y[X++],Z=!!(J&128),V=0;if(!Z)V=J;else{let Q=J&127;if(!Q)throw new G("tlv.decode(long): indefinite length not supported");if(Q>4)throw new G("tlv.decode(long): byte length is too big");let N=Y.subarray(X,X+Q);if(N.length!==Q)throw new G("tlv.decode: length bytes not complete");if(N[0]===0)throw new G("tlv.decode(long): zero leftmost byte");for(let q of N)V=V<<8|q;if(X+=Q,V<128)throw new G("tlv.decode(long): not minimal encoding")}let U=Y.subarray(X,X+V);if(U.length!==V)throw new G("tlv.decode: wrong value length");return{v:U,l:Y.subarray(X+V)}}},_int:{encode(W){let{Err:Y}=G4;if(W<X4)throw new Y("integer: negative integers are not allowed");let G=WQ(W);if(Number.parseInt(G[0],16)&8)G="00"+G;if(G.length&1)throw new Y("unexpected DER parsing assertion: unpadded hex");return G},decode(W){let{Err:Y}=G4;if(W[0]&128)throw new Y("invalid signature integer: negative");if(W[0]===0&&!(W[1]&128))throw new Y("invalid signature integer: unnecessary leading zero");return NG(W)}},toSig(W){let{Err:Y,_int:G,_tlv:X}=G4,J=b8("signature",W),{v:Z,l:V}=X.decode(48,J);if(V.length)throw new Y("invalid signature: left bytes after parsing");let{v:U,l:Q}=X.decode(2,Z),{v:N,l:q}=X.decode(2,Q);if(q.length)throw new Y("invalid signature: left bytes after parsing");return{r:G.decode(U),s:G.decode(N)}},hexFromSig(W){let{_tlv:Y,_int:G}=G4,X=Y.encode(2,G.encode(W.r)),J=Y.encode(2,G.encode(W.s)),Z=X+J;return Y.encode(48,Z)}},X4=BigInt(0),ZG=BigInt(1),ST=BigInt(2),YQ=BigInt(3),Bu=BigInt(4);function RW(W,Y){let{BYTES:G}=W,X;if(typeof Y==="bigint")X=Y;else{let J=b8("private key",Y);try{X=W.fromBytes(J)}catch(Z){throw Error(`invalid private key: expected ui8a of size ${G}, got ${typeof Y}`)}}if(!W.isValidNot0(X))throw Error("invalid private key: out of range [1..N-1]");return X}function Eu(W,Y={}){let G=Pu("weierstrass",W,Y),{Fp:X,Fn:J}=G,Z=G.CURVE,{h:V,n:U}=Z;wz(Y,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:Q}=Y;if(Q){if(!X.is0(Z.a)||typeof Q.beta!=="bigint"||!Array.isArray(Q.basises))throw Error('invalid endo: expected "beta": bigint and "basises": array')}let N=kT(X,J);function q(){if(!X.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}function H(k,l,P){let{x:B,y:m}=l.toAffine(),a=X.toBytes(B);if(IQ(P,"isCompressed"),P){q();let n=!X.isOdd(m);return I7(xT(n),a)}else return I7(Uint8Array.of(4),a,X.toBytes(m))}function A(k){CW(k,void 0,"Point");let{publicKey:l,publicKeyUncompressed:P}=N,B=k.length,m=k[0],a=k.subarray(1);if(B===l&&(m===2||m===3)){let n=X.fromBytes(a);if(!X.isValid(n))throw Error("bad point: is not on curve, wrong x");let E=O(n),$;try{$=X.sqrt(E)}catch(x){let R=x instanceof Error?": "+x.message:"";throw Error("bad point: is not on curve, sqrt error"+R)}q();let _=X.isOdd($);if((m&1)===1!==_)$=X.neg($);return{x:n,y:$}}else if(B===P&&m===4){let n=X.BYTES,E=X.fromBytes(a.subarray(0,n)),$=X.fromBytes(a.subarray(n,n*2));if(!M(E,$))throw Error("bad point: is not on curve");return{x:E,y:$}}else throw Error(`bad point: got length ${B}, expected compressed=${l} or uncompressed=${P}`)}let I=Y.toBytes||H,w=Y.fromBytes||A;function O(k){let l=X.sqr(k),P=X.mul(l,k);return X.add(X.add(P,X.mul(k,Z.a)),Z.b)}function M(k,l){let P=X.sqr(l),B=O(k);return X.eql(P,B)}if(!M(Z.Gx,Z.Gy))throw Error("bad curve params: generator point");let S=X.mul(X.pow(Z.a,YQ),Bu),g=X.mul(X.sqr(Z.b),BigInt(27));if(X.is0(X.add(S,g)))throw Error("bad curve params: a or b");function c(k,l,P=!1){if(!X.isValid(l)||P&&X.is0(l))throw Error(`bad point coordinate ${k}`);return l}function u(k){if(!(k instanceof b))throw Error("ProjectivePoint expected")}function p(k){if(!Q||!Q.basises)throw Error("no endo");return Lu(k,Q.basises,J.ORDER)}let h=bC((k,l)=>{let{X:P,Y:B,Z:m}=k;if(X.eql(m,X.ONE))return{x:P,y:B};let a=k.is0();if(l==null)l=a?X.ONE:X.inv(m);let n=X.mul(P,l),E=X.mul(B,l),$=X.mul(m,l);if(a)return{x:X.ZERO,y:X.ZERO};if(!X.eql($,X.ONE))throw Error("invZ was invalid");return{x:n,y:E}}),f=bC((k)=>{if(k.is0()){if(Y.allowInfinityPoint&&!X.is0(k.Y))return;throw Error("bad point: ZERO")}let{x:l,y:P}=k.toAffine();if(!X.isValid(l)||!X.isValid(P))throw Error("bad point: x or y not field elements");if(!M(l,P))throw Error("bad point: equation left != right");if(!k.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function t(k,l,P,B,m){return P=new b(X.mul(P.X,k),P.Y,P.Z),l=wQ(B,l),P=wQ(m,P),l.add(P)}class b{constructor(k,l,P){this.X=c("x",k),this.Y=c("y",l,!0),this.Z=c("z",P),Object.freeze(this)}static CURVE(){return Z}static fromAffine(k){let{x:l,y:P}=k||{};if(!k||!X.isValid(l)||!X.isValid(P))throw Error("invalid affine point");if(k instanceof b)throw Error("projective point not allowed");if(X.is0(l)&&X.is0(P))return b.ZERO;return new b(l,P,X.ONE)}static fromBytes(k){let l=b.fromAffine(w(CW(k,void 0,"point")));return l.assertValidity(),l}static fromHex(k){return b.fromBytes(b8("pointHex",k))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(k=8,l=!0){if(I0.createCache(this,k),!l)this.multiply(YQ);return this}assertValidity(){f(this)}hasEvenY(){let{y:k}=this.toAffine();if(!X.isOdd)throw Error("Field doesn't support isOdd");return!X.isOdd(k)}equals(k){u(k);let{X:l,Y:P,Z:B}=this,{X:m,Y:a,Z:n}=k,E=X.eql(X.mul(l,n),X.mul(m,B)),$=X.eql(X.mul(P,n),X.mul(a,B));return E&&$}negate(){return new b(this.X,X.neg(this.Y),this.Z)}double(){let{a:k,b:l}=Z,P=X.mul(l,YQ),{X:B,Y:m,Z:a}=this,n=X.ZERO,E=X.ZERO,$=X.ZERO,_=X.mul(B,B),x=X.mul(m,m),R=X.mul(a,a),v=X.mul(B,m);return v=X.add(v,v),$=X.mul(B,a),$=X.add($,$),n=X.mul(k,$),E=X.mul(P,R),E=X.add(n,E),n=X.sub(x,E),E=X.add(x,E),E=X.mul(n,E),n=X.mul(v,n),$=X.mul(P,$),R=X.mul(k,R),v=X.sub(_,R),v=X.mul(k,v),v=X.add(v,$),$=X.add(_,_),_=X.add($,_),_=X.add(_,R),_=X.mul(_,v),E=X.add(E,_),R=X.mul(m,a),R=X.add(R,R),_=X.mul(R,v),n=X.sub(n,_),$=X.mul(R,x),$=X.add($,$),$=X.add($,$),new b(n,E,$)}add(k){u(k);let{X:l,Y:P,Z:B}=this,{X:m,Y:a,Z:n}=k,E=X.ZERO,$=X.ZERO,_=X.ZERO,x=Z.a,R=X.mul(Z.b,YQ),v=X.mul(l,m),X0=X.mul(P,a),V0=X.mul(B,n),Q0=X.add(l,P),F0=X.add(m,a);Q0=X.mul(Q0,F0),F0=X.add(v,X0),Q0=X.sub(Q0,F0),F0=X.add(l,B);let y0=X.add(m,n);return F0=X.mul(F0,y0),y0=X.add(v,V0),F0=X.sub(F0,y0),y0=X.add(P,B),E=X.add(a,n),y0=X.mul(y0,E),E=X.add(X0,V0),y0=X.sub(y0,E),_=X.mul(x,F0),E=X.mul(R,V0),_=X.add(E,_),E=X.sub(X0,_),_=X.add(X0,_),$=X.mul(E,_),X0=X.add(v,v),X0=X.add(X0,v),V0=X.mul(x,V0),F0=X.mul(R,F0),X0=X.add(X0,V0),V0=X.sub(v,V0),V0=X.mul(x,V0),F0=X.add(F0,V0),v=X.mul(X0,F0),$=X.add($,v),v=X.mul(y0,F0),E=X.mul(Q0,E),E=X.sub(E,v),v=X.mul(Q0,X0),_=X.mul(y0,_),_=X.add(_,v),new b(E,$,_)}subtract(k){return this.add(k.negate())}is0(){return this.equals(b.ZERO)}multiply(k){let{endo:l}=Y;if(!J.isValidNot0(k))throw Error("invalid scalar: out of range");let P,B,m=(a)=>I0.cached(this,a,(n)=>iH(b,n));if(l){let{k1neg:a,k1:n,k2neg:E,k2:$}=p(k),{p:_,f:x}=m(n),{p:R,f:v}=m($);B=x.add(v),P=t(l.beta,_,R,a,E)}else{let{p:a,f:n}=m(k);P=a,B=n}return iH(b,[P,B])[0]}multiplyUnsafe(k){let{endo:l}=Y,P=this;if(!J.isValid(k))throw Error("invalid scalar: out of range");if(k===X4||P.is0())return b.ZERO;if(k===ZG)return P;if(I0.hasCache(this))return this.multiply(k);if(l){let{k1neg:B,k1:m,k2neg:a,k2:n}=p(k),{p1:E,p2:$}=Mu(b,P,m,n);return t(l.beta,E,$,B,a)}else return I0.unsafe(P,k)}multiplyAndAddUnsafe(k,l,P){let B=this.multiplyUnsafe(l).add(k.multiplyUnsafe(P));return B.is0()?void 0:B}toAffine(k){return h(this,k)}isTorsionFree(){let{isTorsionFree:k}=Y;if(V===ZG)return!0;if(k)return k(b,this);return I0.unsafe(this,U).is0()}clearCofactor(){let{clearCofactor:k}=Y;if(V===ZG)return this;if(k)return k(b,this);return this.multiplyUnsafe(V)}isSmallOrder(){return this.multiplyUnsafe(V).is0()}toBytes(k=!0){return IQ(k,"isCompressed"),this.assertValidity(),I(b,this,k)}toHex(k=!0){return JG(this.toBytes(k))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(k=!0){return this.toBytes(k)}_setWindowSize(k){this.precompute(k)}static normalizeZ(k){return iH(b,k)}static msm(k,l){return Ru(b,J,k,l)}static fromPrivateKey(k){return b.BASE.multiply(RW(J,k))}}b.BASE=new b(Z.Gx,Z.Gy,X.ONE),b.ZERO=new b(X.ZERO,X.ONE,X.ZERO),b.Fp=X,b.Fn=J;let J0=J.BITS,I0=new $T(b,Y.endo?Math.ceil(J0/2):J0);return b.BASE.precompute(8),b}function xT(W){return Uint8Array.of(W?2:3)}function kT(W,Y){return{secretKey:Y.BYTES,publicKey:1+W.BYTES,publicKeyUncompressed:1+2*W.BYTES,publicKeyHasPrefix:!0,signature:2*Y.BYTES}}function $u(W,Y={}){let{Fn:G}=W,X=Y.randomBytes||MQ,J=Object.assign(kT(W.Fp,G),{seed:PT(G.ORDER)});function Z(A){try{return!!RW(G,A)}catch(I){return!1}}function V(A,I){let{publicKey:w,publicKeyUncompressed:O}=J;try{let M=A.length;if(I===!0&&M!==w)return!1;if(I===!1&&M!==O)return!1;return!!W.fromBytes(A)}catch(M){return!1}}function U(A=X(J.seed)){return LT(CW(A,J.seed,"seed"),G.ORDER)}function Q(A,I=!0){return W.BASE.multiply(RW(G,A)).toBytes(I)}function N(A){let I=U(A);return{secretKey:I,publicKey:Q(I)}}function q(A){if(typeof A==="bigint")return!1;if(A instanceof W)return!0;let{secretKey:I,publicKey:w,publicKeyUncompressed:O}=J;if(G.allowedLengths||I===w)return;let M=b8("key",A).length;return M===w||M===O}function H(A,I,w=!0){if(q(A)===!0)throw Error("first arg must be private key");if(q(I)===!1)throw Error("second arg must be public key");let O=RW(G,A);return W.fromHex(I).multiply(O).toBytes(w)}return Object.freeze({getPublicKey:Q,getSharedSecret:H,keygen:N,Point:W,utils:{isValidSecretKey:Z,isValidPublicKey:V,randomSecretKey:U,isValidPrivateKey:Z,randomPrivateKey:U,normPrivateKeyToScalar:(A)=>RW(G,A),precompute(A=8,I=W.BASE){return I.precompute(A,!1)}},lengths:J})}function Fu(W,Y,G={}){JT(Y),wz(G,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let X=G.randomBytes||MQ,J=G.hmac||((P,...B)=>NT(Y,P,I7(...B))),{Fp:Z,Fn:V}=W,{ORDER:U,BITS:Q}=V,{keygen:N,getPublicKey:q,getSharedSecret:H,utils:A,lengths:I}=$u(W,G),w={prehash:!1,lowS:typeof G.lowS==="boolean"?G.lowS:!1,format:void 0,extraEntropy:!1},O="compact";function M(P){let B=U>>ZG;return P>B}function S(P,B){if(!V.isValidNot0(B))throw Error(`invalid signature ${P}: out of range 1..Point.Fn.ORDER`);return B}function g(P,B){Uz(B);let m=I.signature,a=B==="compact"?m:B==="recovered"?m+1:void 0;return CW(P,a,`${B} signature`)}class c{constructor(P,B,m){if(this.r=S("r",P),this.s=S("s",B),m!=null)this.recovery=m;Object.freeze(this)}static fromBytes(P,B=O){g(P,B);let m;if(B==="der"){let{r:$,s:_}=G4.toSig(CW(P));return new c($,_)}if(B==="recovered")m=P[0],B="compact",P=P.subarray(1);let a=V.BYTES,n=P.subarray(0,a),E=P.subarray(a,a*2);return new c(V.fromBytes(n),V.fromBytes(E),m)}static fromHex(P,B){return this.fromBytes(zQ(P),B)}addRecoveryBit(P){return new c(this.r,this.s,P)}recoverPublicKey(P){let B=Z.ORDER,{r:m,s:a,recovery:n}=this;if(n==null||![0,1,2,3].includes(n))throw Error("recovery id invalid");if(U*ST<B&&n>1)throw Error("recovery id is ambiguous for h>1 curve");let E=n===2||n===3?m+U:m;if(!Z.isValid(E))throw Error("recovery id 2 or 3 invalid");let $=Z.toBytes(E),_=W.fromBytes(I7(xT((n&1)===0),$)),x=V.inv(E),R=p(b8("msgHash",P)),v=V.create(-R*x),X0=V.create(a*x),V0=W.BASE.multiplyUnsafe(v).add(_.multiplyUnsafe(X0));if(V0.is0())throw Error("point at infinify");return V0.assertValidity(),V0}hasHighS(){return M(this.s)}toBytes(P=O){if(Uz(P),P==="der")return zQ(G4.hexFromSig(this));let B=V.toBytes(this.r),m=V.toBytes(this.s);if(P==="recovered"){if(this.recovery==null)throw Error("recovery bit must be present");return I7(Uint8Array.of(this.recovery),B,m)}return I7(B,m)}toHex(P){return JG(this.toBytes(P))}assertValidity(){}static fromCompact(P){return c.fromBytes(b8("sig",P),"compact")}static fromDER(P){return c.fromBytes(b8("sig",P),"der")}normalizeS(){return this.hasHighS()?new c(this.r,V.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return JG(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return JG(this.toBytes("compact"))}}let u=G.bits2int||function(P){if(P.length>8192)throw Error("input is too large");let B=NG(P),m=P.length*8-Q;return m>0?B>>BigInt(m):B},p=G.bits2int_modN||function(P){return V.create(u(P))},h=hJ(Q);function f(P){return qu("num < 2^"+Q,P,X4,h),V.toBytes(P)}function t(P,B){return CW(P,void 0,"message"),B?CW(Y(P),void 0,"prehashed message"):P}function b(P,B,m){if(["recovered","canonical"].some((V0)=>(V0 in m)))throw Error("sign() legacy options not supported");let{lowS:a,prehash:n,extraEntropy:E}=tH(m,w);P=t(P,n);let $=p(P),_=RW(V,B),x=[f(_),f($)];if(E!=null&&E!==!1){let V0=E===!0?X(I.secretKey):E;x.push(b8("extraEntropy",V0))}let R=I7(...x),v=$;function X0(V0){let Q0=u(V0);if(!V.isValidNot0(Q0))return;let F0=V.inv(Q0),y0=W.BASE.multiply(Q0).toAffine(),A1=V.create(y0.x);if(A1===X4)return;let v1=V.create(F0*V.create(v+A1*_));if(v1===X4)return;let G0=(y0.x===A1?0:2)|Number(y0.y&ZG),C0=v1;if(a&&M(v1))C0=V.neg(v1),G0^=1;return new c(A1,C0,G0)}return{seed:R,k2sig:X0}}function J0(P,B,m={}){P=b8("message",P);let{seed:a,k2sig:n}=b(P,B,m);return Au(Y.outputLen,V.BYTES,J)(a,n)}function I0(P){let B=void 0,m=typeof P==="string"||TQ(P),a=!m&&P!==null&&typeof P==="object"&&typeof P.r==="bigint"&&typeof P.s==="bigint";if(!m&&!a)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(a)B=new c(P.r,P.s);else if(m){try{B=c.fromBytes(b8("sig",P),"der")}catch(n){if(!(n instanceof G4.Err))throw n}if(!B)try{B=c.fromBytes(b8("sig",P),"compact")}catch(n){return!1}}if(!B)return!1;return B}function k(P,B,m,a={}){let{lowS:n,prehash:E,format:$}=tH(a,w);if(m=b8("publicKey",m),B=t(b8("message",B),E),"strict"in a)throw Error("options.strict was renamed to lowS");let _=$===void 0?I0(P):c.fromBytes(b8("sig",P),$);if(_===!1)return!1;try{let x=W.fromBytes(m);if(n&&_.hasHighS())return!1;let{r:R,s:v}=_,X0=p(B),V0=V.inv(v),Q0=V.create(X0*V0),F0=V.create(R*V0),y0=W.BASE.multiplyUnsafe(Q0).add(x.multiplyUnsafe(F0));if(y0.is0())return!1;return V.create(y0.x)===R}catch(x){return!1}}function l(P,B,m={}){let{prehash:a}=tH(m,w);return B=t(B,a),c.fromBytes(P,"recovered").recoverPublicKey(B).toBytes()}return Object.freeze({keygen:N,getPublicKey:q,getSharedSecret:H,utils:A,lengths:I,Point:W,sign:J0,verify:k,recoverPublicKey:l,Signature:c,hash:Y})}function Su(W){let Y={a:W.a,b:W.b,p:W.Fp.ORDER,n:W.n,h:W.h,Gx:W.Gx,Gy:W.Gy},G=W.Fp,X=W.allowedPrivateKeyLengths?Array.from(new Set(W.allowedPrivateKeyLengths.map((V)=>Math.ceil(V/2)))):void 0,J=bJ(Y.n,{BITS:W.nBitLength,allowedLengths:X,modFromBytes:W.wrapPrivateKey}),Z={Fp:G,Fn:J,allowInfinityPoint:W.allowInfinityPoint,endo:W.endo,isTorsionFree:W.isTorsionFree,clearCofactor:W.clearCofactor,fromBytes:W.fromBytes,toBytes:W.toBytes};return{CURVE:Y,curveOpts:Z}}function xu(W){let{CURVE:Y,curveOpts:G}=Su(W),X={hmac:W.hmac,randomBytes:W.randomBytes,lowS:W.lowS,bits2int:W.bits2int,bits2int_modN:W.bits2int_modN};return{CURVE:Y,curveOpts:G,hash:W.hash,ecdsaOpts:X}}function ku(W,Y){let G=Y.Point;return Object.assign({},Y,{ProjectivePoint:G,CURVE:Object.assign({},W,MT(G.Fn.ORDER,G.Fn.BITS))})}function _u(W){let{CURVE:Y,curveOpts:G,hash:X,ecdsaOpts:J}=xu(W),Z=Eu(Y,G),V=Fu(Z,X,J);return ku(W,V)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yu(W,Y){let G=(X)=>_u({...W,hash:X});return{...G(Y),create:G}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var QG={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},vu={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},gu=BigInt(0),oC=BigInt(1),Qz=BigInt(2);function uu(W){let Y=QG.p,G=BigInt(3),X=BigInt(6),J=BigInt(11),Z=BigInt(22),V=BigInt(23),U=BigInt(44),Q=BigInt(88),N=W*W*W%Y,q=N*N*W%Y,H=O5(q,G,Y)*q%Y,A=O5(H,G,Y)*q%Y,I=O5(A,Qz,Y)*N%Y,w=O5(I,J,Y)*I%Y,O=O5(w,Z,Y)*w%Y,M=O5(O,U,Y)*O%Y,S=O5(M,Q,Y)*M%Y,g=O5(S,U,Y)*O%Y,c=O5(g,G,Y)*q%Y,u=O5(c,V,Y)*w%Y,p=O5(u,X,Y)*N%Y,h=O5(p,Qz,Y);if(!jQ.eql(jQ.sqr(h),W))throw Error("Cannot find square root");return h}var jQ=bJ(QG.p,{sqrt:uu}),_T=yu({...QG,Fp:jQ,lowS:!0,endo:vu},Jz),nC={};function KQ(W,...Y){let G=nC[W];if(G===void 0){let X=Jz(VT(W));G=I7(X,X),nC[W]=G}return Jz(I7(G,...Y))}var Kz=(W)=>W.toBytes(!0).slice(1),qG=(()=>_T.Point)(),Oz=(W)=>W%Qz===gu;function Nz(W){let{Fn:Y,BASE:G}=qG,X=RW(Y,W),J=G.multiply(X);return{scalar:Oz(J.y)?X:Y.neg(X),bytes:Kz(J)}}function yT(W){let Y=jQ;if(!Y.isValidNot0(W))throw Error("invalid x: Fail if x \u2265 p");let G=Y.create(W*W),X=Y.create(G*W+BigInt(7)),J=Y.sqrt(X);if(!Oz(J))J=Y.neg(J);let Z=qG.fromAffine({x:W,y:J});return Z.assertValidity(),Z}var gJ=NG;function vT(...W){return qG.Fn.create(gJ(KQ("BIP0340/challenge",...W)))}function iC(W){return Nz(W).bytes}function hu(W,Y,G=MQ(32)){let{Fn:X}=qG,J=b8("message",W),{bytes:Z,scalar:V}=Nz(Y),U=b8("auxRand",G,32),Q=X.toBytes(V^gJ(KQ("BIP0340/aux",U))),N=KQ("BIP0340/nonce",Q,Z,J),{bytes:q,scalar:H}=Nz(N),A=vT(q,Z,J),I=new Uint8Array(64);if(I.set(q,0),I.set(X.toBytes(X.create(H+A*V)),32),!gT(I,J,Z))throw Error("sign: Invalid signature produced");return I}function gT(W,Y,G){let{Fn:X,BASE:J}=qG,Z=b8("signature",W,64),V=b8("message",Y),U=b8("publicKey",G,32);try{let Q=yT(gJ(U)),N=gJ(Z.subarray(0,32));if(!Vz(N,oC,QG.p))return!1;let q=gJ(Z.subarray(32,64));if(!Vz(q,oC,QG.n))return!1;let H=vT(X.toBytes(N),Kz(Q),V),A=J.multiplyUnsafe(q).add(Q.multiplyUnsafe(X.neg(H))),{x:I,y:w}=A.toAffine();if(A.is0()||!Oz(w)||I!==N)return!1;return!0}catch(Q){return!1}}var Dz=(()=>{let W=(G=MQ(48))=>{return LT(G,QG.n)};_T.utils.randomSecretKey;function Y(G){let X=W(G);return{secretKey:X,publicKey:iC(X)}}return{keygen:Y,getPublicKey:iC,sign:hu,verify:gT,Point:qG,utils:{randomSecretKey:W,randomPrivateKey:W,taggedHash:KQ,lift_x:yT,pointToBytes:Kz,numberToBytesBE:RQ,bytesToNumberBE:NG,mod:C5},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})(),bu=new TextEncoder,mu=new TextDecoder,PW=(W)=>bu.encode(W),xJ=(W)=>mu.decode(W),qz=(W)=>Array.from(W,(Y)=>Y.toString(16).padStart(2,"0")).join(""),w7=JSON.stringify,OQ=JSON.parse,uT=(W,Y=Number.MAX_SAFE_INTEGER)=>W.split("").reduce((G,X)=>G+X.charCodeAt(0),0)%Y,Cz="AES-GCM",fu={},hT="$",bT=",",cu=(W)=>{let Y=new Uint8Array(W),G=32768,X="";for(let J=0;J<Y.length;J+=32768)X+=String.fromCharCode(...Y.subarray(J,J+32768));return btoa(X)},pu=(W)=>Uint8Array.from(atob(W),(Y)=>Y.charCodeAt(0)).buffer,GQ=(W)=>fu[W]??=crypto.subtle.digest("SHA-1",PW(W)).then((Y)=>{let G=new Uint8Array(Y),X="";for(let J of G)X+=J.toString(36);return X}),lu=async(W,Y,G)=>{let X=await crypto.subtle.digest("SHA-256",PW(`${W}:${Y}:${G}`));return crypto.subtle.importKey("raw",X,{name:Cz},!1,["encrypt","decrypt"])},du=async(W,Y)=>{let G=crypto.getRandomValues(new Uint8Array(12)),X=await W,J=await crypto.subtle.encrypt({name:Cz,iv:G},X,PW(Y));return`${G.join(bT)}${hT}${cu(J)}`},ou=async(W,Y)=>{let[G,X]=Y.split(hT);if(!G||!X)throw Error("Invalid encrypted payload format");let J=Uint8Array.from(G.split(bT),Number),Z=await W,V=await crypto.subtle.decrypt({name:Cz,iv:J},Z,pu(X));return xJ(V)},D5="GenosRTC",Tz=(W,Y)=>Array.from({length:W},Y),DQ=(W)=>Array.from(crypto.getRandomValues(new Uint8Array(W)),(Y)=>"0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"[Y%62]).join(""),H8=typeof sessionStorage<"u"?sessionStorage.__genosrtcId??=DQ(20):DQ(20),XG=Promise.all.bind(Promise),nu=typeof window<"u",{entries:iu,fromEntries:mT,keys:xe}=Object,rC=()=>{},Y4=(W)=>Error(`GenosRTC: ${W}`),XQ=(...W)=>W.join("@"),ru=(W,Y)=>{let G=[...W],X=G.length,J=()=>{let Z=Math.sin(Y++)*1e4;return Z-Math.floor(Z)};while(X){let Z=Math.floor(J()*X--);[G[X],G[Z]]=[G[Z],G[X]]}return G},au=5000,aC="icegatheringstatechange",sC="offer",su="answer",tu=[...Tz(3,(W,Y)=>`stun:stun${Y||""}.l.google.com:19302`),"stun:stun.cloudflare.com:3478"].map((W)=>({urls:W})),tC=(W,{rtcConfig:Y,rtcPolyfill:G,turnConfig:X})=>{let J=new(G||RTCPeerConnection)({iceServers:[...tu,...X||[]],...Y}),Z={},V=!1,U=!1,Q,N=(A)=>Object.assign(A,{binaryType:"arraybuffer",bufferedAmountLowThreshold:65535,onmessage:(I)=>Z.data?.(I.data),onopen:()=>Z.connect?.(),onclose:()=>Z.close?.(),onerror:(I)=>!I?.error?.message?.includes("User-Initiated Abort")&&Z.error?.(I)}),q=()=>Promise.race([new Promise((A)=>{let I=()=>{if(J.iceGatheringState==="complete")J.removeEventListener(aC,I),A()};J.addEventListener(aC,I),I()}),new Promise((A)=>setTimeout(A,au))]).then(()=>({type:J.localDescription.type,sdp:J.localDescription.sdp.replace(/a=ice-options:trickle\s\n/g,"")}));if(W?N(Q=J.createDataChannel("data")):J.ondatachannel=({channel:A})=>N(Q=A),J.onnegotiationneeded=async()=>{try{V=!0,await J.setLocalDescription(),Z.signal?.(await q())}catch(A){Z.error?.(A)}finally{V=!1}},J.onconnectionstatechange=()=>{if(["disconnected","failed","closed"].includes(J.connectionState))Z.close?.()},J.ontrack=(A)=>{Z.track?.(A.track,A.streams[0]),Z.stream?.(A.streams[0])},J.onremovestream=(A)=>Z.stream?.(A.stream),W&&!J.canTrickleIceCandidates)J.onnegotiationneeded();let H=()=>J.getSenders();return{created:Date.now(),connection:J,get channel(){return Q},get isDead(){return J.connectionState==="closed"},async signal(A){if(Q?.readyState==="open"&&!A.sdp?.includes("a=rtpmap"))return;try{if(A.type===sC){if(V||J.signalingState!=="stable"&&!U){if(W)return;await XG([J.setLocalDescription({type:"rollback"}),J.setRemoteDescription(A)])}else await J.setRemoteDescription(A);await J.setLocalDescription();let I=await q();return Z.signal?.(I),I}if(A.type===su){U=!0;try{await J.setRemoteDescription(A)}finally{U=!1}}}catch(I){Z.error?.(I)}},sendData:(A)=>{if(Q?.readyState==="open")Q.send(A)},destroy:()=>{Q?.close(),J.close(),V=U=!1},setHandlers:(A)=>Object.assign(Z,A),offerPromise:W?new Promise((A)=>Z.signal=(I)=>I.type===sC&&A(I)):Promise.resolve(),addStream:(A)=>A.getTracks().forEach((I)=>J.addTrack(I,A)),removeStream:(A)=>H().filter((I)=>A.getTracks().includes(I.track)).forEach((I)=>J.removeTrack(I)),addTrack:(A,I)=>J.addTrack(A,I),removeTrack:(A)=>{let I=H().find((w)=>w.track===A);if(I)J.removeTrack(I)},replaceTrack:(A,I)=>H().find((w)=>w.track===A)?.replaceTrack(I)}},eu=Object.getPrototypeOf(Uint8Array),UQ=12,fT=0,QQ=fT+UQ,NQ=QQ+1,kJ=NQ+1,_J=kJ+1,FJ=16384-_J,JQ=255,eH="bufferedamountlow",GG=(W)=>`@_${W}`,eC=GG("ping"),Wz=100,Wh=3,Yh=200,Gh=512,WT=(W,Y)=>new Response(new Blob([W]).stream().pipeThrough(new Y("deflate"))).arrayBuffer().then((G)=>new Uint8Array(G)),Xh=(W,Y,G,X,J)=>{let Z=new Map,V=new Map,U=new Map,Q={},N={},q={},H={},A=new Map,I=new Map,w=Promise.resolve(),O=(R,v)=>{if(!A.has(R))A.set(R,new Set);A.get(R).add(v)},M=(R,v)=>A.get(R)?.delete(v),S=(R,...v)=>A.get(R)?.forEach((X0)=>X0(...v)),g=(R,v)=>{let X0=R?Array.isArray(R)?R:[R]:Z.keys();return Array.from(X0,(V0)=>{let Q0=Z.get(V0);if(!Q0)return console.warn(`${D5}: no peer with id ${V0}`),null;return v(V0,Q0)}).filter(Boolean)},c=(R)=>{if(!Z.has(R))return;Z.delete(R),I.delete(R),_.delete(R),delete Q[R],delete N[R],delete q[R],delete H[R],S("peer:leave",R),Y(R)},u=(R)=>new Promise((v,X0)=>{let V0=setTimeout(()=>{R.removeEventListener(eH,Q0),X0(Error(`${D5}: bufferLow timeout`))},5000);function Q0(){clearTimeout(V0),R.removeEventListener(eH,Q0),v()}R.addEventListener(eH,Q0)}),p=(R)=>{if(U.has(R))return U.get(R);if(!R)throw Y4("action type is required");let v=PW(R);if(v.byteLength>UQ)throw Y4(`\u274C "${R}" exceeds ${UQ} bytes. Use a shorter name.`);let X0=new Uint8Array(UQ).map((G0,C0)=>v[C0]||0),V0=0,Q0=new Map([["message",new Set],["progress",new Set]]),F0=(G0,C0)=>Q0.get(G0)?.add(C0),y0=(G0,C0)=>Q0.get(G0)?.delete(C0),A1=async(G0,C0,B0,e)=>{if(B0&&typeof B0!=="object")throw Y4("meta must be object");if(G0===void 0)throw Y4("data cannot be undefined");let T0=G0 instanceof Blob,M0=T0||G0 instanceof ArrayBuffer||G0 instanceof eu,q0=typeof G0!=="string";if(B0&&!M0)throw Y4("meta only allowed with binary");let _0=M0?new Uint8Array(T0?await G0.arrayBuffer():G0):PW(q0?w7(G0):G0),Y1=0;if(!M0&&_0.byteLength>=Gh){let e0=await WT(_0,CompressionStream);if(e0.byteLength<_0.byteLength)_0=e0,Y1=1}let t0=B0?PW(w7(B0)):null,$1=Math.ceil(_0.byteLength/FJ)+(B0?1:0)||1;if($1>Wz)throw Y4(`Message too large, exceeds max chunks ${Wz}`);let Y8=Tz($1,(e0,D1)=>{let r0=D1===$1-1,t1=B0&&D1===0,t8=t1?t0:_0.subarray(B0?(D1-1)*FJ:D1*FJ,B0?D1*FJ:(D1+1)*FJ),C8=new Uint8Array(_J+t8.byteLength);return C8.set(X0),C8.set([V0],QQ),C8.set([r0|t1<<1|M0<<2|q0<<3|Y1<<4],NQ),C8.set([Math.round((D1+1)/$1*JQ)],kJ),C8.set(t8,_J),C8});return V0=V0+1&JQ,XG(g(C0,async(e0,D1)=>{let{channel:r0}=D1;for(let t1=0;t1<$1;t1++){let t8=0;while(r0.bufferedAmount>r0.bufferedAmountLowThreshold){if(t8++>Wh)throw Y4(`${D5}: send buffer full, max retries reached for peer ${e0}`);try{await u(r0)}catch(C8){console.warn(C8.message),await new Promise((w5)=>setTimeout(w5,Yh))}}if(!Z.has(e0))break;D1.sendData(Y8[t1]),e?.(Y8[t1][kJ]/JQ,e0,B0)}}))};V.set(R,{listeners:Q0,send:A1});let v1={send:A1,on:F0,off:y0};return U.set(R,v1),v1},h=(R,v)=>{try{I.set(R,Date.now()),_.delete(R);let X0=new Uint8Array(v),V0=xJ(X0.subarray(fT,QQ)).replace(/\x00/g,"");if(!V.has(V0))return console.warn(`${D5}: unregistered type (${V0})`);if(V0===eC){b("",R).catch(()=>{});return}let[Q0]=X0.subarray(QQ,NQ),[F0]=X0.subarray(NQ,kJ),[y0]=X0.subarray(kJ,_J),A1=X0.subarray(_J),v1=Boolean(F0&1),G0=Boolean(F0&2),C0=Boolean(F0&4),B0=Boolean(F0&8),e=Boolean(F0&16),T0=V.get(V0),M0=(Q[R]||={})[V0]||={};if(M0[Q0]?.chunks?.length>Wz){console.warn(`${D5}: peer ${R} sent too many chunks for nonce ${Q0}, ignoring.`);return}let q0=M0[Q0]||={chunks:[]};if(G0)try{q0.meta=OQ(xJ(A1))}catch{console.warn(`${D5}: failed to parse meta from peer ${R} for type ${V0}`);return}else q0.chunks.push(A1);if(T0.listeners.get("progress").forEach((Y1)=>{try{Y1(y0/JQ,R,q0.meta)}catch(t0){console.error(t0)}}),!v1)return;let _0=new Uint8Array(q0.chunks.reduce((Y1,t0)=>Y1+t0.byteLength,0));q0.chunks.reduce((Y1,t0)=>(_0.set(t0,Y1),Y1+t0.byteLength),0),delete M0[Q0],w=w.then(async()=>{let Y1=e?await WT(_0,DecompressionStream):_0,t0;if(C0)t0=Y1;else if(B0)try{t0=OQ(xJ(Y1))}catch{console.warn(`${D5}: failed to parse JSON message data from peer ${R} for type ${V0}`);return}else t0=xJ(Y1);T0.listeners.get("message").forEach(($1)=>{try{$1(t0,R,q0.meta)}catch(Y8){console.error(Y8)}})}).catch((Y1)=>console.error(`${D5}: dispatch error from peer ${R}:`,Y1))}catch(X0){console.error(`${D5}: error handling data from peer ${R}:`,X0)}},f=async()=>{try{await a(""),await new Promise((R)=>setTimeout(R,99))}catch(R){console.warn(`${D5}: error sending leave`,R)}for(let[R,v]of Z){try{v.destroy()}catch{}Z.delete(R)}clearInterval(x),G()},{send:t}=p(eC),{send:b,on:J0}=p(GG("pong")),{send:I0,on:k}=p(GG("signal")),{send:l,on:P}=p(GG("stream")),{send:B,on:m}=p(GG("track")),{send:a,on:n}=p(GG("leave"));W((R,v)=>{let X0=Z.get(v);if(X0===R)return;if(X0){let V0=()=>{};X0.setHandlers({data:V0,stream:V0,track:V0,signal:V0,close:V0,error:V0})}Z.set(v,R),I.set(v,Date.now()),_.delete(v),R.setHandlers({data:(V0)=>h(v,V0),stream:(V0)=>{S("stream:add",V0,v,q[v]),delete q[v]},track:(V0,Q0)=>{S("track:add",V0,Q0,v,H[v]),delete H[v]},signal:(V0)=>I0(V0,v),close:()=>c(v),error:(V0)=>{console.error(`${D5}: peer error for ${v}`,V0),c(v)}}),S("peer:join",v,X?.(v))}),J?.((R,v,X0)=>S(X0?"peer:seen":"peer:lost",R,v)),J0("message",(R,v)=>{N[v]?.(),delete N[v]}),k("message",(R,v)=>Z.get(v)?.signal(R)),P("message",(R,v)=>q[v]=R),m("message",(R,v)=>H[v]=R),n("message",(R,v)=>c(v));let E=1e4,$=20000,_=new Map,x=setInterval(()=>{let R=Date.now();for(let[v,X0]of Z){if(R-(I.get(v)??R)<=E)continue;let V0=_.get(v);if(V0===void 0)_.set(v,R),t("",v).catch(()=>{});else if(R-V0>$){_.delete(v);try{X0.destroy()}catch{}c(v)}}},5000);if(nu)addEventListener("beforeunload",f);return{on:O,off:M,channel:p,leave:f,ping:async(R)=>{if(!R)throw Y4("ping() requires target peer ID");let v=Date.now();return t("",R),await new Promise((X0)=>N[R]=X0),Date.now()-v},getPeers:()=>mT(Array.from(Z,([R,v])=>[R,v.connection])),addStream:(R,v,X0)=>g(v,async(V0,Q0)=>{if(X0)await l(X0,V0);Q0.addStream(R)}),removeStream:(R,v)=>g(v,(X0,V0)=>V0.removeStream(R)),addTrack:(R,v,X0,V0)=>g(X0,async(Q0,F0)=>{if(V0)await B(V0,Q0);F0.addTrack(R,v)}),removeTrack:(R,v)=>g(v,(X0,V0)=>V0.removeTrack(R)),replaceTrack:(R,v,X0,V0)=>g(X0,async(Q0,F0)=>{if(V0)await B(V0,Q0);F0.replaceTrack(R,v)})}},Jh=5,Zh=10,Vh=2500,ZQ=57333,Uh=({init:W,subscribe:Y,announce:G,bye:X})=>{let J={},Z=!1,V,U;return(Q,N,q)=>{let{appId:H}=Q;if(J[H]?.[N])return J[H][N];if(!Q||!N||!H&&!Q.firebaseApp)throw Y4(!Q?"config required":!N?"roomId required":"appId missing");let A=rC,I=rC;if(!Z){let _=W(Q);U=Tz(Jh,()=>{try{return tC(!0,Q)}catch{return null}}).filter(Boolean),V=Array.isArray(_)?_:[_];let x=setInterval(()=>{U=U.filter((R)=>{let v=Date.now()-R.created<ZQ;if(!v)R.destroy();return v})},ZQ);J.offerCleanupTimer||=x,Z=!0}let w={},O={},M=new Map,S=new Map,g=new Map,c={},u=XQ(D5,H,N),p=GQ(u),h=GQ(XQ(u,H8)),f=lu(Q.password||"",H,N),t=(_)=>async(x)=>({type:x.type,sdp:await _(f,x.sdp)}),b=t(ou),J0=t(du),I0=(_)=>{return setTimeout(()=>{if(!_.isDead&&!Object.values(O).includes(_))_.destroy()},ZQ),_},k=(_)=>{try{return I0(tC(_,Q))}catch{return null}},l=(_,x)=>{if(O[x]===_)return;_.connectedAt=Date.now(),O[x]?.destroy(),O[x]=_,A(_,x),w[x]?.forEach((R)=>R!==_&&R.destroy()),delete w[x]},P=(_,x)=>{if(O[x]===_)delete O[x]},B=(_)=>async(x,R,v)=>{let[X0,V0]=await XG([p,h]);if(x!==X0&&x!==V0)return;let{peerId:Q0,offer:F0,answer:y0,type:A1,bye:v1}=typeof R==="string"?OQ(R):R;if(v1){if(Q0&&Q0!==H8)S.delete(Q0),I(Q0,null,!1),g.set(Q0,Date.now()),delete c[Q0];return}if(Q0&&Q0!==H8)I(Q0,A1,!0),S.set(Q0,Date.now()),g.delete(Q0);if(A1&&Q0)c[Q0]=A1;if(Q0===H8)return;if(O[Q0]){let G0=O[Q0].channel?.readyState==="open";if(!F0||G0||Date.now()-O[Q0].connectedAt<2000)return;O[Q0].destroy(),delete O[Q0]}if(Q.admit&&!Q.admit(Q0))return;if(F0){if(w[Q0]?.[_]&&H8>Q0)return;let G0=k(!1);if(!G0)return;G0.setHandlers({connect:()=>l(G0,Q0),close:()=>P(G0,Q0)});try{let C0=await b(F0);if(G0.isDead)return;let[B0,e]=await XG([GQ(XQ(u,Q0)),G0.signal(C0).then(J0)]);v(B0,w7({peerId:H8,answer:e,...Q.type&&{type:Q.type}}))}catch{q?.({error:"decryption failed (offer)",appId:H,peerId:Q0,roomId:N})}}else if(y0){let G0=w[Q0]?.[_];if(!G0||G0.isDead)return;G0.setHandlers({connect:()=>l(G0,Q0),close:()=>P(G0,Q0)});try{G0.signal(await b(y0))}catch{q?.({error:"decryption failed (answer)",appId:H,peerId:Q0,roomId:N})}}else{let G0=w[Q0]||=[];if(G0.forEach((e,T0)=>{if(e&&(e.isDead||Date.now()-(e.dialedAt??e.created)>ZQ)){if(e.isDead)M.set(Q0,Date.now()+30000);e.destroy(),delete G0[T0]}}),G0[_]||G0.filter(Boolean).length>=2||M.get(Q0)>Date.now())return;if(Object.values(w).reduce((e,T0)=>e+T0.filter((M0)=>M0&&!M0.isDead).length,0)>=Zh)return;let C0=U.pop(),B0=C0?I0(C0):k(!0);if(!B0){M.set(Q0,Date.now()+30000);return}B0.dialedAt=Date.now(),G0[_]=B0;try{let[e,{offer:T0}]=await XG([GQ(XQ(u,Q0)),B0.offerPromise.then(J0).then((M0)=>({offer:M0}))]);B0.setHandlers({connect:()=>l(B0,Q0),close:()=>P(B0,Q0)}),v(e,w7({peerId:H8,offer:T0,peer:B0,...Q.type&&{type:Q.type}}))}catch{if(G0[_]===B0)delete G0[_];B0.destroy()}}},m=[],a=[],n=[],E=()=>n.forEach(({relay:_,rootTopic:x})=>X?.(_,x));V.forEach(async(_,x)=>{let R=await _;if(!R)return;let[v,X0]=await XG([p,h]);a[x]=Y(R,v,X0,B(x)),n.push({relay:R,rootTopic:v});let V0=async()=>{let Q0=await G(R,v,X0);m[x]=setTimeout(V0,typeof Q0==="number"?Q0:Vh)};V0()}),J[H]||={};let $=Xh((_)=>A=_,(_)=>delete O[_],()=>$.onCleanup?.(),(_)=>c[_],(_)=>I=_);if(typeof window<"u")window.addEventListener("pagehide",E);return $.onCleanup=()=>{if(E(),typeof window<"u")window.removeEventListener("pagehide",E);if(delete J[H][N],m.forEach(clearTimeout),a.forEach((_)=>_?.()),Object.keys(J).length===0)clearInterval(J.offerCleanupTimer),delete J.offerCleanupTimer},$._census=()=>{for(let x of Object.keys(O))S.set(x,Date.now());let _=Date.now()-120000;for(let[x,R]of S)if(R<_)S.delete(x);return[...S.keys()]},$._gone=()=>{let _=Date.now()-60000;for(let[x,R]of g)if(R<_)g.delete(x);return[...g.keys()]},J[H][N]=$}},YT=3333,Qh=30000,SJ={},cT={},Nh=(W,Y)=>{let G={},X=null;G.reopenHandlers=new Set;let J=()=>{if(X)clearTimeout(X),X=null;if(G.socket)G.socket.onclose=null,G.socket.close();let Z=new WebSocket(W);Z.onclose=()=>{SJ[W]??=YT,X=setTimeout(J,SJ[W]),SJ[W]=Math.min(SJ[W]*2,Qh)},Z.onmessage=(V)=>Y(V.data),G.socket=Z,G.url=Z.url,G.ready=new Promise((V)=>{Z.onopen=()=>{SJ[W]=YT,V(G),G.reopenHandlers.forEach((U)=>U())}}),G.send=(V)=>{if(Z.readyState===1)Z.send(V)}};return G.forceReconnect=J,J(),cT[W]=G,G};if(typeof window<"u"){let W=(Y)=>{vJ.info("\u26A1 [GenosRTC] Network event detected. Forcing reconnection\u2026"),Object.values(cT).forEach((G)=>{if(G.socket&&G.socket.readyState!==WebSocket.OPEN&&(Y||G.socket.readyState!==WebSocket.CONNECTING))G.forceReconnect()})};window.addEventListener("online",()=>{vJ.info("\u2705 Reconnected to the network."),W(!0)}),window.addEventListener("offline",async()=>{vJ.info("\u274C Disconnected from the network.")}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible")W()})}var qh=(W)=>()=>mT(iu(W).map(([Y,G])=>[Y,G.socket])),Ah=(W,Y,G,X)=>(W.relayUrls??(X?ru(Y,uT(W.appId)):Y)).slice(0,W.relayUrls?.length??W.relayRedundancy??G),Hh=["wss://relay.primal.net","wss://relay.snort.social","wss://nostr.oxtr.dev","wss://nostr.vulpem.com","wss://relay.nostr.net","wss://nostr.sathoarder.com","wss://nostr.data.haus","wss://relay.mostr.pub"],VG={},zh=10,pT="x",lT="EVENT",Ih=/pow:\s*(\d+)\s*bits needed\.?/i,qQ=new Set,dT=Dz.utils.randomSecretKey(),wh=qz(Dz.getPublicKey(dT)),Mz={},yJ={},jh={},oT=()=>Math.floor(Date.now()/1000),nT=(W)=>jh[W]??=uT(W,1e4)+20000,uJ=(W)=>W.replace(/\/$/,""),Kh=(W,Y)=>{let[G,X,J,Z]=OQ(Y);if(G===lT)return yJ[X]?.(Mz[X],J.content);if(G==="NOTICE"||G==="OK"&&!J){if(+((G==="NOTICE"?X:Z).match(Ih)?.[1]??0)>0){let V=uJ(W);qQ.add(V),VG[V]?.close?.(),delete VG[V]}}},Oh=(W)=>{let Y=uJ(W);if(VG[Y])return VG[Y];let G=Nh(Y,(X)=>Kh(Y,X));return VG[Y]=G},Yz=async(W,Y)=>{let G={kind:nT(W),content:Y,pubkey:wh,created_at:oT(),tags:[[pT,W]]},X=PW(w7([0,G.pubkey,G.created_at,G.kind,G.tags,G.content])),J=new Uint8Array(await crypto.subtle.digest("SHA-256",X)),Z=Dz.sign(J,dT);return w7([lT,{...G,id:qz(J),sig:qz(Z)}])},GT=(W,Y)=>{return Mz[W]=Y,w7(["REQ",W,{kinds:[nT(Y)],since:oT(),["#"+pT]:[Y]}])},XT=(W)=>{return delete Mz[W],w7(["CLOSE",W])},iT=Uh({init:(W)=>{let Y=(W?.relayUrls?.length?W.relayUrls:null)??Hh;return Ah(W,Y,zh,!1).map(Oh).map((G)=>G.ready.then(()=>G).catch(()=>null))},subscribe:(W,Y,G,X)=>{let J=DQ(64),Z=DQ(64);yJ[J]=yJ[Z]=(U,Q)=>X(U,Q,async(N,q)=>{if(qQ.has(uJ(W.url)))return;W.send(await Yz(N,q))});let V=()=>{W.send(GT(J,Y)),W.send(GT(Z,G))};return V(),W.reopenHandlers.add(V),()=>{W.reopenHandlers.delete(V),W.send(XT(J)),W.send(XT(Z)),delete yJ[J],delete yJ[Z]}},announce:async(W,Y)=>{if(qQ.has(uJ(W.url)))return;W.send(await Yz(Y,w7({peerId:H8})))},bye:async(W,Y)=>{if(qQ.has(uJ(W.url)))return;W.send(await Yz(Y,w7({peerId:H8,bye:1})))}}),ke=qh(VG),Dh={cellSize:10},Ch=5000,Th=3000,Mh=2000,Rh=2000,Ph=1e4,Lh=30000,Bh=5000,Eh=30000,CQ=(W)=>{let Y=String(W||"").match(/cell-(\d+)/);return Y?Number(Y[1]):null},Gz=(W,Y)=>{let G=CQ(W);if(G==null)return[];let X=[];for(let J=1;J<Y;J*=2){if(G-J>=0)X.push(`cell-${G-J}`);if(G+J<Y)X.push(`cell-${G+J}`)}return X},VQ=(W)=>`c${(CQ(W)||0).toString(36)}`,$h=10,Fh=(W,Y)=>{let G=+Y.cellSize>=2?Y.cellSize|0:$h;return Math.max(1,Math.ceil(W/G))},rT=(W)=>{let Y=0;for(let G=0;G<W.length;G++)Y=Math.imul(Y^W.charCodeAt(G),2654435761);return Y>>>0},A6=(W,Y)=>{let G=0,X=-1;for(let J=0;J<Y;J++){let Z=rT(`${W}:${J}`);if(Z>X)X=Z,G=J}return G};function Sh(W,Y={},G={}){let X={...Dh,...Y},J=1,Z={epoch:0,roster:[H8],set:new Set([H8]),key:H8,C:1,cellId:null,isBridge:!1,bridges:[],edgeBridges:[]},V={cellId:null},U=0,Q=0,N="",q=0,H=0,A=0,I=null,w=null,O=null,M=new Map,S=new Set,g=new Map,c=new Set,u=0,p=new Set,h=new Map,f=()=>Math.min(150,Math.ceil(Math.log2(Z.C+1))*2+3),t=(e)=>Gz(e,Z.C),b=W.on?.bind(W),J0=W.off?.bind(W);if(b)W.on=(e,T0)=>String(e).startsWith("mesh:")?l(e,T0):b(e,T0);if(J0)W.off=(e,T0)=>String(e).startsWith("mesh:")?g.get(e)?.delete(T0):J0(e,T0);let I0=(e)=>(S.add(e),()=>S.delete(e)),k=(e,T0)=>{for(let M0 of S)try{M0(e,T0)}catch(q0){vJ.error("\uD83D\uDD78\uFE0F [Cells] Error in deliver handler:",q0)}},l=(e,T0)=>{if(!g.has(e))g.set(e,new Set);return g.get(e).add(T0),()=>g.get(e)?.delete(T0)},P=(e,...T0)=>{let M0=g.get(e);if(M0)for(let q0 of M0)try{q0(...T0)}catch{}},B=(e)=>{try{return typeof e==="string"?JSON.parse(e):e}catch{return null}},m=()=>`${H8}:${Date.now().toString(36)}:${(u++&65535).toString(36)}`,a=()=>{if(c.size>Ch)c.delete(c.values().next().value)},n=()=>[...new Set([...W._census(),H8])].sort(),E=(e,T0,M0)=>T0.filter((q0)=>A6(q0,M0)===e),$=(e,T0,M0)=>{if(e==null)return null;let q0=(t0)=>rT(`${t0}@${e}`),_0=null,Y1=-1;for(let t0 of E(e,T0,M0)){let $1=q0(t0);if($1>Y1)Y1=$1,_0=t0}return _0},_=(e)=>{let T0=Z.audience?.get(e);if(!T0)return[];return Object.keys(W.getPeers?.()||{}).filter((M0)=>T0.has(M0))},x=(e,T0)=>{if(e!==w&&!(Z.isBridge&&Z.bridges.some((r0)=>VQ(r0)===e)))return;let M0=B(T0);if(!M0?.id||!M0?.t)return;if(c.has(M0.id))return;c.add(M0.id),a();let{t:q0,id:_0,ttl:Y1,data:t0,origin:$1,originCell:Y8}=M0,e0=Z.cellId;if(q0==="ping"&&t0?.pingId&&t0.target===H8&&$1!==H8){let r0={t:"pong",id:m(),ttl:f(),data:{pingId:t0.pingId,receivedAt:Date.now()},origin:H8,originCell:e0},t1=W.getPeers?.()?.[$1]?[$1]:_(e0);I?.send(JSON.stringify(r0),t1)}if(q0==="pong"&&t0?.pingId){let r0=h.get(t0.pingId);if(r0)clearTimeout(r0.timeout),r0.resolve(Date.now()-r0.start),h.delete(t0.pingId)}if(q0==="msg"&&$1!==H8)k(t0,$1);if(!Z.isBridge)return;if((Y1??0)<=0)return;let D1=(r0,t1,t8=null)=>{if(!r0||!t1.length)return;let C8={t:q0,id:_0,ttl:t8??(Y1??f())-1,data:t0,origin:$1||H8,originCell:Y8||e0};r0.send(JSON.stringify(C8),t1)};if(e===w){for(let r0 of t(e0))D1(R(r0),_(r0));return}D1(I,_(e0));for(let r0 of t(e0))if(VQ(r0)!==e)D1(R(r0),_(r0))},R=(e)=>{let T0=VQ(e),M0=W.channel(T0);if(!p.has(T0))p.add(T0),M0.on("message",(q0)=>x(T0,q0));return M0},v=()=>{if(!Z.cellId)return;if(w=VQ(Z.cellId),I=W.channel(w),!p.has(w))p.add(w),I.on("message",(e)=>x(w,e));if(Z.isBridge)for(let e of t(Z.cellId))R(e)},X0=(e,T0)=>{if(!e.cellId||!e.set.has(T0))return!1;let M0=`cell-${A6(T0,e.C)}`;return M0===e.cellId||e.bridges.includes(M0)||Gz(M0,e.C).includes(e.cellId)&&$(A6(T0,e.C),e.roster,e.C)===T0},V0=(e)=>Z.set.size<2&&(V.set?.size??0)<2||X0(Z,e)||Date.now()<U&&X0(V,e),Q0=()=>{let e=W.getPeers?.()||{};for(let T0 of Object.keys(e))if(!V0(T0))e[T0].close?.()};G.admit=V0;let F0=()=>({epoch:Z.epoch,cellId:Z.cellId,isBridge:Z.isBridge,bridges:Z.bridges,roster:[...Z.roster],cellSize:J,dynamicTTL:f(),totalCells:Z.C}),y0=()=>{H=Date.now();for(let[e,T0]of M){if(e===H8)continue;P("mesh:peer-state",{id:e,cell:T0.cell,bridges:T0.bridges,timestamp:H})}},A1=(e)=>{let T0=Fh(e.length,X);J=Math.ceil(e.length/T0);let M0=`cell-${A6(H8,T0)}`,q0=new Map,_0=new Set,Y1=new Map,t0=(r0)=>Y1.get(r0)??Y1.set(r0,new Set).get(r0);for(let r0 of e)t0(`cell-${A6(r0,T0)}`).add(r0);let $1=new Map,Y8=(r0)=>$1.has(r0)?$1.get(r0):$1.set(r0,$(r0,e,T0)).get(r0);for(let r0 of new Set(e.map((t1)=>A6(t1,T0)))){let t1=`cell-${r0}`;for(let t8 of Gz(t1,T0)){if(CQ(t8)<r0)continue;for(let C8 of[Y8(r0),Y8(CQ(t8))]){if(!C8)continue;let w5=`cell-${A6(C8,T0)}`===t1?t8:t1,d=q0.get(C8)??[];if(!d.includes(w5))d.push(w5);if(q0.set(C8,d),t0(t1).add(C8),t0(t8).add(C8),t1===M0||t8===M0)_0.add(C8)}}}let e0=q0.get(H8)??[],D1=Z.cellId!==M0||String(Z.bridges)!==String(e0);V=Z,Z={epoch:Z.epoch+1,roster:e,set:new Set(e),key:e.join("|"),C:T0,cellId:M0,isBridge:e0.length>0,bridges:e0,edgeBridges:[..._0],audience:Y1},A=Date.now(),M.clear();for(let r0 of e){let t1=q0.get(r0)??[];M.set(r0,{cell:`cell-${A6(r0,T0)}`,isBridge:t1.length>0,bridges:t1})}if(U=Date.now()+Bh,D1)v();vJ.info("\uD83D\uDD78\uFE0F [Cells] seal",{epoch:Z.epoch,myCell:M0,bridges:e0,C:T0,roster:e.length}),y0(),P("mesh:state",F0())},v1=()=>{let e=n(),T0=e.join("|");if(T0===Z.key)Q=0;else{let M0=Date.now();if(Q||=M0,T0!==N)N=T0,q=M0;if(e.some((q0)=>!Z.set.has(q0))||Z.edgeBridges.some((q0)=>!e.includes(q0))||(W._gone?.()??[]).some((q0)=>Z.set.has(q0))?M0-q>=Rh||M0-Q>=Ph:M0-Q>=Lh)Q=0,A1(e)}if(U&&Date.now()>=U)U=0,Q0()},G0=()=>{if(O)return;O=setInterval(()=>{if(v1(),Date.now()-H>=Eh)y0()},Mh)},C0=()=>{if(O)clearInterval(O),O=null},B0=(e)=>{return new Promise((T0,M0)=>{let q0=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,_0=Date.now(),Y1=setTimeout(()=>{h.delete(q0),M0(Error("Ping timeout"))},Th);h.set(q0,{start:_0,resolve:T0,reject:M0,timeout:Y1,peerId:e});let t0={t:"ping",id:m(),ttl:f(),data:{pingId:q0,target:e},origin:H8,originCell:Z.cellId};I?.send(JSON.stringify(t0),_(Z.cellId))})};return W.on?.("peer:join",()=>v1()),W.on?.("peer:leave",()=>v1()),A1(n()),G0(),{send:(e)=>{let T0={t:"msg",id:m(),ttl:f(),data:e,origin:H8,originCell:Z.cellId},M0=JSON.stringify(T0);I.send(M0,_(Z.cellId)),x(w,M0)},on:(e,T0)=>e==="message"?I0(T0):void 0,ping:B0,getState:()=>({...F0(),knownCells:new Set([...M.values()].map((e)=>e.cell)).size}),getPeerInfo:()=>new Map(M),getStableRoster:()=>[...Z.roster],getKnownCells:()=>{let e=new Map;for(let[T0,{cell:M0}]of M)if(!e.has(M0))e.set(M0,{lastSeen:A,peerId:T0});return e},getCellSize:()=>J,destroy:()=>{C0(),h.forEach((e)=>clearTimeout(e.timeout)),h.clear()}}}function xh(W,Y,G){let X={},J=iT({...W,admit:(Q)=>X.admit?.(Q)??!0},Y,G),Z=W.overlay||{},V=Sh(J,Z,X),U=new Map;return{on:(Q,N)=>J.on(Q,N),off:(Q,N)=>J.off?.(Q,N),channel:(Q)=>{if(U.has(Q))return U.get(Q);let N=J.channel(Q),q={send:(H,A)=>{if(A){let I=[].concat(A),w=J.getPeers?.()||{};if(I.every((O)=>w[O]))return N.send(H,A)}V.send({_ch:Q,_d:H,_t:A})},on:(H,A)=>{if(H==="message")V.on("message",(I,w)=>{if(I?._ch!==Q)return;if(I._t&&![].concat(I._t).includes(H8))return;A(I._d,w)}),N.on(H,A);else N.on(H,A)},off:(H,A)=>N.off?.(H,A),_original:N};return U.set(Q,q),q},get id(){return J.id},get peers(){return J.peers},getPeers:()=>J.getPeers?.()||{},mesh:V,_room:J,getState:()=>V.getState(),getPeerInfo:()=>V.getPeerInfo(),ping:(Q)=>V.ping(Q),leave:()=>{V.destroy(),U.clear(),J.leave()},destroy:()=>{V.destroy(),U.clear()}}}var Rz=(W,Y,G)=>W?.cells||W?.overlay?xh(W,Y,G):iT(W,Y,G);import{randomBytes as IS}from"crypto";function kh(){var W,Y=!1,G=this;G._DeArray=function(X,J,Z){return[X.slice(J,J+Z)]},G._EnArray=function(X,J,Z,V){for(var U=0;U<Z;X[J+U]=V[U]?V[U]:0,U++);},G._DeChar=function(X,J){return String.fromCharCode(X[J])},G._EnChar=function(X,J,Z){X[J]=Z.charCodeAt(0)},G._DeInt=function(X,J){var Z=Y?W.len-1:0,V=Y?-1:1,U=Z+V*W.len,Q,N,q;for(Q=0,N=Z,q=1;N!=U;Q+=X[J+N]*q,N+=V,q*=256);if(W.bSigned&&Q&Math.pow(2,W.len*8-1))Q-=Math.pow(2,W.len*8);return Q},G._EnInt=function(X,J,Z){var V=Y?W.len-1:0,U=Y?-1:1,Q=V+U*W.len,N;Z=Z<W.min?W.min:Z>W.max?W.max:Z;for(N=V;N!=Q;X[J+N]=Z&255,N+=U,Z>>=8);},G._DeString=function(X,J,Z){for(var V=Array(Z),U=0;U<Z;V[U]=String.fromCharCode(X[J+U]),U++);return V.join("")},G._EnString=function(X,J,Z,V){for(var U,Q=0;Q<Z;X[J+Q]=(U=V.charCodeAt(Q))?U:0,Q++);},G._De754=function(X,J){var Z,V,U,Q,N,q,H,A,I,w;H=W.mLen,A=W.len*8-W.mLen-1,w=(1<<A)-1,I=w>>1,Q=Y?0:W.len-1,N=Y?1:-1,Z=X[J+Q],Q+=N,q=-7;for(V=Z&(1<<-q)-1,Z>>=-q,q+=A;q>0;V=V*256+X[J+Q],Q+=N,q-=8);for(U=V&(1<<-q)-1,V>>=-q,q+=H;q>0;U=U*256+X[J+Q],Q+=N,q-=8);switch(V){case 0:V=1-I;break;case w:return U?NaN:(Z?-1:1)*(1/0);default:U=U+Math.pow(2,H),V=V-I;break}return(Z?-1:1)*U*Math.pow(2,V-H)},G._En754=function(X,J,Z){var V,U,Q,N,q,H,A,I,w,O;if(A=W.mLen,I=W.len*8-W.mLen-1,O=(1<<I)-1,w=O>>1,V=Z<0?1:0,Z=Math.abs(Z),isNaN(Z)||Z==1/0)Q=isNaN(Z)?1:0,U=O;else{if(U=Math.floor(Math.log(Z)/Math.LN2),Z*(H=Math.pow(2,-U))<1)U--,H*=2;if(U+w>=1)Z+=W.rt/H;else Z+=W.rt*Math.pow(2,1-w);if(Z*H>=2)U++,H/=2;if(U+w>=O)Q=0,U=O;else if(U+w>=1)Q=(Z*H-1)*Math.pow(2,A),U=U+w;else Q=Z*Math.pow(2,w-1)*Math.pow(2,A),U=0}for(N=Y?W.len-1:0,q=Y?-1:1;A>=8;X[J+N]=Q&255,N+=q,Q/=256,A-=8);for(U=U<<A|Q,I+=A;I>0;X[J+N]=U&255,N+=q,U/=256,I-=8);X[J+N-q]|=V*128},G._DeInt64=function(X,J){var Z=Y?0:7,V=Y?1:-1,U=Z+V*8,Q=[0,0,!W.bSigned],N,q,H;for(N=Z,H=1,q=0;N!=U;Q[H]=(Q[H]<<8>>>0)+X[J+N],N+=V,q++,H=q<4?1:0);return Q},G._EnInt64=function(X,J,Z){var V=Y?0:7,U=Y?1:-1,Q=V+U*8,N,q,H,A;for(N=V,H=1,q=0,A=24;N!=Q;X[J+N]=Z[H]>>A&255,N+=U,q++,H=q<4?1:0,A=24-8*(q%4));},G._sPattern="(\\d + )?([AxcbBhHsfdiIlLqQ])",G._lenLut={A:1,x:1,c:1,b:1,B:1,h:2,H:2,s:1,f:4,d:8,i:4,I:4,l:4,L:4,q:8,Q:8},G._elLut={A:{en:G._EnArray,de:G._DeArray},s:{en:G._EnString,de:G._DeString},c:{en:G._EnChar,de:G._DeChar},b:{en:G._EnInt,de:G._DeInt,len:1,bSigned:!0,min:-Math.pow(2,7),max:Math.pow(2,7)-1},B:{en:G._EnInt,de:G._DeInt,len:1,bSigned:!1,min:0,max:Math.pow(2,8)-1},h:{en:G._EnInt,de:G._DeInt,len:2,bSigned:!0,min:-Math.pow(2,15),max:Math.pow(2,15)-1},H:{en:G._EnInt,de:G._DeInt,len:2,bSigned:!1,min:0,max:Math.pow(2,16)-1},i:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!0,min:-Math.pow(2,31),max:Math.pow(2,31)-1},I:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!1,min:0,max:Math.pow(2,32)-1},l:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!0,min:-Math.pow(2,31),max:Math.pow(2,31)-1},L:{en:G._EnInt,de:G._DeInt,len:4,bSigned:!1,min:0,max:Math.pow(2,32)-1},f:{en:G._En754,de:G._De754,len:4,mLen:23,rt:Math.pow(2,-24)-Math.pow(2,-77)},d:{en:G._En754,de:G._De754,len:8,mLen:52,rt:0},q:{en:G._EnInt64,de:G._DeInt64,bSigned:!0},Q:{en:G._EnInt64,de:G._DeInt64,bSigned:!1}},G._UnpackSeries=function(X,J,Z,V){for(var U=W.de,Q=[],N=0;N<X;Q.push(U(Z,V+N*J)),N++);return Q},G._PackSeries=function(X,J,Z,V,U,Q){for(var N=W.en,q=0;q<X;N(Z,V+q*J,U[Q+q]),q++);},G.Unpack=function(X,J,Z){Y=X.charAt(0)!="<",Z=Z?Z:0;var V=new RegExp(this._sPattern,"g"),U,Q,N,q=[];while(U=V.exec(X)){if(Q=U[1]==null||U[1]==""?1:parseInt(U[1]),N=this._lenLut[U[2]],Z+Q*N>J.length)return;switch(U[2]){case"A":case"s":q.push(this._elLut[U[2]].de(J,Z,Q));break;case"c":case"b":case"B":case"h":case"H":case"i":case"I":case"l":case"L":case"f":case"d":case"q":case"Q":W=this._elLut[U[2]],q.push(this._UnpackSeries(Q,N,J,Z));break}Z+=Q*N}return Array.prototype.concat.apply([],q)},G.PackTo=function(X,J,Z,V){Y=X.charAt(0)!="<";var U=new RegExp(this._sPattern,"g"),Q,N,q,H,A=0;while(Q=U.exec(X)){if(N=Q[1]==null||Q[1]==""?1:parseInt(Q[1]),q=this._lenLut[Q[2]],Z+N*q>J.length)return!1;switch(Q[2]){case"A":case"s":if(A+1>V.length)return!1;this._elLut[Q[2]].en(J,Z,N,V[A]),A+=1;break;case"c":case"b":case"B":case"h":case"H":case"i":case"I":case"l":case"L":case"f":case"d":case"q":case"Q":if(W=this._elLut[Q[2]],A+N>V.length)return!1;this._PackSeries(N,q,J,Z,V,A),A+=N;break;case"x":for(H=0;H<N;H++)J[Z+H]=0;break}Z+=N*q}return J},G.Pack=function(X,J){return this.PackTo(X,Array(this.CalcLength(X)),0,J)},G.CalcLength=function(X){var J=new RegExp(this._sPattern,"g"),Z=0,V;while(V=J.exec(X))Z+=(V[1]==null||V[1]==""?1:parseInt(V[1]))*this._lenLut[V[2]];return Z}}var a1=new kh;var LS=y1(ZM(),1),NA=y1(gz(),1);import{createSocket as kd}from"dgram";import{createSocket as vd}from"dgram";import*as BS from"net";import{connect as gd}from"net";import{createSign as hd,randomBytes as bd,webcrypto as md}from"crypto";var KN0=y1(_M(),1);var R7={};qH(R7,{verifySchema:()=>lm,fromBER:()=>Q4,compareSchema:()=>J4,VisibleString:()=>FW,ViewWriter:()=>dJ,VideotexString:()=>RG,ValueBlock:()=>W9,Utf8String:()=>h5,UniversalString:()=>DG,UTCTime:()=>SW,TimeOfDay:()=>aQ,TeletexString:()=>MG,TIME:()=>eQ,Set:()=>f9,Sequence:()=>_9,Repeated:()=>IG,RelativeObjectIdentifier:()=>iQ,RawData:()=>PR,PrintableString:()=>TG,Primitive:()=>K6,OctetString:()=>T7,ObjectIdentifier:()=>KG,NumericString:()=>CG,Null:()=>C7,Integer:()=>O6,IA5String:()=>PG,HexBlock:()=>D7,GraphicString:()=>LG,GeneralizedTime:()=>$G,GeneralString:()=>BG,Enumerated:()=>jG,EndOfContent:()=>oQ,Duration:()=>tQ,DateTime:()=>sQ,DEFAULT_MAX_NODES:()=>oM,DEFAULT_MAX_DEPTH:()=>dM,DEFAULT_MAX_CONTENT_LENGTH:()=>nM,DATE:()=>rQ,Constructed:()=>c8,Choice:()=>nJ,CharacterString:()=>EG,Boolean:()=>wG,BmpString:()=>OG,BitString:()=>M7,BaseStringBlock:()=>lQ,BaseBlock:()=>k8,Any:()=>V4});/*!
|
|
148
148
|
* MIT License
|
|
149
149
|
*
|
|
150
150
|
* Copyright (c) 2017-2024 Peculiar Ventures, LLC
|