@wormhole-foundation/wormhole-connect 2.5.0-beta.8-development → 2.5.0-beta.9-development
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/assets/aptos-Cutllx5i.js +3 -0
- package/dist/assets/{ccip-DoYNnipC.js → ccip-C6cz5NqJ.js} +1 -1
- package/dist/assets/events-MYC_Tkdh.js +1 -0
- package/dist/assets/{evm-Cg9_Z6ON.js → evm-DzwJdvcV.js} +2 -2
- package/dist/assets/{evm-DSNDNefN.js → evm-LJDXipdh.js} +3 -3
- package/dist/assets/{index-Bhi-Ol-W.js → index-BECoIARf.js} +1 -1
- package/dist/assets/{index-TVGCRxSf.js → index-BO5vFz_J.js} +1 -1
- package/dist/assets/{index-IFf5IHmZ.js → index-BVJL1orJ.js} +1 -1
- package/dist/assets/{index-CuW_tQti.js → index-BwNyYZxM.js} +1 -1
- package/dist/assets/{index-CLAfmegc.js → index-C6UKJUdm.js} +1 -1
- package/dist/assets/index-CJZzjIow.js +1 -0
- package/dist/assets/{index-CItGJ_dO.js → index-CSiH4dly.js} +1 -1
- package/dist/assets/{index-CrZXNnmG.js → index-CqEHg303.js} +1 -1
- package/dist/assets/{index-Ba5OrqB6.js → index-D3R8fZfr.js} +1 -1
- package/dist/assets/{index-DPi-hS0A.js → index-Ds_BlDdN.js} +2 -2
- package/dist/assets/{index-7lgoK4KP.js → index-DwJjUFus.js} +1 -1
- package/dist/assets/{index-mE5izIg0.js → index-Dxpp9NXJ.js} +1 -1
- package/dist/assets/{index-DShwbc4p.js → index-EvC_Tjca.js} +1 -1
- package/dist/assets/{index-TctZ2EQK.js → index-RZp63Yuv.js} +1 -1
- package/dist/assets/{index-CD-O7bSQ.js → index-iiAA6CTH.js} +1 -1
- package/dist/assets/{index-CmR0e8xk.js → index-m7pOREIu.js} +1 -1
- package/dist/assets/{index-D2Ev-0A_.js → index-wwvQRwKh.js} +1 -1
- package/dist/assets/{index.es-e2znZrg8.js → index.es-C9O0OD76.js} +6 -6
- package/dist/assets/solana-B0Eox3vZ.js +2 -0
- package/dist/assets/{solana-DCCw_nmt.js → solana-BGWrrBcM.js} +2 -2
- package/dist/assets/solanaEmbed.esm-C9Mwa0DJ.js +37 -0
- package/dist/assets/{sui-ByNmqUgP.js → sui-COEHPNCD.js} +2 -2
- package/dist/assets/{tokens-BSV7gluG.js → tokens-CzZADlQh.js} +1 -1
- package/dist/main.js +54 -54
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/components/v2/Button.d.ts.map +1 -1
- package/dist/src/config/tokens.d.ts +1 -2
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/icons/Chains/APT.d.ts.map +1 -1
- package/dist/src/icons/Chains/OSMO.d.ts.map +1 -1
- package/dist/src/icons/Chains/SOL.d.ts.map +1 -1
- package/dist/src/icons/Chains/SUI.d.ts.map +1 -1
- package/dist/src/icons/Chains/UNI.d.ts.map +1 -1
- package/dist/src/icons/Chains/XLAYER.d.ts.map +1 -1
- package/dist/src/icons/Routes/CCTP.d.ts.map +1 -1
- package/dist/src/icons/SvgDefs.d.ts +4 -0
- package/dist/src/icons/SvgDefs.d.ts.map +1 -0
- package/dist/src/icons/Tokens/BNB.d.ts.map +1 -1
- package/dist/src/icons/Tokens/BUSD.d.ts.map +1 -1
- package/dist/src/icons/Tokens/DAI.d.ts.map +1 -1
- package/dist/src/icons/Tokens/INJ.d.ts.map +1 -1
- package/dist/src/icons/Tokens/NTT.d.ts.map +1 -1
- package/dist/src/icons/Tokens/OSMO.d.ts.map +1 -1
- package/dist/src/icons/Tokens/POLY.d.ts.map +1 -1
- package/dist/src/icons/Tokens/SOL.d.ts.map +1 -1
- package/dist/src/icons/Tokens/USDT.d.ts.map +1 -1
- package/dist/src/icons/Tokens/WBTC.d.ts.map +1 -1
- package/dist/src/theme.d.ts +1 -0
- package/dist/src/theme.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/WalletConnector/index.d.ts.map +1 -1
- package/lib/{aptos-BG8ndPcW.mjs → aptos-CNOw8kcO.mjs} +58 -42
- package/lib/{aptos-DxDdKfid.js → aptos-CdOJRI0R.js} +1 -1
- package/lib/aptos-D_QSCYMR.js +2 -0
- package/lib/{aptos-CzXBQ5wx.mjs → aptos-tn2jO8K3.mjs} +2 -2
- package/lib/{base64-BFLeU3MK.mjs → base64-CNYMRf7S.mjs} +1 -1
- package/lib/{base64-B0sAJgP2.js → base64-Ds8M0J4c.js} +1 -1
- package/lib/{ccip-Cbpf1wJo.js → ccip-B1tGU3IZ.js} +1 -1
- package/lib/{ccip-Bm7IOUCL.mjs → ccip-CJG_3SRo.mjs} +1 -1
- package/lib/{chunk-IMTC3J2M-DwURKwAV.mjs → chunk-IMTC3J2M-C67AHEC7.mjs} +3 -3
- package/lib/{chunk-IMTC3J2M-BGGrA_WC.js → chunk-IMTC3J2M-DhIJb7y6.js} +1 -1
- package/lib/{evm-l6ukE6CV.mjs → evm-BBI017hN.mjs} +6 -6
- package/lib/{evm-DJcjc-_C.js → evm-Bb5iqY3o.js} +3 -3
- package/lib/{evm-1rdXpiv3.mjs → evm-Bx1LcD14.mjs} +5 -5
- package/lib/{evm-defRIE54.js → evm-CJNdFS0I.js} +2 -2
- package/lib/{index-B2xDzy7A.js → index-1pV294K4.js} +1 -1
- package/lib/{index-lPrZfOXi.mjs → index-4bm5RrMg.mjs} +2 -2
- package/lib/{index-BQqU6Wly.js → index-677G66rd.js} +1 -1
- package/lib/{index-CNIZSAFU.mjs → index-B8jKT8hS.mjs} +1 -1
- package/lib/{index-BloVXId9.js → index-BCRcCl3p.js} +1 -1
- package/lib/{index-BI7xYeBM.mjs → index-BHH4psXr.mjs} +34 -34
- package/lib/{index-B_MUS6zc.mjs → index-BILxmVr6.mjs} +1 -1
- package/lib/{index-BmCFLdEX.js → index-BJc9lWin.js} +1 -1
- package/lib/{index-EDktb6S4.js → index-BLlDozHI.js} +1 -1
- package/lib/{index-DtqirkNJ.js → index-BQirQqhY.js} +1 -1
- package/lib/{index-CFJ0wajU.mjs → index-BSUsUG2w.mjs} +1 -1
- package/lib/{index-5NBqfbfS.mjs → index-BhqL4iKE.mjs} +1 -1
- package/lib/{index-BegFjogX.mjs → index-BjKp2_FS.mjs} +1 -1
- package/lib/{index-BgOfWrzS.mjs → index-BkY7MdDS.mjs} +3 -3
- package/lib/{index-pNMjrl4H.js → index-BoSypod5.js} +1 -1
- package/lib/{index-BwAyuZmy.mjs → index-Bt5YpmVV.mjs} +1 -1
- package/lib/{index-OVEyrgEm.js → index-C2b7cmIz.js} +1 -1
- package/lib/{index-Dxs-J9dD.mjs → index-CEiBhm2k.mjs} +1 -1
- package/lib/{index-BWOiAGve.js → index-CF4eoE6Y.js} +1 -1
- package/lib/index-CPrRSa2B.js +374 -0
- package/lib/{index-8FtdcDhM.mjs → index-CRsKK4Wj.mjs} +3 -3
- package/lib/{index-DYb7vb-V.js → index-CS6zPhdi.js} +1 -1
- package/lib/index-CcRm6XfT.js +1 -0
- package/lib/{index-DcKSwYsA.js → index-CccxsNz1.js} +1 -1
- package/lib/{index-DicZFeR7.mjs → index-CdREsgaL.mjs} +2 -2
- package/lib/{index-D6N53skz.js → index-Cjmq0C8h.js} +1 -1
- package/lib/{index-CIC3ywMJ.js → index-CjuEl-J-.js} +1 -1
- package/lib/{index-IjHFzfzT.mjs → index-CkznFwK1.mjs} +6 -6
- package/lib/{index-CVoCwjDl.js → index-ClfCpirL.js} +1 -1
- package/lib/{index-BxQJKr_h.js → index-CpnIGxuI.js} +1 -1
- package/lib/{index-B2xZ6kt4.mjs → index-Cz7lvPUn.mjs} +29272 -27282
- package/lib/{index-CPcdt_MH.js → index-D0uASZTF.js} +1 -1
- package/lib/{index-mZitl_HA.mjs → index-D1VXS7yd.mjs} +2 -2
- package/lib/{index-Dh8BTmR_.mjs → index-DAYkgaNq.mjs} +2 -2
- package/lib/{index-EyD8yuwm.mjs → index-DDW07uFl.mjs} +2 -2
- package/lib/{index-CelSnuJI.mjs → index-DGr-Gzdg.mjs} +1 -1
- package/lib/{index-BMEVNQXB.js → index-DJrtKnre.js} +1 -1
- package/lib/{index-VhqEeF9I.mjs → index-DNZXTDXa.mjs} +2 -2
- package/lib/{index-Cx9TS0XH.mjs → index-DUOERLRj.mjs} +8 -10
- package/lib/{index-CDRjrfnz.mjs → index-DfWcL4P6.mjs} +1 -1
- package/lib/{index-C3dHeQ6j.js → index-OBs6XFzT.js} +1 -1
- package/lib/{index-BsOOcqS5.js → index-Snn4BI2R.js} +1 -1
- package/lib/{index-DJLQFXCy.js → index-aqgK4OhT.js} +1 -1
- package/lib/{index-CVlcHpc6.mjs → index-kYNBaZzW.mjs} +4 -4
- package/lib/{index-BtsATNxk.js → index-lmBnBbjj.js} +1 -1
- package/lib/{index-Bq9Xcog1.js → index-mBnUIOuA.js} +1 -1
- package/lib/{index-DW-aptRt.mjs → index-tGvYiLKw.mjs} +2 -2
- package/lib/{index-NgGkgCpa.mjs → index-wMpCRV7E.mjs} +1 -1
- package/lib/{index.es-B_1fLcW-.mjs → index.es-D5MZxe7R.mjs} +5 -5
- package/lib/{index.es-DCm0D4jx.js → index.es-Dvk4tueQ.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-9vI5B7UW.mjs → signer-CNO6jgxp.mjs} +3 -3
- package/lib/{signer-BQc7Wphd.js → signer-aa3XAM1g.js} +1 -1
- package/lib/solana-CFESTPH_.js +1 -0
- package/lib/{solana-DuIMWd_Y.js → solana-CLTYTqZY.js} +1 -1
- package/lib/solana-DJmdwuns.mjs +17 -0
- package/lib/{solana-CjANz7Fi.mjs → solana-rVF30oAK.mjs} +4 -4
- package/lib/{solanaEmbed.esm-Ck3n8zZh.mjs → solanaEmbed.esm-BhoGryRA.mjs} +2 -2
- package/lib/{solanaEmbed.esm-CIh3hnnF.js → solanaEmbed.esm-D4kizK0g.js} +1 -1
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/components/v2/Button.d.ts.map +1 -1
- package/lib/src/config/tokens.d.ts +1 -2
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/icons/Chains/APT.d.ts.map +1 -1
- package/lib/src/icons/Chains/OSMO.d.ts.map +1 -1
- package/lib/src/icons/Chains/SOL.d.ts.map +1 -1
- package/lib/src/icons/Chains/SUI.d.ts.map +1 -1
- package/lib/src/icons/Chains/UNI.d.ts.map +1 -1
- package/lib/src/icons/Chains/XLAYER.d.ts.map +1 -1
- package/lib/src/icons/Routes/CCTP.d.ts.map +1 -1
- package/lib/src/icons/SvgDefs.d.ts +4 -0
- package/lib/src/icons/SvgDefs.d.ts.map +1 -0
- package/lib/src/icons/Tokens/BNB.d.ts.map +1 -1
- package/lib/src/icons/Tokens/BUSD.d.ts.map +1 -1
- package/lib/src/icons/Tokens/DAI.d.ts.map +1 -1
- package/lib/src/icons/Tokens/INJ.d.ts.map +1 -1
- package/lib/src/icons/Tokens/NTT.d.ts.map +1 -1
- package/lib/src/icons/Tokens/OSMO.d.ts.map +1 -1
- package/lib/src/icons/Tokens/POLY.d.ts.map +1 -1
- package/lib/src/icons/Tokens/SOL.d.ts.map +1 -1
- package/lib/src/icons/Tokens/USDT.d.ts.map +1 -1
- package/lib/src/icons/Tokens/WBTC.d.ts.map +1 -1
- package/lib/src/theme.d.ts +1 -0
- package/lib/src/theme.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/WalletConnector/index.d.ts.map +1 -1
- package/lib/{sui-DXobmCof.mjs → sui-BbBH_HT2.mjs} +1 -1
- package/lib/{sui-C3Hk0XoB.js → sui-CjVsY3mn.js} +1 -1
- package/lib/{sui-BDz0ND8Q.js → sui-DP2zgcH5.js} +1 -1
- package/lib/{sui-BaNlF5eU.mjs → sui-DPCoQlHx.mjs} +5 -5
- package/lib/{tokens-Dr0VPGjM.js → tokens-DbXdl7J8.js} +1 -1
- package/lib/{tokens-BMcb2BBp.mjs → tokens-TdYDSawW.mjs} +2 -2
- package/package.json +19 -18
- package/dist/assets/aptos-h3S6O6Gp.js +0 -3
- package/dist/assets/index-BMLcq4no.js +0 -1
- package/dist/assets/solana-BNhbIgt5.js +0 -2
- package/dist/assets/solanaEmbed.esm-D6aTKNPa.js +0 -37
- package/dist/src/utils/theme.d.ts +0 -11
- package/dist/src/utils/theme.d.ts.map +0 -1
- package/lib/aptos-BI3SOFlh.js +0 -2
- package/lib/index-B-3CdahH.js +0 -374
- package/lib/index-BjH74c5e.js +0 -1
- package/lib/solana-3AW1_2QL.js +0 -1
- package/lib/solana-DyGkYgAN.mjs +0 -17
- package/lib/src/utils/theme.d.ts +0 -11
- package/lib/src/utils/theme.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _e,c2 as yf,b as or,c7 as zi,d as ne,c8 as vt,c9 as ou,ca as ha,s as Qr,cd as fu}from"../main.js";var Zi={},vf={exports:{}},Hi={};(function(e){e.fetch=i(_e.fetch)&&i(_e.ReadableStream),e.writableStream=i(_e.WritableStream),e.abortController=i(_e.AbortController);var t;function r(){if(t!==void 0)return t;if(_e.XMLHttpRequest){t=new _e.XMLHttpRequest;try{t.open("GET",_e.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(a){var o=r();if(!o)return!1;try{return o.responseType=a,o.responseType===a}catch{}return!1}e.arraybuffer=e.fetch||n("arraybuffer"),e.msstream=!e.fetch&&n("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&n("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||(r()?i(r().overrideMimeType):!1);function i(a){return typeof a=="function"}t=null})(Hi);var en={},Ei={exports:{}},gf=yf.EventEmitter,_n,da;function lu(){if(da)return _n;da=1;function e(D,k){var F=Object.keys(D);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(D);k&&(M=M.filter(function(T){return Object.getOwnPropertyDescriptor(D,T).enumerable})),F.push.apply(F,M)}return F}function t(D){for(var k=1;k<arguments.length;k++){var F=arguments[k]!=null?arguments[k]:{};k%2?e(Object(F),!0).forEach(function(M){r(D,M,F[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(F)):e(Object(F)).forEach(function(M){Object.defineProperty(D,M,Object.getOwnPropertyDescriptor(F,M))})}return D}function r(D,k,F){return k=o(k),k in D?Object.defineProperty(D,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):D[k]=F,D}function n(D,k){if(!(D instanceof k))throw new TypeError("Cannot call a class as a function")}function i(D,k){for(var F=0;F<k.length;F++){var M=k[F];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(D,o(M.key),M)}}function a(D,k,F){return k&&i(D.prototype,k),Object.defineProperty(D,"prototype",{writable:!1}),D}function o(D){var k=f(D,"string");return typeof k=="symbol"?k:String(k)}function f(D,k){if(typeof D!="object"||D===null)return D;var F=D[Symbol.toPrimitive];if(F!==void 0){var M=F.call(D,k);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(D)}var d=or,l=d.Buffer,u=zi,m=u.inspect,_=m&&m.custom||"inspect";function S(D,k,F){l.prototype.copy.call(D,k,F)}return _n=function(){function D(){n(this,D),this.head=null,this.tail=null,this.length=0}return a(D,[{key:"push",value:function(F){var M={data:F,next:null};this.length>0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(F){var M={data:F,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var F=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,F}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(F){if(this.length===0)return"";for(var M=this.head,T=""+M.data;M=M.next;)T+=F+M.data;return T}},{key:"concat",value:function(F){if(this.length===0)return l.alloc(0);for(var M=l.allocUnsafe(F>>>0),T=this.head,R=0;T;)S(T.data,M,R),R+=T.data.length,T=T.next;return M}},{key:"consume",value:function(F,M){var T;return F<this.head.data.length?(T=this.head.data.slice(0,F),this.head.data=this.head.data.slice(F)):F===this.head.data.length?T=this.shift():T=M?this._getString(F):this._getBuffer(F),T}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(F){var M=this.head,T=1,R=M.data;for(F-=R.length;M=M.next;){var P=M.data,O=F>P.length?P.length:F;if(O===P.length?R+=P:R+=P.slice(0,F),F-=O,F===0){O===P.length?(++T,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=P.slice(O));break}++T}return this.length-=T,R}},{key:"_getBuffer",value:function(F){var M=l.allocUnsafe(F),T=this.head,R=1;for(T.data.copy(M),F-=T.data.length;T=T.next;){var P=T.data,O=F>P.length?P.length:F;if(P.copy(M,M.length-F,0,O),F-=O,F===0){O===P.length?(++R,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=P.slice(O));break}++R}return this.length-=R,M}},{key:_,value:function(F,M){return m(this,t(t({},M),{},{depth:0,customInspect:!1}))}}]),D}(),_n}function uu(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ne.process.nextTick(Si,this,e)):ne.process.nextTick(Si,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?ne.process.nextTick(Nr,r):(r._writableState.errorEmitted=!0,ne.process.nextTick(pa,r,a)):ne.process.nextTick(pa,r,a):t?(ne.process.nextTick(Nr,r),t(a)):ne.process.nextTick(Nr,r)}),this)}function pa(e,t){Si(e,t),Nr(e)}function Nr(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function su(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Si(e,t){e.emit("error",t)}function cu(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var _f={destroy:uu,undestroy:su,errorOrDestroy:cu},Pt={};function hu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var bf={};function Be(e,t,r){r||(r=Error);function n(a,o,f){return typeof t=="string"?t:t(a,o,f)}var i=function(a){hu(o,a);function o(f,d,l){return a.call(this,n(f,d,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,bf[e]=i}function ya(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function du(e,t,r){return e.substr(0,t.length)===t}function pu(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function yu(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Be("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Be("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&du(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(pu(e," argument"))i="The ".concat(e," ").concat(n," ").concat(ya(t,"type"));else{var a=yu(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(ya(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Be("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Be("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Be("ERR_STREAM_PREMATURE_CLOSE","Premature close");Be("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Be("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Be("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Be("ERR_STREAM_WRITE_AFTER_END","write after end");Be("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Be("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Be("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Pt.codes=bf;var vu=Pt.codes.ERR_INVALID_OPT_VALUE;function gu(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function _u(e,t,r,n){var i=gu(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new vu(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var mf={getHighWaterMark:_u},bn,va;function wf(){if(va)return bn;va=1,bn=q;function e(c){var v=this;this.next=null,this.entry=null,this.finish=function(){g(v,c)}}var t;q.WritableState=B;var r={deprecate:ou},n=gf,i=or.Buffer,a=(typeof _e<"u"?_e:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(c){return i.from(c)}function f(c){return i.isBuffer(c)||c instanceof a}var d=_f,l=mf,u=l.getHighWaterMark,m=Pt.codes,_=m.ERR_INVALID_ARG_TYPE,S=m.ERR_METHOD_NOT_IMPLEMENTED,D=m.ERR_MULTIPLE_CALLBACK,k=m.ERR_STREAM_CANNOT_PIPE,F=m.ERR_STREAM_DESTROYED,M=m.ERR_STREAM_NULL_VALUES,T=m.ERR_STREAM_WRITE_AFTER_END,R=m.ERR_UNKNOWN_ENCODING,P=d.errorOrDestroy;vt(q,n);function O(){}function B(c,v,E){t=t||zt(),c=c||{},typeof E!="boolean"&&(E=v instanceof t),this.objectMode=!!c.objectMode,E&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=u(this,c,"writableHighWaterMark",E),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var L=c.decodeStrings===!1;this.decodeStrings=!L,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(x){ie(v,x)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}B.prototype.getBuffer=function(){for(var v=this.bufferedRequest,E=[];v;)E.push(v),v=v.next;return E},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var U;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(U=Function.prototype[Symbol.hasInstance],Object.defineProperty(q,Symbol.hasInstance,{value:function(v){return U.call(this,v)?!0:this!==q?!1:v&&v._writableState instanceof B}})):U=function(v){return v instanceof this};function q(c){t=t||zt();var v=this instanceof t;if(!v&&!U.call(q,this))return new q(c);this._writableState=new B(c,this,v),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),n.call(this)}q.prototype.pipe=function(){P(this,new k)};function j(c,v){var E=new T;P(c,E),ne.process.nextTick(v,E)}function te(c,v,E,L){var x;return E===null?x=new M:typeof E!="string"&&!v.objectMode&&(x=new _("chunk",["string","Buffer"],E)),x?(P(c,x),ne.process.nextTick(L,x),!1):!0}q.prototype.write=function(c,v,E){var L=this._writableState,x=!1,h=!L.objectMode&&f(c);return h&&!i.isBuffer(c)&&(c=o(c)),typeof v=="function"&&(E=v,v=null),h?v="buffer":v||(v=L.defaultEncoding),typeof E!="function"&&(E=O),L.ending?j(this,E):(h||te(this,L,c,E))&&(L.pendingcb++,x=b(this,L,h,c,v,E)),x},q.prototype.cork=function(){this._writableState.corked++},q.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&z(this,c))},q.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new R(v);return this._writableState.defaultEncoding=v,this},Object.defineProperty(q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X(c,v,E){return!c.objectMode&&c.decodeStrings!==!1&&typeof v=="string"&&(v=i.from(v,E)),v}Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b(c,v,E,L,x,h){if(!E){var p=X(v,L,x);L!==p&&(E=!0,x="buffer",L=p)}var $=v.objectMode?1:L.length;v.length+=$;var V=v.length<v.highWaterMark;if(V||(v.needDrain=!0),v.writing||v.corked){var se=v.lastBufferedRequest;v.lastBufferedRequest={chunk:L,encoding:x,isBuf:E,callback:h,next:null},se?se.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else C(c,v,!1,$,L,x,h);return V}function C(c,v,E,L,x,h,p){v.writelen=L,v.writecb=p,v.writing=!0,v.sync=!0,v.destroyed?v.onwrite(new F("write")):E?c._writev(x,v.onwrite):c._write(x,h,v.onwrite),v.sync=!1}function J(c,v,E,L,x){--v.pendingcb,E?(ne.process.nextTick(x,L),ne.process.nextTick(w,c,v),c._writableState.errorEmitted=!0,P(c,L)):(x(L),c._writableState.errorEmitted=!0,P(c,L),w(c,v))}function re(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function ie(c,v){var E=c._writableState,L=E.sync,x=E.writecb;if(typeof x!="function")throw new D;if(re(E),v)J(c,E,L,v,x);else{var h=I(E)||c.destroyed;!h&&!E.corked&&!E.bufferProcessing&&E.bufferedRequest&&z(c,E),L?ne.process.nextTick(ue,c,E,h,x):ue(c,E,h,x)}}function ue(c,v,E,L){E||ae(c,v),v.pendingcb--,L(),w(c,v)}function ae(c,v){v.length===0&&v.needDrain&&(v.needDrain=!1,c.emit("drain"))}function z(c,v){v.bufferProcessing=!0;var E=v.bufferedRequest;if(c._writev&&E&&E.next){var L=v.bufferedRequestCount,x=new Array(L),h=v.corkedRequestsFree;h.entry=E;for(var p=0,$=!0;E;)x[p]=E,E.isBuf||($=!1),E=E.next,p+=1;x.allBuffers=$,C(c,v,!0,v.length,x,"",h.finish),v.pendingcb++,v.lastBufferedRequest=null,h.next?(v.corkedRequestsFree=h.next,h.next=null):v.corkedRequestsFree=new e(v),v.bufferedRequestCount=0}else{for(;E;){var V=E.chunk,se=E.encoding,oe=E.callback,de=v.objectMode?1:V.length;if(C(c,v,!1,de,V,se,oe),E=E.next,v.bufferedRequestCount--,v.writing)break}E===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=E,v.bufferProcessing=!1}q.prototype._write=function(c,v,E){E(new S("_write()"))},q.prototype._writev=null,q.prototype.end=function(c,v,E){var L=this._writableState;return typeof c=="function"?(E=c,c=null,v=null):typeof v=="function"&&(E=v,v=null),c!=null&&this.write(c,v),L.corked&&(L.corked=1,this.uncork()),L.ending||y(this,L,E),this},Object.defineProperty(q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function I(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function H(c,v){c._final(function(E){v.pendingcb--,E&&P(c,E),v.prefinished=!0,c.emit("prefinish"),w(c,v)})}function W(c,v){!v.prefinished&&!v.finalCalled&&(typeof c._final=="function"&&!v.destroyed?(v.pendingcb++,v.finalCalled=!0,ne.process.nextTick(H,c,v)):(v.prefinished=!0,c.emit("prefinish")))}function w(c,v){var E=I(v);if(E&&(W(c,v),v.pendingcb===0&&(v.finished=!0,c.emit("finish"),v.autoDestroy))){var L=c._readableState;(!L||L.autoDestroy&&L.endEmitted)&&c.destroy()}return E}function y(c,v,E){v.ending=!0,w(c,v),E&&(v.finished?ne.process.nextTick(E):c.once("finish",E)),v.ended=!0,c.writable=!1}function g(c,v,E){var L=c.entry;for(c.entry=null;L;){var x=L.callback;v.pendingcb--,x(E),L=L.next}v.corkedRequestsFree.next=c}return Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(v){this._writableState&&(this._writableState.destroyed=v)}}),q.prototype.destroy=d.destroy,q.prototype._undestroy=d.undestroy,q.prototype._destroy=function(c,v){v(c)},bn}var mn,ga;function zt(){if(ga)return mn;ga=1;var e=Object.keys||function(l){var u=[];for(var m in l)u.push(m);return u};mn=o;var t=Sf(),r=wf();vt(o,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var a=n[i];o.prototype[a]||(o.prototype[a]=r.prototype[a])}function o(l){if(!(this instanceof o))return new o(l);t.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",f)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function f(){this._writableState.ended||ne.process.nextTick(d,this)}function d(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),mn}var _a=Pt.codes.ERR_STREAM_PREMATURE_CLOSE;function bu(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function mu(){}function wu(e){return e.setHeader&&typeof e.abort=="function"}function Ef(e,t,r){if(typeof t=="function")return Ef(e,null,t);t||(t={}),r=bu(r||mu);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||f()},o=e._writableState&&e._writableState.finished,f=function(){i=!1,o=!0,n||r.call(e)},d=e._readableState&&e._readableState.endEmitted,l=function(){n=!1,d=!0,i||r.call(e)},u=function(D){r.call(e,D)},m=function(){var D;if(n&&!d)return(!e._readableState||!e._readableState.ended)&&(D=new _a),r.call(e,D);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(D=new _a),r.call(e,D)},_=function(){e.req.on("finish",f)};return wu(e)?(e.on("complete",f),e.on("abort",m),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",f),t.error!==!1&&e.on("error",u),e.on("close",m),function(){e.removeListener("complete",f),e.removeListener("abort",m),e.removeListener("request",_),e.req&&e.req.removeListener("finish",f),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",m)}}var Wi=Ef,wn,ba;function Eu(){if(ba)return wn;ba=1;var e;function t(R,P,O){return P=r(P),P in R?Object.defineProperty(R,P,{value:O,enumerable:!0,configurable:!0,writable:!0}):R[P]=O,R}function r(R){var P=n(R,"string");return typeof P=="symbol"?P:String(P)}function n(R,P){if(typeof R!="object"||R===null)return R;var O=R[Symbol.toPrimitive];if(O!==void 0){var B=O.call(R,P);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(R)}var i=Wi,a=Symbol("lastResolve"),o=Symbol("lastReject"),f=Symbol("error"),d=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),m=Symbol("stream");function _(R,P){return{value:R,done:P}}function S(R){var P=R[a];if(P!==null){var O=R[m].read();O!==null&&(R[l]=null,R[a]=null,R[o]=null,P(_(O,!1)))}}function D(R){ne.process.nextTick(S,R)}function k(R,P){return function(O,B){R.then(function(){if(P[d]){O(_(void 0,!0));return}P[u](O,B)},B)}}var F=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((e={get stream(){return this[m]},next:function(){var P=this,O=this[f];if(O!==null)return Promise.reject(O);if(this[d])return Promise.resolve(_(void 0,!0));if(this[m].destroyed)return new Promise(function(j,te){ne.process.nextTick(function(){P[f]?te(P[f]):j(_(void 0,!0))})});var B=this[l],U;if(B)U=new Promise(k(B,this));else{var q=this[m].read();if(q!==null)return Promise.resolve(_(q,!1));U=new Promise(this[u])}return this[l]=U,U}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var P=this;return new Promise(function(O,B){P[m].destroy(null,function(U){if(U){B(U);return}O(_(void 0,!0))})})}),e),F),T=function(P){var O,B=Object.create(M,(O={},t(O,m,{value:P,writable:!0}),t(O,a,{value:null,writable:!0}),t(O,o,{value:null,writable:!0}),t(O,f,{value:null,writable:!0}),t(O,d,{value:P._readableState.endEmitted,writable:!0}),t(O,u,{value:function(q,j){var te=B[m].read();te?(B[l]=null,B[a]=null,B[o]=null,q(_(te,!1))):(B[a]=q,B[o]=j)},writable:!0}),O));return B[l]=null,i(P,function(U){if(U&&U.code!=="ERR_STREAM_PREMATURE_CLOSE"){var q=B[o];q!==null&&(B[l]=null,B[a]=null,B[o]=null,q(U)),B[f]=U;return}var j=B[a];j!==null&&(B[l]=null,B[a]=null,B[o]=null,j(_(void 0,!0))),B[d]=!0}),P.on("readable",D.bind(null,B)),B};return wn=T,wn}var En,ma;function Su(){return ma||(ma=1,En=function(){throw new Error("Readable.from is not available in the browser")}),En}var Sn,wa;function Sf(){if(wa)return Sn;wa=1,Sn=j;var e;j.ReadableState=q,yf.EventEmitter;var t=function(p,$){return p.listeners($).length},r=gf,n=or.Buffer,i=(typeof _e<"u"?_e:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(h){return n.from(h)}function o(h){return n.isBuffer(h)||h instanceof i}var f=zi,d;f&&f.debuglog?d=f.debuglog("stream"):d=function(){};var l=lu(),u=_f,m=mf,_=m.getHighWaterMark,S=Pt.codes,D=S.ERR_INVALID_ARG_TYPE,k=S.ERR_STREAM_PUSH_AFTER_EOF,F=S.ERR_METHOD_NOT_IMPLEMENTED,M=S.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,T,R,P;vt(j,r);var O=u.errorOrDestroy,B=["error","close","destroy","pause","resume"];function U(h,p,$){if(typeof h.prependListener=="function")return h.prependListener(p,$);!h._events||!h._events[p]?h.on(p,$):Array.isArray(h._events[p])?h._events[p].unshift($):h._events[p]=[$,h._events[p]]}function q(h,p,$){e=e||zt(),h=h||{},typeof $!="boolean"&&($=p instanceof e),this.objectMode=!!h.objectMode,$&&(this.objectMode=this.objectMode||!!h.readableObjectMode),this.highWaterMark=_(this,h,"readableHighWaterMark",$),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=h.emitClose!==!1,this.autoDestroy=!!h.autoDestroy,this.destroyed=!1,this.defaultEncoding=h.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,h.encoding&&(T||(T=ha().StringDecoder),this.decoder=new T(h.encoding),this.encoding=h.encoding)}function j(h){if(e=e||zt(),!(this instanceof j))return new j(h);var p=this instanceof e;this._readableState=new q(h,this,p),this.readable=!0,h&&(typeof h.read=="function"&&(this._read=h.read),typeof h.destroy=="function"&&(this._destroy=h.destroy)),r.call(this)}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(p){this._readableState&&(this._readableState.destroyed=p)}}),j.prototype.destroy=u.destroy,j.prototype._undestroy=u.undestroy,j.prototype._destroy=function(h,p){p(h)},j.prototype.push=function(h,p){var $=this._readableState,V;return $.objectMode?V=!0:typeof h=="string"&&(p=p||$.defaultEncoding,p!==$.encoding&&(h=n.from(h,p),p=""),V=!0),te(this,h,p,!1,V)},j.prototype.unshift=function(h){return te(this,h,null,!0,!1)};function te(h,p,$,V,se){d("readableAddChunk",p);var oe=h._readableState;if(p===null)oe.reading=!1,ie(h,oe);else{var de;if(se||(de=b(oe,p)),de)O(h,de);else if(oe.objectMode||p&&p.length>0)if(typeof p!="string"&&!oe.objectMode&&Object.getPrototypeOf(p)!==n.prototype&&(p=a(p)),V)oe.endEmitted?O(h,new M):X(h,oe,p,!0);else if(oe.ended)O(h,new k);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!$?(p=oe.decoder.write(p),oe.objectMode||p.length!==0?X(h,oe,p,!1):z(h,oe)):X(h,oe,p,!1)}else V||(oe.reading=!1,z(h,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function X(h,p,$,V){p.flowing&&p.length===0&&!p.sync?(p.awaitDrain=0,h.emit("data",$)):(p.length+=p.objectMode?1:$.length,V?p.buffer.unshift($):p.buffer.push($),p.needReadable&&ue(h)),z(h,p)}function b(h,p){var $;return!o(p)&&typeof p!="string"&&p!==void 0&&!h.objectMode&&($=new D("chunk",["string","Buffer","Uint8Array"],p)),$}j.prototype.isPaused=function(){return this._readableState.flowing===!1},j.prototype.setEncoding=function(h){T||(T=ha().StringDecoder);var p=new T(h);this._readableState.decoder=p,this._readableState.encoding=this._readableState.decoder.encoding;for(var $=this._readableState.buffer.head,V="";$!==null;)V+=p.write($.data),$=$.next;return this._readableState.buffer.clear(),V!==""&&this._readableState.buffer.push(V),this._readableState.length=V.length,this};var C=1073741824;function J(h){return h>=C?h=C:(h--,h|=h>>>1,h|=h>>>2,h|=h>>>4,h|=h>>>8,h|=h>>>16,h++),h}function re(h,p){return h<=0||p.length===0&&p.ended?0:p.objectMode?1:h!==h?p.flowing&&p.length?p.buffer.head.data.length:p.length:(h>p.highWaterMark&&(p.highWaterMark=J(h)),h<=p.length?h:p.ended?p.length:(p.needReadable=!0,0))}j.prototype.read=function(h){d("read",h),h=parseInt(h,10);var p=this._readableState,$=h;if(h!==0&&(p.emittedReadable=!1),h===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return d("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?E(this):ue(this),null;if(h=re(h,p),h===0&&p.ended)return p.length===0&&E(this),null;var V=p.needReadable;d("need readable",V),(p.length===0||p.length-h<p.highWaterMark)&&(V=!0,d("length less than watermark",V)),p.ended||p.reading?(V=!1,d("reading or ended",V)):V&&(d("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(h=re($,p)));var se;return h>0?se=v(h,p):se=null,se===null?(p.needReadable=p.length<=p.highWaterMark,h=0):(p.length-=h,p.awaitDrain=0),p.length===0&&(p.ended||(p.needReadable=!0),$!==h&&p.ended&&E(this)),se!==null&&this.emit("data",se),se};function ie(h,p){if(d("onEofChunk"),!p.ended){if(p.decoder){var $=p.decoder.end();$&&$.length&&(p.buffer.push($),p.length+=p.objectMode?1:$.length)}p.ended=!0,p.sync?ue(h):(p.needReadable=!1,p.emittedReadable||(p.emittedReadable=!0,ae(h)))}}function ue(h){var p=h._readableState;d("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(d("emitReadable",p.flowing),p.emittedReadable=!0,ne.process.nextTick(ae,h))}function ae(h){var p=h._readableState;d("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&(p.length||p.ended)&&(h.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,c(h)}function z(h,p){p.readingMore||(p.readingMore=!0,ne.process.nextTick(I,h,p))}function I(h,p){for(;!p.reading&&!p.ended&&(p.length<p.highWaterMark||p.flowing&&p.length===0);){var $=p.length;if(d("maybeReadMore read 0"),h.read(0),$===p.length)break}p.readingMore=!1}j.prototype._read=function(h){O(this,new F("_read()"))},j.prototype.pipe=function(h,p){var $=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=h;break;case 1:V.pipes=[V.pipes,h];break;default:V.pipes.push(h);break}V.pipesCount+=1,d("pipe count=%d opts=%j",V.pipesCount,p);var se=(!p||p.end!==!1)&&h!==ne.process.stdout&&h!==ne.process.stderr,oe=se?be:G;V.endEmitted?ne.process.nextTick(oe):$.once("end",oe),h.on("unpipe",de);function de(Q,ee){d("onunpipe"),Q===$&&ee&&ee.hasUnpiped===!1&&(ee.hasUnpiped=!0,Ie())}function be(){d("onend"),h.end()}var Z=H($);h.on("drain",Z);var je=!1;function Ie(){d("cleanup"),h.removeListener("close",s),h.removeListener("finish",A),h.removeListener("drain",Z),h.removeListener("error",Y),h.removeListener("unpipe",de),$.removeListener("end",be),$.removeListener("end",G),$.removeListener("data",N),je=!0,V.awaitDrain&&(!h._writableState||h._writableState.needDrain)&&Z()}$.on("data",N);function N(Q){d("ondata");var ee=h.write(Q);d("dest.write",ee),ee===!1&&((V.pipesCount===1&&V.pipes===h||V.pipesCount>1&&x(V.pipes,h)!==-1)&&!je&&(d("false write response, pause",V.awaitDrain),V.awaitDrain++),$.pause())}function Y(Q){d("onerror",Q),G(),h.removeListener("error",Y),t(h,"error")===0&&O(h,Q)}U(h,"error",Y);function s(){h.removeListener("finish",A),G()}h.once("close",s);function A(){d("onfinish"),h.removeListener("close",s),G()}h.once("finish",A);function G(){d("unpipe"),$.unpipe(h)}return h.emit("pipe",$),V.flowing||(d("pipe resume"),$.resume()),h};function H(h){return function(){var $=h._readableState;d("pipeOnDrain",$.awaitDrain),$.awaitDrain&&$.awaitDrain--,$.awaitDrain===0&&t(h,"data")&&($.flowing=!0,c(h))}}j.prototype.unpipe=function(h){var p=this._readableState,$={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return h&&h!==p.pipes?this:(h||(h=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,h&&h.emit("unpipe",this,$),this);if(!h){var V=p.pipes,se=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var oe=0;oe<se;oe++)V[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var de=x(p.pipes,h);return de===-1?this:(p.pipes.splice(de,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),h.emit("unpipe",this,$),this)},j.prototype.on=function(h,p){var $=r.prototype.on.call(this,h,p),V=this._readableState;return h==="data"?(V.readableListening=this.listenerCount("readable")>0,V.flowing!==!1&&this.resume()):h==="readable"&&!V.endEmitted&&!V.readableListening&&(V.readableListening=V.needReadable=!0,V.flowing=!1,V.emittedReadable=!1,d("on readable",V.length,V.reading),V.length?ue(this):V.reading||ne.process.nextTick(w,this)),$},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(h,p){var $=r.prototype.removeListener.call(this,h,p);return h==="readable"&&ne.process.nextTick(W,this),$},j.prototype.removeAllListeners=function(h){var p=r.prototype.removeAllListeners.apply(this,arguments);return(h==="readable"||h===void 0)&&ne.process.nextTick(W,this),p};function W(h){var p=h._readableState;p.readableListening=h.listenerCount("readable")>0,p.resumeScheduled&&!p.paused?p.flowing=!0:h.listenerCount("data")>0&&h.resume()}function w(h){d("readable nexttick read 0"),h.read(0)}j.prototype.resume=function(){var h=this._readableState;return h.flowing||(d("resume"),h.flowing=!h.readableListening,y(this,h)),h.paused=!1,this};function y(h,p){p.resumeScheduled||(p.resumeScheduled=!0,ne.process.nextTick(g,h,p))}function g(h,p){d("resume",p.reading),p.reading||h.read(0),p.resumeScheduled=!1,h.emit("resume"),c(h),p.flowing&&!p.reading&&h.read(0)}j.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(h){var p=h._readableState;for(d("flow",p.flowing);p.flowing&&h.read()!==null;);}j.prototype.wrap=function(h){var p=this,$=this._readableState,V=!1;h.on("end",function(){if(d("wrapped end"),$.decoder&&!$.ended){var de=$.decoder.end();de&&de.length&&p.push(de)}p.push(null)}),h.on("data",function(de){if(d("wrapped data"),$.decoder&&(de=$.decoder.write(de)),!($.objectMode&&de==null)&&!(!$.objectMode&&(!de||!de.length))){var be=p.push(de);be||(V=!0,h.pause())}});for(var se in h)this[se]===void 0&&typeof h[se]=="function"&&(this[se]=function(be){return function(){return h[be].apply(h,arguments)}}(se));for(var oe=0;oe<B.length;oe++)h.on(B[oe],this.emit.bind(this,B[oe]));return this._read=function(de){d("wrapped _read",de),V&&(V=!1,h.resume())},this},typeof Symbol=="function"&&(j.prototype[Symbol.asyncIterator]=function(){return R===void 0&&(R=Eu()),R(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){this._readableState&&(this._readableState.flowing=p)}}),j._fromList=v,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function v(h,p){if(p.length===0)return null;var $;return p.objectMode?$=p.buffer.shift():!h||h>=p.length?(p.decoder?$=p.buffer.join(""):p.buffer.length===1?$=p.buffer.first():$=p.buffer.concat(p.length),p.buffer.clear()):$=p.buffer.consume(h,p.decoder),$}function E(h){var p=h._readableState;d("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,ne.process.nextTick(L,p,h))}function L(h,p){if(d("endReadableNT",h.endEmitted,h.length),!h.endEmitted&&h.length===0&&(h.endEmitted=!0,p.readable=!1,p.emit("end"),h.autoDestroy)){var $=p._writableState;(!$||$.autoDestroy&&$.finished)&&p.destroy()}}typeof Symbol=="function"&&(j.from=function(h,p){return P===void 0&&(P=Su()),P(j,h,p)});function x(h,p){for(var $=0,V=h.length;$<V;$++)if(h[$]===p)return $;return-1}return Sn}var Rf=ot,tn=Pt.codes,Ru=tn.ERR_METHOD_NOT_IMPLEMENTED,Au=tn.ERR_MULTIPLE_CALLBACK,Ou=tn.ERR_TRANSFORM_ALREADY_TRANSFORMING,Tu=tn.ERR_TRANSFORM_WITH_LENGTH_0,rn=zt();vt(ot,rn);function Iu(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Au);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ot(e){if(!(this instanceof ot))return new ot(e);rn.call(this,e),this._transformState={afterTransform:Iu.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Pu)}function Pu(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Ea(e,t,r)}):Ea(this,null,null)}ot.prototype.push=function(e,t){return this._transformState.needTransform=!1,rn.prototype.push.call(this,e,t)};ot.prototype._transform=function(e,t,r){r(new Ru("_transform()"))};ot.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ot.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ot.prototype._destroy=function(e,t){rn.prototype._destroy.call(this,e,function(r){t(r)})};function Ea(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Tu;if(e._transformState.transforming)throw new Ou;return e.push(null)}var Nu=fr,Af=Rf;vt(fr,Af);function fr(e){if(!(this instanceof fr))return new fr(e);Af.call(this,e)}fr.prototype._transform=function(e,t,r){r(null,e)};var Rn;function Du(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Of=Pt.codes,Lu=Of.ERR_MISSING_ARGS,Mu=Of.ERR_STREAM_DESTROYED;function Sa(e){if(e)throw e}function ku(e){return e.setHeader&&typeof e.abort=="function"}function Fu(e,t,r,n){n=Du(n);var i=!1;e.on("close",function(){i=!0}),Rn===void 0&&(Rn=Wi),Rn(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,ku(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Mu("pipe"))}}}function Ra(e){e()}function ju(e,t){return e.pipe(t)}function xu(e){return!e.length||typeof e[e.length-1]!="function"?Sa:e.pop()}function $u(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=xu(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Lu("streams");var i,a=t.map(function(o,f){var d=f<t.length-1,l=f>0;return Fu(o,d,l,function(u){i||(i=u),u&&a.forEach(Ra),!d&&(a.forEach(Ra),n(i))})});return t.reduce(ju)}var Cu=$u;(function(e,t){t=e.exports=Sf(),t.Stream=t,t.Readable=t,t.Writable=wf(),t.Duplex=zt(),t.Transform=Rf,t.PassThrough=Nu,t.finished=Wi,t.pipeline=Cu})(Ei,Ei.exports);var Tf=Ei.exports,Aa=Hi,Bu=vt,If=Tf,Er=en.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Gi=en.IncomingMessage=function(e,t,r,n){var i=this;if(If.Readable.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",function(){ne.process.nextTick(function(){i.emit("close")})}),r==="fetch"){let u=function(){o.read().then(function(m){if(!i._destroyed){if(n(m.done),m.done){i.push(null);return}i.push(ne.Buffer.from(m.value)),u()}}).catch(function(m){n(!0),i._destroyed||i.emit("error",m)})};if(i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText,t.headers.forEach(function(m,_){i.headers[_.toLowerCase()]=m,i.rawHeaders.push(_,m)}),Aa.writableStream){var a=new WritableStream({write:function(m){return n(!1),new Promise(function(_,S){i._destroyed?S():i.push(ne.Buffer.from(m))?_():i._resumeFetch=_})},close:function(){n(!0),i._destroyed||i.push(null)},abort:function(m){n(!0),i._destroyed||i.emit("error",m)}});try{t.body.pipeTo(a).catch(function(m){n(!0),i._destroyed||i.emit("error",m)});return}catch{}}var o=t.body.getReader();u()}else{i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText;var f=e.getAllResponseHeaders().split(/\r?\n/);if(f.forEach(function(u){var m=u.match(/^([^:]+):\s*(.*)/);if(m){var _=m[1].toLowerCase();_==="set-cookie"?(i.headers[_]===void 0&&(i.headers[_]=[]),i.headers[_].push(m[2])):i.headers[_]!==void 0?i.headers[_]+=", "+m[2]:i.headers[_]=m[2],i.rawHeaders.push(m[1],m[2])}}),i._charset="x-user-defined",!Aa.overrideMimeType){var d=i.rawHeaders["mime-type"];if(d){var l=d.match(/;\s*charset=([^;])(;|$)/);l&&(i._charset=l[1].toLowerCase())}i._charset||(i._charset="utf-8")}}};Bu(Gi,If.Readable);Gi.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())};Gi.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,n=null;switch(t._mode){case"text":if(n=r.responseText,n.length>t._pos){var i=n.substr(t._pos);if(t._charset==="x-user-defined"){for(var a=ne.Buffer.alloc(i.length),o=0;o<i.length;o++)a[o]=i.charCodeAt(o)&255;t.push(a)}else t.push(i,t._charset);t._pos=n.length}break;case"arraybuffer":if(r.readyState!==Er.DONE||!r.response)break;n=r.response,t.push(ne.Buffer.from(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=r.response,r.readyState!==Er.LOADING||!n)break;t.push(ne.Buffer.from(new Uint8Array(n)));break;case"ms-stream":if(n=r.response,r.readyState!==Er.LOADING)break;var f=new _e.MSStreamReader;f.onprogress=function(){f.result.byteLength>t._pos&&(t.push(ne.Buffer.from(new Uint8Array(f.result.slice(t._pos)))),t._pos=f.result.byteLength)},f.onload=function(){e(!0),t.push(null)},f.readAsArrayBuffer(n);break}t._xhr.readyState===Er.DONE&&t._mode!=="ms-stream"&&(e(!0),t.push(null))};var mt=Hi,Uu=vt,Pf=en,Vi=Tf,qu=Pf.IncomingMessage,Oa=Pf.readyStates;function zu(e,t){return mt.fetch&&t?"fetch":mt.mozchunkedarraybuffer?"moz-chunked-arraybuffer":mt.msstream?"ms-stream":mt.arraybuffer&&e?"arraybuffer":"text"}var Le=vf.exports=function(e){var t=this;Vi.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+ne.Buffer.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(i){t.setHeader(i,e.headers[i])});var r,n=!0;if(e.mode==="disable-fetch"||"requestTimeout"in e&&!mt.abortController)n=!1,r=!0;else if(e.mode==="prefer-streaming")r=!1;else if(e.mode==="allow-wrong-content-type")r=!mt.overrideMimeType;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");t._mode=zu(r,n),t._fetchTimer=null,t._socketTimeout=null,t._socketTimer=null,t.on("finish",function(){t._onFinish()})};Uu(Le,Vi.Writable);Le.prototype.setHeader=function(e,t){var r=this,n=e.toLowerCase();Hu.indexOf(n)===-1&&(r._headers[n]={name:e,value:t})};Le.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null};Le.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]};Le.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&t.timeout!==0&&e.setTimeout(t.timeout);var r=e._headers,n=null;t.method!=="GET"&&t.method!=="HEAD"&&(n=new Blob(e._body,{type:(r["content-type"]||{}).value||""}));var i=[];if(Object.keys(r).forEach(function(d){var l=r[d].name,u=r[d].value;Array.isArray(u)?u.forEach(function(m){i.push([l,m])}):i.push([l,u])}),e._mode==="fetch"){var a=null;if(mt.abortController){var o=new AbortController;a=o.signal,e._fetchAbortController=o,"requestTimeout"in t&&t.requestTimeout!==0&&(e._fetchTimer=_e.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}_e.fetch(e._opts.url,{method:e._opts.method,headers:i,body:n||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:a}).then(function(d){e._fetchResponse=d,e._resetTimers(!1),e._connect()},function(d){e._resetTimers(!0),e._destroyed||e.emit("error",d)})}else{var f=e._xhr=new _e.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(d){ne.process.nextTick(function(){e.emit("error",d)});return}"responseType"in f&&(f.responseType=e._mode),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),e._mode==="text"&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),i.forEach(function(d){f.setRequestHeader(d[0],d[1])}),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case Oa.LOADING:case Oa.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{f.send(n)}catch(d){ne.process.nextTick(function(){e.emit("error",d)});return}}}};function Zu(e){try{var t=e.status;return t!==null&&t!==0}catch{return!1}}Le.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),!(!Zu(e._xhr)||e._destroyed)&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))};Le.prototype._connect=function(){var e=this;e._destroyed||(e._response=new qu(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))};Le.prototype._write=function(e,t,r){var n=this;n._body.push(e),r()};Le.prototype._resetTimers=function(e){var t=this;_e.clearTimeout(t._socketTimer),t._socketTimer=null,e?(_e.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=_e.setTimeout(function(){t.emit("timeout")},t._socketTimeout))};Le.prototype.abort=Le.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)};Le.prototype.end=function(e,t,r){var n=this;typeof e=="function"&&(r=e,e=void 0),Vi.Writable.prototype.end.call(n,e,t,r)};Le.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)};Le.prototype.flushHeaders=function(){};Le.prototype.setNoDelay=function(){};Le.prototype.setSocketKeepAlive=function(){};var Hu=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],Wu=vf.exports,Gu=Ku,Vu=Object.prototype.hasOwnProperty;function Ku(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Vu.call(r,n)&&(e[n]=r[n])}return e}var Yu={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Ri={exports:{}},zr={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */zr.exports;(function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof _e=="object"&&_e;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,f=2147483647,d=36,l=1,u=26,m=38,_=700,S=72,D=128,k="-",F=/^xn--/,M=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=d-l,O=Math.floor,B=String.fromCharCode,U;function q(I){throw new RangeError(R[I])}function j(I,H){for(var W=I.length,w=[];W--;)w[W]=H(I[W]);return w}function te(I,H){var W=I.split("@"),w="";W.length>1&&(w=W[0]+"@",I=W[1]),I=I.replace(T,".");var y=I.split("."),g=j(y,H).join(".");return w+g}function X(I){for(var H=[],W=0,w=I.length,y,g;W<w;)y=I.charCodeAt(W++),y>=55296&&y<=56319&&W<w?(g=I.charCodeAt(W++),(g&64512)==56320?H.push(((y&1023)<<10)+(g&1023)+65536):(H.push(y),W--)):H.push(y);return H}function b(I){return j(I,function(H){var W="";return H>65535&&(H-=65536,W+=B(H>>>10&1023|55296),H=56320|H&1023),W+=B(H),W}).join("")}function C(I){return I-48<10?I-22:I-65<26?I-65:I-97<26?I-97:d}function J(I,H){return I+22+75*(I<26)-((H!=0)<<5)}function re(I,H,W){var w=0;for(I=W?O(I/_):I>>1,I+=O(I/H);I>P*u>>1;w+=d)I=O(I/P);return O(w+(P+1)*I/(I+m))}function ie(I){var H=[],W=I.length,w,y=0,g=D,c=S,v,E,L,x,h,p,$,V,se;for(v=I.lastIndexOf(k),v<0&&(v=0),E=0;E<v;++E)I.charCodeAt(E)>=128&&q("not-basic"),H.push(I.charCodeAt(E));for(L=v>0?v+1:0;L<W;){for(x=y,h=1,p=d;L>=W&&q("invalid-input"),$=C(I.charCodeAt(L++)),($>=d||$>O((f-y)/h))&&q("overflow"),y+=$*h,V=p<=c?l:p>=c+u?u:p-c,!($<V);p+=d)se=d-V,h>O(f/se)&&q("overflow"),h*=se;w=H.length+1,c=re(y-x,w,x==0),O(y/w)>f-g&&q("overflow"),g+=O(y/w),y%=w,H.splice(y++,0,g)}return b(H)}function ue(I){var H,W,w,y,g,c,v,E,L,x,h,p=[],$,V,se,oe;for(I=X(I),$=I.length,H=D,W=0,g=S,c=0;c<$;++c)h=I[c],h<128&&p.push(B(h));for(w=y=p.length,y&&p.push(k);w<$;){for(v=f,c=0;c<$;++c)h=I[c],h>=H&&h<v&&(v=h);for(V=w+1,v-H>O((f-W)/V)&&q("overflow"),W+=(v-H)*V,H=v,c=0;c<$;++c)if(h=I[c],h<H&&++W>f&&q("overflow"),h==H){for(E=W,L=d;x=L<=g?l:L>=g+u?u:L-g,!(E<x);L+=d)oe=E-x,se=d-x,p.push(B(J(x+oe%se,0))),E=O(oe/se);p.push(B(J(E,0))),g=re(W,V,w==y),W=0,++w}++W,++H}return p.join("")}function ae(I){return te(I,function(H){return F.test(H)?ie(H.slice(4).toLowerCase()):H})}function z(I){return te(I,function(H){return M.test(H)?"xn--"+ue(H):H})}if(o={version:"1.4.1",ucs2:{decode:X,encode:b},decode:ie,encode:ue,toASCII:z,toUnicode:ae},n&&i)if(e.exports==n)i.exports=o;else for(U in o)o.hasOwnProperty(U)&&(n[U]=o[U]);else r.punycode=o})(_e)})(zr,zr.exports);var Xu=zr.exports,ft=TypeError,Ki=typeof Map=="function"&&Map.prototype,An=Object.getOwnPropertyDescriptor&&Ki?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Zr=Ki&&An&&typeof An.get=="function"?An.get:null,Ta=Ki&&Map.prototype.forEach,Yi=typeof Set=="function"&&Set.prototype,On=Object.getOwnPropertyDescriptor&&Yi?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=Yi&&On&&typeof On.get=="function"?On.get:null,Ia=Yi&&Set.prototype.forEach,Ju=typeof WeakMap=="function"&&WeakMap.prototype,er=Ju?WeakMap.prototype.has:null,Qu=typeof WeakSet=="function"&&WeakSet.prototype,tr=Qu?WeakSet.prototype.has:null,es=typeof WeakRef=="function"&&WeakRef.prototype,Pa=es?WeakRef.prototype.deref:null,ts=Boolean.prototype.valueOf,rs=Object.prototype.toString,ns=Function.prototype.toString,is=String.prototype.match,Xi=String.prototype.slice,ht=String.prototype.replace,as=String.prototype.toUpperCase,Na=String.prototype.toLowerCase,Nf=RegExp.prototype.test,Da=Array.prototype.concat,Qe=Array.prototype.join,os=Array.prototype.slice,La=Math.floor,Ai=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Tn=Object.getOwnPropertySymbols,Oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="object",rr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Zt||!0)?Symbol.toStringTag:null,Df=Object.prototype.propertyIsEnumerable,Ma=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function ka(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Nf.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-La(-e):La(e);if(n!==e){var i=String(n),a=Xi.call(t,i.length+1);return ht.call(i,r,"$&_")+"."+ht.call(ht.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ht.call(t,r,"$&_")}var Ti=zi,Fa=Ti.custom,ja=kf(Fa)?Fa:null,Lf={__proto__:null,double:'"',single:"'"},fs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},nn=function e(t,r,n,i){var a=r||{};if(it(a,"quoteStyle")&&!it(Lf,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(it(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=it(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(it(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(it(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=a.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return jf(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var d=String(t);return f?ka(t,d):d}if(typeof t=="bigint"){var l=String(t)+"n";return f?ka(t,l):l}var u=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof t=="object")return Ii(t)?"[Array]":"[Object]";var m=As(a,n);if(typeof i>"u")i=[];else if(Ff(i,t)>=0)return"[Circular]";function _(C,J,re){if(J&&(i=os.call(i),i.push(J)),re){var ie={depth:a.depth};return it(a,"quoteStyle")&&(ie.quoteStyle=a.quoteStyle),e(C,ie,n+1,i)}return e(C,a,n+1,i)}if(typeof t=="function"&&!xa(t)){var S=vs(t),D=Sr(t,_);return"[Function"+(S?": "+S:" (anonymous)")+"]"+(D.length>0?" { "+Qe.call(D,", ")+" }":"")}if(kf(t)){var k=Zt?ht.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Oi.call(t);return typeof t=="object"&&!Zt?Xt(k):k}if(Es(t)){for(var F="<"+Na.call(String(t.nodeName)),M=t.attributes||[],T=0;T<M.length;T++)F+=" "+M[T].name+"="+Mf(ls(M[T].value),"double",a);return F+=">",t.childNodes&&t.childNodes.length&&(F+="..."),F+="</"+Na.call(String(t.nodeName))+">",F}if(Ii(t)){if(t.length===0)return"[]";var R=Sr(t,_);return m&&!Rs(R)?"["+Pi(R,m)+"]":"[ "+Qe.call(R,", ")+" ]"}if(ss(t)){var P=Sr(t,_);return!("cause"in Error.prototype)&&"cause"in t&&!Df.call(t,"cause")?"{ ["+String(t)+"] "+Qe.call(Da.call("[cause]: "+_(t.cause),P),", ")+" }":P.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Qe.call(P,", ")+" }"}if(typeof t=="object"&&o){if(ja&&typeof t[ja]=="function"&&Ti)return Ti(t,{depth:u-n});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(gs(t)){var O=[];return Ta&&Ta.call(t,function(C,J){O.push(_(J,t,!0)+" => "+_(C,t))}),$a("Map",Zr.call(t),O,m)}if(ms(t)){var B=[];return Ia&&Ia.call(t,function(C){B.push(_(C,t))}),$a("Set",Hr.call(t),B,m)}if(_s(t))return In("WeakMap");if(ws(t))return In("WeakSet");if(bs(t))return In("WeakRef");if(hs(t))return Xt(_(Number(t)));if(ps(t))return Xt(_(Ai.call(t)));if(ds(t))return Xt(ts.call(t));if(cs(t))return Xt(_(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof _e<"u"&&t===_e)return"{ [object globalThis] }";if(!us(t)&&!xa(t)){var U=Sr(t,_),q=Ma?Ma(t)===Object.prototype:t instanceof Object||t.constructor===Object,j=t instanceof Object?"":"null prototype",te=!q&&rr&&Object(t)===t&&rr in t?Xi.call(gt(t),8,-1):j?"Object":"",X=q||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",b=X+(te||j?"["+Qe.call(Da.call([],te||[],j||[]),": ")+"] ":"");return U.length===0?b+"{}":m?b+"{"+Pi(U,m)+"}":b+"{ "+Qe.call(U,", ")+" }"}return String(t)};function Mf(e,t,r){var n=r.quoteStyle||t,i=Lf[n];return i+e+i}function ls(e){return ht.call(String(e),/"/g,""")}function Nt(e){return!rr||!(typeof e=="object"&&(rr in e||typeof e[rr]<"u"))}function Ii(e){return gt(e)==="[object Array]"&&Nt(e)}function us(e){return gt(e)==="[object Date]"&&Nt(e)}function xa(e){return gt(e)==="[object RegExp]"&&Nt(e)}function ss(e){return gt(e)==="[object Error]"&&Nt(e)}function cs(e){return gt(e)==="[object String]"&&Nt(e)}function hs(e){return gt(e)==="[object Number]"&&Nt(e)}function ds(e){return gt(e)==="[object Boolean]"&&Nt(e)}function kf(e){if(Zt)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Oi)return!1;try{return Oi.call(e),!0}catch{}return!1}function ps(e){if(!e||typeof e!="object"||!Ai)return!1;try{return Ai.call(e),!0}catch{}return!1}var ys=Object.prototype.hasOwnProperty||function(e){return e in this};function it(e,t){return ys.call(e,t)}function gt(e){return rs.call(e)}function vs(e){if(e.name)return e.name;var t=is.call(ns.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Ff(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function gs(e){if(!Zr||!e||typeof e!="object")return!1;try{Zr.call(e);try{Hr.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function _s(e){if(!er||!e||typeof e!="object")return!1;try{er.call(e,er);try{tr.call(e,tr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function bs(e){if(!Pa||!e||typeof e!="object")return!1;try{return Pa.call(e),!0}catch{}return!1}function ms(e){if(!Hr||!e||typeof e!="object")return!1;try{Hr.call(e);try{Zr.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function ws(e){if(!tr||!e||typeof e!="object")return!1;try{tr.call(e,tr);try{er.call(e,er)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Es(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function jf(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return jf(Xi.call(e,0,t.maxStringLength),t)+n}var i=fs[t.quoteStyle||"single"];i.lastIndex=0;var a=ht.call(ht.call(e,i,"\\$1"),/[\x00-\x1f]/g,Ss);return Mf(a,"single",t)}function Ss(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+as.call(t.toString(16))}function Xt(e){return"Object("+e+")"}function In(e){return e+" { ? }"}function $a(e,t,r,n){var i=n?Pi(r,n):Qe.call(r,", ");return e+" ("+t+") {"+i+"}"}function Rs(e){for(var t=0;t<e.length;t++)if(Ff(e[t],`
|
|
1
|
+
import{c as _e,c2 as yf,b as or,c6 as zi,d as ne,c7 as vt,c8 as ou,c9 as ha,s as Qr,cc as fu}from"../main.js";var Zi={},vf={exports:{}},Hi={};(function(e){e.fetch=i(_e.fetch)&&i(_e.ReadableStream),e.writableStream=i(_e.WritableStream),e.abortController=i(_e.AbortController);var t;function r(){if(t!==void 0)return t;if(_e.XMLHttpRequest){t=new _e.XMLHttpRequest;try{t.open("GET",_e.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(a){var o=r();if(!o)return!1;try{return o.responseType=a,o.responseType===a}catch{}return!1}e.arraybuffer=e.fetch||n("arraybuffer"),e.msstream=!e.fetch&&n("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&n("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||(r()?i(r().overrideMimeType):!1);function i(a){return typeof a=="function"}t=null})(Hi);var en={},Ei={exports:{}},gf=yf().EventEmitter,_n,da;function lu(){if(da)return _n;da=1;function e(D,k){var F=Object.keys(D);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(D);k&&(M=M.filter(function(T){return Object.getOwnPropertyDescriptor(D,T).enumerable})),F.push.apply(F,M)}return F}function t(D){for(var k=1;k<arguments.length;k++){var F=arguments[k]!=null?arguments[k]:{};k%2?e(Object(F),!0).forEach(function(M){r(D,M,F[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(F)):e(Object(F)).forEach(function(M){Object.defineProperty(D,M,Object.getOwnPropertyDescriptor(F,M))})}return D}function r(D,k,F){return k=o(k),k in D?Object.defineProperty(D,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):D[k]=F,D}function n(D,k){if(!(D instanceof k))throw new TypeError("Cannot call a class as a function")}function i(D,k){for(var F=0;F<k.length;F++){var M=k[F];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(D,o(M.key),M)}}function a(D,k,F){return k&&i(D.prototype,k),Object.defineProperty(D,"prototype",{writable:!1}),D}function o(D){var k=f(D,"string");return typeof k=="symbol"?k:String(k)}function f(D,k){if(typeof D!="object"||D===null)return D;var F=D[Symbol.toPrimitive];if(F!==void 0){var M=F.call(D,k);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(D)}var d=or,l=d.Buffer,u=zi,m=u.inspect,_=m&&m.custom||"inspect";function S(D,k,F){l.prototype.copy.call(D,k,F)}return _n=function(){function D(){n(this,D),this.head=null,this.tail=null,this.length=0}return a(D,[{key:"push",value:function(F){var M={data:F,next:null};this.length>0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(F){var M={data:F,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var F=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,F}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(F){if(this.length===0)return"";for(var M=this.head,T=""+M.data;M=M.next;)T+=F+M.data;return T}},{key:"concat",value:function(F){if(this.length===0)return l.alloc(0);for(var M=l.allocUnsafe(F>>>0),T=this.head,R=0;T;)S(T.data,M,R),R+=T.data.length,T=T.next;return M}},{key:"consume",value:function(F,M){var T;return F<this.head.data.length?(T=this.head.data.slice(0,F),this.head.data=this.head.data.slice(F)):F===this.head.data.length?T=this.shift():T=M?this._getString(F):this._getBuffer(F),T}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(F){var M=this.head,T=1,R=M.data;for(F-=R.length;M=M.next;){var P=M.data,O=F>P.length?P.length:F;if(O===P.length?R+=P:R+=P.slice(0,F),F-=O,F===0){O===P.length?(++T,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=P.slice(O));break}++T}return this.length-=T,R}},{key:"_getBuffer",value:function(F){var M=l.allocUnsafe(F),T=this.head,R=1;for(T.data.copy(M),F-=T.data.length;T=T.next;){var P=T.data,O=F>P.length?P.length:F;if(P.copy(M,M.length-F,0,O),F-=O,F===0){O===P.length?(++R,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=P.slice(O));break}++R}return this.length-=R,M}},{key:_,value:function(F,M){return m(this,t(t({},M),{},{depth:0,customInspect:!1}))}}]),D}(),_n}function uu(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ne.process.nextTick(Si,this,e)):ne.process.nextTick(Si,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?ne.process.nextTick(Nr,r):(r._writableState.errorEmitted=!0,ne.process.nextTick(pa,r,a)):ne.process.nextTick(pa,r,a):t?(ne.process.nextTick(Nr,r),t(a)):ne.process.nextTick(Nr,r)}),this)}function pa(e,t){Si(e,t),Nr(e)}function Nr(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function su(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Si(e,t){e.emit("error",t)}function cu(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var _f={destroy:uu,undestroy:su,errorOrDestroy:cu},Pt={};function hu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var bf={};function Be(e,t,r){r||(r=Error);function n(a,o,f){return typeof t=="string"?t:t(a,o,f)}var i=function(a){hu(o,a);function o(f,d,l){return a.call(this,n(f,d,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,bf[e]=i}function ya(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function du(e,t,r){return e.substr(0,t.length)===t}function pu(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function yu(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Be("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Be("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&du(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(pu(e," argument"))i="The ".concat(e," ").concat(n," ").concat(ya(t,"type"));else{var a=yu(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(ya(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Be("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Be("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Be("ERR_STREAM_PREMATURE_CLOSE","Premature close");Be("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Be("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Be("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Be("ERR_STREAM_WRITE_AFTER_END","write after end");Be("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Be("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Be("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Pt.codes=bf;var vu=Pt.codes.ERR_INVALID_OPT_VALUE;function gu(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function _u(e,t,r,n){var i=gu(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new vu(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var mf={getHighWaterMark:_u},bn,va;function wf(){if(va)return bn;va=1,bn=q;function e(c){var v=this;this.next=null,this.entry=null,this.finish=function(){g(v,c)}}var t;q.WritableState=B;var r={deprecate:ou},n=gf,i=or.Buffer,a=(typeof _e<"u"?_e:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(c){return i.from(c)}function f(c){return i.isBuffer(c)||c instanceof a}var d=_f,l=mf,u=l.getHighWaterMark,m=Pt.codes,_=m.ERR_INVALID_ARG_TYPE,S=m.ERR_METHOD_NOT_IMPLEMENTED,D=m.ERR_MULTIPLE_CALLBACK,k=m.ERR_STREAM_CANNOT_PIPE,F=m.ERR_STREAM_DESTROYED,M=m.ERR_STREAM_NULL_VALUES,T=m.ERR_STREAM_WRITE_AFTER_END,R=m.ERR_UNKNOWN_ENCODING,P=d.errorOrDestroy;vt(q,n);function O(){}function B(c,v,E){t=t||zt(),c=c||{},typeof E!="boolean"&&(E=v instanceof t),this.objectMode=!!c.objectMode,E&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=u(this,c,"writableHighWaterMark",E),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var L=c.decodeStrings===!1;this.decodeStrings=!L,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(x){ie(v,x)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}B.prototype.getBuffer=function(){for(var v=this.bufferedRequest,E=[];v;)E.push(v),v=v.next;return E},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var U;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(U=Function.prototype[Symbol.hasInstance],Object.defineProperty(q,Symbol.hasInstance,{value:function(v){return U.call(this,v)?!0:this!==q?!1:v&&v._writableState instanceof B}})):U=function(v){return v instanceof this};function q(c){t=t||zt();var v=this instanceof t;if(!v&&!U.call(q,this))return new q(c);this._writableState=new B(c,this,v),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),n.call(this)}q.prototype.pipe=function(){P(this,new k)};function j(c,v){var E=new T;P(c,E),ne.process.nextTick(v,E)}function te(c,v,E,L){var x;return E===null?x=new M:typeof E!="string"&&!v.objectMode&&(x=new _("chunk",["string","Buffer"],E)),x?(P(c,x),ne.process.nextTick(L,x),!1):!0}q.prototype.write=function(c,v,E){var L=this._writableState,x=!1,h=!L.objectMode&&f(c);return h&&!i.isBuffer(c)&&(c=o(c)),typeof v=="function"&&(E=v,v=null),h?v="buffer":v||(v=L.defaultEncoding),typeof E!="function"&&(E=O),L.ending?j(this,E):(h||te(this,L,c,E))&&(L.pendingcb++,x=b(this,L,h,c,v,E)),x},q.prototype.cork=function(){this._writableState.corked++},q.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&z(this,c))},q.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new R(v);return this._writableState.defaultEncoding=v,this},Object.defineProperty(q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X(c,v,E){return!c.objectMode&&c.decodeStrings!==!1&&typeof v=="string"&&(v=i.from(v,E)),v}Object.defineProperty(q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b(c,v,E,L,x,h){if(!E){var p=X(v,L,x);L!==p&&(E=!0,x="buffer",L=p)}var $=v.objectMode?1:L.length;v.length+=$;var V=v.length<v.highWaterMark;if(V||(v.needDrain=!0),v.writing||v.corked){var se=v.lastBufferedRequest;v.lastBufferedRequest={chunk:L,encoding:x,isBuf:E,callback:h,next:null},se?se.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else C(c,v,!1,$,L,x,h);return V}function C(c,v,E,L,x,h,p){v.writelen=L,v.writecb=p,v.writing=!0,v.sync=!0,v.destroyed?v.onwrite(new F("write")):E?c._writev(x,v.onwrite):c._write(x,h,v.onwrite),v.sync=!1}function J(c,v,E,L,x){--v.pendingcb,E?(ne.process.nextTick(x,L),ne.process.nextTick(w,c,v),c._writableState.errorEmitted=!0,P(c,L)):(x(L),c._writableState.errorEmitted=!0,P(c,L),w(c,v))}function re(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function ie(c,v){var E=c._writableState,L=E.sync,x=E.writecb;if(typeof x!="function")throw new D;if(re(E),v)J(c,E,L,v,x);else{var h=I(E)||c.destroyed;!h&&!E.corked&&!E.bufferProcessing&&E.bufferedRequest&&z(c,E),L?ne.process.nextTick(ue,c,E,h,x):ue(c,E,h,x)}}function ue(c,v,E,L){E||ae(c,v),v.pendingcb--,L(),w(c,v)}function ae(c,v){v.length===0&&v.needDrain&&(v.needDrain=!1,c.emit("drain"))}function z(c,v){v.bufferProcessing=!0;var E=v.bufferedRequest;if(c._writev&&E&&E.next){var L=v.bufferedRequestCount,x=new Array(L),h=v.corkedRequestsFree;h.entry=E;for(var p=0,$=!0;E;)x[p]=E,E.isBuf||($=!1),E=E.next,p+=1;x.allBuffers=$,C(c,v,!0,v.length,x,"",h.finish),v.pendingcb++,v.lastBufferedRequest=null,h.next?(v.corkedRequestsFree=h.next,h.next=null):v.corkedRequestsFree=new e(v),v.bufferedRequestCount=0}else{for(;E;){var V=E.chunk,se=E.encoding,oe=E.callback,de=v.objectMode?1:V.length;if(C(c,v,!1,de,V,se,oe),E=E.next,v.bufferedRequestCount--,v.writing)break}E===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=E,v.bufferProcessing=!1}q.prototype._write=function(c,v,E){E(new S("_write()"))},q.prototype._writev=null,q.prototype.end=function(c,v,E){var L=this._writableState;return typeof c=="function"?(E=c,c=null,v=null):typeof v=="function"&&(E=v,v=null),c!=null&&this.write(c,v),L.corked&&(L.corked=1,this.uncork()),L.ending||y(this,L,E),this},Object.defineProperty(q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function I(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function H(c,v){c._final(function(E){v.pendingcb--,E&&P(c,E),v.prefinished=!0,c.emit("prefinish"),w(c,v)})}function W(c,v){!v.prefinished&&!v.finalCalled&&(typeof c._final=="function"&&!v.destroyed?(v.pendingcb++,v.finalCalled=!0,ne.process.nextTick(H,c,v)):(v.prefinished=!0,c.emit("prefinish")))}function w(c,v){var E=I(v);if(E&&(W(c,v),v.pendingcb===0&&(v.finished=!0,c.emit("finish"),v.autoDestroy))){var L=c._readableState;(!L||L.autoDestroy&&L.endEmitted)&&c.destroy()}return E}function y(c,v,E){v.ending=!0,w(c,v),E&&(v.finished?ne.process.nextTick(E):c.once("finish",E)),v.ended=!0,c.writable=!1}function g(c,v,E){var L=c.entry;for(c.entry=null;L;){var x=L.callback;v.pendingcb--,x(E),L=L.next}v.corkedRequestsFree.next=c}return Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(v){this._writableState&&(this._writableState.destroyed=v)}}),q.prototype.destroy=d.destroy,q.prototype._undestroy=d.undestroy,q.prototype._destroy=function(c,v){v(c)},bn}var mn,ga;function zt(){if(ga)return mn;ga=1;var e=Object.keys||function(l){var u=[];for(var m in l)u.push(m);return u};mn=o;var t=Sf(),r=wf();vt(o,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var a=n[i];o.prototype[a]||(o.prototype[a]=r.prototype[a])}function o(l){if(!(this instanceof o))return new o(l);t.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",f)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function f(){this._writableState.ended||ne.process.nextTick(d,this)}function d(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),mn}var _a=Pt.codes.ERR_STREAM_PREMATURE_CLOSE;function bu(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function mu(){}function wu(e){return e.setHeader&&typeof e.abort=="function"}function Ef(e,t,r){if(typeof t=="function")return Ef(e,null,t);t||(t={}),r=bu(r||mu);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||f()},o=e._writableState&&e._writableState.finished,f=function(){i=!1,o=!0,n||r.call(e)},d=e._readableState&&e._readableState.endEmitted,l=function(){n=!1,d=!0,i||r.call(e)},u=function(D){r.call(e,D)},m=function(){var D;if(n&&!d)return(!e._readableState||!e._readableState.ended)&&(D=new _a),r.call(e,D);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(D=new _a),r.call(e,D)},_=function(){e.req.on("finish",f)};return wu(e)?(e.on("complete",f),e.on("abort",m),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",f),t.error!==!1&&e.on("error",u),e.on("close",m),function(){e.removeListener("complete",f),e.removeListener("abort",m),e.removeListener("request",_),e.req&&e.req.removeListener("finish",f),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",m)}}var Wi=Ef,wn,ba;function Eu(){if(ba)return wn;ba=1;var e;function t(R,P,O){return P=r(P),P in R?Object.defineProperty(R,P,{value:O,enumerable:!0,configurable:!0,writable:!0}):R[P]=O,R}function r(R){var P=n(R,"string");return typeof P=="symbol"?P:String(P)}function n(R,P){if(typeof R!="object"||R===null)return R;var O=R[Symbol.toPrimitive];if(O!==void 0){var B=O.call(R,P);if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(R)}var i=Wi,a=Symbol("lastResolve"),o=Symbol("lastReject"),f=Symbol("error"),d=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),m=Symbol("stream");function _(R,P){return{value:R,done:P}}function S(R){var P=R[a];if(P!==null){var O=R[m].read();O!==null&&(R[l]=null,R[a]=null,R[o]=null,P(_(O,!1)))}}function D(R){ne.process.nextTick(S,R)}function k(R,P){return function(O,B){R.then(function(){if(P[d]){O(_(void 0,!0));return}P[u](O,B)},B)}}var F=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((e={get stream(){return this[m]},next:function(){var P=this,O=this[f];if(O!==null)return Promise.reject(O);if(this[d])return Promise.resolve(_(void 0,!0));if(this[m].destroyed)return new Promise(function(j,te){ne.process.nextTick(function(){P[f]?te(P[f]):j(_(void 0,!0))})});var B=this[l],U;if(B)U=new Promise(k(B,this));else{var q=this[m].read();if(q!==null)return Promise.resolve(_(q,!1));U=new Promise(this[u])}return this[l]=U,U}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var P=this;return new Promise(function(O,B){P[m].destroy(null,function(U){if(U){B(U);return}O(_(void 0,!0))})})}),e),F),T=function(P){var O,B=Object.create(M,(O={},t(O,m,{value:P,writable:!0}),t(O,a,{value:null,writable:!0}),t(O,o,{value:null,writable:!0}),t(O,f,{value:null,writable:!0}),t(O,d,{value:P._readableState.endEmitted,writable:!0}),t(O,u,{value:function(q,j){var te=B[m].read();te?(B[l]=null,B[a]=null,B[o]=null,q(_(te,!1))):(B[a]=q,B[o]=j)},writable:!0}),O));return B[l]=null,i(P,function(U){if(U&&U.code!=="ERR_STREAM_PREMATURE_CLOSE"){var q=B[o];q!==null&&(B[l]=null,B[a]=null,B[o]=null,q(U)),B[f]=U;return}var j=B[a];j!==null&&(B[l]=null,B[a]=null,B[o]=null,j(_(void 0,!0))),B[d]=!0}),P.on("readable",D.bind(null,B)),B};return wn=T,wn}var En,ma;function Su(){return ma||(ma=1,En=function(){throw new Error("Readable.from is not available in the browser")}),En}var Sn,wa;function Sf(){if(wa)return Sn;wa=1,Sn=j;var e;j.ReadableState=q,yf().EventEmitter;var t=function(p,$){return p.listeners($).length},r=gf,n=or.Buffer,i=(typeof _e<"u"?_e:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(h){return n.from(h)}function o(h){return n.isBuffer(h)||h instanceof i}var f=zi,d;f&&f.debuglog?d=f.debuglog("stream"):d=function(){};var l=lu(),u=_f,m=mf,_=m.getHighWaterMark,S=Pt.codes,D=S.ERR_INVALID_ARG_TYPE,k=S.ERR_STREAM_PUSH_AFTER_EOF,F=S.ERR_METHOD_NOT_IMPLEMENTED,M=S.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,T,R,P;vt(j,r);var O=u.errorOrDestroy,B=["error","close","destroy","pause","resume"];function U(h,p,$){if(typeof h.prependListener=="function")return h.prependListener(p,$);!h._events||!h._events[p]?h.on(p,$):Array.isArray(h._events[p])?h._events[p].unshift($):h._events[p]=[$,h._events[p]]}function q(h,p,$){e=e||zt(),h=h||{},typeof $!="boolean"&&($=p instanceof e),this.objectMode=!!h.objectMode,$&&(this.objectMode=this.objectMode||!!h.readableObjectMode),this.highWaterMark=_(this,h,"readableHighWaterMark",$),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=h.emitClose!==!1,this.autoDestroy=!!h.autoDestroy,this.destroyed=!1,this.defaultEncoding=h.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,h.encoding&&(T||(T=ha().StringDecoder),this.decoder=new T(h.encoding),this.encoding=h.encoding)}function j(h){if(e=e||zt(),!(this instanceof j))return new j(h);var p=this instanceof e;this._readableState=new q(h,this,p),this.readable=!0,h&&(typeof h.read=="function"&&(this._read=h.read),typeof h.destroy=="function"&&(this._destroy=h.destroy)),r.call(this)}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(p){this._readableState&&(this._readableState.destroyed=p)}}),j.prototype.destroy=u.destroy,j.prototype._undestroy=u.undestroy,j.prototype._destroy=function(h,p){p(h)},j.prototype.push=function(h,p){var $=this._readableState,V;return $.objectMode?V=!0:typeof h=="string"&&(p=p||$.defaultEncoding,p!==$.encoding&&(h=n.from(h,p),p=""),V=!0),te(this,h,p,!1,V)},j.prototype.unshift=function(h){return te(this,h,null,!0,!1)};function te(h,p,$,V,se){d("readableAddChunk",p);var oe=h._readableState;if(p===null)oe.reading=!1,ie(h,oe);else{var de;if(se||(de=b(oe,p)),de)O(h,de);else if(oe.objectMode||p&&p.length>0)if(typeof p!="string"&&!oe.objectMode&&Object.getPrototypeOf(p)!==n.prototype&&(p=a(p)),V)oe.endEmitted?O(h,new M):X(h,oe,p,!0);else if(oe.ended)O(h,new k);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!$?(p=oe.decoder.write(p),oe.objectMode||p.length!==0?X(h,oe,p,!1):z(h,oe)):X(h,oe,p,!1)}else V||(oe.reading=!1,z(h,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function X(h,p,$,V){p.flowing&&p.length===0&&!p.sync?(p.awaitDrain=0,h.emit("data",$)):(p.length+=p.objectMode?1:$.length,V?p.buffer.unshift($):p.buffer.push($),p.needReadable&&ue(h)),z(h,p)}function b(h,p){var $;return!o(p)&&typeof p!="string"&&p!==void 0&&!h.objectMode&&($=new D("chunk",["string","Buffer","Uint8Array"],p)),$}j.prototype.isPaused=function(){return this._readableState.flowing===!1},j.prototype.setEncoding=function(h){T||(T=ha().StringDecoder);var p=new T(h);this._readableState.decoder=p,this._readableState.encoding=this._readableState.decoder.encoding;for(var $=this._readableState.buffer.head,V="";$!==null;)V+=p.write($.data),$=$.next;return this._readableState.buffer.clear(),V!==""&&this._readableState.buffer.push(V),this._readableState.length=V.length,this};var C=1073741824;function J(h){return h>=C?h=C:(h--,h|=h>>>1,h|=h>>>2,h|=h>>>4,h|=h>>>8,h|=h>>>16,h++),h}function re(h,p){return h<=0||p.length===0&&p.ended?0:p.objectMode?1:h!==h?p.flowing&&p.length?p.buffer.head.data.length:p.length:(h>p.highWaterMark&&(p.highWaterMark=J(h)),h<=p.length?h:p.ended?p.length:(p.needReadable=!0,0))}j.prototype.read=function(h){d("read",h),h=parseInt(h,10);var p=this._readableState,$=h;if(h!==0&&(p.emittedReadable=!1),h===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return d("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?E(this):ue(this),null;if(h=re(h,p),h===0&&p.ended)return p.length===0&&E(this),null;var V=p.needReadable;d("need readable",V),(p.length===0||p.length-h<p.highWaterMark)&&(V=!0,d("length less than watermark",V)),p.ended||p.reading?(V=!1,d("reading or ended",V)):V&&(d("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(h=re($,p)));var se;return h>0?se=v(h,p):se=null,se===null?(p.needReadable=p.length<=p.highWaterMark,h=0):(p.length-=h,p.awaitDrain=0),p.length===0&&(p.ended||(p.needReadable=!0),$!==h&&p.ended&&E(this)),se!==null&&this.emit("data",se),se};function ie(h,p){if(d("onEofChunk"),!p.ended){if(p.decoder){var $=p.decoder.end();$&&$.length&&(p.buffer.push($),p.length+=p.objectMode?1:$.length)}p.ended=!0,p.sync?ue(h):(p.needReadable=!1,p.emittedReadable||(p.emittedReadable=!0,ae(h)))}}function ue(h){var p=h._readableState;d("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(d("emitReadable",p.flowing),p.emittedReadable=!0,ne.process.nextTick(ae,h))}function ae(h){var p=h._readableState;d("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&(p.length||p.ended)&&(h.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,c(h)}function z(h,p){p.readingMore||(p.readingMore=!0,ne.process.nextTick(I,h,p))}function I(h,p){for(;!p.reading&&!p.ended&&(p.length<p.highWaterMark||p.flowing&&p.length===0);){var $=p.length;if(d("maybeReadMore read 0"),h.read(0),$===p.length)break}p.readingMore=!1}j.prototype._read=function(h){O(this,new F("_read()"))},j.prototype.pipe=function(h,p){var $=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=h;break;case 1:V.pipes=[V.pipes,h];break;default:V.pipes.push(h);break}V.pipesCount+=1,d("pipe count=%d opts=%j",V.pipesCount,p);var se=(!p||p.end!==!1)&&h!==ne.process.stdout&&h!==ne.process.stderr,oe=se?be:G;V.endEmitted?ne.process.nextTick(oe):$.once("end",oe),h.on("unpipe",de);function de(Q,ee){d("onunpipe"),Q===$&&ee&&ee.hasUnpiped===!1&&(ee.hasUnpiped=!0,Ie())}function be(){d("onend"),h.end()}var Z=H($);h.on("drain",Z);var je=!1;function Ie(){d("cleanup"),h.removeListener("close",s),h.removeListener("finish",A),h.removeListener("drain",Z),h.removeListener("error",Y),h.removeListener("unpipe",de),$.removeListener("end",be),$.removeListener("end",G),$.removeListener("data",N),je=!0,V.awaitDrain&&(!h._writableState||h._writableState.needDrain)&&Z()}$.on("data",N);function N(Q){d("ondata");var ee=h.write(Q);d("dest.write",ee),ee===!1&&((V.pipesCount===1&&V.pipes===h||V.pipesCount>1&&x(V.pipes,h)!==-1)&&!je&&(d("false write response, pause",V.awaitDrain),V.awaitDrain++),$.pause())}function Y(Q){d("onerror",Q),G(),h.removeListener("error",Y),t(h,"error")===0&&O(h,Q)}U(h,"error",Y);function s(){h.removeListener("finish",A),G()}h.once("close",s);function A(){d("onfinish"),h.removeListener("close",s),G()}h.once("finish",A);function G(){d("unpipe"),$.unpipe(h)}return h.emit("pipe",$),V.flowing||(d("pipe resume"),$.resume()),h};function H(h){return function(){var $=h._readableState;d("pipeOnDrain",$.awaitDrain),$.awaitDrain&&$.awaitDrain--,$.awaitDrain===0&&t(h,"data")&&($.flowing=!0,c(h))}}j.prototype.unpipe=function(h){var p=this._readableState,$={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return h&&h!==p.pipes?this:(h||(h=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,h&&h.emit("unpipe",this,$),this);if(!h){var V=p.pipes,se=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var oe=0;oe<se;oe++)V[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var de=x(p.pipes,h);return de===-1?this:(p.pipes.splice(de,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),h.emit("unpipe",this,$),this)},j.prototype.on=function(h,p){var $=r.prototype.on.call(this,h,p),V=this._readableState;return h==="data"?(V.readableListening=this.listenerCount("readable")>0,V.flowing!==!1&&this.resume()):h==="readable"&&!V.endEmitted&&!V.readableListening&&(V.readableListening=V.needReadable=!0,V.flowing=!1,V.emittedReadable=!1,d("on readable",V.length,V.reading),V.length?ue(this):V.reading||ne.process.nextTick(w,this)),$},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(h,p){var $=r.prototype.removeListener.call(this,h,p);return h==="readable"&&ne.process.nextTick(W,this),$},j.prototype.removeAllListeners=function(h){var p=r.prototype.removeAllListeners.apply(this,arguments);return(h==="readable"||h===void 0)&&ne.process.nextTick(W,this),p};function W(h){var p=h._readableState;p.readableListening=h.listenerCount("readable")>0,p.resumeScheduled&&!p.paused?p.flowing=!0:h.listenerCount("data")>0&&h.resume()}function w(h){d("readable nexttick read 0"),h.read(0)}j.prototype.resume=function(){var h=this._readableState;return h.flowing||(d("resume"),h.flowing=!h.readableListening,y(this,h)),h.paused=!1,this};function y(h,p){p.resumeScheduled||(p.resumeScheduled=!0,ne.process.nextTick(g,h,p))}function g(h,p){d("resume",p.reading),p.reading||h.read(0),p.resumeScheduled=!1,h.emit("resume"),c(h),p.flowing&&!p.reading&&h.read(0)}j.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(h){var p=h._readableState;for(d("flow",p.flowing);p.flowing&&h.read()!==null;);}j.prototype.wrap=function(h){var p=this,$=this._readableState,V=!1;h.on("end",function(){if(d("wrapped end"),$.decoder&&!$.ended){var de=$.decoder.end();de&&de.length&&p.push(de)}p.push(null)}),h.on("data",function(de){if(d("wrapped data"),$.decoder&&(de=$.decoder.write(de)),!($.objectMode&&de==null)&&!(!$.objectMode&&(!de||!de.length))){var be=p.push(de);be||(V=!0,h.pause())}});for(var se in h)this[se]===void 0&&typeof h[se]=="function"&&(this[se]=function(be){return function(){return h[be].apply(h,arguments)}}(se));for(var oe=0;oe<B.length;oe++)h.on(B[oe],this.emit.bind(this,B[oe]));return this._read=function(de){d("wrapped _read",de),V&&(V=!1,h.resume())},this},typeof Symbol=="function"&&(j.prototype[Symbol.asyncIterator]=function(){return R===void 0&&(R=Eu()),R(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){this._readableState&&(this._readableState.flowing=p)}}),j._fromList=v,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function v(h,p){if(p.length===0)return null;var $;return p.objectMode?$=p.buffer.shift():!h||h>=p.length?(p.decoder?$=p.buffer.join(""):p.buffer.length===1?$=p.buffer.first():$=p.buffer.concat(p.length),p.buffer.clear()):$=p.buffer.consume(h,p.decoder),$}function E(h){var p=h._readableState;d("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,ne.process.nextTick(L,p,h))}function L(h,p){if(d("endReadableNT",h.endEmitted,h.length),!h.endEmitted&&h.length===0&&(h.endEmitted=!0,p.readable=!1,p.emit("end"),h.autoDestroy)){var $=p._writableState;(!$||$.autoDestroy&&$.finished)&&p.destroy()}}typeof Symbol=="function"&&(j.from=function(h,p){return P===void 0&&(P=Su()),P(j,h,p)});function x(h,p){for(var $=0,V=h.length;$<V;$++)if(h[$]===p)return $;return-1}return Sn}var Rf=ot,tn=Pt.codes,Ru=tn.ERR_METHOD_NOT_IMPLEMENTED,Au=tn.ERR_MULTIPLE_CALLBACK,Ou=tn.ERR_TRANSFORM_ALREADY_TRANSFORMING,Tu=tn.ERR_TRANSFORM_WITH_LENGTH_0,rn=zt();vt(ot,rn);function Iu(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Au);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ot(e){if(!(this instanceof ot))return new ot(e);rn.call(this,e),this._transformState={afterTransform:Iu.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Pu)}function Pu(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Ea(e,t,r)}):Ea(this,null,null)}ot.prototype.push=function(e,t){return this._transformState.needTransform=!1,rn.prototype.push.call(this,e,t)};ot.prototype._transform=function(e,t,r){r(new Ru("_transform()"))};ot.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ot.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ot.prototype._destroy=function(e,t){rn.prototype._destroy.call(this,e,function(r){t(r)})};function Ea(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Tu;if(e._transformState.transforming)throw new Ou;return e.push(null)}var Nu=fr,Af=Rf;vt(fr,Af);function fr(e){if(!(this instanceof fr))return new fr(e);Af.call(this,e)}fr.prototype._transform=function(e,t,r){r(null,e)};var Rn;function Du(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Of=Pt.codes,Lu=Of.ERR_MISSING_ARGS,Mu=Of.ERR_STREAM_DESTROYED;function Sa(e){if(e)throw e}function ku(e){return e.setHeader&&typeof e.abort=="function"}function Fu(e,t,r,n){n=Du(n);var i=!1;e.on("close",function(){i=!0}),Rn===void 0&&(Rn=Wi),Rn(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,ku(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Mu("pipe"))}}}function Ra(e){e()}function ju(e,t){return e.pipe(t)}function xu(e){return!e.length||typeof e[e.length-1]!="function"?Sa:e.pop()}function $u(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=xu(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Lu("streams");var i,a=t.map(function(o,f){var d=f<t.length-1,l=f>0;return Fu(o,d,l,function(u){i||(i=u),u&&a.forEach(Ra),!d&&(a.forEach(Ra),n(i))})});return t.reduce(ju)}var Cu=$u;(function(e,t){t=e.exports=Sf(),t.Stream=t,t.Readable=t,t.Writable=wf(),t.Duplex=zt(),t.Transform=Rf,t.PassThrough=Nu,t.finished=Wi,t.pipeline=Cu})(Ei,Ei.exports);var Tf=Ei.exports,Aa=Hi,Bu=vt,If=Tf,Er=en.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Gi=en.IncomingMessage=function(e,t,r,n){var i=this;if(If.Readable.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",function(){ne.process.nextTick(function(){i.emit("close")})}),r==="fetch"){let u=function(){o.read().then(function(m){if(!i._destroyed){if(n(m.done),m.done){i.push(null);return}i.push(ne.Buffer.from(m.value)),u()}}).catch(function(m){n(!0),i._destroyed||i.emit("error",m)})};if(i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText,t.headers.forEach(function(m,_){i.headers[_.toLowerCase()]=m,i.rawHeaders.push(_,m)}),Aa.writableStream){var a=new WritableStream({write:function(m){return n(!1),new Promise(function(_,S){i._destroyed?S():i.push(ne.Buffer.from(m))?_():i._resumeFetch=_})},close:function(){n(!0),i._destroyed||i.push(null)},abort:function(m){n(!0),i._destroyed||i.emit("error",m)}});try{t.body.pipeTo(a).catch(function(m){n(!0),i._destroyed||i.emit("error",m)});return}catch{}}var o=t.body.getReader();u()}else{i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText;var f=e.getAllResponseHeaders().split(/\r?\n/);if(f.forEach(function(u){var m=u.match(/^([^:]+):\s*(.*)/);if(m){var _=m[1].toLowerCase();_==="set-cookie"?(i.headers[_]===void 0&&(i.headers[_]=[]),i.headers[_].push(m[2])):i.headers[_]!==void 0?i.headers[_]+=", "+m[2]:i.headers[_]=m[2],i.rawHeaders.push(m[1],m[2])}}),i._charset="x-user-defined",!Aa.overrideMimeType){var d=i.rawHeaders["mime-type"];if(d){var l=d.match(/;\s*charset=([^;])(;|$)/);l&&(i._charset=l[1].toLowerCase())}i._charset||(i._charset="utf-8")}}};Bu(Gi,If.Readable);Gi.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())};Gi.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,n=null;switch(t._mode){case"text":if(n=r.responseText,n.length>t._pos){var i=n.substr(t._pos);if(t._charset==="x-user-defined"){for(var a=ne.Buffer.alloc(i.length),o=0;o<i.length;o++)a[o]=i.charCodeAt(o)&255;t.push(a)}else t.push(i,t._charset);t._pos=n.length}break;case"arraybuffer":if(r.readyState!==Er.DONE||!r.response)break;n=r.response,t.push(ne.Buffer.from(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=r.response,r.readyState!==Er.LOADING||!n)break;t.push(ne.Buffer.from(new Uint8Array(n)));break;case"ms-stream":if(n=r.response,r.readyState!==Er.LOADING)break;var f=new _e.MSStreamReader;f.onprogress=function(){f.result.byteLength>t._pos&&(t.push(ne.Buffer.from(new Uint8Array(f.result.slice(t._pos)))),t._pos=f.result.byteLength)},f.onload=function(){e(!0),t.push(null)},f.readAsArrayBuffer(n);break}t._xhr.readyState===Er.DONE&&t._mode!=="ms-stream"&&(e(!0),t.push(null))};var mt=Hi,Uu=vt,Pf=en,Vi=Tf,qu=Pf.IncomingMessage,Oa=Pf.readyStates;function zu(e,t){return mt.fetch&&t?"fetch":mt.mozchunkedarraybuffer?"moz-chunked-arraybuffer":mt.msstream?"ms-stream":mt.arraybuffer&&e?"arraybuffer":"text"}var Le=vf.exports=function(e){var t=this;Vi.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+ne.Buffer.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(i){t.setHeader(i,e.headers[i])});var r,n=!0;if(e.mode==="disable-fetch"||"requestTimeout"in e&&!mt.abortController)n=!1,r=!0;else if(e.mode==="prefer-streaming")r=!1;else if(e.mode==="allow-wrong-content-type")r=!mt.overrideMimeType;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");t._mode=zu(r,n),t._fetchTimer=null,t._socketTimeout=null,t._socketTimer=null,t.on("finish",function(){t._onFinish()})};Uu(Le,Vi.Writable);Le.prototype.setHeader=function(e,t){var r=this,n=e.toLowerCase();Hu.indexOf(n)===-1&&(r._headers[n]={name:e,value:t})};Le.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null};Le.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]};Le.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&t.timeout!==0&&e.setTimeout(t.timeout);var r=e._headers,n=null;t.method!=="GET"&&t.method!=="HEAD"&&(n=new Blob(e._body,{type:(r["content-type"]||{}).value||""}));var i=[];if(Object.keys(r).forEach(function(d){var l=r[d].name,u=r[d].value;Array.isArray(u)?u.forEach(function(m){i.push([l,m])}):i.push([l,u])}),e._mode==="fetch"){var a=null;if(mt.abortController){var o=new AbortController;a=o.signal,e._fetchAbortController=o,"requestTimeout"in t&&t.requestTimeout!==0&&(e._fetchTimer=_e.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}_e.fetch(e._opts.url,{method:e._opts.method,headers:i,body:n||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:a}).then(function(d){e._fetchResponse=d,e._resetTimers(!1),e._connect()},function(d){e._resetTimers(!0),e._destroyed||e.emit("error",d)})}else{var f=e._xhr=new _e.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(d){ne.process.nextTick(function(){e.emit("error",d)});return}"responseType"in f&&(f.responseType=e._mode),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),e._mode==="text"&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),i.forEach(function(d){f.setRequestHeader(d[0],d[1])}),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case Oa.LOADING:case Oa.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{f.send(n)}catch(d){ne.process.nextTick(function(){e.emit("error",d)});return}}}};function Zu(e){try{var t=e.status;return t!==null&&t!==0}catch{return!1}}Le.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),!(!Zu(e._xhr)||e._destroyed)&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))};Le.prototype._connect=function(){var e=this;e._destroyed||(e._response=new qu(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))};Le.prototype._write=function(e,t,r){var n=this;n._body.push(e),r()};Le.prototype._resetTimers=function(e){var t=this;_e.clearTimeout(t._socketTimer),t._socketTimer=null,e?(_e.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=_e.setTimeout(function(){t.emit("timeout")},t._socketTimeout))};Le.prototype.abort=Le.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)};Le.prototype.end=function(e,t,r){var n=this;typeof e=="function"&&(r=e,e=void 0),Vi.Writable.prototype.end.call(n,e,t,r)};Le.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)};Le.prototype.flushHeaders=function(){};Le.prototype.setNoDelay=function(){};Le.prototype.setSocketKeepAlive=function(){};var Hu=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],Wu=vf.exports,Gu=Ku,Vu=Object.prototype.hasOwnProperty;function Ku(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Vu.call(r,n)&&(e[n]=r[n])}return e}var Yu={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Ri={exports:{}},zr={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */zr.exports;(function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof _e=="object"&&_e;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,f=2147483647,d=36,l=1,u=26,m=38,_=700,S=72,D=128,k="-",F=/^xn--/,M=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=d-l,O=Math.floor,B=String.fromCharCode,U;function q(I){throw new RangeError(R[I])}function j(I,H){for(var W=I.length,w=[];W--;)w[W]=H(I[W]);return w}function te(I,H){var W=I.split("@"),w="";W.length>1&&(w=W[0]+"@",I=W[1]),I=I.replace(T,".");var y=I.split("."),g=j(y,H).join(".");return w+g}function X(I){for(var H=[],W=0,w=I.length,y,g;W<w;)y=I.charCodeAt(W++),y>=55296&&y<=56319&&W<w?(g=I.charCodeAt(W++),(g&64512)==56320?H.push(((y&1023)<<10)+(g&1023)+65536):(H.push(y),W--)):H.push(y);return H}function b(I){return j(I,function(H){var W="";return H>65535&&(H-=65536,W+=B(H>>>10&1023|55296),H=56320|H&1023),W+=B(H),W}).join("")}function C(I){return I-48<10?I-22:I-65<26?I-65:I-97<26?I-97:d}function J(I,H){return I+22+75*(I<26)-((H!=0)<<5)}function re(I,H,W){var w=0;for(I=W?O(I/_):I>>1,I+=O(I/H);I>P*u>>1;w+=d)I=O(I/P);return O(w+(P+1)*I/(I+m))}function ie(I){var H=[],W=I.length,w,y=0,g=D,c=S,v,E,L,x,h,p,$,V,se;for(v=I.lastIndexOf(k),v<0&&(v=0),E=0;E<v;++E)I.charCodeAt(E)>=128&&q("not-basic"),H.push(I.charCodeAt(E));for(L=v>0?v+1:0;L<W;){for(x=y,h=1,p=d;L>=W&&q("invalid-input"),$=C(I.charCodeAt(L++)),($>=d||$>O((f-y)/h))&&q("overflow"),y+=$*h,V=p<=c?l:p>=c+u?u:p-c,!($<V);p+=d)se=d-V,h>O(f/se)&&q("overflow"),h*=se;w=H.length+1,c=re(y-x,w,x==0),O(y/w)>f-g&&q("overflow"),g+=O(y/w),y%=w,H.splice(y++,0,g)}return b(H)}function ue(I){var H,W,w,y,g,c,v,E,L,x,h,p=[],$,V,se,oe;for(I=X(I),$=I.length,H=D,W=0,g=S,c=0;c<$;++c)h=I[c],h<128&&p.push(B(h));for(w=y=p.length,y&&p.push(k);w<$;){for(v=f,c=0;c<$;++c)h=I[c],h>=H&&h<v&&(v=h);for(V=w+1,v-H>O((f-W)/V)&&q("overflow"),W+=(v-H)*V,H=v,c=0;c<$;++c)if(h=I[c],h<H&&++W>f&&q("overflow"),h==H){for(E=W,L=d;x=L<=g?l:L>=g+u?u:L-g,!(E<x);L+=d)oe=E-x,se=d-x,p.push(B(J(x+oe%se,0))),E=O(oe/se);p.push(B(J(E,0))),g=re(W,V,w==y),W=0,++w}++W,++H}return p.join("")}function ae(I){return te(I,function(H){return F.test(H)?ie(H.slice(4).toLowerCase()):H})}function z(I){return te(I,function(H){return M.test(H)?"xn--"+ue(H):H})}if(o={version:"1.4.1",ucs2:{decode:X,encode:b},decode:ie,encode:ue,toASCII:z,toUnicode:ae},n&&i)if(e.exports==n)i.exports=o;else for(U in o)o.hasOwnProperty(U)&&(n[U]=o[U]);else r.punycode=o})(_e)})(zr,zr.exports);var Xu=zr.exports,ft=TypeError,Ki=typeof Map=="function"&&Map.prototype,An=Object.getOwnPropertyDescriptor&&Ki?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Zr=Ki&&An&&typeof An.get=="function"?An.get:null,Ta=Ki&&Map.prototype.forEach,Yi=typeof Set=="function"&&Set.prototype,On=Object.getOwnPropertyDescriptor&&Yi?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=Yi&&On&&typeof On.get=="function"?On.get:null,Ia=Yi&&Set.prototype.forEach,Ju=typeof WeakMap=="function"&&WeakMap.prototype,er=Ju?WeakMap.prototype.has:null,Qu=typeof WeakSet=="function"&&WeakSet.prototype,tr=Qu?WeakSet.prototype.has:null,es=typeof WeakRef=="function"&&WeakRef.prototype,Pa=es?WeakRef.prototype.deref:null,ts=Boolean.prototype.valueOf,rs=Object.prototype.toString,ns=Function.prototype.toString,is=String.prototype.match,Xi=String.prototype.slice,ht=String.prototype.replace,as=String.prototype.toUpperCase,Na=String.prototype.toLowerCase,Nf=RegExp.prototype.test,Da=Array.prototype.concat,Qe=Array.prototype.join,os=Array.prototype.slice,La=Math.floor,Ai=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Tn=Object.getOwnPropertySymbols,Oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="object",rr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Zt||!0)?Symbol.toStringTag:null,Df=Object.prototype.propertyIsEnumerable,Ma=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function ka(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Nf.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-La(-e):La(e);if(n!==e){var i=String(n),a=Xi.call(t,i.length+1);return ht.call(i,r,"$&_")+"."+ht.call(ht.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ht.call(t,r,"$&_")}var Ti=zi,Fa=Ti.custom,ja=kf(Fa)?Fa:null,Lf={__proto__:null,double:'"',single:"'"},fs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},nn=function e(t,r,n,i){var a=r||{};if(it(a,"quoteStyle")&&!it(Lf,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(it(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=it(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(it(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(it(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=a.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return jf(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var d=String(t);return f?ka(t,d):d}if(typeof t=="bigint"){var l=String(t)+"n";return f?ka(t,l):l}var u=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof t=="object")return Ii(t)?"[Array]":"[Object]";var m=As(a,n);if(typeof i>"u")i=[];else if(Ff(i,t)>=0)return"[Circular]";function _(C,J,re){if(J&&(i=os.call(i),i.push(J)),re){var ie={depth:a.depth};return it(a,"quoteStyle")&&(ie.quoteStyle=a.quoteStyle),e(C,ie,n+1,i)}return e(C,a,n+1,i)}if(typeof t=="function"&&!xa(t)){var S=vs(t),D=Sr(t,_);return"[Function"+(S?": "+S:" (anonymous)")+"]"+(D.length>0?" { "+Qe.call(D,", ")+" }":"")}if(kf(t)){var k=Zt?ht.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Oi.call(t);return typeof t=="object"&&!Zt?Xt(k):k}if(Es(t)){for(var F="<"+Na.call(String(t.nodeName)),M=t.attributes||[],T=0;T<M.length;T++)F+=" "+M[T].name+"="+Mf(ls(M[T].value),"double",a);return F+=">",t.childNodes&&t.childNodes.length&&(F+="..."),F+="</"+Na.call(String(t.nodeName))+">",F}if(Ii(t)){if(t.length===0)return"[]";var R=Sr(t,_);return m&&!Rs(R)?"["+Pi(R,m)+"]":"[ "+Qe.call(R,", ")+" ]"}if(ss(t)){var P=Sr(t,_);return!("cause"in Error.prototype)&&"cause"in t&&!Df.call(t,"cause")?"{ ["+String(t)+"] "+Qe.call(Da.call("[cause]: "+_(t.cause),P),", ")+" }":P.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Qe.call(P,", ")+" }"}if(typeof t=="object"&&o){if(ja&&typeof t[ja]=="function"&&Ti)return Ti(t,{depth:u-n});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(gs(t)){var O=[];return Ta&&Ta.call(t,function(C,J){O.push(_(J,t,!0)+" => "+_(C,t))}),$a("Map",Zr.call(t),O,m)}if(ms(t)){var B=[];return Ia&&Ia.call(t,function(C){B.push(_(C,t))}),$a("Set",Hr.call(t),B,m)}if(_s(t))return In("WeakMap");if(ws(t))return In("WeakSet");if(bs(t))return In("WeakRef");if(hs(t))return Xt(_(Number(t)));if(ps(t))return Xt(_(Ai.call(t)));if(ds(t))return Xt(ts.call(t));if(cs(t))return Xt(_(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof _e<"u"&&t===_e)return"{ [object globalThis] }";if(!us(t)&&!xa(t)){var U=Sr(t,_),q=Ma?Ma(t)===Object.prototype:t instanceof Object||t.constructor===Object,j=t instanceof Object?"":"null prototype",te=!q&&rr&&Object(t)===t&&rr in t?Xi.call(gt(t),8,-1):j?"Object":"",X=q||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",b=X+(te||j?"["+Qe.call(Da.call([],te||[],j||[]),": ")+"] ":"");return U.length===0?b+"{}":m?b+"{"+Pi(U,m)+"}":b+"{ "+Qe.call(U,", ")+" }"}return String(t)};function Mf(e,t,r){var n=r.quoteStyle||t,i=Lf[n];return i+e+i}function ls(e){return ht.call(String(e),/"/g,""")}function Nt(e){return!rr||!(typeof e=="object"&&(rr in e||typeof e[rr]<"u"))}function Ii(e){return gt(e)==="[object Array]"&&Nt(e)}function us(e){return gt(e)==="[object Date]"&&Nt(e)}function xa(e){return gt(e)==="[object RegExp]"&&Nt(e)}function ss(e){return gt(e)==="[object Error]"&&Nt(e)}function cs(e){return gt(e)==="[object String]"&&Nt(e)}function hs(e){return gt(e)==="[object Number]"&&Nt(e)}function ds(e){return gt(e)==="[object Boolean]"&&Nt(e)}function kf(e){if(Zt)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Oi)return!1;try{return Oi.call(e),!0}catch{}return!1}function ps(e){if(!e||typeof e!="object"||!Ai)return!1;try{return Ai.call(e),!0}catch{}return!1}var ys=Object.prototype.hasOwnProperty||function(e){return e in this};function it(e,t){return ys.call(e,t)}function gt(e){return rs.call(e)}function vs(e){if(e.name)return e.name;var t=is.call(ns.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Ff(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function gs(e){if(!Zr||!e||typeof e!="object")return!1;try{Zr.call(e);try{Hr.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function _s(e){if(!er||!e||typeof e!="object")return!1;try{er.call(e,er);try{tr.call(e,tr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function bs(e){if(!Pa||!e||typeof e!="object")return!1;try{return Pa.call(e),!0}catch{}return!1}function ms(e){if(!Hr||!e||typeof e!="object")return!1;try{Hr.call(e);try{Zr.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function ws(e){if(!tr||!e||typeof e!="object")return!1;try{tr.call(e,tr);try{er.call(e,er)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Es(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function jf(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return jf(Xi.call(e,0,t.maxStringLength),t)+n}var i=fs[t.quoteStyle||"single"];i.lastIndex=0;var a=ht.call(ht.call(e,i,"\\$1"),/[\x00-\x1f]/g,Ss);return Mf(a,"single",t)}function Ss(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+as.call(t.toString(16))}function Xt(e){return"Object("+e+")"}function In(e){return e+" { ? }"}function $a(e,t,r,n){var i=n?Pi(r,n):Qe.call(r,", ");return e+" ("+t+") {"+i+"}"}function Rs(e){for(var t=0;t<e.length;t++)if(Ff(e[t],`
|
|
2
2
|
`)>=0)return!1;return!0}function As(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Qe.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Qe.call(Array(t+1),r)}}function Pi(e,t){if(e.length===0)return"";var r=`
|
|
3
3
|
`+t.prev+t.base;return r+Qe.call(e,","+r)+`
|
|
4
4
|
`+t.prev}function Sr(e,t){var r=Ii(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=it(e,i)?t(e[i],e):""}var a=typeof Tn=="function"?Tn(e):[],o;if(Zt){o={};for(var f=0;f<a.length;f++)o["$"+a[f]]=a[f]}for(var d in e)it(e,d)&&(r&&String(Number(d))===d&&d<e.length||Zt&&o["$"+d]instanceof Symbol||(Nf.call(/[^\w$]/,d)?n.push(t(d,e)+": "+t(e[d],e)):n.push(d+": "+t(e[d],e))));if(typeof Tn=="function")for(var l=0;l<a.length;l++)Df.call(e,a[l])&&n.push("["+t(a[l])+"]: "+t(e[a[l]],e));return n}var Os=nn,Ts=ft,an=function(e,t,r){for(var n=e,i;(i=n.next)!=null;n=i)if(i.key===t)return n.next=i.next,r||(i.next=e.next,e.next=i),i},Is=function(e,t){if(e){var r=an(e,t);return r&&r.value}},Ps=function(e,t,r){var n=an(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},Ns=function(e,t){return e?!!an(e,t):!1},Ds=function(e,t){if(e)return an(e,t,!0)},Ls=function(){var t,r={assert:function(n){if(!r.has(n))throw new Ts("Side channel does not contain "+Os(n))},delete:function(n){var i=t&&t.next,a=Ds(t,n);return a&&i&&i===a&&(t=void 0),!!a},get:function(n){return Is(t,n)},has:function(n){return Ns(t,n)},set:function(n,i){t||(t={next:void 0}),Ps(t,n,i)}};return r},Ji=Object,Ms=Error,ks=EvalError,Fs=RangeError,js=ReferenceError,xf=SyntaxError,xs=URIError,$s=Math.abs,Cs=Math.floor,Bs=Math.max,Us=Math.min,qs=Math.pow,zs=Math.round,Zs=Number.isNaN||function(t){return t!==t},Hs=Zs,Ws=function(t){return Hs(t)||t===0?t:t<0?-1:1},Gs=Object.getOwnPropertyDescriptor,Dr=Gs;if(Dr)try{Dr([],"length")}catch{Dr=null}var Wt=Dr,Lr=Object.defineProperty||!1;if(Lr)try{Lr({},"a",{value:1})}catch{Lr=!1}var on=Lr,Qi=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,r);if(f.value!==i||f.enumerable!==!0)return!1}return!0},Pn,Ca;function Vs(){if(Ca)return Pn;Ca=1;var e=typeof Symbol<"u"&&Symbol,t=Qi;return Pn=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Pn}var Nn,Ba;function $f(){return Ba||(Ba=1,Nn=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Nn}var Dn,Ua;function Cf(){if(Ua)return Dn;Ua=1;var e=Ji;return Dn=e.getPrototypeOf||null,Dn}var Ln,qa;function Ks(){if(qa)return Ln;qa=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(d,l){for(var u=[],m=0;m<d.length;m+=1)u[m]=d[m];for(var _=0;_<l.length;_+=1)u[_+d.length]=l[_];return u},a=function(d,l){for(var u=[],m=l,_=0;m<d.length;m+=1,_+=1)u[_]=d[m];return u},o=function(f,d){for(var l="",u=0;u<f.length;u+=1)l+=f[u],u+1<f.length&&(l+=d);return l};return Ln=function(d){var l=this;if(typeof l!="function"||t.apply(l)!==n)throw new TypeError(e+l);for(var u=a(arguments,1),m,_=function(){if(this instanceof m){var M=l.apply(this,i(u,arguments));return Object(M)===M?M:this}return l.apply(d,i(u,arguments))},S=r(0,l.length-u.length),D=[],k=0;k<S;k++)D[k]="$"+k;if(m=Function("binder","return function ("+o(D,",")+"){ return binder.apply(this,arguments); }")(_),l.prototype){var F=function(){};F.prototype=l.prototype,m.prototype=new F,F.prototype=null}return m},Ln}var Mn,za;function dr(){if(za)return Mn;za=1;var e=Ks();return Mn=Function.prototype.bind||e,Mn}var kn,Za;function ea(){return Za||(Za=1,kn=Function.prototype.call),kn}var Fn,Ha;function ta(){return Ha||(Ha=1,Fn=Function.prototype.apply),Fn}var Ys=typeof Reflect<"u"&&Reflect&&Reflect.apply,Xs=dr(),Js=ta(),Qs=ea(),ec=Ys,Bf=ec||Xs.call(Qs,Js),tc=dr(),rc=ft,nc=ea(),ic=Bf,ra=function(t){if(t.length<1||typeof t[0]!="function")throw new rc("a function is required");return ic(tc,nc,t)},jn,Wa;function ac(){if(Wa)return jn;Wa=1;var e=ra,t=Wt,r;try{r=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return jn=n&&typeof n.get=="function"?e([n.get]):typeof a=="function"?function(f){return a(f==null?f:i(f))}:!1,jn}var xn,Ga;function Uf(){if(Ga)return xn;Ga=1;var e=$f(),t=Cf(),r=ac();return xn=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,xn}var $n,Va;function qf(){if(Va)return $n;Va=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=dr();return $n=r.call(e,t),$n}var pe,oc=Ji,fc=Ms,lc=ks,uc=Fs,sc=js,Ht=xf,Ut=ft,cc=xs,hc=$s,dc=Cs,pc=Bs,yc=Us,vc=qs,gc=zs,_c=Ws,zf=Function,Cn=function(e){try{return zf('"use strict"; return ('+e+").constructor;")()}catch{}},lr=Wt,bc=on,Bn=function(){throw new Ut},mc=lr?function(){try{return arguments.callee,Bn}catch{try{return lr(arguments,"callee").get}catch{return Bn}}}():Bn,Mt=Vs()(),Pe=Uf(),wc=Cf(),Ec=$f(),Zf=ta(),pr=ea(),$t={},Sc=typeof Uint8Array>"u"||!Pe?pe:Pe(Uint8Array),St={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":Mt&&Pe?Pe([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":$t,"%AsyncGenerator%":$t,"%AsyncGeneratorFunction%":$t,"%AsyncIteratorPrototype%":$t,"%Atomics%":typeof Atomics>"u"?pe:Atomics,"%BigInt%":typeof BigInt>"u"?pe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":fc,"%eval%":eval,"%EvalError%":lc,"%Float32Array%":typeof Float32Array>"u"?pe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pe:FinalizationRegistry,"%Function%":zf,"%GeneratorFunction%":$t,"%Int8Array%":typeof Int8Array>"u"?pe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Mt&&Pe?Pe(Pe([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map>"u"?pe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Mt||!Pe?pe:Pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":oc,"%Object.getOwnPropertyDescriptor%":lr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pe:Promise,"%Proxy%":typeof Proxy>"u"?pe:Proxy,"%RangeError%":uc,"%ReferenceError%":sc,"%Reflect%":typeof Reflect>"u"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Mt||!Pe?pe:Pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Mt&&Pe?Pe(""[Symbol.iterator]()):pe,"%Symbol%":Mt?Symbol:pe,"%SyntaxError%":Ht,"%ThrowTypeError%":mc,"%TypedArray%":Sc,"%TypeError%":Ut,"%Uint8Array%":typeof Uint8Array>"u"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pe:Uint32Array,"%URIError%":cc,"%WeakMap%":typeof WeakMap>"u"?pe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pe:WeakSet,"%Function.prototype.call%":pr,"%Function.prototype.apply%":Zf,"%Object.defineProperty%":bc,"%Object.getPrototypeOf%":wc,"%Math.abs%":hc,"%Math.floor%":dc,"%Math.max%":pc,"%Math.min%":yc,"%Math.pow%":vc,"%Math.round%":gc,"%Math.sign%":_c,"%Reflect.getPrototypeOf%":Ec};if(Pe)try{null.error}catch(e){var Rc=Pe(Pe(e));St["%Error.prototype%"]=Rc}var Ac=function e(t){var r;if(t==="%AsyncFunction%")r=Cn("async function () {}");else if(t==="%GeneratorFunction%")r=Cn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Cn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Pe&&(r=Pe(i.prototype))}return St[t]=r,r},Ka={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},yr=dr(),Wr=qf(),Oc=yr.call(pr,Array.prototype.concat),Tc=yr.call(Zf,Array.prototype.splice),Ya=yr.call(pr,String.prototype.replace),Gr=yr.call(pr,String.prototype.slice),Ic=yr.call(pr,RegExp.prototype.exec),Pc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Nc=/\\(\\)?/g,Dc=function(t){var r=Gr(t,0,1),n=Gr(t,-1);if(r==="%"&&n!=="%")throw new Ht("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ht("invalid intrinsic syntax, expected opening `%`");var i=[];return Ya(t,Pc,function(a,o,f,d){i[i.length]=f?Ya(d,Nc,"$1"):o||a}),i},Lc=function(t,r){var n=t,i;if(Wr(Ka,n)&&(i=Ka[n],n="%"+i[0]+"%"),Wr(St,n)){var a=St[n];if(a===$t&&(a=Ac(n)),typeof a>"u"&&!r)throw new Ut("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Ht("intrinsic "+t+" does not exist!")},vr=function(t,r){if(typeof t!="string"||t.length===0)throw new Ut("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ut('"allowMissing" argument must be a boolean');if(Ic(/^%?[^%]*%?$/,t)===null)throw new Ht("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Dc(t),i=n.length>0?n[0]:"",a=Lc("%"+i+"%",r),o=a.name,f=a.value,d=!1,l=a.alias;l&&(i=l[0],Tc(n,Oc([0,1],l)));for(var u=1,m=!0;u<n.length;u+=1){var _=n[u],S=Gr(_,0,1),D=Gr(_,-1);if((S==='"'||S==="'"||S==="`"||D==='"'||D==="'"||D==="`")&&S!==D)throw new Ht("property names with quotes must have matching quotes");if((_==="constructor"||!m)&&(d=!0),i+="."+_,o="%"+i+"%",Wr(St,o))f=St[o];else if(f!=null){if(!(_ in f)){if(!r)throw new Ut("base intrinsic for "+t+" exists, but the property is not available.");return}if(lr&&u+1>=n.length){var k=lr(f,_);m=!!k,m&&"get"in k&&!("originalValue"in k.get)?f=k.get:f=f[_]}else m=Wr(f,_),f=f[_];m&&!d&&(St[o]=f)}}return f},Hf=vr,Wf=ra,Mc=Wf([Hf("%String.prototype.indexOf%")]),_t=function(t,r){var n=Hf(t,!!r);return typeof n=="function"&&Mc(t,".prototype.")>-1?Wf([n]):n},kc=vr,gr=_t,Fc=nn,jc=ft,Xa=kc("%Map%",!0),xc=gr("Map.prototype.get",!0),$c=gr("Map.prototype.set",!0),Cc=gr("Map.prototype.has",!0),Bc=gr("Map.prototype.delete",!0),Uc=gr("Map.prototype.size",!0),Gf=!!Xa&&function(){var t,r={assert:function(n){if(!r.has(n))throw new jc("Side channel does not contain "+Fc(n))},delete:function(n){if(t){var i=Bc(t,n);return Uc(t)===0&&(t=void 0),i}return!1},get:function(n){if(t)return xc(t,n)},has:function(n){return t?Cc(t,n):!1},set:function(n,i){t||(t=new Xa),$c(t,n,i)}};return r},qc=vr,fn=_t,zc=nn,Rr=Gf,Zc=ft,kt=qc("%WeakMap%",!0),Hc=fn("WeakMap.prototype.get",!0),Wc=fn("WeakMap.prototype.set",!0),Gc=fn("WeakMap.prototype.has",!0),Vc=fn("WeakMap.prototype.delete",!0),Kc=kt?function(){var t,r,n={assert:function(i){if(!n.has(i))throw new Zc("Side channel does not contain "+zc(i))},delete:function(i){if(kt&&i&&(typeof i=="object"||typeof i=="function")){if(t)return Vc(t,i)}else if(Rr&&r)return r.delete(i);return!1},get:function(i){return kt&&i&&(typeof i=="object"||typeof i=="function")&&t?Hc(t,i):r&&r.get(i)},has:function(i){return kt&&i&&(typeof i=="object"||typeof i=="function")&&t?Gc(t,i):!!r&&r.has(i)},set:function(i,a){kt&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new kt),Wc(t,i,a)):Rr&&(r||(r=Rr()),r.set(i,a))}};return n}:Rr,Yc=ft,Xc=nn,Jc=Ls,Qc=Gf,eh=Kc,th=eh||Qc||Jc,rh=function(){var t,r={assert:function(n){if(!r.has(n))throw new Yc("Side channel does not contain "+Xc(n))},delete:function(n){return!!t&&t.delete(n)},get:function(n){return t&&t.get(n)},has:function(n){return!!t&&t.has(n)},set:function(n,i){t||(t=th()),t.set(n,i)}};return r},nh=String.prototype.replace,ih=/%20/g,Un={RFC1738:"RFC1738",RFC3986:"RFC3986"},na={default:Un.RFC3986,formatters:{RFC1738:function(e){return nh.call(e,ih,"+")},RFC3986:function(e){return String(e)}},RFC1738:Un.RFC1738,RFC3986:Un.RFC3986},ah=na,qn=Object.prototype.hasOwnProperty,bt=Array.isArray,Ke=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),oh=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(bt(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);r.obj[r.prop]=i}}},Vf=function(t,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},fh=function e(t,r,n){if(!r)return t;if(typeof r!="object"&&typeof r!="function"){if(bt(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!qn.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return bt(t)&&!bt(r)&&(i=Vf(t,n)),bt(t)&&bt(r)?(r.forEach(function(a,o){if(qn.call(t,o)){var f=t[o];f&&typeof f=="object"&&a&&typeof a=="object"?t[o]=e(f,a,n):t.push(a)}else t[o]=a}),t):Object.keys(r).reduce(function(a,o){var f=r[o];return qn.call(a,o)?a[o]=e(a[o],f,n):a[o]=f,a},i)},lh=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},uh=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},zn=1024,sh=function(t,r,n,i,a){if(t.length===0)return t;var o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(S){return"%26%23"+parseInt(S.slice(2),16)+"%3B"});for(var f="",d=0;d<o.length;d+=zn){for(var l=o.length>=zn?o.slice(d,d+zn):o,u=[],m=0;m<l.length;++m){var _=l.charCodeAt(m);if(_===45||_===46||_===95||_===126||_>=48&&_<=57||_>=65&&_<=90||_>=97&&_<=122||a===ah.RFC1738&&(_===40||_===41)){u[u.length]=l.charAt(m);continue}if(_<128){u[u.length]=Ke[_];continue}if(_<2048){u[u.length]=Ke[192|_>>6]+Ke[128|_&63];continue}if(_<55296||_>=57344){u[u.length]=Ke[224|_>>12]+Ke[128|_>>6&63]+Ke[128|_&63];continue}m+=1,_=65536+((_&1023)<<10|l.charCodeAt(m)&1023),u[u.length]=Ke[240|_>>18]+Ke[128|_>>12&63]+Ke[128|_>>6&63]+Ke[128|_&63]}f+=u.join("")}return f},ch=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],o=a.obj[a.prop],f=Object.keys(o),d=0;d<f.length;++d){var l=f[d],u=o[l];typeof u=="object"&&u!==null&&n.indexOf(u)===-1&&(r.push({obj:o,prop:l}),n.push(u))}return oh(r),t},hh=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},dh=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},ph=function(t,r){return[].concat(t,r)},yh=function(t,r){if(bt(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},Kf={arrayToObject:Vf,assign:lh,combine:ph,compact:ch,decode:uh,encode:sh,isBuffer:dh,isRegExp:hh,maybeMap:yh,merge:fh},Yf=rh,Mr=Kf,nr=na,vh=Object.prototype.hasOwnProperty,Xf={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Je=Array.isArray,gh=Array.prototype.push,Jf=function(e,t){gh.apply(e,Je(t)?t:[t])},_h=Date.prototype.toISOString,Ja=nr.default,Oe={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Mr.encode,encodeValuesOnly:!1,filter:void 0,format:Ja,formatter:nr.formatters[Ja],indices:!1,serializeDate:function(t){return _h.call(t)},skipNulls:!1,strictNullHandling:!1},bh=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Zn={},mh=function e(t,r,n,i,a,o,f,d,l,u,m,_,S,D,k,F,M,T){for(var R=t,P=T,O=0,B=!1;(P=P.get(Zn))!==void 0&&!B;){var U=P.get(t);if(O+=1,typeof U<"u"){if(U===O)throw new RangeError("Cyclic object value");B=!0}typeof P.get(Zn)>"u"&&(O=0)}if(typeof u=="function"?R=u(r,R):R instanceof Date?R=S(R):n==="comma"&&Je(R)&&(R=Mr.maybeMap(R,function(I){return I instanceof Date?S(I):I})),R===null){if(o)return l&&!F?l(r,Oe.encoder,M,"key",D):r;R=""}if(bh(R)||Mr.isBuffer(R)){if(l){var q=F?r:l(r,Oe.encoder,M,"key",D);return[k(q)+"="+k(l(R,Oe.encoder,M,"value",D))]}return[k(r)+"="+k(String(R))]}var j=[];if(typeof R>"u")return j;var te;if(n==="comma"&&Je(R))F&&l&&(R=Mr.maybeMap(R,l)),te=[{value:R.length>0?R.join(",")||null:void 0}];else if(Je(u))te=u;else{var X=Object.keys(R);te=m?X.sort(m):X}var b=d?String(r).replace(/\./g,"%2E"):String(r),C=i&&Je(R)&&R.length===1?b+"[]":b;if(a&&Je(R)&&R.length===0)return C+"[]";for(var J=0;J<te.length;++J){var re=te[J],ie=typeof re=="object"&&re&&typeof re.value<"u"?re.value:R[re];if(!(f&&ie===null)){var ue=_&&d?String(re).replace(/\./g,"%2E"):String(re),ae=Je(R)?typeof n=="function"?n(C,ue):C:C+(_?"."+ue:"["+ue+"]");T.set(t,O);var z=Yf();z.set(Zn,T),Jf(j,e(ie,ae,n,i,a,o,f,d,n==="comma"&&F&&Je(R)?null:l,u,m,_,S,D,k,F,M,z))}}return j},wh=function(t){if(!t)return Oe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Oe.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=nr.default;if(typeof t.format<"u"){if(!vh.call(nr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=nr.formatters[n],a=Oe.filter;(typeof t.filter=="function"||Je(t.filter))&&(a=t.filter);var o;if(t.arrayFormat in Xf?o=t.arrayFormat:"indices"in t?o=t.indices?"indices":"repeat":o=Oe.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Oe.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Oe.addQueryPrefix,allowDots:f,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Oe.allowEmptyArrays,arrayFormat:o,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Oe.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Oe.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Oe.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Oe.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Oe.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Oe.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Oe.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Oe.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Oe.strictNullHandling}},Eh=function(e,t){var r=e,n=wh(t),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):Je(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof r!="object"||r===null)return"";var f=Xf[n.arrayFormat],d=f==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var l=Yf(),u=0;u<i.length;++u){var m=i[u],_=r[m];n.skipNulls&&_===null||Jf(o,mh(_,m,f,d,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var S=o.join(n.delimiter),D=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?D+="utf8=%26%2310003%3B&":D+="utf8=%E2%9C%93&"),S.length>0?D+S:""},Rt=Kf,Ni=Object.prototype.hasOwnProperty,Qa=Array.isArray,Re={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Rt.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Sh=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Qf=function(e,t,r){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},Rh="utf8=%26%2310003%3B",Ah="utf8=%E2%9C%93",Oh=function(t,r){var n={__proto__:null},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,r.throwOnLimitExceeded?a+1:a);if(r.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(a===1?"":"s")+" allowed.");var f=-1,d,l=r.charset;if(r.charsetSentinel)for(d=0;d<o.length;++d)o[d].indexOf("utf8=")===0&&(o[d]===Ah?l="utf-8":o[d]===Rh&&(l="iso-8859-1"),f=d,d=o.length);for(d=0;d<o.length;++d)if(d!==f){var u=o[d],m=u.indexOf("]="),_=m===-1?u.indexOf("="):m+1,S,D;_===-1?(S=r.decoder(u,Re.decoder,l,"key"),D=r.strictNullHandling?null:""):(S=r.decoder(u.slice(0,_),Re.decoder,l,"key"),D=Rt.maybeMap(Qf(u.slice(_+1),r,Qa(n[S])?n[S].length:0),function(F){return r.decoder(F,Re.decoder,l,"value")})),D&&r.interpretNumericEntities&&l==="iso-8859-1"&&(D=Sh(String(D))),u.indexOf("[]=")>-1&&(D=Qa(D)?[D]:D);var k=Ni.call(n,S);k&&r.duplicates==="combine"?n[S]=Rt.combine(n[S],D):(!k||r.duplicates==="last")&&(n[S]=D)}return n},Th=function(e,t,r,n){var i=0;if(e.length>0&&e[e.length-1]==="[]"){var a=e.slice(0,-1).join("");i=Array.isArray(t)&&t[a]?t[a].length:0}for(var o=n?t:Qf(t,r,i),f=e.length-1;f>=0;--f){var d,l=e[f];if(l==="[]"&&r.parseArrays)d=r.allowEmptyArrays&&(o===""||r.strictNullHandling&&o===null)?[]:Rt.combine([],o);else{d=r.plainObjects?{__proto__:null}:{};var u=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,m=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,_=parseInt(m,10);!r.parseArrays&&m===""?d={0:o}:!isNaN(_)&&l!==m&&String(_)===m&&_>=0&&r.parseArrays&&_<=r.arrayLimit?(d=[],d[_]=o):m!=="__proto__"&&(d[m]=o)}o=d}return o},Ih=function(t,r,n,i){if(t){var a=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/,f=/(\[[^[\]]*])/g,d=n.depth>0&&o.exec(a),l=d?a.slice(0,d.index):a,u=[];if(l){if(!n.plainObjects&&Ni.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var m=0;n.depth>0&&(d=f.exec(a))!==null&&m<n.depth;){if(m+=1,!n.plainObjects&&Ni.call(Object.prototype,d[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(d[1])}if(d){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");u.push("["+a.slice(d.index)+"]")}return Th(u,r,n,i)}},Ph=function(t){if(!t)return Re;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof t.charset>"u"?Re.charset:t.charset,n=typeof t.duplicates>"u"?Re.duplicates:t.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Re.allowDots:!!t.allowDots;return{allowDots:i,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Re.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Re.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Re.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Re.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Re.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Re.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Re.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Re.decoder,delimiter:typeof t.delimiter=="string"||Rt.isRegExp(t.delimiter)?t.delimiter:Re.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Re.depth,duplicates:n,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Re.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Re.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Re.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Re.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Re.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},Nh=function(e,t){var r=Ph(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof e=="string"?Oh(e,r):e,i=r.plainObjects?{__proto__:null}:{},a=Object.keys(n),o=0;o<a.length;++o){var f=a[o],d=Ih(f,n[f],r,typeof e=="string");i=Rt.merge(i,d,r)}return r.allowSparse===!0?i:Rt.compact(i)},Dh=Eh,Lh=Nh,Mh=na,kh={formats:Mh,parse:Lh,stringify:Dh};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Xu,n=kh;function i(N){return N&&typeof N=="object"&&"default"in N?N:{default:N}}var a=i(r),o=i(n),f=a.default;function d(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var l=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,m=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,_=["<",">",'"',"`"," ","\r",`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var h=(i,e,r)=>e in i?d(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var o=(i,e,r)=>h(i,typeof e!="symbol"?e+"":e,r);import{
|
|
1
|
+
var d=Object.defineProperty;var h=(i,e,r)=>e in i?d(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var o=(i,e,r)=>h(i,typeof e!="symbol"?e+"":e,r);import{ce as m,dj as w,bC as p,cq as g}from"../main.js";import{S as u}from"./sui-COEHPNCD.js";import"./blake2b-DUBWCh0U.js";import"./index-Nx8cks1z.js";class c{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=m(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await u.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new c(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const a=s.parsedJson;return w("Uint8Array",{emitterChain:this.chain,emitterAddress:new p(a.sender).toUniversalAddress(),sequence:BigInt(a.sequence),guardianSet:0,timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:a.nonce,signatures:[],payload:new Uint8Array(a.payload)})})}}g("Sui","WormholeCore",c);export{c as SuiWormholeCore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var oe=Object.defineProperty;var se=(m,t,e)=>t in m?oe(m,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[t]=e;var h=(m,t,e)=>se(m,typeof t!="symbol"?t+"":t,e);import{g as F,a as N,i as $,S as I,b,T as B,c as O,p as ae,d as ie,e as R,f as M,h as Q,j as ce,k as x,l as de,m as le}from"./sui-ByNmqUgP.js";import{dt as V,bA as ge,du as X,dv as S,ch as ue,cC as D,cD as q,cm as fe,cf as j,bC as C,a$ as v,cj as pe,cI as H,cF as he,dw as we,cn as W,bz as ye,aU as U,br as me,dj as ke,d6 as G,dx as be,dy as Ie,bB as L,cr as Z}from"../main.js";import"./index-DShwbc4p.js";import{S as ee}from"./unsignedTransaction-arVvzoJx.js";import"./blake2b-DUBWCh0U.js";import"./index-Nx8cks1z.js";const Y=async(m,t,e)=>{var d,r,n;if(!V(e))throw new Error(`Invalid Sui type: ${e}`);const i=await F(m,t);if(!i)throw new Error(`Unable to fetch object fields from token bridge state. Object ID: ${t}`);const o=(r=(d=i.token_registry.fields)==null?void 0:d.id)==null?void 0:r.id;if(!o)throw new Error("Unable to fetch token registry object ID");const a=ge((n=i.token_registry)==null?void 0:n.type);if(!a)throw new Error("Unable to fetch token registry package ID");return m.getDynamicFieldObject({parentId:o,name:{type:`${a}::token_registry::Key<${e}>`,value:{dummy_field:!1}}})},P=async(m,t,e,i)=>{var s,u,f,w;const o=await F(m,t);if(!o)throw new Error("Unable to fetch object fields from token bridge state");const a=(u=(s=o.token_registry)==null?void 0:s.fields)==null?void 0:u.coin_types,d=(w=(f=a==null?void 0:a.fields)==null?void 0:f.id)==null?void 0:w.id;if(!d)throw new Error("Unable to fetch coin types");const r=X(a==null?void 0:a.type);if(!r)throw new Error("Unable to get key type");const n=await m.getDynamicFieldObject({parentId:d,name:{type:r,value:{addr:[...e],chain:i}}});if(n.error){if(n.error.code==="dynamicFieldNotFound")return null;throw new Error(`Unexpected getDynamicFieldObject response ${n.error}`)}const l=N(n);if(!l)return null;if(!$(l))throw new Error("What?");return"value"in l?S(l.value):null};class z{constructor(t,e,i,o){h(this,"network");h(this,"chain");h(this,"provider");h(this,"contracts");h(this,"coreBridgeObjectId");h(this,"tokenBridgeObjectId");h(this,"chainId");this.network=t,this.chain=e,this.provider=i,this.contracts=o,this.chainId=ue.get(t,e);const a=this.contracts.tokenBridge;if(!a)throw new Error(`Wormhole Token Bridge contract for domain ${e} not found`);const d=this.contracts.coreBridge;if(!d)throw new Error(`Wormhole Token Bridge contract for domain ${e} not found`);this.tokenBridgeObjectId=a,this.coreBridgeObjectId=d}static async fromRpc(t,e){const[i,o]=await I.chainFromRpc(t),a=e[o];if(a.network!==i)throw new Error(`Network mismatch: ${a.network} != ${i}`);return new z(i,o,t,a.contracts)}async isWrappedAsset(t){try{return await this.getOriginalAsset(t),!0}catch{return!1}}async getOriginalAsset(t){let e=t.getCoinType();if(!V(e))throw new Error(`Invalid Sui type: ${e}`);const i=await Y(this.provider,this.tokenBridgeObjectId,e),o=N(i);if(!o)throw D(e);if(!$(o))throw new Error("Expected fields to be a MoveStruct");if(!("value"in o))throw new Error("Expected a `value` key in fields of MoveStruct");const a=o.value;if(!b(a))throw new Error("Expected fields to be a MoveStruct");const d=S(a.type);if(e=S(e),d.includes(`wrapped_asset::WrappedAsset<${e}>`)){const r=a.fields.info;if(!b(r))throw new Error("Expected fields to be a MoveStruct");const n=r.fields.token_address;if(!b(n))throw new Error("Expected fields to be a MoveStruct");if(!$(n.fields))throw new Error("Expected address data to be a MoveObject");if(!("value"in n.fields))throw new Error("Expected a `value` key in fields of MoveStruct");const l=n.fields.value;if(!b(l))throw new Error("Expected fields to be a MoveStruct");const s=new Uint8Array(l.fields.data);return{chain:fe(Number(r.fields.token_chain)),address:new q(s)}}throw D(e)}async getTokenUniversalAddress(t){let e=t.getCoinType();if(!V(e))throw new Error(`Invalid Sui type: ${e}`);const i=await Y(this.provider,this.tokenBridgeObjectId,e),o=N(i);if(!o)throw new Error(`Token of type ${e} has not been registered with the token bridge. Has it been attested?`);if(!$(o))throw new Error("Expected fields to be a MoveStruct");if(!("value"in o))throw new Error("Expected a `value` key in fields of MoveStruct");const a=o.value;if(!b(a))throw new Error("Expected fields to be a MoveStruct");const d=S(a.type);if(e=S(e),d.includes(`native_asset::NativeAsset<${e}>`)){const r=a.fields.token_address;if(!b(r))throw new Error("Expected fields to be a MoveStruct");if(!("value"in r.fields))throw new Error("Expected a `value` key in fields of MoveStruct");const n=r.fields.value;if(!b(n))throw new Error("Expected fields to be a MoveStruct");const l=new Uint8Array(n.fields.data);return new q(l)}throw new Error(`Token of type ${e} is not a native asset`)}async getTokenNativeAddress(t,e){const i=await P(this.provider,this.tokenBridgeObjectId,e.toUint8Array(),j(t));if(!i)throw new Error(`Token ${e.toString()} not found in token registry`);return new C(i)}async hasWrappedAsset(t){try{return await this.getWrappedAsset(t),!0}catch{}return!1}async getWrappedAsset(t){if(v(t.address))throw new Error("Token Address required, 'native' literal not supported");const e=await P(this.provider,this.tokenBridgeObjectId,t.address.toUniversalAddress().toUint8Array(),j(t.chain));if(!e)throw D(pe(t));return H(this.chain,e)}async isTransferCompleted(t){var r,n,l,s,u,f,w,y;const e=await F(this.provider,this.tokenBridgeObjectId);if(!e)throw new Error("Unable to fetch object fields from token bridge state");const i=(n=(r=e.consumed_vaas)==null?void 0:r.fields)==null?void 0:n.hashes,o=X((s=(l=i==null?void 0:i.fields)==null?void 0:l.items)==null?void 0:s.type);if(!o)throw new Error("Unable to get key type");const a=(y=(w=(f=(u=i==null?void 0:i.fields)==null?void 0:u.items)==null?void 0:f.fields)==null?void 0:w.id)==null?void 0:y.id;if(!a)throw new Error("Unable to fetch consumed VAAs table");const d=await this.provider.getDynamicFieldObject({parentId:a,name:{type:o,value:{data:[...he(t.hash)]}}});if(!d.error)return!0;if(d.error.code==="dynamicFieldNotFound")return!1;throw new Error(`Unexpected getDynamicFieldObject response ${d.error}`)}async*createAttestation(t){const e=0n,o=t.toString(),a=await this.provider.getCoinMetadata({coinType:o});if(a===null||a.id===null)throw new Error(`Coin metadata ID for type ${o} not found`);const[d,r]=await this.getPackageIds(),n=new B,[l]=n.splitCoins(n.gas,[n.pure.u64(e)]),[s]=n.moveCall({target:`${r}::attest_token::attest_token`,arguments:[n.object(this.tokenBridgeObjectId),n.object(a.id),n.pure.u32(0)],typeArguments:[o]});n.moveCall({target:`${d}::publish_message::publish_message`,arguments:[n.object(this.coreBridgeObjectId),l,s,n.object(O)]}),yield this.createUnsignedTx(n,"Sui.TokenBridge.CreateAttestation")}async*submitAttestation(t,e){const[i,o]=await this.getPackageIds(),a=e.toString(),d=Math.min(t.payload.decimals,8),r=await this.getCoinBuildOutput(i,o,d),n=await ae(r,a);yield this.createUnsignedTx(n,"Sui.TokenBridge.PrepareCreateWrapped");let l="",s="",u="",f="",w="",y=!1;for(;!y;){await new Promise(p=>setTimeout(p,500));const _=await this.provider.queryTransactionBlocks({filter:{FromAddress:a},options:{showObjectChanges:!0},limit:3});for(const p of _.data)if("objectChanges"in p){for(const g of p.objectChanges)ie(g)&&g.packageId!==void 0?l=g.packageId:R(g)&&g.objectType.includes("WrappedAssetSetup")?(s=g.objectId,w=g.objectType.split(", ")[1].replace(">","")):R(g)&&g.objectType.includes("UpgradeCap")?u=g.objectId:R(g)&&g.objectType.includes("CoinMetadata")&&(f=g.objectId);if(l!==""&&s!==""&&u!==""&&f!==""){y=!0;break}else l="",s="",u="",f=""}}const k=we(l),c=new B,[A]=c.moveCall({target:`${i}::vaa::parse_and_verify`,arguments:[c.object(this.coreBridgeObjectId),c.pure.vector("u8",W(t)),c.object(O)]}),[E]=c.moveCall({target:`${o}::vaa::verify_only_once`,arguments:[c.object(this.tokenBridgeObjectId),A]});c.moveCall({target:`${o}::create_wrapped::complete_registration`,arguments:[c.object(this.tokenBridgeObjectId),c.object(f),c.object(s),c.object(u),E],typeArguments:[k,w]}),yield this.createUnsignedTx(c,"Sui.TokenBridge.SubmitAttestation")}async*transfer(t,e,i,o,a){const d=0n,r=0n,l=t.toString(),s=(v(i)?M:i).toString(),u=await I.getCoins(this.provider,t,s),[f,...w]=u.filter(p=>Q(p.coinType,s));if(f===void 0)throw new Error(`Coins array doesn't contain any coins of type ${s}`);const[y,k]=await this.getPackageIds(),c=new B,[A]=(()=>{if(s===M)return c.splitCoins(c.gas,[c.pure.u64(o)]);{const p=c.object(f.coinObjectId);return w.length&&c.mergeCoins(p,w.map(g=>c.object(g.coinObjectId))),c.splitCoins(p,[c.pure.u64(o)])}})(),[E]=c.splitCoins(c.gas,[c.pure.u64(d)]),[_]=c.moveCall({target:`${k}::state::verified_asset`,arguments:[c.object(this.tokenBridgeObjectId)],typeArguments:[s]});if(a){if(!l)throw new Error("senderAddress is required for transfer with payload");let p=!1;const g=await(async()=>{const K=await ce(this.provider,y,l);if(K!==null)return c.object(K);{const[ne]=c.moveCall({target:`${y}::emitter::new`,arguments:[c.object(this.coreBridgeObjectId)]});return p=!0,ne}})(),[T,te]=c.moveCall({target:`${k}::transfer_tokens_with_payload::prepare_transfer`,arguments:[g,_,A,c.pure.u16(j(e.chain)),c.pure.vector("u8",e.address.toUint8Array()),c.pure.vector("u8",a),c.pure.u32(0)],typeArguments:[s]});c.moveCall({target:`${k}::coin_utils::return_nonzero`,arguments:[te],typeArguments:[s]});const[re]=c.moveCall({target:`${k}::transfer_tokens_with_payload::transfer_tokens_with_payload`,arguments:[c.object(this.tokenBridgeObjectId),T],typeArguments:[s]});c.moveCall({target:`${y}::publish_message::publish_message`,arguments:[c.object(this.coreBridgeObjectId),E,re,c.object(O)]}),p&&c.transferObjects([g],c.pure.address(l)),yield this.createUnsignedTx(c,"Sui.TokenBridge.TransferWithPayload")}else{const[p,g]=c.moveCall({target:`${k}::transfer_tokens::prepare_transfer`,arguments:[_,A,c.pure.u16(j(e.chain)),c.pure.vector("u8",e.address.toUint8Array()),c.pure.u64(r),c.pure.u32(0)],typeArguments:[s]});c.moveCall({target:`${k}::coin_utils::return_nonzero`,arguments:[g],typeArguments:[s]});const[T]=c.moveCall({target:`${k}::transfer_tokens::transfer_tokens`,arguments:[c.object(this.tokenBridgeObjectId),p],typeArguments:[s]});c.moveCall({target:`${y}::publish_message::publish_message`,arguments:[c.object(this.coreBridgeObjectId),E,T,c.object(O)]}),yield this.createUnsignedTx(c,"Sui.TokenBridge.Transfer")}}async*redeem(t,e,i=!0){const o=await P(this.provider,this.tokenBridgeObjectId,e.payload.token.address.toUint8Array(),j(e.payload.token.chain));if(!o)throw new Error("Unable to fetch token coinType");const[a,d]=await this.getPackageIds(),r=new B,[n]=r.moveCall({target:`${a}::vaa::parse_and_verify`,arguments:[r.object(this.coreBridgeObjectId),r.pure.vector("u8",W(e)),r.object(O)]}),[l]=r.moveCall({target:`${d}::vaa::verify_only_once`,arguments:[r.object(this.tokenBridgeObjectId),n]}),[s]=r.moveCall({target:`${d}::complete_transfer::authorize_transfer`,arguments:[r.object(this.tokenBridgeObjectId),l],typeArguments:[o]}),[u]=r.moveCall({target:`${d}::complete_transfer::redeem_relayer_payout`,arguments:[s],typeArguments:[o]});r.moveCall({target:`${d}::coin_utils::return_nonzero`,arguments:[u],typeArguments:[o]}),yield this.createUnsignedTx(r,"Sui.TokenBridge.Redeem")}async getWrappedNative(){return H(this.chain,M)}async getPackageIds(){return Promise.all([x(this.provider,this.coreBridgeObjectId),x(this.provider,this.tokenBridgeObjectId)])}async getCoinBuildOutput(t,e,i){var r;if(i>8)throw new Error("Decimals is capped at 8");const o=(r=await de(this.provider,this.tokenBridgeObjectId))==null?void 0:r.replace("0x","");if(!o)throw new Error(`Original token bridge package ID not found for object ID ${this.tokenBridgeObjectId}`);const a="a11ceb0b060000000901000a020a14031e1704350405392d07669f01088502600ae502050cea02160004010b010c0205020d000002000201020003030c020001000104020700000700010001090801010c020a050600030803040202000302010702080007080100020800080303090002070801010b020209000901010608010105010b0202080008030209000504434f494e095478436f6e7465787408565f5f305f325f3011577261707065644173736574536574757004636f696e0e6372656174655f777261707065640b64756d6d795f6669656c6404696e697414707265706172655f726567697374726174696f6e0f7075626c69635f7472616e736665720673656e646572087472616e736665720a74785f636f6e746578740f76657273696f6e5f636f6e74726f6c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"+o+"00020106010000000001090b0031"+i.toString(16).padStart(2,"0")+"0a0138000b012e110238010200";return{modules:[ye.encode(U.decode(a))],dependencies:["0x1","0x2",e,t].map(n=>me(n))}}createUnsignedTx(t,e,i=!1){return new ee(t,this.network,this.chain,e,i)}}class J{constructor(t,e,i,o){h(this,"network");h(this,"chain");h(this,"connection");h(this,"contracts");h(this,"tokenBridgeRelayerObjectId");h(this,"coreBridgeObjectId");h(this,"tokenBridgeObjectId");h(this,"fields");this.network=t,this.chain=e,this.connection=i,this.contracts=o;const{tokenBridge:a,tokenBridgeRelayer:d,coreBridge:r}=o;if(!a||!d||!r)throw new Error(`Some object IDs for ${e} Automatic Token Bridge not found`);this.tokenBridgeRelayerObjectId=d,this.tokenBridgeObjectId=a,this.coreBridgeObjectId=r}static async fromRpc(t,e){const[i,o]=await I.chainFromRpc(t),a=e[o];if(a.network!==i)throw new Error(`Network mismatch for chain ${o}: ${a.network} != ${i}`);return new J(i,o,t,a.contracts)}async*transfer(t,e,i,o,a){const r=new C(v(i)?I.nativeTokenId(this.network,this.chain).address:i).getCoinType(),{coreBridge:n,tokenBridge:l}=await this.getPackageIds(),s=new B,u=BigInt(0),[f]=s.splitCoins(s.gas,[s.pure.u64(u)]),[w]=await(async()=>{if(v(i))return s.splitCoins(s.gas,[s.pure.u64(o)]);{const E=await I.getCoins(this.connection,t,r),[_,...p]=E.filter(T=>T.coinType===r);if(_===void 0)throw new Error(`Coins array doesn't contain any coins of type ${r}`);const g=s.object(_.coinObjectId);return p.length&&s.mergeCoins(g,p.map(T=>s.object(T.coinObjectId))),s.splitCoins(g,[s.pure.u64(o)])}})(),[y]=s.moveCall({target:`${l}::state::verified_asset`,arguments:[s.object(this.tokenBridgeObjectId)],typeArguments:[r]}),k=await this.getPackageId(),[c]=s.moveCall({target:`${k}::transfer::transfer_tokens_with_relay`,arguments:[s.object(this.tokenBridgeRelayerObjectId),w,y,s.pure.u64(a??0n),s.pure.u16(j(e.chain)),s.pure.address(U.encode(e.address.toUint8Array(),!0)),s.pure.u32(123)],typeArguments:[r]}),[A]=s.moveCall({target:`${l}::transfer_tokens_with_payload::transfer_tokens_with_payload`,arguments:[s.object(this.tokenBridgeObjectId),c],typeArguments:[r]});s.moveCall({target:`${n}::publish_message::publish_message`,arguments:[s.object(this.coreBridgeObjectId),f,A,s.object(O)]}),yield this.createUnsignedTx(s,"AutomaticTokenBridge.transfer")}async*redeem(t,e){const{coreBridge:i,tokenBridge:o}=await this.getPackageIds(),{address:a,chain:d}=e.payload.token,r=await P(this.connection,this.tokenBridgeObjectId,a.toUniversalAddress().toUint8Array(),j(d));if(!r)throw new Error("Unable to fetch token coinType");const n=new B,[l]=n.moveCall({target:`${i}::vaa::parse_and_verify`,arguments:[n.object(this.coreBridgeObjectId),n.pure.vector("u8",W(e)),n.object(O)]}),[s]=n.moveCall({target:`${o}::vaa::verify_only_once`,arguments:[n.object(this.tokenBridgeObjectId),l]}),[u]=n.moveCall({target:`${o}::complete_transfer_with_payload::authorize_transfer`,arguments:[n.object(this.tokenBridgeObjectId),s],typeArguments:[r]}),f=await this.getPackageId();n.moveCall({target:`${f}::redeem::complete_transfer`,arguments:[n.object(this.tokenBridgeRelayerObjectId),u],typeArguments:[r]}),yield this.createUnsignedTx(n,"AutomaticTokenBridge.redeem")}async getRelayerFee(t,e){const i=v(e)?I.nativeTokenId(this.network,this.chain):e,o=await this.getTokenInfo(i.toString());if(o===null)throw new Error("Unsupported token for relay");const a=await this.getFields(),d=await this.connection.getDynamicFieldObject({parentId:this.tokenBridgeRelayerObjectId,name:{type:"vector<u8>",value:Array.from(ke.encode("relayer_fees"))}});if(!d.data||!d.data.content)throw d.error?new Error("Failed to get relayer fees: "+JSON.stringify(d.error)):new Error("Unable to compute relayer fee");const{content:r}=d.data;if(!b(r)||!le(r.fields.id))throw new Error("Unable to compute relayer fee");const n=await this.connection.getDynamicFieldObject({parentId:r.fields.id.id,name:{type:"u16",value:j(t)}});if(!n.data||!n.data.content)throw n.error?new Error("Failed to get relayer fees: "+JSON.stringify(d.error)):new Error("Unable to compute relayer fee");const{content:l}=n.data;if(!b(l))throw new Error("Unable to compute relayer fee");const s=await I.getDecimals(this.chain,this.connection,e.toString()),u=o.swap_rate,f=a.relayer_fee_precision,w=a.swap_rate_precision,y=l.fields.value;return 10n**BigInt(s)*BigInt(y)*BigInt(w)/(BigInt(u)*BigInt(f))}async maxSwapAmount(t){var n,l;const i=(v(t)?I.nativeTokenId(this.network,this.chain):t).toString(),o=await this.connection.getCoinMetadata({coinType:i});if(!o)throw new Error("metadata is null");const a=await this.getPackageId(),d=new B;d.moveCall({target:`${a}::redeem::calculate_max_swap_amount_in`,arguments:[d.object(this.tokenBridgeRelayerObjectId),d.pure.u8(o.decimals)],typeArguments:[i]});const r=await this.connection.devInspectTransactionBlock({transactionBlock:d,sender:U.encode(new Uint8Array(32))});if(!r.results||r.results.length==0||!((n=r.results[0])!=null&&n.returnValues)||((l=r.results[0])==null?void 0:l.returnValues.length)!==1)throw Error("swap rate not set");return G.decode(new Uint8Array(r.results[0].returnValues[0][0].toReversed()))}async nativeTokenAmount(t,e){var l,s;const o=(v(t)?I.nativeTokenId(this.network,this.chain):t).toString(),a=await this.connection.getCoinMetadata({coinType:o});if(!a)throw new Error("metadata is null");const d=await this.getPackageId(),r=new B;r.moveCall({target:`${d}::redeem::calculate_native_swap_amount_out`,arguments:[r.object(this.tokenBridgeRelayerObjectId),r.pure.u64(e),r.pure.u8(a.decimals)],typeArguments:[o]});const n=await this.connection.devInspectTransactionBlock({transactionBlock:r,sender:U.encode(new Uint8Array(32))});if(!n.results||n.results.length==0||!((l=n.results[0])!=null&&l.returnValues)||((s=n.results[0])==null?void 0:s.returnValues.length)!==1)throw Error("swap rate not set");return G.decode(new Uint8Array(n.results[0].returnValues[0][0].toReversed()))}async getRegisteredTokens(){const e=(await this.getFields()).registered_tokens.fields.id.id;return(await this.connection.getDynamicFields({parentId:e})).data.map(a=>{const{address:d,module:r,name:n}=be(a.objectType);return new C([d,r,n].join(Ie))})}async isRegisteredToken(t){const e=new C(v(t)?I.nativeTokenId(this.network,this.chain).address:t).unwrap();try{return await this.getTokenInfo(e)!==null}catch(i){console.error(i)}return!1}async getTokenInfo(t){var n;const e=await this.getFields(),o=new C(e.registered_tokens.type).getPackageId(),a=e.registered_tokens.fields.id.id,d=new C(t),r=Q(L,d.unwrap())?L:d.getCoinType();try{const l=await this.connection.getDynamicFieldObject({parentId:a,name:{type:`${o}::registered_tokens::Key<${r}>`,value:{dummy_field:!1}}});if(l.error)throw new Error("Failed to get token info: "+JSON.stringify(l.error));if(!l.data||!l.data.content)throw new Error("Failed to get token info: "+JSON.stringify(l));const{content:s}=l.data;return b(s)&&b(s.fields.value)?s.fields.value.fields:null}catch(l){if((l==null?void 0:l.code)===-32e3&&((n=l.message)!=null&&n.includes("RPC Error")))return console.error(l),null;throw l}}async getFields(){if(!this.fields){const t=await F(this.connection,this.tokenBridgeRelayerObjectId);if(t===null)throw new Error("Failed to get fields from token bridge relayer state");this.fields=t}return this.fields}async getPackageId(){const t=await this.getFields();return new C(t.registered_tokens.type).getPackageId()}async getPackageIds(){const[t,e]=await Promise.all([x(this.connection,this.coreBridgeObjectId),x(this.connection,this.tokenBridgeObjectId)]);return{coreBridge:t,tokenBridge:e}}createUnsignedTx(t,e,i=!1){return new ee(t,this.network,this.chain,e,i)}}Z("Sui","TokenBridge",z);Z("Sui","AutomaticTokenBridge",J);export{J as SuiAutomaticTokenBridge,z as SuiTokenBridge,P as getTokenCoinType,Y as getTokenFromTokenRegistry};
|
|
1
|
+
var oe=Object.defineProperty;var se=(m,t,e)=>t in m?oe(m,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[t]=e;var h=(m,t,e)=>se(m,typeof t!="symbol"?t+"":t,e);import{g as F,a as N,i as $,S as I,b,T as B,c as O,p as ae,d as ie,e as R,f as M,h as Q,j as ce,k as x,l as de,m as le}from"./sui-COEHPNCD.js";import{ds as V,bA as ge,dt as X,du as S,cg as ue,cB as D,cC as K,cl as fe,ce as j,bC as C,a$ as v,ci as pe,cH as H,cE as he,dv as we,cm as W,bz as ye,aU as U,br as me,di as ke,d5 as G,dw as be,dx as Ie,bB as L,cq as Z}from"../main.js";import"./index-EvC_Tjca.js";import{S as ee}from"./unsignedTransaction-arVvzoJx.js";import"./blake2b-DUBWCh0U.js";import"./index-Nx8cks1z.js";const Y=async(m,t,e)=>{var d,r,n;if(!V(e))throw new Error(`Invalid Sui type: ${e}`);const i=await F(m,t);if(!i)throw new Error(`Unable to fetch object fields from token bridge state. Object ID: ${t}`);const o=(r=(d=i.token_registry.fields)==null?void 0:d.id)==null?void 0:r.id;if(!o)throw new Error("Unable to fetch token registry object ID");const a=ge((n=i.token_registry)==null?void 0:n.type);if(!a)throw new Error("Unable to fetch token registry package ID");return m.getDynamicFieldObject({parentId:o,name:{type:`${a}::token_registry::Key<${e}>`,value:{dummy_field:!1}}})},P=async(m,t,e,i)=>{var s,u,f,w;const o=await F(m,t);if(!o)throw new Error("Unable to fetch object fields from token bridge state");const a=(u=(s=o.token_registry)==null?void 0:s.fields)==null?void 0:u.coin_types,d=(w=(f=a==null?void 0:a.fields)==null?void 0:f.id)==null?void 0:w.id;if(!d)throw new Error("Unable to fetch coin types");const r=X(a==null?void 0:a.type);if(!r)throw new Error("Unable to get key type");const n=await m.getDynamicFieldObject({parentId:d,name:{type:r,value:{addr:[...e],chain:i}}});if(n.error){if(n.error.code==="dynamicFieldNotFound")return null;throw new Error(`Unexpected getDynamicFieldObject response ${n.error}`)}const l=N(n);if(!l)return null;if(!$(l))throw new Error("What?");return"value"in l?S(l.value):null};class z{constructor(t,e,i,o){h(this,"network");h(this,"chain");h(this,"provider");h(this,"contracts");h(this,"coreBridgeObjectId");h(this,"tokenBridgeObjectId");h(this,"chainId");this.network=t,this.chain=e,this.provider=i,this.contracts=o,this.chainId=ue.get(t,e);const a=this.contracts.tokenBridge;if(!a)throw new Error(`Wormhole Token Bridge contract for domain ${e} not found`);const d=this.contracts.coreBridge;if(!d)throw new Error(`Wormhole Token Bridge contract for domain ${e} not found`);this.tokenBridgeObjectId=a,this.coreBridgeObjectId=d}static async fromRpc(t,e){const[i,o]=await I.chainFromRpc(t),a=e[o];if(a.network!==i)throw new Error(`Network mismatch: ${a.network} != ${i}`);return new z(i,o,t,a.contracts)}async isWrappedAsset(t){try{return await this.getOriginalAsset(t),!0}catch{return!1}}async getOriginalAsset(t){let e=t.getCoinType();if(!V(e))throw new Error(`Invalid Sui type: ${e}`);const i=await Y(this.provider,this.tokenBridgeObjectId,e),o=N(i);if(!o)throw D(e);if(!$(o))throw new Error("Expected fields to be a MoveStruct");if(!("value"in o))throw new Error("Expected a `value` key in fields of MoveStruct");const a=o.value;if(!b(a))throw new Error("Expected fields to be a MoveStruct");const d=S(a.type);if(e=S(e),d.includes(`wrapped_asset::WrappedAsset<${e}>`)){const r=a.fields.info;if(!b(r))throw new Error("Expected fields to be a MoveStruct");const n=r.fields.token_address;if(!b(n))throw new Error("Expected fields to be a MoveStruct");if(!$(n.fields))throw new Error("Expected address data to be a MoveObject");if(!("value"in n.fields))throw new Error("Expected a `value` key in fields of MoveStruct");const l=n.fields.value;if(!b(l))throw new Error("Expected fields to be a MoveStruct");const s=new Uint8Array(l.fields.data);return{chain:fe(Number(r.fields.token_chain)),address:new K(s)}}throw D(e)}async getTokenUniversalAddress(t){let e=t.getCoinType();if(!V(e))throw new Error(`Invalid Sui type: ${e}`);const i=await Y(this.provider,this.tokenBridgeObjectId,e),o=N(i);if(!o)throw new Error(`Token of type ${e} has not been registered with the token bridge. Has it been attested?`);if(!$(o))throw new Error("Expected fields to be a MoveStruct");if(!("value"in o))throw new Error("Expected a `value` key in fields of MoveStruct");const a=o.value;if(!b(a))throw new Error("Expected fields to be a MoveStruct");const d=S(a.type);if(e=S(e),d.includes(`native_asset::NativeAsset<${e}>`)){const r=a.fields.token_address;if(!b(r))throw new Error("Expected fields to be a MoveStruct");if(!("value"in r.fields))throw new Error("Expected a `value` key in fields of MoveStruct");const n=r.fields.value;if(!b(n))throw new Error("Expected fields to be a MoveStruct");const l=new Uint8Array(n.fields.data);return new K(l)}throw new Error(`Token of type ${e} is not a native asset`)}async getTokenNativeAddress(t,e){const i=await P(this.provider,this.tokenBridgeObjectId,e.toUint8Array(),j(t));if(!i)throw new Error(`Token ${e.toString()} not found in token registry`);return new C(i)}async hasWrappedAsset(t){try{return await this.getWrappedAsset(t),!0}catch{}return!1}async getWrappedAsset(t){if(v(t.address))throw new Error("Token Address required, 'native' literal not supported");const e=await P(this.provider,this.tokenBridgeObjectId,t.address.toUniversalAddress().toUint8Array(),j(t.chain));if(!e)throw D(pe(t));return H(this.chain,e)}async isTransferCompleted(t){var r,n,l,s,u,f,w,y;const e=await F(this.provider,this.tokenBridgeObjectId);if(!e)throw new Error("Unable to fetch object fields from token bridge state");const i=(n=(r=e.consumed_vaas)==null?void 0:r.fields)==null?void 0:n.hashes,o=X((s=(l=i==null?void 0:i.fields)==null?void 0:l.items)==null?void 0:s.type);if(!o)throw new Error("Unable to get key type");const a=(y=(w=(f=(u=i==null?void 0:i.fields)==null?void 0:u.items)==null?void 0:f.fields)==null?void 0:w.id)==null?void 0:y.id;if(!a)throw new Error("Unable to fetch consumed VAAs table");const d=await this.provider.getDynamicFieldObject({parentId:a,name:{type:o,value:{data:[...he(t.hash)]}}});if(!d.error)return!0;if(d.error.code==="dynamicFieldNotFound")return!1;throw new Error(`Unexpected getDynamicFieldObject response ${d.error}`)}async*createAttestation(t){const e=0n,o=t.toString(),a=await this.provider.getCoinMetadata({coinType:o});if(a===null||a.id===null)throw new Error(`Coin metadata ID for type ${o} not found`);const[d,r]=await this.getPackageIds(),n=new B,[l]=n.splitCoins(n.gas,[n.pure.u64(e)]),[s]=n.moveCall({target:`${r}::attest_token::attest_token`,arguments:[n.object(this.tokenBridgeObjectId),n.object(a.id),n.pure.u32(0)],typeArguments:[o]});n.moveCall({target:`${d}::publish_message::publish_message`,arguments:[n.object(this.coreBridgeObjectId),l,s,n.object(O)]}),yield this.createUnsignedTx(n,"Sui.TokenBridge.CreateAttestation")}async*submitAttestation(t,e){const[i,o]=await this.getPackageIds(),a=e.toString(),d=Math.min(t.payload.decimals,8),r=await this.getCoinBuildOutput(i,o,d),n=await ae(r,a);yield this.createUnsignedTx(n,"Sui.TokenBridge.PrepareCreateWrapped");let l="",s="",u="",f="",w="",y=!1;for(;!y;){await new Promise(p=>setTimeout(p,500));const _=await this.provider.queryTransactionBlocks({filter:{FromAddress:a},options:{showObjectChanges:!0},limit:3});for(const p of _.data)if("objectChanges"in p){for(const g of p.objectChanges)ie(g)&&g.packageId!==void 0?l=g.packageId:R(g)&&g.objectType.includes("WrappedAssetSetup")?(s=g.objectId,w=g.objectType.split(", ")[1].replace(">","")):R(g)&&g.objectType.includes("UpgradeCap")?u=g.objectId:R(g)&&g.objectType.includes("CoinMetadata")&&(f=g.objectId);if(l!==""&&s!==""&&u!==""&&f!==""){y=!0;break}else l="",s="",u="",f=""}}const k=we(l),c=new B,[A]=c.moveCall({target:`${i}::vaa::parse_and_verify`,arguments:[c.object(this.coreBridgeObjectId),c.pure.vector("u8",W(t)),c.object(O)]}),[E]=c.moveCall({target:`${o}::vaa::verify_only_once`,arguments:[c.object(this.tokenBridgeObjectId),A]});c.moveCall({target:`${o}::create_wrapped::complete_registration`,arguments:[c.object(this.tokenBridgeObjectId),c.object(f),c.object(s),c.object(u),E],typeArguments:[k,w]}),yield this.createUnsignedTx(c,"Sui.TokenBridge.SubmitAttestation")}async*transfer(t,e,i,o,a){const d=0n,r=0n,l=t.toString(),s=(v(i)?M:i).toString(),u=await I.getCoins(this.provider,t,s),[f,...w]=u.filter(p=>Q(p.coinType,s));if(f===void 0)throw new Error(`Coins array doesn't contain any coins of type ${s}`);const[y,k]=await this.getPackageIds(),c=new B,[A]=(()=>{if(s===M)return c.splitCoins(c.gas,[c.pure.u64(o)]);{const p=c.object(f.coinObjectId);return w.length&&c.mergeCoins(p,w.map(g=>c.object(g.coinObjectId))),c.splitCoins(p,[c.pure.u64(o)])}})(),[E]=c.splitCoins(c.gas,[c.pure.u64(d)]),[_]=c.moveCall({target:`${k}::state::verified_asset`,arguments:[c.object(this.tokenBridgeObjectId)],typeArguments:[s]});if(a){if(!l)throw new Error("senderAddress is required for transfer with payload");let p=!1;const g=await(async()=>{const q=await ce(this.provider,y,l);if(q!==null)return c.object(q);{const[ne]=c.moveCall({target:`${y}::emitter::new`,arguments:[c.object(this.coreBridgeObjectId)]});return p=!0,ne}})(),[T,te]=c.moveCall({target:`${k}::transfer_tokens_with_payload::prepare_transfer`,arguments:[g,_,A,c.pure.u16(j(e.chain)),c.pure.vector("u8",e.address.toUint8Array()),c.pure.vector("u8",a),c.pure.u32(0)],typeArguments:[s]});c.moveCall({target:`${k}::coin_utils::return_nonzero`,arguments:[te],typeArguments:[s]});const[re]=c.moveCall({target:`${k}::transfer_tokens_with_payload::transfer_tokens_with_payload`,arguments:[c.object(this.tokenBridgeObjectId),T],typeArguments:[s]});c.moveCall({target:`${y}::publish_message::publish_message`,arguments:[c.object(this.coreBridgeObjectId),E,re,c.object(O)]}),p&&c.transferObjects([g],c.pure.address(l)),yield this.createUnsignedTx(c,"Sui.TokenBridge.TransferWithPayload")}else{const[p,g]=c.moveCall({target:`${k}::transfer_tokens::prepare_transfer`,arguments:[_,A,c.pure.u16(j(e.chain)),c.pure.vector("u8",e.address.toUint8Array()),c.pure.u64(r),c.pure.u32(0)],typeArguments:[s]});c.moveCall({target:`${k}::coin_utils::return_nonzero`,arguments:[g],typeArguments:[s]});const[T]=c.moveCall({target:`${k}::transfer_tokens::transfer_tokens`,arguments:[c.object(this.tokenBridgeObjectId),p],typeArguments:[s]});c.moveCall({target:`${y}::publish_message::publish_message`,arguments:[c.object(this.coreBridgeObjectId),E,T,c.object(O)]}),yield this.createUnsignedTx(c,"Sui.TokenBridge.Transfer")}}async*redeem(t,e,i=!0){const o=await P(this.provider,this.tokenBridgeObjectId,e.payload.token.address.toUint8Array(),j(e.payload.token.chain));if(!o)throw new Error("Unable to fetch token coinType");const[a,d]=await this.getPackageIds(),r=new B,[n]=r.moveCall({target:`${a}::vaa::parse_and_verify`,arguments:[r.object(this.coreBridgeObjectId),r.pure.vector("u8",W(e)),r.object(O)]}),[l]=r.moveCall({target:`${d}::vaa::verify_only_once`,arguments:[r.object(this.tokenBridgeObjectId),n]}),[s]=r.moveCall({target:`${d}::complete_transfer::authorize_transfer`,arguments:[r.object(this.tokenBridgeObjectId),l],typeArguments:[o]}),[u]=r.moveCall({target:`${d}::complete_transfer::redeem_relayer_payout`,arguments:[s],typeArguments:[o]});r.moveCall({target:`${d}::coin_utils::return_nonzero`,arguments:[u],typeArguments:[o]}),yield this.createUnsignedTx(r,"Sui.TokenBridge.Redeem")}async getWrappedNative(){return H(this.chain,M)}async getPackageIds(){return Promise.all([x(this.provider,this.coreBridgeObjectId),x(this.provider,this.tokenBridgeObjectId)])}async getCoinBuildOutput(t,e,i){var r;if(i>8)throw new Error("Decimals is capped at 8");const o=(r=await de(this.provider,this.tokenBridgeObjectId))==null?void 0:r.replace("0x","");if(!o)throw new Error(`Original token bridge package ID not found for object ID ${this.tokenBridgeObjectId}`);const a="a11ceb0b060000000901000a020a14031e1704350405392d07669f01088502600ae502050cea02160004010b010c0205020d000002000201020003030c020001000104020700000700010001090801010c020a050600030803040202000302010702080007080100020800080303090002070801010b020209000901010608010105010b0202080008030209000504434f494e095478436f6e7465787408565f5f305f325f3011577261707065644173736574536574757004636f696e0e6372656174655f777261707065640b64756d6d795f6669656c6404696e697414707265706172655f726567697374726174696f6e0f7075626c69635f7472616e736665720673656e646572087472616e736665720a74785f636f6e746578740f76657273696f6e5f636f6e74726f6c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"+o+"00020106010000000001090b0031"+i.toString(16).padStart(2,"0")+"0a0138000b012e110238010200";return{modules:[ye.encode(U.decode(a))],dependencies:["0x1","0x2",e,t].map(n=>me(n))}}createUnsignedTx(t,e,i=!1){return new ee(t,this.network,this.chain,e,i)}}class J{constructor(t,e,i,o){h(this,"network");h(this,"chain");h(this,"connection");h(this,"contracts");h(this,"tokenBridgeRelayerObjectId");h(this,"coreBridgeObjectId");h(this,"tokenBridgeObjectId");h(this,"fields");this.network=t,this.chain=e,this.connection=i,this.contracts=o;const{tokenBridge:a,tokenBridgeRelayer:d,coreBridge:r}=o;if(!a||!d||!r)throw new Error(`Some object IDs for ${e} Automatic Token Bridge not found`);this.tokenBridgeRelayerObjectId=d,this.tokenBridgeObjectId=a,this.coreBridgeObjectId=r}static async fromRpc(t,e){const[i,o]=await I.chainFromRpc(t),a=e[o];if(a.network!==i)throw new Error(`Network mismatch for chain ${o}: ${a.network} != ${i}`);return new J(i,o,t,a.contracts)}async*transfer(t,e,i,o,a){const r=new C(v(i)?I.nativeTokenId(this.network,this.chain).address:i).getCoinType(),{coreBridge:n,tokenBridge:l}=await this.getPackageIds(),s=new B,u=BigInt(0),[f]=s.splitCoins(s.gas,[s.pure.u64(u)]),[w]=await(async()=>{if(v(i))return s.splitCoins(s.gas,[s.pure.u64(o)]);{const E=await I.getCoins(this.connection,t,r),[_,...p]=E.filter(T=>T.coinType===r);if(_===void 0)throw new Error(`Coins array doesn't contain any coins of type ${r}`);const g=s.object(_.coinObjectId);return p.length&&s.mergeCoins(g,p.map(T=>s.object(T.coinObjectId))),s.splitCoins(g,[s.pure.u64(o)])}})(),[y]=s.moveCall({target:`${l}::state::verified_asset`,arguments:[s.object(this.tokenBridgeObjectId)],typeArguments:[r]}),k=await this.getPackageId(),[c]=s.moveCall({target:`${k}::transfer::transfer_tokens_with_relay`,arguments:[s.object(this.tokenBridgeRelayerObjectId),w,y,s.pure.u64(a??0n),s.pure.u16(j(e.chain)),s.pure.address(U.encode(e.address.toUint8Array(),!0)),s.pure.u32(123)],typeArguments:[r]}),[A]=s.moveCall({target:`${l}::transfer_tokens_with_payload::transfer_tokens_with_payload`,arguments:[s.object(this.tokenBridgeObjectId),c],typeArguments:[r]});s.moveCall({target:`${n}::publish_message::publish_message`,arguments:[s.object(this.coreBridgeObjectId),f,A,s.object(O)]}),yield this.createUnsignedTx(s,"AutomaticTokenBridge.transfer")}async*redeem(t,e){const{coreBridge:i,tokenBridge:o}=await this.getPackageIds(),{address:a,chain:d}=e.payload.token,r=await P(this.connection,this.tokenBridgeObjectId,a.toUniversalAddress().toUint8Array(),j(d));if(!r)throw new Error("Unable to fetch token coinType");const n=new B,[l]=n.moveCall({target:`${i}::vaa::parse_and_verify`,arguments:[n.object(this.coreBridgeObjectId),n.pure.vector("u8",W(e)),n.object(O)]}),[s]=n.moveCall({target:`${o}::vaa::verify_only_once`,arguments:[n.object(this.tokenBridgeObjectId),l]}),[u]=n.moveCall({target:`${o}::complete_transfer_with_payload::authorize_transfer`,arguments:[n.object(this.tokenBridgeObjectId),s],typeArguments:[r]}),f=await this.getPackageId();n.moveCall({target:`${f}::redeem::complete_transfer`,arguments:[n.object(this.tokenBridgeRelayerObjectId),u],typeArguments:[r]}),yield this.createUnsignedTx(n,"AutomaticTokenBridge.redeem")}async getRelayerFee(t,e){const i=v(e)?I.nativeTokenId(this.network,this.chain):e,o=await this.getTokenInfo(i.toString());if(o===null)throw new Error("Unsupported token for relay");const a=await this.getFields(),d=await this.connection.getDynamicFieldObject({parentId:this.tokenBridgeRelayerObjectId,name:{type:"vector<u8>",value:Array.from(ke.encode("relayer_fees"))}});if(!d.data||!d.data.content)throw d.error?new Error("Failed to get relayer fees: "+JSON.stringify(d.error)):new Error("Unable to compute relayer fee");const{content:r}=d.data;if(!b(r)||!le(r.fields.id))throw new Error("Unable to compute relayer fee");const n=await this.connection.getDynamicFieldObject({parentId:r.fields.id.id,name:{type:"u16",value:j(t)}});if(!n.data||!n.data.content)throw n.error?new Error("Failed to get relayer fees: "+JSON.stringify(d.error)):new Error("Unable to compute relayer fee");const{content:l}=n.data;if(!b(l))throw new Error("Unable to compute relayer fee");const s=await I.getDecimals(this.chain,this.connection,e.toString()),u=o.swap_rate,f=a.relayer_fee_precision,w=a.swap_rate_precision,y=l.fields.value;return 10n**BigInt(s)*BigInt(y)*BigInt(w)/(BigInt(u)*BigInt(f))}async maxSwapAmount(t){var n,l;const i=(v(t)?I.nativeTokenId(this.network,this.chain):t).toString(),o=await this.connection.getCoinMetadata({coinType:i});if(!o)throw new Error("metadata is null");const a=await this.getPackageId(),d=new B;d.moveCall({target:`${a}::redeem::calculate_max_swap_amount_in`,arguments:[d.object(this.tokenBridgeRelayerObjectId),d.pure.u8(o.decimals)],typeArguments:[i]});const r=await this.connection.devInspectTransactionBlock({transactionBlock:d,sender:U.encode(new Uint8Array(32))});if(!r.results||r.results.length==0||!((n=r.results[0])!=null&&n.returnValues)||((l=r.results[0])==null?void 0:l.returnValues.length)!==1)throw Error("swap rate not set");return G.decode(new Uint8Array(r.results[0].returnValues[0][0].toReversed()))}async nativeTokenAmount(t,e){var l,s;const o=(v(t)?I.nativeTokenId(this.network,this.chain):t).toString(),a=await this.connection.getCoinMetadata({coinType:o});if(!a)throw new Error("metadata is null");const d=await this.getPackageId(),r=new B;r.moveCall({target:`${d}::redeem::calculate_native_swap_amount_out`,arguments:[r.object(this.tokenBridgeRelayerObjectId),r.pure.u64(e),r.pure.u8(a.decimals)],typeArguments:[o]});const n=await this.connection.devInspectTransactionBlock({transactionBlock:r,sender:U.encode(new Uint8Array(32))});if(!n.results||n.results.length==0||!((l=n.results[0])!=null&&l.returnValues)||((s=n.results[0])==null?void 0:s.returnValues.length)!==1)throw Error("swap rate not set");return G.decode(new Uint8Array(n.results[0].returnValues[0][0].toReversed()))}async getRegisteredTokens(){const e=(await this.getFields()).registered_tokens.fields.id.id;return(await this.connection.getDynamicFields({parentId:e})).data.map(a=>{const{address:d,module:r,name:n}=be(a.objectType);return new C([d,r,n].join(Ie))})}async isRegisteredToken(t){const e=new C(v(t)?I.nativeTokenId(this.network,this.chain).address:t).unwrap();try{return await this.getTokenInfo(e)!==null}catch(i){console.error(i)}return!1}async getTokenInfo(t){var n;const e=await this.getFields(),o=new C(e.registered_tokens.type).getPackageId(),a=e.registered_tokens.fields.id.id,d=new C(t),r=Q(L,d.unwrap())?L:d.getCoinType();try{const l=await this.connection.getDynamicFieldObject({parentId:a,name:{type:`${o}::registered_tokens::Key<${r}>`,value:{dummy_field:!1}}});if(l.error)throw new Error("Failed to get token info: "+JSON.stringify(l.error));if(!l.data||!l.data.content)throw new Error("Failed to get token info: "+JSON.stringify(l));const{content:s}=l.data;return b(s)&&b(s.fields.value)?s.fields.value.fields:null}catch(l){if((l==null?void 0:l.code)===-32e3&&((n=l.message)!=null&&n.includes("RPC Error")))return console.error(l),null;throw l}}async getFields(){if(!this.fields){const t=await F(this.connection,this.tokenBridgeRelayerObjectId);if(t===null)throw new Error("Failed to get fields from token bridge relayer state");this.fields=t}return this.fields}async getPackageId(){const t=await this.getFields();return new C(t.registered_tokens.type).getPackageId()}async getPackageIds(){const[t,e]=await Promise.all([x(this.connection,this.coreBridgeObjectId),x(this.connection,this.tokenBridgeObjectId)]);return{coreBridge:t,tokenBridge:e}}createUnsignedTx(t,e,i=!1){return new ee(t,this.network,this.chain,e,i)}}Z("Sui","TokenBridge",z);Z("Sui","AutomaticTokenBridge",J);export{J as SuiAutomaticTokenBridge,z as SuiTokenBridge,P as getTokenCoinType,Y as getTokenFromTokenRegistry};
|